Tải bản đầy đủ - 0 (trang)
Chapter 12. Understanding Protocol Independent Multicast (PIM)

Chapter 12. Understanding Protocol Independent Multicast (PIM)

Tải bản đầy đủ - 0trang

interestedinthepackets.MulticastpacketsarewithintheClass

Daddressrangeof224.0.0.0to239.255.255.255.The

multicastsendersendsonlyonecopyofthepacket,andonly

thehostsinterestedinthemulticastpacketprocessthepacket.

Becausemulticastpacketsmighttraverseseveralroutersbefore

reachingtheintendeddestination,theseroutersneedtohavea

routingprotocolenabledtoensurethatmulticastpacketsare

deliveredefficientlyandloop-free.

Severalmulticastroutingprotocolshavebeendevelopedforthis

matter.OneofthefirstisDistanceVectorMulticastRouting

Protocol(DVMRP);however,DVMRPisslowincon-vergenceand

isnotscalable.Ciscodevelopeditsownmulticastrouting

protocolcalledProtocolIndependentMulticast(PIM).PIMuses

theunicastroutingtabletomakeforward-ingdecisions;

therefore,therouter'schoiceofunicastroutingprotocolcould

beanyoftheprotocolcoveredinthisbooknamely,RIP,IGRP,

EIGRP,OSPF,BGP,orIS-IS.PIMworksintwodifferent

modesdensemodeandsparsemode.Eachmodehasitsown

advantagesanddisadvantages,andeachmodehasdifferent

implementationmethods.

Densemodeusestheflood-and-prunemechanismtoforward

multicasttraffic.Densemodeisextremelyeasytoimplement

andislesscomplexthansparsemode;however,densemodeis

notscalableinlargenetworks.Therefore,densemodeismore

suitableforasmallmulticastenvironment.

Sparsemodeusestheexplicitgroup-joinmechanismtoforward

multicasttraffic.Unlikedensemode,sparsemodeisvery

scalableandcanruninalargemulticastenvironment.Because

itismorescalable,itsimplementationismorecomplexthan

densemode,whichmeansthatitishardertotroubleshoot.



FundamentalsofIGMPVersion1,IGMPVersion

2,andReversePathForwarding

BeforedivingintotheintricaciesofthePIMprotocol,youneed

tounderstandtheconceptbehindtheInternetGroup

ManagementProtocol(IGMP)andreversepathforwarding

(RPF).

IGMPistheprotocolthatfunctionsbetweenthehost,alsocalled

thereceiver,andthemulticast-enabledrouter.Inshort,IGMP

allowstheroutertoknowthatahostisinterestedinreceiving

multicasttrafficforaspecificgroup.IGMPisenabledonthe

routerwheneverPIMisenabled.IGMPmessagesaresentwith

aTTLof1;therefore,IGMPpacketsareconstrainedtothelocal

networkonly.



IGMPVersion1

InIGMPversion1(definedinRFC1112),therouterssends

IGMPqueriestothe"all-hosts"multicastaddressof224.0.0.1

tosolicitmulticastgroupswithactivemulticastreceivers.The

multicastreceiversalsocansendIGMPreportstotherouterto

notifyitthattheyareinterestedinreceivingaparticular

multicaststream.Hostscansendthereportasynchron-ouslyor

inresponsetotheIGMPqueriessentbytherouter.Ifmorethan

onemulticastreceiverexistsforthesamemulticastgroup,only

oneofthesehostssendsanIGMPreportmessage;theother

hostssuppressestheirs.

Forexample,inFigure12-1,therouterR1sendsperiodicIGMP

queriestothe224.0.0.1address.Onlyonememberpergroup

persubnetsendstheIGMPreportmessagetotherouterinthis

case,H2whiletheotherhostsH1andH3suppresstheirs.



Figure12-1.ExampleofIGMPVersion1



InIGMPversion1,thereisnoelectionofanIGMPquerier.If

morethanonerouteronthesegmentexists,alltherouters

sendperiodicIGMPqueries.IGMPversion1hasnospecial

mechanismbywhichthehostscanleavethegroup.Ifthehosts

arenolongerinterestedinreceivingmulticastpacketsfora

particulargroup,theysimplydonotreplytotheIGMPquery

packetssentfromtherouter.Theroutercontinuessending

querypackets.Iftherouterdoesnotheararesponseinthree

IGMPqueries,thegrouptimesoutandtherouterstopssending

multicastpacketsonthesegmentforthegroup.Ifthehost

laterwantstoreceivemulticastpacketsafterthetimeout

period,thehostsimplysendsanewIGMPjointotherouter,

andtherouterbeginstoforwardthemulticastpacketagain.



IGMPVersion2

IGMPversion2(definedinRFC2236)introducesseveral

changestomakeIGMPmoreefficientinjoiningandleavingthe

group.Someoftheimportantchangesarelistedhere:

QuerierelectionmechanismOnamultiaccessnetwork,

anIGMPquerierrouteriselectedbasedontheIPaddress.



Therefore,onlyonerouterpersegmentsendsIGMP

queries.

LeavegroupmessageThehostsendsaleavemessageif

itisnolongerinterestedinamulticastgroup.Thisreduces

leavelatencywhencomparedtoversion1.

Group-specificqueryTheroutersendsagroup-specific

querybeforeittimesoutthegroup.Thisensuresthatthere

arenomorehostsleftonthesegmentthatmightstillbe

interestedinreceivingthemulticastgroup.

TheIGMPjoinmechanisminversion2isthesameasinversion

1.Theleavemechanismisalittledifferent,though.Inversion

2,whenahostwantstoleavethegroup,itsendsanIGMP

leavemessage.Whentherouterreceivestheleavemessage,it

sendsanIGMPquerypackettoseeifanymorehostsare

interestedinthegroup.Ifhostsstillareinterestedinthegroup,

theysendanIGMPjoinmessagetooverridetheIGMPleave

message;otherwise,therouterassumesthattherearenomore

hostsinterestedinthemulticastgroup,andthegrouptimes

out.

Figure12-2illustratesthathostH2wantstoleavethemulticast

groupbecauseitsendsanIGMPleavemessage.WhenRouter

R1receivestheleavemessage,itimmediatelysendsoutan

IGMPquerytomakesurethatnootherhostsareinterestedin

thegroup.Inthiscase,hostH1isstillinthegroup,andH1

overridestheIGMPleavemessagebysendinganIGMPreport

message.Inthisscenario,thegroupremainsactiveandthe

routerkeepsforwardingmulticastpacketsonthesegment.



Figure12-2.IGMPVersion2Leave

MechanismMulticastGroupRetained



Figure12-3depictsthesamescenarioasintheFigure12-2.

RouterR1sendsoutanIGMPqueryafteritreceivestheIGMP

leavefromthehostH2.BecausebothhostsH1andH3arenot

interestedinthegroup,theysimplyignoretheIGMPquery

messagesentbytherouter.Whentherouterdoesn'thearany

responsefromitsIGMPquery,ittimesoutthegrouponthe

segment,andRouterR1stopssendingmulticastpacketsfor

thatgroup.



Figure12-3.IGMPVersion2Leave

MechanismMulticastGroupTimedOut



MulticastForwarding(ReversePathForwarding)



Youmustunderstandthewaythemulticastforwarding

mechanismworksbeforeunderstandinghowPIMcomesinto

play.Multicastroutingisbackwardfromunicastrouting.Unicast

routingisconcernedaboutwherethepacketisgoing,whereas

inmulticastrouting,theconcerniswherethepacketsare

comingfrom.Multicastroutingusestheconceptofreversepath

forwarding(RPF)todeterminewhetheraforwardingloop

exists.Inshort,RPFallowstheroutertoforwardamulticast

packetonlyifthepacketisreceivedontheupstreaminterface

tothesource.Tobespecific,iftherouterreceivesamulticast

packetonaninterface,theunicastroutingtableisusedto

checkthesourceaddressofthemulticastpacket.Ifthepacket

arrivesontheinterfacespecifiedintheunicastroutingtablefor

thesourceaddress,theRPFchecksucceeds;otherwise,theRPF

checkfailsandthemulticastpacketsaresilentlydropped.

InFigure12-4,therouterreceivesamulticastpacketfrom

interfaceS1,andthesourceis192.168.3.1.Therouterchecks

itsunicastroutingtableforaddress192.168.3.1.Theunicast

routingtableindicatesthatitlearnedaboutnetwork

192.168.3.0/24frominterfaceS1.TheRPFcheck,inthiscase,

succeedsbecausethemulticastinterfaceandtheunicast

routingtablearecongruent.WhentheRPFchecksucceeds,the

routerforwardsthemulticastpacketstoitsoutgoing

interfacesinthiscase,interfacesE0andS2.Theoutgoing

interfacesareinterfacesthatmeetanyofthefollowing

conditions:

APIMneighborisheardontheinterface.

Ahostonthisinterfacehasjoinedthegroup.

Theinterfacehasbeenmanuallyconfiguredtojointhe

group.



Figure12-4.SuccessfulRPFCheck



InFigure12-5,therouterreceivesmulticastpacketsfrom

interfaceS0withthesourceaddressof192.168.3.1.Therouter

checksitsunicastroutingtable,asinthepreviousexampleand

findsoutthattheunicastroutingtableknowsaboutnetwork

192.168.3.0/24frominterfaceS1.Theunicastroutingtable,in

thiscase,isnotcongruentwiththeinterfacethatthemulticast

packetsarecomingfrom.Therefore,theRPFcheckfailsandthe

multicastpacketsaredropped.



Figure12-5.FailedRPFCheck



PIMDenseMode

PIMhastwomodesofoperationdensemodeandsparsemode.

Densemodeusesaflood-and-prunemechanismtoforward

multicastpackets.Therouterassumesthateverymulticast

interfaceisinterestedinmulticastpackets,unlessitistold

otherwise.Therouterfirstforwardsmulticastpacketstoallthe

interfaces.Segmentsthatdon'twantmulticastpacketsreceive

prunemessagesfromtheneighboringrouters,andthebranch

ispruned.

Whentherouterisfirstconfiguredformulticast,therouter

sendsperiodicPIMquerypacketstothemulticastaddressof

224.0.0.2(allroutersonthissubnetaddress)todiscoverits

PIMneighbors.ThePIMquerypacketsaresentoutthe

interfacesthatareconfiguredforPIM.PIMneighborsare

establishedacrossaninterfacewhenPIMqueriesarereceived

onthatinterface.

PIMdensemodefloodsmulticastpacketsonitsoutinterfacelist

(alsoknownasanoilist).PIMdensemodeputsaninterfacein

itsoilistifthefollowingconditionsaretrue:

TheinterfacehasanestablishedPIMneighbor.

Theinterfacehashostsjoiningthemulticastgroupthrough

IGMP.

Theinterfacehasbeenmanuallyconfiguredtojointhe

groupthroughtheipigmpjoin-groupcommand.

WhenarouterrunningPIMdensemodefirstreceivesmulticast

packets,itfloodsthemulticastpacketstoallinterfaceslistedin

theoilist.Therouterstopsforwardingmulticastpacketsonan



interfaceifitreceivesaprunepacketfromitsneighbor.

InFigure12-6,theRouterR1receivesincomingmulticast

packetsoninterfaceS0.AsR1isrunningdensemode,itfloods

themulticastpacketstoallitsoilistinterfaces,E0andS1.

BecauseRouterR2doesn'thaveanyhostsinterestedin

multicasttraffic,itsendsaPIMprunemessagetowardR1.

WhenR1receivesthePIMprune,itwaitsforthreeseconds

beforeitstopsforwardingmulticastpacketsforthegroupto

interfaceE0.Thisthree-seconddelayallowsotherrouterson

thesegmenttooverridetheprunewithaPIMjoin.



Figure12-6.PIMDense-ModePruning



Whentheinterfacehasbeenpruned,therouterstops



forwardingmulticastpacketsforthegrouptotheinterface.In

Figure12-6,supposethatRouterR2nowhasahostthatwants

toreceivemulticastpacketsoninterfaceE1.RouterR2sendsa

PIMgraftpackettoRouterR1.WhenRouterR1receivesthe

PIMgraftmessage,itputsitsinterfaceE0intoaforwarding

state,andmulticasttrafficflowstoRouterR2.

IftherearetworoutersonthesameLANinterfaceandboth

routershaveaconnectiontothesourceofthemulticaststream,

bothrouterspotentiallycouldforwardmulticastpacketsand

causeduplicatepacketsontheLANinterface.PIMdensemode

hasanassertmechanismtoavoidsuchscenarios.Figure12-7

illustratesthePIMassertmechanism.



Figure12-7.PIMAssertMechanism



IntheabsenceofthePIMassertprocess,bothroutersforward

multicastpacketsontointerfaceE0.Thiscausesduplicate

packetsontheLANinterface.Withtheassertmech-anism,both

routerssendthePIMassertpacketwiththeunicastrouting

distanceandmetrictothesourceofthemulticaststream.The

routerwiththebestunicastroutetothesourcewinsandstarts

forwardingthemulticastpackets.Therouterthatlosesthe

assertbattleprunestheoutgoinginterface.Ifatieisonthe

unicastroutingmetric,therouterwiththehighestIPaddress

winstheassert.Thisway,onlyonerouterisactivelyforwarding

themulticasttraffic.



PIMSparseMode

PIMsparsemodeworkstheoppositewayofdensemode.PIM

densemodeassumesthatallthemulticastinterfacesare

interestedinmulticastpackets,unlessbeingtoldotherwise.In

PIMsparsemode,therouterassumesthatnoneofthe

multicastinter-facesisinterestedinreceivingmulticastpackets,

unlessaPIMjoinmessageisreceivedontheinterface.PIM

sparsemodeismorescalablethanPIMdensemode,butthe

conceptismorecomplex.PIMsparsemodeusestheconceptof

arendezvouspoint(RP).TheRPiswherethesenderandthe

receiversmeetfirstbeforetheshortest-pathtreeisestablished.

Theshortest-pathtreeistheshortestpathbetweenthemulticastsenderandthereceiver.Foraparticularmulticastgroup,

onlyoneRPischosen.TheselectionoftheRPisdonebyeither

staticconfigurationordynamicallylearnedthroughtheAuto-RP

mechanism.

PIMsparsemodediscoversitsneighborthesamewaythatPIM

densemodeworks.ThePIMrouterssendoutPIMquerypackets

todiscoverPIMneighborsonthelink.InPIMsparsemode,the

highestIPaddressonaLANsegmentiselectedthedesignated

router.Thisdesig-natedrouterisusedtosendPIMjoinstothe

RPforthesegment.

Insparsemode,multicastflowhastwoparts:

1. ReceiverssendPIMjoinstotheRP.

ThesourcesendsPIMregisterstotheRP.

InthePIMsparsemodejoinmechanism,therouterthatis

closesttothereceivingstationsendsthePIMjoinmessageto

theRP.IfmorethanonerouterexistsontheLANsegment,the

PIMDRsendsthejointotheRP.ThePIMjoinsarethensent

hopbyhoptowardtheRP.Figure12-8illustratesthePIM



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Chapter 12. Understanding Protocol Independent Multicast (PIM)

Tải bản đầy đủ ngay(0 tr)

×