Úvod do protokolu
ThehostIPsoftwareneedstobeextendedbymulticasttoenablethehosttosendandreceivemulticastpacketsonthelocalnetwork.Butthisaloneisnotenough,becausemulticastforwardingacrossmultiplenetworksmustrelyonrouters.Inordertoestablishamulticastforwardingroute,aroutermustunderstandthedistributionofeachgroupmemberintheInternet.Thisrequiresthatthehostmustbeabletonotifythelocalrouterofthemulticastgroupitisin.Thisisalsothebasisforestablishingamulticastforwardingroute.TheInternetGroupManagementProtocol(IGMP)isusedbetweenthehostandthelocalroutertoexchangeinformationaboutmulticastgroupmembers.Onthisbasis,thelocalroutercommunicateswithhermulticastrouterwithyourinformation,disseminatesthemembershipinformationofthemulticastgroup,andestablishesamulticastroute.Regularunicastroutingbetweenthisprocessandtherouter.Thisprocessisverysimilartothepropagationofconventionalunicastroutingbetweenrouters.IGMPisoneoftheimportantstandardsinTCP/IP.AllIPmulticastsystems(includinghostsandrouters)needtosupporttheIGMPprotocol.
Multicastprotocolsincludegroupmembermanagementprotocolsandmulticastroutingprotocols.Thegroupmembermanagementprotocolisusedtomanagethejoiningandleavingofmulticastgroupmembers,andthemulticastroutingprotocolisresponsibleforexchanginginformationbetweenrouterstoestablishamulticasttree.IGMPbelongstotheformer.Itisaprotocolusedbymulticastrouterstomaintainmulticastgroupmemberinformation,anditrunsbetweenthehostandthemulticastrouter.IGMPinformationisencapsulatedinIPpackets,anditsIPprotocolnumberis2.
Ifahostwantstoreceivemulticastpacketssenttoaspecificgroup,itneedstomonitorallpacketssenttothatspecificgroup.TosolvethepathselectionofmulticastdatapacketsontheInternet,thehostneedstonotifythemulticastrouteronitssubnettojoinorleaveagroup.IGMPisusedinmulticasttocompletethistask.Inthisway,themulticastroutercanknowthemembersofthemulticastgrouponthenetwork,andthusdecidewhethertoforwardthemulticastdatapackettotheirnetwork.Whenamulticastrouterreceivesamulticastpacket,itchecksthemulticastdestinationaddressofthepacketandforwardsitonlyiftherearemembersofthatgroupontheinterface.
IGMPprovidestheinformationneededinthefinalstageofforwardingmulticastpacketstothedestination,andrealizesthefollowingtwo-wayfunctions:
ThehostisnotifiedthroughIGMPTherouterwantstoreceiveorleavetheinformationofaspecificmulticastgroup.
TherouterperiodicallyquerieswhetherthemulticastgroupmembersintheLANareactivethroughIGMP,soastorealizethecollectionandmaintenanceofthegroupmembershipoftheconnectednetworksegment.
Existují tři verze IGMP, jmenovitě IGMPv1, v2 a v3.
IGMPv1
IGMPv1definesthatahostcanonlyjoinamulticastgroup,butdoesnotdefineinformationaboutleavingamembergroup.Therouterdiscoversofflinegroupmembersbasedonthetimeoutmechanismofmembergroups.
IGMPv1ismainlybasedonthequeryandresponsemechanismtocompletethemanagementofmulticastgroupmembers.Whentherearemultiplemulticastroutersinanetworksegment,sincetheycanallreceiveIGMPMembershipReportMessagesfromthehost,onlyonerouterisrequiredtosendIGMPQueryMessages.Willsuffice.Thisrequiresaquerier(Querier)electionmechanismtodeterminewhichrouteristheIGMPquerier.ForIGMPv1,theonlymulticastinformationforwarderDR(DesignatedRouter)iselectedbythemulticastroutingprotocol(suchasPIM)astheIGMPquerier.
IGMPv1doesnotspecificallydefinemessagesleavingamulticastgroup.WhenahostrunningIGMPv1leavesamulticastgroup,itwillnotsendreportmessagestothemulticastgroupitisleaving.Whenthemembersofthemulticastgroupnolongerexistinthenetworksegment,theIGMProuterwillnotreceiveanyreportmessagessenttothemulticastgroup,sotheIGMProuterdeletesthegroupcorrespondingtothemulticastgroupafteraperiodoftimeBroadcastforwardingitems.
IGMPv2
IGMPv2isbasedonversion1withtheadditionofinformationaboutthehostleavingthemembergroup,allowingrapidreportingoftheleavingofgroupmemberstotheroutingprotocol,whichissuitableforhigh-bandwidthmulticastgroupsOritisveryimportantforthemembersofthevariablemulticastgroup.Inaddition,iftherearemultiplemulticastroutersinasubnet,thenmultiplerouterssendingIGMPquerymessagesatthesametimewillnotonlywasteresources,butalsocausenetworkcongestion.Tosolvethisproblem,IGMPv2.Differentrouteelectionmechanismsareused,andmultiplerouterscanbequeriedinasubnet.
Improvementsmadebyigmpversion2overversion1areasfollows:
(1)Theelectionmechanismofmulticastroutersonthesharednetworksegment
Indicatesthattherearemultiplemulticastroutersonanetworksegment.Inthiscase,sincetheroutersrunningigmponthisnetworksegmentcanreceivemembershipreportmessagesfromthehost,onlyonerouterisrequiredtosendmembershipquerymessages,whichrequiresarouterelectionmechanismtodeterminearouterAsaquerier.Theelectionprocessisasfollows:
(1)AllIGMPv2routersinitiallyconsiderthemselvesasqueriers,andsendIGMPGeneralQuerymessagestoallhostsandroutersinthelocalnetworksegment.(Destinationaddress:224.0.0.1);
(2)Afterreceivingthemessage,otherIGMPv2routersinthelocalnetworksegmentcomparethesourceIPaddressofthemessagewithitsowninterfaceaddress.Bycomparison,therouterwiththesmallestIPaddresswillbecomethequerier,andotherrouterswillbecomenon-queriers(Non-Querier);
(3)Allnon-querierswillstartatimer(ie,otherqueriers)Existencetimer(OtherQuerierPresentTimer).Beforethetimerexpires,ifanIGMPquerymessagefromthequerierisreceived,thetimerisreset;otherwise,theoriginalquerierisconsideredinvalidandanewquerierelectionprocessisinitiated.
Inigmpversion1,thechoiceofquerierisdeterminedbythemulticastroutingprotocol;igmpversion2hasmadeimprovementstothis,stipulatingthatwhentherearemultiplemulticastroutersonthesamenetworksegment,theyhavethesmallestipaddressOfthemulticastroutersareelectedtoactasqueriers.
(2)Igmpversion2addsalevinggroupmechanism
Inigmpversion1,thehostquietlyleavesthemulticastgroupwithoutanynotificationtoanymulticastrouter.Asaresult,themulticastroutercanonlyrelyontheresponsetimeoutofthemulticastgrouptodeterminethedepartureofthemulticastmember.Inversion2,whenahostdecidestoleave,ifitisthehostrespondingtoamembershipquerymessage,itwillsendamessagetoleavethegroup.
InIGMPv2, když hostitel opustí skupinu vícesměrového vysílání:
(1)Hostitel odešle všem vícenásobným strojům v segmentu místní sítě (adresa cíle je224.0.0.2)SendaLeaveGroupMessage;
(2)Whenthequerierreceivesthemessage,itsendsaspecificgroupquery(Group-SpecificQuery)message(boththedestinationaddressfieldandthegroupaddressfieldarefilledwiththemulticastgroupaddresstobequeried);
(3)Ifthereareothermembersofthemulticastgroupinthenetworksegment,Afterthesemembersreceiveaspecificgroupquerymessage,theywillsendamembershipreportmessagewithinthemaximumresponsetime(MaxResponseTime)setinthemessage;
(4)IfAfterreceivingmembershipreportmessagesfromothermembersofthemulticastgroupwithinthemaximumresponsetime,thequerierwillcontinuetomaintainthemembershipofthemulticastgroup;otherwise,thequerierwillconsiderthatthereisnosuchmulticastgroupinthenetworksegment.Themembersofthegroup,sothemembershipofthismulticastgroupisnolongermaintained.
(3)igmpversion2addsqueryforspecificgroups
Inigmpversion1,onequeryofthemulticastrouterisforallmulticastsunderthenetworksegmentGroup.Thiskindofqueryiscalledageneralquery.
Inigmpversion2,aspecificgroupqueryisaddedinadditiontothegeneralgroupquery.Thedestinationipaddressofthisquerymessageistheipaddressofthemulticastgroup,andthegroupaddressinthemessageThedomainpartisalsotheipaddressofthemulticastgroup.Thispreventshostsbelongingtoothermulticastgroupmembersfromsendingresponsepackets.
(4)igmpversion2přidápolemaximumresponsetime
igmpversion2addsthemaximumresponsetimefieldtodynamicallyadjustthehost'sresponsetimetogroupquerymessages.
IGMPv3
IGMPv3iscompatiblewithandinheritsIGMPv1andIGMPv2,andfurtherenhancesthecontrolcapabilityofthehost,andenhancesthefunctionsofqueryandreportmessages.
1)HostEnhancementofcontrolcapabilities
IGMPv3addsThefilteringmode(INCLUDE/EXCLUDE)enablesthehosttojoinamulticastgroupGwhileexplicitlyrequestingtoreceiveorrejectthemulticastinformationfromaspecificmulticastsourceS.Whenahostjoinsamulticastgroup:
Pokud je vyžadováno pouze přijímat informace o vícenásobném vysílání ze specifikovaných zdrojů vícenásobného vysílání, jako jsou S1, S2,..., lze jeho zprávu hlášení označit jako VČETNĚ zdrojů (S1, S2,...);
Pokud odmítnete přijímat informace o vícenásobném vysílání ze specifikovaných zdrojů vícenásobného vysílání, jako jsou S1, S2,..., lze zprávu označit jako VYLOUČNÉ zdroje (S1, S2,...…).
2)QueryandreportmessageEnhancedfunction
(1)Zpráva s dotazem na adresu zdroje
IGMPv3notonlysupportsIGMPv1generalgroupqueryandIGMPv2specificgroupquery,butalsoaddssupportforspecificsourcegroupquery:
zgeneralgroupqueryThemessagecarriesneitherthegroupaddressnorthesourceaddress;
zInthespecificgroupquerymessage,thegroupaddressiscarried,butthesourceaddressisnotcarried;
zSpecificThesourcegroupquerymessagecarriesboththegroupaddressandoneormoresourceaddresses.
(2)Zpráva obsahující více skupin záznamů
ThedestinationaddressoftheIGMPv3reportmessageis224.0.0.22,whichcancarryoneormoregrouprecords.Eachgrouprecordcontainsalistofmulticastgroupaddressesandmulticastsourceaddresses.Grouprecordscanbedividedintomultipletypes,asfollows:
IS_IN:IndicatesthatthefiltermodebetweenthemulticastgroupandthemulticastsourcelistisINCLUDE,thatis,onlyreceivemessagesfromthespecifiedmulticastsourcelisttothisgroupThemulticastdataofthebroadcastgroup.
IS_EX:IndicatesthatthefiltermodebetweenthemulticastgroupandthemulticastsourcelistisEXCLUDE,thatis,onlyreceivemulticastssenttothemulticastgroupfrommulticastsourcesoutsidethespecifiedmulticastsourcelistdata.
zTO_IN:IndicatesthatthefilteringmodebetweenthemulticastgroupandthemulticastsourcelistischangedfromEXCLUDEtoINCLUDE.
TO_EX:IndicatesthatthefilteringmodebetweenthemulticastgroupandthemulticastsourcelistischangedfromINCLUDEtoEXCLUDE.
ALLOW:Onthebasisofthecurrentstatus,italsohopestoreceivemulticastdatafromsomemulticastsources.IfthecurrentcorrespondenceisINCLUDE,thesemulticastsourcesareaddedtotheexistingmulticastsourcelist;ifthecurrentcorrespondenceisEXCLUDE,thesemulticastsourcesaredeletedfromtheexistingmulticastsourcelist.
BLOCK:Indicatesthatbasedonthecurrentstatus,itnolongerwantstoreceivemulticastdatafromcertainmulticastsources.IfthecurrentcorrespondenceisINCLUDE,thesemulticastsourcesaredeletedfromtheexistingmulticastsourcelist;ifthecurrentcorrespondenceisEXCLUDE,thesemulticastsourcesareaddedtotheexistingmulticastsourcelist.
Implementační kroky v oblastech jsou následující:
1.Whenaprocessofthehostjoinsamulticastgroup,thehostsendsanIGMPreport.Ifmultipleprocessesofahostjointhesamegroupatthesametime,anIGMPreportissent.
2.Whenaprocessleavesamulticastgroup,thehostdoesnotsendanIGMPreport,evenifthelastprocessinthegroupleavesthemulticastgroup.Whenthehostdeterminesthattherearenomoregroupmembers,itwillnotrespondtoanysubsequentIGMPqueries.
3.ThemulticastrouterregularlysendsIGMPtoquerywhetherthereareotherhoststhatcontainprocessesbelongingtothemulticastgroup.ThemulticastroutermustsendanIGMPquerytoeachinterface.
4.ThehostrespondstoanIGMPquerybysendinganIGMPreport,andsendsbackanIGMPreportforeachgroupthatcontainsatleastoneprocess.
Usingtheabovequeryandreportmessages,themulticastroutermaintainsamappingtableforeachinterface.Thetablerecordsoneormorehostmulticastgroupscontainedontheinterface.Whentherouterreceivesthemulticastdatagramtobeforwarded,itonlyneedstoforwardthedatagramtotheinterface.
Problémy v IGMPMulticast
Spolehlivost Multicast
IPMulticastusestheuserdatagramUDPprotocol,butUDPdoesitsbesttodeliverAnagreement.Therefore,IPmulticastapplicationsareboundtoencounterdatapacketlossandout-of-sequenceproblems.Forthisreason,differenttypesofIGMPapplicationsmustcomprehensivelyconsidertheconfirmationmethods(positiveconfirmationACKandnegativeconfirmationNACK),centralizedconfirmationanddistributedconfirmation,retransmissionmechanism,flowcontrol,congestioncontrol,etc.,andproposesolutions.Sofar,althoughtherearemanyreliablemulticastprotocolsintheWANenvironment,includingReliableMulticastProtocol(RMP),ScalableReliableMulticast(SRM),andReliableMulticastTransportProtocol(RMTP)).Thereliabilityresearchofmulticastisstilloneofthekeyresearchtopics.
Vícesměrové zabezpečení
Vícesměrové zabezpečenímeansthatonlyregisteredhostscansendandreceivemulticastdatatothegroup.
However,IPmulticastisdifficulttoguaranteethis.First,IPmulticastusesUDP,andanyhostinthenetworkcansendUDPpacketstoamulticastaddress;second,theInternetlacksaccesscontrolatthenetworklayer,andgroupmemberscanjoinandleavethemulticastgroupatanytime,makingmulticastsaferSexualityisstillatechnicaldifficulty.
IGMPmulticastprotocolisanimportantprotocolintheIPv4environment.IGMPv1issimpletoimplement,butthedelayofthehostleavingthemulticastgroupistoolarge,andtheselectionofthequeryrouterneedstorelyonthespecificmulticastroutingprotocol;IGMPv2lacksthedefinitionofthehostprocesstojointhemulticastgroup,whichrestrictsitsscopeofapplication.ThemainimprovementofIGMPv3istosupportsource-specificmulticast.MostnetworkdevicesandhostoperatingsystemprotocolstackssupportIGMPv1andIGMPv2,butinordertoadapttocomplexnetworkrequirements,theapplicationofIGMPv3mustbevigorouslypromoted.WindowsXPalreadysupportsIGMPv3,andtheUNIXoperatingsystemcanalsobebackwardcompatiblewithIGMPv1/v2.Multicasttechnologyhasbroadprospectsfordevelopment.
Členský dotaz IGMPmulticast
IGMPgroupmemberqueryisidentifiedbythetypefield0x11inthemessage.IGMPgroupmembershipqueryincludestwosub-types:generalgroupmemberquery(GeneralQuery)andspecificgroupmemberquery(Group-SpecificQuery).Thesubtypesaredistinguishedbythegroupaddressfieldinthepacket:thegroupaddressfieldisequalto0,whichmeansgeneralgroupmemberquery;thegroupaddressfieldisnotequalto0,whichmeansspecificgroupmemberquery,whichisusedtoquerythelocalnetworkEachofthespecifiedmulticastgroupmembers,wherethemulticastgroupaddressisspecifiedbythegroupaddress(GroupAddress)fieldtospecifythequeriedmulticastgroup.InIGMPv1,onlygeneralgroupmemberqueryissupported,andIGMPv2supportsspecificgroupmemberquery.
Dotaz na členy obecné skupiny
IGMPstipulatesthatthelocalrouterusesthegeneralgroupmemberquerymethodtoperiodicallysendIGMPgroupmemberquerymessagestoallhostsinthelocalnetwork;localnetworkWhenthehostinreceivesanIGMPquerymessage,itwillrespondtothemessageandreturnagroupmembershipreportmessagetonotifytherouteroftheaddressofthemulticastgroupwherethehostbelongs.
Dotaz konkrétního člena skupiny
Undernormalcircumstances,IGMPusesgeneralmulticastgroupmemberquerytopollgroupmemberinformationinthelocalnetwork.Thiskindofqueryisnotforacertainmulticastgroup,butforallgroupsinthelocalnetwork.Insomespecificenvironments,therouteralsoneedstoquerywhethertherearemembersofaspecificmulticastgroupinthelocalnetwork.Atthistime,youcanuseaspecificgroupmemberquery.