Close
About
FAQ
Home
Collections
Login
USC Login
Register
0
Selected
Invert selection
Deselect all
Deselect all
Click here to refresh results
Click here to refresh results
USC
/
Digital Library
/
Computer Science Technical Report Archive
/
USC Computer Science Technical Reports, no. 649 (1997)
(USC DC Other)
USC Computer Science Technical Reports, no. 649 (1997)
PDF
Download
Share
Open document
Flip pages
Contact Us
Contact Us
Copy asset link
Request this asset
Transcript (if available)
Content
Proto col Indep enden t MulticastSparse Mo de PIMSM
Implemen tation Do cumen t
Ahmed Helm y
Computer Science Departmen tISI
Univ ersit y of Southern California
Los Angeles CA ahelm yuscedu
PIMSMimplemen tationps
Jan uary
Status of This Memo
This do cumentisanIn ternet Draft In ternet Drafts are w orking do cumen ts of the In ternet Engineering T ask
F orce IETF its Areas and its W orking Groups Note that other groups ma y also distribute w orking do cumen ts
as In ternet Drafts
In ternet Drafts are draft do cumen ts v alid for a maxim um of six mon ths In ternet Drafts ma y be up dated
replaced or obsoleted b y other do cumen ts at an y time It is not appropriate to use In ternet Drafts as reference
material or to cite them other than as a w orking draft or w ork in progress
Please c hec k the ID abstract listing con tained in eachIn ternet Draft directory to learn the curren t status of
this or an y other In ternet Draft
drafthelm ypimsmimplemps Abstract
This do cumen t describ es the details of the PIMSM v ersion implemen tation for UNIX
platforms namely SunOS and SGIIRIX A generic k ernel mo del is adopted whic h is proto col inde
penden t ho w ev er some supp orting functions are added to the k ernel for encapsulation of data pac k ets
at user lev el and decapsulation of PIM Registers
F urther the basic mo del for the user lev el PIM daemon pimd implemen tation is describ ed
Implemen tation details and co de are included in supplemen tary app endices
In tro duction
In order to supp ort m ulticast routing proto cols in a UNIX en vironmen t b oth the k ernel and the daemon
parts ha vetoin teract and co op erate in p erforming the pro cessing and forw arding functions
The k ernel basically handles forw arding the data pac k ets according to a m ulticast forw arding cac he
MF C stored in the k ernel While the proto col sp ecic daemon is resp onsible for pro cessing the con trol
messages from other routers and from the k ernel and main taining the m ulticast forw arding cac he from
user lev el through traps and system calls The daemon tak es care of all timers for the m ulticast routing
table MR T en tries according to the sp ecications of the m ulticast proto col PIMSMv The details of the implemen tation are presen ted as follo ws First an o v erview of the system k ernel and
daemon is giv en with emphasis on the basic functions of eac h Then a structural mo del is presen ted for
the daemon outlining the basic building blo c ks for the m ulticast routing table and the virtual in terface
table at user space An illustrativ e functional description is giv en thereafter for the daemonk ernel
in terface and the k ernel Finally supplemen tary app endices pro vide more detailed information ab out
the implemen tation sp ecics
The mo dels discussed herein are merely illustrativ e and b y no means are they exhaustiv e nor authoritativ e
drafthelm ypimsmimplemps PIM daemon
KERNEL
raw_input()
[PIM & IGMP messages]
socket_send()
[internal control]
setsockopt() getsockopt() ioctl
IP Mcast
data packets
IP
packets
PIM control
messages
Figure System o v erview
System Ov erview
The PIM daemon pro cesses all the PIM con trol messages and sets up an appropriate k ernel en vironmen t
to deliv er m ulticast data pac k ets The k ernel has to supp ort m ulticast pac k ets forw arding see gure The k ernel lev el
When the k ernel receiv es an IP pac k et it passes it through the IP handling routine ipin tr ipin tr
dispatc hes the pac k et to the appropriate handling mac hinery based on the destination address and the
IP proto col n um b er Here w e are only concerned with the follo wing cases
If the pac k et is a m ulticast pac k et then it passes through the m ulticast forw arding mac hinery in
the k ernel ipmforw ard Subsequen tly if there is a matc hing en try source and group addresses
with the righ t incoming in terface iif w e get a cac he hit and the pac k et is forw arded to the
corresp onding outgoing in terfaces oifs through the fast forw arding path Otherwise if the pac k et
do es not matc h the source group and iif w e get a cac he miss and an in ternal con trol message is
passed up accordingly to the daemon for pro cessing
If the IP pac k et is a PIM pac k et ie has proto col n um b er of IPPR OTOPIM it passes through
the PIM mac hinery in the k ernel piminput and in turn is passed up to the so c k et queue using
the ra winput call
If the IP pac k et is an IGMP pac k et ie has proto col n um ber of IPPR OTOIGMP it passes
through the IGMP mac hinery in the k ernel igmpinput and in turn is passed up to the so c k et
queue using the ra winput call
The user lev el daemon
All PIM IGMP and in ternal con trol eg cac he miss and wrong incoming in terface messages are passed
to PIM daemon the daemon has the complete information to creat m ulticast routing table MR T It
also up dates the m ulticast forw arding cac he MF C inside the k ernel b y using the setso c k opt system
call to facilitate m ulticast pac k ets forw arding see gure
drafthelm ypimsmimplemps IP Packets
Multicast Forwarding Cache (MFC)
Interface
Queue
Mcast
Pkts
KERNEL
USER LEVEL
MFC lookup;
match (S,G)
IIF check
IIF match
Forward to OIFs
Multicast Routing Table (MRT)
Multicast Routing Protocol
(Multicast Routing Daemon)
PIM &IGMP
Cache-miss Wrong-IIF
socket-Qs
PIM & IGMP
raw_input()
socket_send()
setsockopt()
getsockopt() ioctl()
Packets
control messages
Figure IPm ulticast implemen tation mo del
The PIM daemon listens to PIM and IGMP so c k ets and receiv es b oth PIM and IGMP messages The
messages are pro cessed b y the corresp onding mac hinery in the daemon acceptpim and acceptigmp
resp ectiv ely and dispatc hed to the righ t comp onen t of the proto col
Mo dications and up dates are made to the m ulticast routing table MR T according to the pro cessing
and appropriate c hanges are reected in the k ernel en tries using the setso c k opt system call Other messages ma y be triggered o of the state k ept in the daemon to be pro cessed b y up
streamdo wnstream routers
Userlev el Implemen tation The Multicast Routing Daemon
The basic functional o w mo del for the PIM daemon is describ ed in this section see gure The user lev el implemen tation is brok en up in to mo dules based on functionalit y and includes mo d ules to handle the m ulticast routing table MR T in mrtc the virtual in terface vif table in vifc
PIM IGMP messages in pimc igmpc proto col sp ecic routing functions in routec timers and
housek eeping in timerc k ernel lev el in terface in k erncetc
F ollo wing is an explanation of these mo dules in addition to the data structures
Data Structures
There are t w o basic data structures the m ulticast routing en try mrten try and virtual in terface en try
vifen try These structures are created and mo died in the daemon b y receiving the PIM con trol
messages The denitions of the data structures are giv en in pimh le
Multicast Routing T able
The m ulticast routing en try is sho wn b elow
struct mrtentry
struct srcentry source source
drafthelm ypimsmimplemps accept_igmp()
process_upcall():
timer
age_routes():
house-keeping,
and timing
accept_register()
accept_join_prune()
Cache-miss
Wrong-iif
Whole-Pkt
accept_assert()
upcall
protocol
Register
type
check message
type
Join/Prune
type
Assert
MEMBERSHIP-REPORT-type
accept-group-report()
type
accept_pim()
Figure Basic functional o w of the PIM daemon
struct grpentry group group
vifbitmapt outgoing outgoing vifs to downstream
vifbitmapt vifmaskoff deleted vifs
struct mrtentry srcnext next entry of same source
struct mrtentry srcprev prev entry of same source
struct mrtentry grpnext next entry of same group
struct nbrentry upstream upstream router needed as in
RPbit entry the upstream
router is different than
the source upstream router
ulong pktrateprev packet count of prev check ulong idlecntprev pkt cnt to check idle states uint dataratetimer keep track of the data rate uint regratetimer keep track of Register rate at
RP
uint regcnt keep track of the Register
count at RP
uchar timers vif timer list
ushort timer entry timer
ushort joinprunetimer periodic joinprune timer
ushort flags flags
uint assertrpftimer Assert timer
ushort registerBitTimer RegisterSuppression timer
drafthelm ypimsmimplemps Routing
Entry
Mcast
Routing
Entry
Mcast
Routing
Entry
Mcast
Routing
Entry
Mcast
Source Entry
Group
Entry
SourceList
GroupList
*source
*group
*mrtlink
*mrtlink
Multicast
Routing
Table
Figure The m ulticast routing table o v erall structure at user lev el
struct srcentry ulong source subnet source of multicasts
vifit incoming incoming vif
struct nbrentry upstream upstream router
ushort timer timer for recompute incoming
ulong metric Unicast Routing Metric for source
ulong preference The metric preference value
struct mrtentry mrtlink link to routing entries
struct srcentry next link to next entry
struct grpentry ulong group subnet group of multicasts
vifbitmapt leaves outgoing vif to host
uchar timers vif timer list
struct mrtentry mrtlink link to routing entries
struct grpentry next link to next entry
struct mrtentry rpentry Pointer to the G entry
struct rplist activerp Pointer to the active RP
The m ulticast routing table is the collection of all routing en tries whic h are organized in a link ed list
in the daemon
The o v erall structure of the m ulticast routing table in the daemon is sho wn in gure One of the frequen tly used elds in the mrten try is the ags eld where the v alues assigned to that
eld can b e onecom bination of the follo wing
define MRTFSPT x shortest path tree bit define MRTFWC x wildcard bit define MRTFRP x RP bit
drafthelm ypimsmimplemps define MRTFCRT x newly created define MRTFIIFREGISTER x iif regvif define MRTFREGISTER x oif includes regvif define MRTFKERNELCACHE x kernel cache mirror define MRTFNULLOIF x null oif cache define MRTFREGSUPP x register suppress define MRTFASSERTED x RPF is an assert winner
define MRTFSG x pure SG entry Virtual In terface List
The virtual in terface data structure is sho wn b elow
struct vifentry ushort flags VIFF flags
uchar threshold min ttl required
ulong local local interface address
ulong remote remote address
ulong subnet subnet number
ulong subnetmask subnet mask
ulong broadcast subnet broadcast addr
char nameIFNAMSIZ interface name
uchar timer timer for sending queries
uchar gqtimer Group Query timer used by DR
struct nbrentry neighbors list of neighboring routers
uint ratelimit max rate
The virtual in terface table is the collection of all virtual in terface en tries They are organized as an
arra y viistMAXVIFS MAXVIFS curren tly set to
In addition to dening mrtenry vifen try and other data structures the pimh le also denes all
default timer v alues
Initialization and Set up
Most of the initialization calls and so c k et setup are handled through main in mainc Basically after
the alarm and other signals are initialized PIM and IGMP so c k et handlers are setup then the function
a w aits on a select call The timer in terv al is set to TIMERINTER V AL curren tly seconds after
whic h the timer function is in v ok ed if no pac k ets w ere detected b y select The timer function basically
calls the other timing and housek eeping functions agevifs and ageroutes Also another alarm is
sc heduled for the follo wing in terv al
PIM and IGMP message handling
PIM All PIM con trol messages in PIMSMv ha v e an IP proto col n um ber of IPPR OTO
PIM assigned to and are not part of IGMP lik e PIMv messages
Incoming PIM messages are receiv ed on the pim so c k et and are dispatc hed b y acceptpim in pimc
according to their t yp e
PIM t yp es are
drafthelm ypimsmimplemps PIMHELLO PIMREGISTER PIMREGISTERSTOP PIMJOINPRUNE PIMBOOTSTRAP PIMASSERT PIMGRAFT PIMGRAFTACK PIMCANDIDATERPADVERTIS EME NT Outgoing PIM messages are sen t using sendpim and sendpimunicast in pimc
IGMP IGMP messages are dispatc hed using similar mac hinery to that of PIM only IGMP
messages are receiv ed on the igmp so c k et dispatc hed b y acceptigmp and are sen t using sendigmp
in igmpc
MR T main tenance
The functions handling the MR T creation access query and up date are found in mrtc le
Ma jor functions include route lo okups as in ndroute ndsource and ndgroup
The hash function and group to RP mapping are also p erformed b y functions in mrtc
Proto col Sp ecic actions Routing
File routec con tains the proto col sp ecic functions and pro cesses the incomingoutgoing PIM messages
F unctions pro cessing incoming PIM messages include acceptjoinprune acceptassert accept
register acceptregisterstopetc and other supp orting functions
F unctions triggering outgoing PIM messages include ev en tjoinprune sendregister triggerassert
sendCRPAdvetc and supp orting functions
In addition routec also handles the in ternal con trol messages through pro cessk ernelCall whic h
dispatc hes the in ternal con trol messages according to their t yp e
Curren tly there are three t yp es of in ternal con trol messages
IGMPMSGNOCACHE indicating a cache miss
IGMPMSGWRONGVIF indicating wrong incoming interface
IGMPMSGWHOLEPKT indicating whole data packet used
for registering
These messages are dispatc hed to pro cesscac heMiss pro cesswrongiif and pro cesswholepkt
resp ectiv ely Timing
The clo c k tic k for the timing system is set to TIMERINTER V AL curren tly seconds That means
that all p erio dic actions are carried out o v er a second gran ularit y On ev ery clo c k tic k the alarm in terrupt calls the timer function in mainc whic h in turn calls age
vifs in vifc and ageroutes in timerc In this subsection the functions in timerc are explained
drafthelm ypimsmimplemps Basically ageroutes bro wses through the routing liststables adv ancing all timers p ertinen t to the
routing tables Sp ecically the group list is tra v ersed and the leaf mem b ership information is aged b y
calling timeoutleaf Then a for lo op bro wses through the m ulticast route en tries aging the outgoing
in terfaces timeoutoutgo and v arious related timers eg RegisterBitTimer Assert timeretc for
eac h en tryas w ell as c hec king the rate thresholds for the Registers in the RP and data in the DRs
In addition garbage collection is p erformed on the timed out en tries in the group list the source list and
the MR T The m ulticast forw arding cac he MF C in the k ernel is also timed out and deletedup dated
accordingly Note that in this mo del the MF C is passiv e and all timing is done in at user lev el then
comm unicated to the k ernel see section The periodic JoinPrune messaging is p erformed per in terface b y calling p erio dicvifjoinprune
Then the RPSetTimer is aged and periodic CRPAdv messages are sen t if the router is a Candidate
RP Virtual In terface List
F unctions in vifc handle setting up the viist arra y in b oth the user lev el and the k ernel through
startvifs Sp ecial care is giv en to the regvif a dumm yin terface used for encapsulatingdecapsulating
Registers see section The regvif is installed b y addregvif and kaddvifregvifn um calls
Other per in terface tasks are carried out b y vifc lik e querygroups acceptgrouprep ort and
queryneigh b ors in addition to the p erio dic agevifs timing function
Conguration
pimd lo oks for the conguration le at etcpimdconf Conguration parameters are parsed b y con
gc Curren t PIM sp ecic congurable parameters include the registerdata rate thresholds after whic h
the RPDRs switc h to the SPT resp ectiv ely A candidate RP can b e congured with optional in terface
address and CRPAdv p erio d and a candidate b o otstrap router can b e congured with optional priorit y F ollo wing is an example pimdconf Command formats
phyint localaddr disable threshold t
candidaterp localaddr time number
bootstraprouter localaddr priority number
switchregisterthreshol d count number time number
switchdatathreshold count number time number
candidaterp time bootstraprouter priority switchregisterthreshold count time In terfacing to Unicast Routing
F or prop er implemen tation PIM requires access to the unicast routing tables Giv en a sp ecic destination
address PIM needs at least information ab out the next hop or the rev erse path forw arding RPF
neigh bor and the in terface iif to reac h that destination Other information are the metric used to
reac h the destination and the unicast routing proto col t yp e if suc h information is attainable In this
do cumen t only the RPF and iif information are discussed
Tw o mo dels ha v e b een emplo y ed to in terface to unicast routing in pimd
drafthelm ypimsmimplemps The rst mo del whic h requires routing so c k et supp ort is implemen ted on the IRIX platform and
other routing so c k et supp orting systems This mo del requires no k ernel mo dications to access the
unicast routing tables All the functionalit y required is pro vided in routeso c kc In this do cumen t w e
adopt this mo del
The second mo del is implemen ted on SunOs and other platforms not supp orting routing so c k ets
and requires some k ernel mo dications In this mo del an io ctl co de is dened eg SIOCGETRPF
and a supp orting function eg getrpf is added to the m ulticast co de in the k ernel to query the unicast
forw arding information base through rtallo c call
Other mo dels ma y also b e adopted dep ending on the op erating system capabilities
In an y case the unicast routing information has to b e up dated p erio dically to adapt to routing c hanges
and net w ork failures
User lev el Kernel In terfaces
Comm unication bet w een the user lev el and the k ernel is established in both directions Messages for
k ernel initialization and setup and adding deleting and up dating en tries from the viftable or the mfc in
the k ernel are triggered b y the m ulticast daemon While PIM IGMP and in ternal con trol messages are
passed from the k ernel to user lev el
User lev el to k ernel messages
Most user lev el in terfacing to the k ernel is done through functions in k ernc T raps used are setso c k opt
getso c k opt and io ctl F ollo wing is a brief description of eac h
setso c k opt used b y the daemon to mo dify and up date the k ernel en vironmen t including the
forw arding cac he the viftable etc
Options used with this call are
MRTINIT initialization
MRTDONE termination
MRTADDVIF add a virtual interface
MRTDELVIF delete a virtual interface
MRTADDMFC add an entry to the multicast forwarding cache
MRTDELMFC delete an entry from the multicast forwarding cache
MRTPIM set a pim flag in the kernel to stub the pim code
getso c k opt used to get information from the k ernel
Options used with this call are
MRTVERSION get the version of the multicast kernel
MRTPIM get the pim flag
io ctl used b y the daemon for w aycomm unication with the k ernel
Used to get in terface information in congc and vifc k ernc uses io ctl with option SIOCGETS
GCNT to get the cac he hit pac k et coun t for an SG en try in the k ernel Also io ctl ma y b e used
to get unicast routing information from the k ernel using the option SIOCGETRPF if suc h mo del
is used to get unicast routing information see section
drafthelm ypimsmimplemps Kernel to user lev el messages
The k ernel uses t w o calls to send PIM IGMP and in ternal con trol messages to user lev el
ra winput used b y the k ernel to send messagespac k ets to the rawsoc k ets at user lev el
Used byboth thepim mac hinery piminput and igmp mac hinery igmpinput in the k ernel
to pass the messages to the ra w so c k et queue and in turn to pim and igmp so c k ets to whic h the
pim daemon listens
so c k etsend used b y the m ulticast forw arding mac hinery to send in ternal con trol messages to the
daemon
Used b y the m ulticast co de in the k ernel in ipmroutec to send in ternal m ulticast sp ecic con trol
messages
ipmforw ard triggers an IGMPMSGNOCA CHE con trol message when getting a cac he
miss
ipmdq triggers an IGMPMSGWR ONGVIF con trol message when failing the RPF c hec k
ie getting a wrong iif registersend rela ys IGMPMSGWHOLEPKT messages con taining the data pac k et when
called b y ipmdq to forw ard pac k ets to the regvif IP Multicast Kernel Supp ort
The k ernel supp ort for IP m ulticast is mostly pro vided through ipmroute fch g pro viding the structure
for the m ulticast forw arding cac he MF C the virtual in terface table viftable and supp orting functions
The Multicast F orw arding Cac he
The Multicast F orw arding Cac he MF C en try is dened in ipmrouteh and consists basically of the
source address group address an incoming in terface iif and an outgoing in terface list oiist F ollo wing
is the complete denition
struct mfc struct inaddr mfcorigin ip origin of mcasts struct inaddr mfcmcastgrp multicast group associated
vifit mfcparent incoming vif uchar mfcttlsMAXVIFS forwarding ttls on vifs uint mfcpktcnt pkt count for srcgrp uint mfcbytecnt byte count for srcgrp uint mfcwrongif wrong if for srcgrp int mfcexpire time to clean entry up
The m ulticast forw arding cac he table mfctable is a hash table of mfc en tries dened as
struct mbuf mfctableMFCTBLSIZ
where MF CTBLSIZ is In case of hash collisions a collision c hain is constructed
drafthelm ypimsmimplemps The Virtual In terface T able
The viftable is an arra y of vif structures dened as follo ws
struct vif uchar vflags VIFF flags defined above uchar vthreshold min ttl required to forward on vif
uint vratelimit max rate struct tbf vtbf token bucket structure at intf struct inaddr vlcladdr local interface address struct inaddr vrmtaddr remote address tunnels only struct ifnet vifp pointer to interface uint vpktin pkts in on interface uint vpktout pkts out on interface uint vbytesin bytes in on interface uint vbytesout bytes out on interface struct route vroute Cached route if this is a tunnel ifdef RSVPISI
uint vrsvpon RSVP listening on this vif struct socket vrsvpd RSVPD daemon endif RSVPISI
One of the frequen tly used elds is the vags eld that ma ytak e one of the follo wing v alues
VIFFTUNNEL x vif represents a tunnel endpoint
VIFFSRCRT x tunnel uses IP src routing
VIFFREGISTER x vif used for register encapdecap
Kernel supp orting functions
The ma jor standard IP m ulticast supp orting functions are
ipmrouterinit
Initialize the ipmrouter so c k et and the MF C
Called b y setso c k opt with option MR TINIT
ipmrouterdone
Disable m ulticast routing
Called b y setso c k opt with option MR TDONE
addvif
Add a new virtual in terface to the viftable
Called b y setso c k opt with option MR TADDVIF
delvif
Delete a virtual in terface from the viftable
Called b y setso c k opt with option MR TDELVIF
drafthelm ypimsmimplemps addmfc
Addup date an mfc en try to the mfctable
Called b y setso c k opt with the option MR TADDMF C
delmfc
Delete an mfc en try from the mfctable
Called b y setso c k opt with the option MR TDELMF C
ipmforw ard
Receivean IP m ulticast pac k et from in terface ifp If it matc hes with a m ulticast forw arding cac he
then pass it to the next pac k et forw arding routine ipmdq Otherwise if the pac k et do es not
match onanen try then create an idle cac he en try enqueue the pac k et to it and send the header
in an in ternal con trol message to the daemon using so c k etsend indicating a cac he miss
ipmdq
The m ulticast pac k et forw arding routine An incoming in terface c hec k is p erformed the iif in
the en try is compared to that o v er whic h the pac k et w as receiv ed If they matc h the pac k et if
forw arded on all vifs according to the ttl arra y included in the mfc this basically constitutes the oif
list T unnels and Registers are handled b y this function b y forw arding to dumm y vifs If the iif
c hec k do es not pass an in ternal con trol message basically the pac k et header is sen t to the daemon
using so c k etsend including vif information and indicating wrong incoming in terface
expireup calls
Clean up cac he en tries if up calls are not serviced
Called bythe Slo w Timeout mec hanism ev ery half second
The follo wing functions in the k ernel pro vide supp ort to PIM and are part of ipmroutec
registersend
Send the whole pac k et in an in ternal con trol message indicating a whole pac k et for encapsulation
at user lev el
Called b y ipmdq
piminput
The PIM receiving mac hinery in the k ernel Chec k the incoming PIM con trol messages and passes
them to the daemon using ra winput If the PIM message is a Register message it is pro cessed
the pac k et is decapsulated and passed to registermforw ard and header of the Register message
is passed up to the pim so c k et using ra winput
Called b y ipin tr based on IPPR OTOPIM
registermforw ard
F orw ard a pac k et resulting from register decapsulation This is p erformed b y lo oping backa cop y
of the pac k et using lo output suc h that the pac k et is enqueued on the regvif queue and fed bac k
in to the m ulticast forw arding mac hinery Called b y piminput
drafthelm ypimsmimplemps App endix I
The user lev el co de k ernel patc hes and c hange description are a v ailable in
h ttpcatarinausceduahelm ypimsmimplem
or through anon ymous ftp from
catarinauscedupubahelm ypimsmimplem
App endix II Register Mo dels
The sender mo del in PIMSM is based on the senders DR registering to the activ e RP for the corre
sp onding group Suc h pro cess in v olv es encapsulating data pac k ets in PIMREGISTER messages Reg
ister encapsulation requires information ab out the RP and is done at the user lev el daemon Added
functionalit y to the k ernel is necessary to pull up the data pac k et to user lev el for encapsulation
Register decapsulation at the RP on the other hand is p erformed in the k ernel as the decapsulated
pac k et has the original source in the IP header and most op erating systems do not allo w suc h pac k et to
be forw arded from user lev el carrying a nonlo cal address sp o ong
The k ernel is mo died to ha v e a piminput mac hinery to receiv e PIM pac k ets If the PIM t yp e is
REGISTER the pac k et is decapsulated The decapsulated pac k et is then lo op ed bac k and treated as a
normal m ulticast pac k et
The t w o mo dels discussed ab o v e are further detailed in this section
Register Encapsulation
Up on receiving a m ulticast data pac k et from a directly connected source a DR initially ha ving no SG
cac he lo oks up the en try in the k ernel cac he When the lo okup mac hinery gets a cac he miss the follo wing
actions tak e place see gure an idle SG cac he en try is created in the k ernel with oif n ull
the data pac k et is enqueued to this idle en try a threshold of pac k ets queue length is curren tly
enforced
an expiry timer is started for the idle queue and
an in ternal con trol pac k et is sen t on the so c k et queue using so c k etsend con taining the pac k et
header and information ab out the incoming in terface and the cac he miss co de
Note that the ab ove pr o c e dur es o c cur for the rst p acket only when the c ache is c old F urther p ackets
wil l b e either enqueue d if the c ache is id le and the queue is not ful l dr opp e d if the c ache is id le and
the queue is ful l or forwar de d if the c ache entry is active
A t user space the igmp pro cessing mac hinery receiv es this pac k et the in ternal con trol proto col is
iden tied and the message is passed to the prop er function to handle the k ernelCalls pro cessk ernelCall
The cac he miss co de is c hec k ed then the router c hec ks to see
if the sender of the pac k et is a directly connected source and
if the router is the DR on the receiving in terface
drafthelm ypimsmimplemps 1. ipintr()
[ip_input.c]
2.ip_mforward()
[ip_mroute.c]
a.MFC lookup-->cache miss
pkt hdr & ctrl
socket_send()
b. create inactive kernel cache,
& enqueue data packet
if DR for S, then register to RP:
a. Create S,G, Reg=1
b. Install entry in kernel, oif=reg_vif
S,G, iif, oif=null Data Pkt
mrouter Sock
accept_igmp()
process_kernelCall()
3. case CACH_MISS:
setsockopt(..ADD_MFC..)
4. add_mfc()
S,G, iif, oif=reg_vif
5. ip_mdq()
if (vif==reg_vif)
ctrl+Data Pkt
socket_send()
6. register_send()-->whole packet
7. case WHOLE_PKT:
a. match S,G,Reg=1
b. encap. pkts in registers
c. unicast registers to active RP
IP
hdr
IGMP
reg-hdr
Data
Pkt
To RP
KERNEL
DAEMON
Queue
Data
Pkt
Interface
Queue
Figure A t the DR Creating SG en tries for lo cal senders and registering to the RP
Actions are n um b ered in the order they o ccur
If the c hec k do es not pass no action p ertaining to Registers is tak en
If the daemon do es not activ ate
the idle k ernel cac he the cac he ev en tually times out and the enqueued pac k ets are dropp ed
If the c hec k passes the daemon creates an SG en try with the REGISTER bit set in the ags
eld the iif set the in terface on whic h the pac k et w as receiv ed and the regvif included in the oiist in
addition to an y other oifs copied from wild card en tries according to the PIM sp ec regvif is an added
dumm y in terface for use in the register mo dels F urther the daemon installs this en try in the k ernel
cac he using setso c k opt with the ADDMF C option
This triggers the addmfc function in the k ernel whic h in turn calls the forw arding mac hinery ip
mdq The forw arding mac hinery iterates on the virtual in terfaces and if the vif is the regvif then the
registersend function is called The latter function is the added function for encapsulation supp ort
whic h sends the enqueued pac k ets as WHOLEPKTs in an in ternal con trol message to the user lev el
using so c k etsend
The message o ws through the igmp and pro cessk ernelCall mac hineries then the SG REGISTER
is matc hed and the pac k et is encapsulated and unicast to the activ e RP of the corresp onding group
Subsequen t pac k ets matc h on SG with oifregvif in the k ernel and get sen t to user space
directly using registersend
Register Decapsulation
A t the RP the unicast Registers b y virtue of b eing PIM messages are receiv ed b y the pim mac hinery in
the k ernel piminput The PIM t yp e is c hec k ed If REGISTER piminput c hec ks the n ull register
bit if not set the pac k et is passed to registermforw ard whic h lo ops it bac k on the regvif queue using
lo output In an y case the header of the Register con taining the original IP header the PIM message
header and the IP header of the inner encapsulated pac k et is passed to ra winput and in turn to pim
so c k et to whic h the PIM daemon listens see gure Other c hec ks are p erformed according to the longest matc h rules in the PIM sp ec Optionallyif no en try is matc hed a
k ernel cac he with oif n ull ma y b e installed to a v oid further cac he misses on the same en try
drafthelm ypimsmimplemps ipintr()
[ip_input.c]
PIM Sock
accept_pim():
add_mfc()
S,G, iif=reg_vif, oif
KERNEL
DAEMON
Queue
Reg
Pkt
Interface
Queue
pim_input():
IPPROTO_PIM
pim pkt
raw_input()
Raw
Queue
accept_register():
check PIM
type
parse, and process Register header,
if decision is forward Register:
a. Create S,G, iif=reg_vif, oif=unpruned (*,G)
b. Install entry in kernel
setscokopt
(ADD_MFC)
register_mforward()
enqueue pkt in reg_vif
queue
reg_vif
Queue
ipintr()
ip_mforward()
match S,G
ip_mdq()
match iif=reg_vif
forward to oiflist
a) If not Register, pass pkt to raw_input()
b) If Register, pass header to raw_input()
c) If null Register bit cleared, decapsulate
and pass pkt to register_mforward()
call looutput() to
Figure Atthe RP receiving Registers decapsulating and forw arding
A t the PIM daemon the message is pro cessed b y the pim mac hinery acceptpim REGISTER
t yp e directs the message to the acceptregister function The Register message is parsed and pro cessed
according to PIMSM rules giv en in the sp ec
If the Register is to b e forw arded the daemon p erforms the follo wing
creates SG en try with iifregvif and the oiist is copied from wild card en tries the data pac k ets
are to be forw arded do wn the unpruned shared tree according to PIMSM longest matc h rules
and
installs the en try in the k ernel cac he using setso c k optADDMF C
A t the same time the decapsulated pac k et enqueued at the regvif queue is fed in to ipin tr the IP
in terrupt service routine and passed to ipmforw ard as a nativ em ulticast data pac k et A cac he lo okup
is p erformed on the decapsulated pac k et If the cac he hits and the iif matc hes ie cac he iif regvif the pac k et is forw arded according to the installed oiist Otherwise a cac he miss in ternal con trol message
is sen t to user lev el and pro cessed accordingly Note that a race condition ma y o ccur where the decapsulated pac k et reac hes ipmforw ard before
the daemon installs the k ernel cac he This case is handled in pro cesscac heMiss in conformance with
the PIM sp ec and the pac k et is forw arded accordingly
drafthelm ypimsmimplemps Ac kno wledgmen ts
Sp ecial thanks to Deb orah Estrin USCISI V an Jacobson LBL Bill F enner Stephen Deering Xero x
P AR C Dino F arinacci Cisco Systems and Da vid Thaler UMic h for pro viding commen ts and hin ts
for the implemen tation An earlier v ersion of PIM v ersion w as written b y Charley Liu and Puneet
Sharma at USC
A Helm ydid m uc h of this w ork as a summer in tern at Silicon Graphics Inc
PIM w as supp orted b y gran ts from the National Science F oundation and Sun Microsystems
drafthelm ypimsmimplemps Con ten ts
In tro duction System Ov erview The k ernel lev el The user lev el daemon Userlev el Implemen tation The Multicast Routing Daemon Data Structures Multicast Routing T able Virtual In terface List Initialization and Set up PIM and IGMP message handling MR T main tenance Proto col Sp ecic actions Routing Timing Virtual In terface List Conguration In terfacing to Unicast Routing User lev el Kernel In terfaces User lev el to k ernel messages Kernel to user lev el messages IP Multicast Kernel Supp ort The Multicast F orw arding Cac he The Virtual In terface T able Kernel supp orting functions App endix I App endix II Register Mo dels Register Encapsulation Register Decapsulation Ac kno wledgmen ts
drafthelm ypimsmimplemps References
D Estrin D F arinacci A Helm y D Thaler S Deering M Handley V Jacobson C Liu P Sharma
and L W ei Proto col indep endentm ulticast pim Motiv ation and arc hitecture Exp erimental RF C Decem b er S Deering D Estrin D F arinacci V Jacobson C Liu L W ei P Sharma and A Helm y Proto col
indep endentm ulticast pim Sp ecication Internet Dr aft June D Estrin D F arinacci A Helm y D Thaler S Deering M Handley V Jacobson C Liu P Sharma
and L W ei Proto col indep endentm ulticastsparse mo de pimsm Proto col sp ecication Exp eri
mental RF C Decem ber
Abstract (if available)
Linked assets
Computer Science Technical Report Archive
Conceptually similar
PDF
USC Computer Science Technical Reports, no. 657 (1997)
PDF
USC Computer Science Technical Reports, no. 663 (1998)
PDF
USC Computer Science Technical Reports, no. 755 (2002)
PDF
USC Computer Science Technical Reports, no. 757 (2002)
PDF
USC Computer Science Technical Reports, no. 644 (1997)
PDF
USC Computer Science Technical Reports, no. 727 (2000)
PDF
USC Computer Science Technical Reports, no. 690 (1998)
PDF
USC Computer Science Technical Reports, no. 749 (2001)
PDF
USC Computer Science Technical Reports, no. 673 (1998)
PDF
USC Computer Science Technical Reports, no. 801 (2003)
PDF
USC Computer Science Technical Reports, no. 747 (2001)
PDF
USC Computer Science Technical Reports, no. 743 (2001)
PDF
USC Computer Science Technical Reports, no. 837 (2004)
PDF
USC Computer Science Technical Reports, no. 608 (1995)
PDF
USC Computer Science Technical Reports, no. 856 (2005)
PDF
USC Computer Science Technical Reports, no. 753 (2002)
PDF
USC Computer Science Technical Reports, no. 696 (1999)
PDF
USC Computer Science Technical Reports, no. 716 (1999)
PDF
USC Computer Science Technical Reports, no. 599 (1995)
PDF
USC Computer Science Technical Reports, no. 654 (1997)
Description
Ahmed Helmy. "Protocol independent multicast-sparse mode (PIM-SM): implementation document." Computer Science Technical Reports (Los Angeles, California, USA: University of Southern California. Department of Computer Science) no. 649 (1997).
Asset Metadata
Creator
Helmy, Ahmed
(author)
Core Title
USC Computer Science Technical Reports, no. 649 (1997)
Alternative Title
Protocol independent multicast-sparse mode (PIM-SM): implementation document (
title
)
Publisher
Department of Computer Science,USC Viterbi School of Engineering, University of Southern California, 3650 McClintock Avenue, Los Angeles, California, 90089, USA
(publisher)
Tag
OAI-PMH Harvest
Format
19 pages
(extent),
technical reports
(aat)
Language
English
Unique identifier
UC16271038
Identifier
97-649 Protocol Independent Multicast-Sparse Mode (PIM-SM) Implementation Document (filename)
Legacy Identifier
usc-cstr-97-649
Format
19 pages (extent),technical reports (aat)
Rights
Department of Computer Science (University of Southern California) and the author(s).
Internet Media Type
application/pdf
Copyright
In copyright - Non-commercial use permitted (https://rightsstatements.org/vocab/InC-NC/1.0/
Source
20180426-rozan-cstechreports-shoaf
(batch),
Computer Science Technical Report Archive
(collection),
University of Southern California. Department of Computer Science. Technical Reports
(series)
Access Conditions
The author(s) retain rights to their work according to U.S. copyright law. Electronic access is being provided by the USC Libraries, but does not grant the reader permission to use the work if the desired use is covered by copyright. It is the author, as rights holder, who must provide use permission if such use is covered by copyright.
Repository Name
USC Viterbi School of Engineering Department of Computer Science
Repository Location
Department of Computer Science. USC Viterbi School of Engineering. Los Angeles\, CA\, 90089
Repository Email
csdept@usc.edu
Inherited Values
Title
Computer Science Technical Report Archive
Coverage Temporal
1991/2017
Repository Email
csdept@usc.edu
Repository Name
USC Viterbi School of Engineering Department of Computer Science
Repository Location
Department of Computer Science. USC Viterbi School of Engineering. Los Angeles\, CA\, 90089
Publisher
Department of Computer Science,USC Viterbi School of Engineering, University of Southern California, 3650 McClintock Avenue, Los Angeles, California, 90089, USA
(publisher)
Copyright
In copyright - Non-commercial use permitted (https://rightsstatements.org/vocab/InC-NC/1.0/