Configuration Guide
IP Multicast Configuration Guide
69 min
ip multicast is a method of transmitting data in computer networks that allows a sender to deliver data to multiple receivers simultaneously, rather than being limited to point to point or broadcast transmission a key concept of multicast is the "multicast group," which is a collection of receivers interested in a specific data stream multicast has the following characteristics in network data transmission many to many communication multicast enables a sender to send data to a multicast group, and multiple receivers in the multicast group can simultaneously receive the same data stream this communication mode is suitable for scenarios where multiple devices share the same data, such as real time video streams, online gaming, etc bandwidth efficiency unlike broadcasting, multicast transmits only to receivers interested in a specific data stream this can significantly save network bandwidth because data is only sent to where it is needed, rather than to every node applicability to multicast domains multicast can be used within a local area network (lan) or across a wide area network (wan) this makes it suitable for communication needs across different geographical locations multiplexing in a multicast group, multiple receivers can share the same data as a result, the sender only needs to send the data once, rather than sending separately to each receiver use of igmp and mld in ipv4 networks, igmp (internet group management protocol) is used to manage multicast group members in ipv6 networks, mld (multicast listener discovery) is used to achieve similar functionality support for various applications multicast is widely used in various scenarios, including streaming media, video conferencing, online gaming, data synchronization for distributed applications, and more in summary, ip multicast is an efficient data transmission method that addresses the many to many communication needs in modern networks by delivering data to multiple receivers simultaneously, effectively saving network resources static multicast members static multicast members introduction introduction by default, when a layer 2 device receives a multicast data packet, it broadcasts the multicast packet within the vlan this not only wastes bandwidth but also poses a security risk to control this broadcast behavior, you can configure igmp snooping on switches to build multicast forwarding entries alternatively, you can manually configure interfaces to join specific multicast groups this allows users on those interfaces to receive multicast data for the specified group in a stable and consistent manner with this configuration, when a multicast data packet with a destination ip matching the multicast group is received, it will only be forwarded to interfaces within the vlan that are configured for that multicast ip address explanation of principles explanation of principles in igmp, ports have two roles member ports member ports refer to the switch ports connected to host devices such as computers, routers, etc these ports listen to igmp messages sent by hosts to determine which multicast groups the hosts are interested in based on this information, the switch can decide which member ports to forward multicast data to router ports router ports are switch ports connected to routers routers are responsible for providing multicast services to multiple subnets in the network router ports listen to igmp messages sent by routers to determine which multicast groups the router is a member of switches forward multicast data to these ports so that routers can distribute multicast data across various subnets configuring static multicast configuring static multicast operation command description enter the vlan view vlan id enable igmp snooping function igmp snooping enable configure a static router port igmp snooping mrouter ethernet interface name configure a static member port interface l2mc static group ethernet interface name vlan id ip address display and maintenance display and maintenance operation command description view igmp enablement information show vlan igmp snooping display igmp snooping router port information show vlan igmp snooping mrouter view membership information for multicast groups show l2 multicast table check the aging time for igmp snooping router ports show vlan igmp snooping mrouter aging configuration example configuration example network requirements router through the device connected to the user network, the network has a, b, c three users, where only two users a and b need to receive multicast data from multicast group 224 1 1 1, c does not need to receive procedure 1 create a vlan and add member interfaces sonic(config)# vlan 100 sonic(config)# port group ethernet 1 4 sonic(config port group 1 4)# switchport access vlan 100 2 enable igmp snooping on the interface and add interfaces ethernet2, 3 to the multicast group in a static manner sonic(config)# interface ethernet 1 sonic(config if 1)# igmp snooping enable sonic(config)# interface ethernet 2 sonic(config if 2)# igmp snooping enable sonic(config)# interface ethernet 3 sonic(config if 3)# igmp snooping enable sonic(config)# interface ethernet 4 sonic(config if 4)# igmp snooping enable sonic(config)# interface l2mc static group ethernet 2 100 224 1 1 1 sonic(config)# interface l2mc static group ethernet 3 100 224 1 1 1 verify configuration 1 view multicast group information sonic# show l2 multicast table total l2 multicast forwarding group counters 2 (source,group) interface vlan \ (0 0 0 0, 224 1 1 1) ethernet2 100 ethernet3 100 2 send a multicast message with destination ip 224 1 1 1 to confirm that only a and b can receive the multicast message and c cannot receive the multicast message igmp snooping configuration igmp snooping configuration introduction introduction igmp snooping (internet group management protocol snooping) is a network switch technology used to intelligently manage the transmission of multicast data based on the actual needs of receivers (hosts or routers) during multicast communication igmp snooping listens to igmp messages on the network to understand which devices are interested in specific multicast groups and makes decisions on which ports to forward multicast data based on this information igmp is a protocol used in ipv4 networks to manage multicast group membership relationships between hosts and routers hosts can notify routers about their interest in specific multicast groups by sending igmp messages, and routers maintain multicast group membership tables based on these messages igmp snooping is the technology that implements this management mechanism on switches explanation of principles explanation of principles the specific handling of different igmp actions by switches running igmp snooping is as follows general group query messages when the switch receives igmp general group query messages, it forwards them out through all ports in the vlan except the receiving port for the receiving port, the switch handles it as follows if the dynamic router port is already included in the router port list, its aging timer is reset if the dynamic router port is not yet included in the router port list, it is added to the router port list, and its aging timer is started membership report messages when hosts receive igmp query messages or want to join a multicast group, they send igmp membership report messages to the igmp querier when the switch receives igmp membership report messages, it forwards them out through all router ports in the vlan for the receiving port, the switch handles it as follows if there is no forwarding table entry for the multicast group, one is created, and the port is added as a dynamic member port to the outgoing port list, and its aging timer is started if there is an existing forwarding table entry for the multicast group but the port is not included in the outgoing port list, the port is added as a dynamic member port to the outgoing port list, and its aging timer is started if there is an existing forwarding table entry for the multicast group and the port is already included in the outgoing port list as a dynamic member port, its aging timer is reset leaving multicast groups when hosts running igmpv2 or igmpv3 leave multicast groups, they send igmp leave group messages to notify the multicast router that they are leaving a specific multicast group if the switch does not have a forwarding table entry for the multicast group or if the port is not included in the outgoing port list for the corresponding multicast group, the switch does not forward the leave group message to any port and discards it directly if there is a forwarding table entry for the multicast group and the port is included in the outgoing port list for the corresponding multicast group, the switch forwards the leave group message out through all router ports in the vlan additionally, since the switch does not know if there are other members of the multicast group on the receiving port, it does not immediately remove the port from the outgoing port list for the multicast group instead, it resets the aging timer for the port igmp snooping configuration igmp snooping configuration configuring basic igmp snooping functionality configuring basic igmp snooping functionality operation command description enter the vlan view vlan id enable igmp snooping function igmp snooping enable enable igmp snooping querier igmp snooping querier enable configure the source address for igmp queries igmp snooping querier ip ip address configuring igmp snooping port aging time configuring igmp snooping port aging time after receiving different igmp protocol messages, the device starts aging timers for member ports with different durations when member ports of the device receive report messages from downstream hosts, the port aging time is set to robustness factor × general query interval + maximum response time when member ports of the device receive leave messages from downstream hosts, the port aging time is set to specific query interval × robustness factor operation command description enter the vlan view vlan id configure the igmp snooping general query interval igmp snooping query interval value configure the igmp snooping maximum response time igmp snooping query max response time value configure the igmp snooping specific query interval igmp snooping last member query interval value configure the igmp snooping robustness factor igmp snooping robustness value enabling fast leave on member interfaces enabling fast leave on member interfaces fast leave on a port means that when the switch receives an igmp leave message from a host indicating it is leaving a multicast group, the switch immediately removes that port from the outgoing port list for the corresponding forwarding table entry subsequently, when the switch receives a specific igmp query message for that multicast group, it will no longer forward it out of that port operation command description enter the vlan view vlan id enable fast leave igmp snooping fast leave enable enabling igmp snooping proxy function enabling igmp snooping proxy function when there are numerous member hosts in the network or when member hosts frequently join/leave multicast groups, a large number of igmp join/leave messages may be generated, resulting in significant processing pressure on the access devices to reduce the number of igmp join and leave messages received by upstream devices, igmp snooping proxy functionality can be configured on edge devices to allow them to act as proxies for downstream hosts to send join and leave messages to upstream devices handling of join messages upon receiving a join message for a multicast group on a port, if a forwarding table entry exists for that group and its outgoing port list already includes the dynamic member port, reset the aging timer for that entry if a forwarding table entry exists for the multicast group but its outgoing port list does not include the port, add the port as a dynamic member port to the outgoing port list and start its aging timer if no forwarding table entry exists for the multicast group on the device, create one, add the port as a dynamic member port to the outgoing port list, start its aging timer, and send a report message for that group to all router ports handling of leave messages upon receiving a leave message for a multicast group on a port, send a specific query message for that group to the port only send a leave message for the group to all router ports when removing the last member port from the corresponding forwarding table entry for that multicast group handling of general group query messages upon receiving a general group query message, forward it to all ports in the vlan except the receiving port generate report messages based on locally maintained group membership relationships and forward them to all router ports simultaneously operation command description enter the vlan view vlan id enable igmp snooping function igmp snooping enable enable igmp snooping proxy function igmp snooping proxy enable configuration example configuration example network requirements router connects to user network as igmp querier through device, there are two users in the network, pc a and pc b igmp snooping is running on device, multicast source sends data to multicast group 224 1 1 1,225 1 1 1 procedure 1 create vlans and add member interfaces sonic(config)# vlan 100 sonic(config vlan 100)# igmp snooping enable sonic(config)# port group ethernet 1 3 sonic(config port group 1 3)# switchport access vlan 100 verify configuration 1 view multicast group information sonic# show l2 multicast table total l2 multicast forwarding group counters 2 (source,group) interface vlan \ (0 0 0 0, 224 1 1 1) ethernet2 100 ethernet3 100 (0 0 0 0, 225 1 1 1) ethernet2 100 ethernet3 100 2 send multicast messages with destination ip 224 1 1 1 and 225 1 1 1 respectively to confirm that a and b can receive the multicast messages mld snooping configuration mld snooping configuration introduction introduction mld snooping (multicast listener discovery snooping) is an ipv6 layer 2 multicast protocol in an ipv6 network, to avoid wasting bandwidth by broadcasting multicast packets within a local area network (lan), mld snooping can be deployed in the layer 2 network to achieve precise forwarding of multicast packets similar to an ipv4 multicast network, layer 2 multicast devices can listen to and analyze mld messages between multicast users and upstream routers based on this information, the devices establish layer 2 multicast forwarding entries to control the forwarding of multicast data packets explanation of principles explanation of principles the specific handling of different mld actions by switches running mld snooping is as follows general group query messages when the switch receives mld general group query messages, it forwards them out through all ports in the vlan except the receiving port for the receiving port, the switch handles it as follows if the dynamic router port is already included in the router port list, its aging timer is reset if the dynamic router port is not yet included in the router port list, it is added to the router port list, and its aging timer is started mld report messages a host will send an mld report message to the mld querier in the following two situations when a member host of a multicast group receives an mld query message, it responds with an mld membership report message if a host wants to join a multicast group, it proactively sends an mld membership report message to the mld querier to declare its membership in the multicast group when the switch receives an mld membership report message, it forwards the message through all router ports within the vlan, parses the multicast group address that the host wants to join from the message, and processes the receiving port as follows if there is no forwarding entry corresponding to the multicast group, it creates a forwarding entry, adds the port as a dynamic member port to the outgoing port list, and starts its aging timer if there is an existing forwarding entry for the multicast group, but the outgoing port list does not include the port, it adds the port as a dynamic member port to the outgoing port list and starts its aging timer if there is an existing forwarding entry for the multicast group and the outgoing port list already includes the dynamic member port, it resets the aging timer leaving multicast groups when a host leaves a multicast group, it sends an mld leave group message to inform the multicast router that it has left a specific multicast group if the switch does not have a forwarding entry for the multicast group, or if the outgoing port list for the multicast group does not include the port, the switch will not forward the message to any port and will discard it if there is a forwarding entry for the multicast group and the outgoing port list for the multicast group includes the port, the switch will forward the message through all router ports within the vlan since the switch does not know whether there are other members of the multicast group on the receiving port, it will not immediately remove the port from the outgoing port list of the forwarding entry for the multicast group but will reset its aging timer mld snooping configuration mld snooping configuration configuring basic mld snooping functionality configuring basic mld snooping functionality operation command description enter the vlan view vlan id enable mld snooping function mld snooping enable enable mld snooping querier mld snooping querier enable configure the source address for mld queries mld snooping querier ip ip address configuring mld snooping port aging time configuring mld snooping port aging time after receiving different mld protocol messages, the device starts aging timers for member ports with different durations when member ports of the device receive report messages from downstream hosts, the port aging time is set to robustness factor × general query interval + maximum response time when member ports of the device receive leave messages from downstream hosts, the port aging time is set to specific query interval × robustness factor operation command description enter the vlan view vlan id configure the mld snooping general query interval mld snooping query interval value configure the mld snooping maximum response time mld snooping query max response time value configure the mld snooping specific query interval mld snooping last member query interval value configure the mld snooping robustness factor mld snooping robustness value enabling fast leave on member interfaces enabling fast leave on member interfaces fast leave on a port means that when the switch receives an mld leave message from a host indicating it is leaving a multicast group, the switch immediately removes that port from the outgoing port list for the corresponding forwarding table entry subsequently, when the switch receives a specific mld query message for that multicast group, it will no longer forward it out of that port operation command description enter the vlan view vlan id enable fast leave mld snooping fast leave enable enabling mld snooping proxy function enabling mld snooping proxy function when there are numerous member hosts in the network or when member hosts frequently join/leave multicast groups, a large number of mld join/leave messages may be generated, resulting in significant processing pressure on the access devices to reduce the number of mld join and leave messages received by upstream devices, mld snooping proxy functionality can be configured on edge devices to allow them to act as proxies for downstream hosts to send join and leave messages to upstream devices handling of join messages upon receiving a join message for a multicast group on a port, if a forwarding table entry exists for that group and its outgoing port list already includes the dynamic member port, reset the aging timer for that entry if a forwarding table entry exists for the multicast group but its outgoing port list does not include the port, add the port as a dynamic member port to the outgoing port list and start its aging timer if no forwarding table entry exists for the multicast group on the device, create one, add the port as a dynamic member port to the outgoing port list, start its aging timer, and send a report message for that group to all router ports handling of leave messages upon receiving a leave message for a multicast group on a port, send a specific query message for that group to the port only send a leave message for the group to all router ports when removing the last member port from the corresponding forwarding table entry for that multicast group handling of general group query messages upon receiving a general group query message, forward it to all ports in the vlan except the receiving port generate report messages based on locally maintained group membership relationships and forward them to all router ports simultaneously operation command description enter the vlan view vlan id enable mld snooping function mld snooping enable enable mld snooping proxy function mld snooping proxy enable multicast vlan configuration multicast vlan configuration i ntroduction ntroduction when users in different vlans have the same multicast data requirements, the upstream router needs to send multiple copies of the same multicast packet, each carrying a different vlan, to different vlans with multicast vlan functionality deployed on layer 2 devices, the upstream router no longer needs to replicate the multicast stream in each user vlan instead, the data stream is duplicated within the multicast vlan and then sent to the layer 2 devices this approach avoids unnecessary duplication of multicast streams on the upstream router, saving network bandwidth and reducing the burden on the upstream router explanation of principles explanation of principles in a multicast vlan, vlans are divided into multicast vlans and user vlans the multicast vlan is the vlan to which the interfaces connected to multicast sources belong, used to aggregate multicast streams the user vlan is the vlan to which multicast member hosts belong, used to receive multicast traffic from the multicast vlan multiple user vlans can be bound to a multicast vlan the implementation process of multicast vlan functionality consists of two parts protocol message forwarding and multicast data forwarding protocol message forwarding replace the tag of igmp report messages from user vlans with the tag of the corresponding multicast vlan and send them out from the router ports of the multicast vlan replace the tag of igmp query messages from the multicast vlan with the tag of the corresponding user vlan and send them out from the member ports of the user vlan merge the learned entries from igmp snooping in user vlans into the multicast vlan multicast data forwarding if the forwarding table entry corresponding to the multicast vlan is found, the outgoing ports and outgoing port vlan ids can be determined then, the data packet is copied and sent to each member port in each user vlan if the corresponding forwarding table entry is not found, the data packet will be discarded or broadcast according to user policy multicast vlan configuration multicast vlan configuration operation command description enter the system configuration view configure configure the multicast vlan igmp snooping mvlan multicast vlan user vlan multicast vlan multicast vlan; user vlan user vlan, supports configuring multiple vlans separated by commas ',' or configuring a range using ' ' display and maintenance display and maintenance operation command description view multicast vlan configuration show vlan igmp snooping mvlan vlan id vlan id configuration example configuration example network requirements the service vlan used to transmit multicast data between router and device is vlan 10, while the downstream user hosts belong to vlan 100 and vlan 200 respectively, and all need to receive multicast data from multicast source by configuring the multicast vlan one to one multifunction based on user vlans, for multiple copies of the same multicast demand from different user hosts, router only needs to send one copy of multicast data to vlan 10, reducing the bandwidth waste between router and device procedure 1 create a vlan and enable igmp snooping sonic(config)# vlan 100 sonic(config vlan 100)# igmp snooping enable sonic(config)# vlan 200 sonic(config vlan 200)# igmp snooping enable 2 create a multicast vlan and enable igmp snooping sonic(config)# vlan 10 sonic(config vlan 10)# igmp snooping enable 3 add the interface to the specified vlan sonic(config)# vlan 100 sonic(config)# vlan 200 sonic(config)# vlan 10 sonic(config)# interface ethernet 1 sonic(config if 1) switchport access vlan 100 sonic(config)# interface ethernet 2 sonic(config if 2) switchport access vlan 100 sonic(config)# interface ethernet 3 sonic(config if 3) switchport access vlan 200 sonic(config)# interface ethernet 4 sonic(config if 4) switchport access vlan 200 sonic(config)# interface ethernet 50 sonic(config if 50) switchport access vlan 10 4 bind user vlan100, vlan200 under multicast vlan sonic(config)# igmp snooping mvlan 20 200,201 verify configuration view multicast vlan configuration sonic# show vlan igmp snooping mvlan + + + \| mvlan id | uvlan ids | +=============+=============+ \| 20 | 200 | \| | 100 | + + + pim sm configuration pim sm configuration introduction introduction pim, short for protocol independent multicast, refers to the ability to utilize either static routes or any unicast routing protocol (including rip, ospf, is is, bgp, etc ) to generate a unicast routing table that provides routing for ip multicast multicast routing is independent of the unicast routing protocol used, as long as the corresponding multicast routing entries can be created via the unicast routing protocol as a multicast routing solution, it directly leverages the routing information from the unicast routing table to perform an rpf (reverse path forwarding) check on multicast packets after the check passes, multicast routing entries are created to forward the multicast packets as an intra domain multicast routing protocol, pim supports two modes dense mode (pim dm) and sparse mode (pim sm) the current version only supports sparse mode in the asm (any source multicast) model, pim sm uses a "pull mode" to forward multicast packets it is typically deployed in networks where multicast group members are relatively large in scale and sparsely distributed based on this sparse network model, its implementation works as follows a crucial pim router is maintained in the network the rendezvous point (rp), which serves any group members or multicast sources that may appear at any time all pim routers in the network know the location of the rp when a group member appears (a user host joins a multicast group g via igmp), the last hop router sends a join message toward the rp, hop by hop, to create a ( , g) entry and build an rpt (rendezvous point tree) rooted at the rp when an active multicast source appears (a multicast source sends the first multicast data packet to a multicast group g), the first hop router encapsulates the multicast data in a register packet and unicasts it to the rp the rp then creates an (s, g) entry to register the source information in the asm model, key mechanisms of pim sm include neighbor discovery, dr election, rp discovery, rpt construction, multicast source registration, spt switchover, and assert basic concepts basic concepts rpf check rpf check in unicast routing and forwarding, a unicast packet travels along a point to point path a router only needs to consider "where the packet needs to go"—the destination address—to determine which interface to forward it out of multicast routing and forwarding are different because the destination address of a multicast packet is a multicast address, which merely identifies a group of receivers, it's impossible to locate the receivers based on the destination address however, the "source location" of the multicast packet—its source address—is definite therefore, the forwarding of multicast packets primarily relies on their source address to ensure the correctness of the forwarding path upon receiving a multicast packet, a router consults the unicast routing table using the packet's source address to find the route back to the packet's source it then checks whether the outgoing interface in the routing table entry for reaching the source matches the incoming interface on which the multicast packet was received if they match, the multicast packet is considered to have arrived on the correct interface, thereby ensuring the correctness and uniqueness of the entire forwarding path this process is called an rpf check this "correct interface" is commonly referred to as the rpf interface, which is the interface that passes the rpf check neighbor discovery neighbor discovery each interface enabled with the pim protocol on a pim router periodically sends out hello messages the hello message is encapsulated in a multicast packet with a destination address of 224 0 0 13 (representing all pim routers on the same network segment), a source address of the interface's ip address, and a ttl value of 1 the purposes of the hello message are to discover pim neighbors, to negotiate various pim protocol parameters, and to maintain neighbor relationships dr election dr election on a network segment where multicast sources or group members reside, multiple pim routers are typically connected these pim routers become neighbors by exchanging hello messages, which carry dr priority and the interface address on that segment each pim router compares its own parameters with the information carried in the received hello messages to elect a dr, which will be responsible for sending and receiving multicast packets on behalf of the source or group members on that segment the election rules are as follows the router with the higher dr priority wins (provided all pim routers on the segment support dr priority in hello messages) if the dr priorities are equal, or if at least one pim router on the segment does not support carrying dr priority in hello messages, the router with the numerically larger ip address wins if the current dr fails, causing pim neighbor relationships to time out, a new round of dr election will be triggered among the remaining pim neighbors in the asm model, the primary roles of the dr are as follows on the shared segment connected to a multicast source, the dr is responsible for sending register registration messages to the rp the dr connected to the multicast source is called the source side dr on the shared segment connected to group members, the dr is responsible for sending join messages to the rp the dr connected to group members is called the member side dr rp discovery rp discovery the rendezvous point (rp) is a crucial pim router within the network, responsible for handling source side dr registration information and group member join requests all pim routers in the network must know the address of the rp, which functions similarly to a central hub for supply and demand information a single rp can serve multiple multicast groups simultaneously, but a specific multicast group can only correspond to one rp currently, the rp can be configured using the following methods static rp configure the same rp address on all pim routers within the network to statically designate the rp's location dynamic rp select several pim routers within the pim domain and configure them as c rp (candidate rp) to dynamically elect the rp through a process simultaneously, a bsr (bootstrap router) must be elected by configuring c bsr (candidate bsr) the bsr collects advertisement information from the c rps and disseminates it to all pim routers within the pim sm domain the current version only supports static rp rpt construction rpt construction the pim sm rpt (rendezvous point tree) is a multicast distribution tree rooted at the rp, with the pim routers connected to group members as its leaves when a group member appears in the network (i e , a user host joins a multicast group g via igmp), the member side dr sends a join message towards the rp this process creates ( , g) entries hop by hop along the path to the rp, ultimately forming an rpt rooted at the rp during the rpt construction process, when a pim router sends a join message, it performs an rpf check it looks up the unicast route to reach the rp the outgoing interface of this unicast route becomes the upstream interface, and the next hop becomes the rpf neighbor the join message is then forwarded hop by hop starting from the member side dr until it reaches the rp m m ulticast source registration ulticast source registration in a pim sm network, any newly active multicast source must first "register" with the rp before its multicast traffic can be delivered to group members the specific process is as follows the multicast source sends its multicast packets to the source side dr upon receiving the multicast packets, the source side dr encapsulates them within a register message and sends it to the rp the rp receives the register message, decapsulates it, establishes an (s, g) entry, and forwards the multicast data down the rpt towards the group members spt switchover spt switchover in a pim sm network, a multicast group corresponds to only one rp and initially relies on a single rpt without spt switchover, all multicast packets destined for the group must first be encapsulated in register messages sent to the rp the rp then decapsulates them and forwards the packets along the rpt this makes the rp a mandatory transit point for all multicast traffic, which can place a significant burden on it as the packet rate increases to address this issue, pim sm allows either the rp or the member side dr to trigger an spt switchover to alleviate the load on the rp rp triggered spt switchover after receiving a register message from the source side dr, the rp forwards the encapsulated multicast packet down the rpt towards the group members simultaneously, the rp sends a join message hop by hop towards the source side dr during this process, (s, g) entries are created on the pim routers along the path, establishing an spt from the rp back to the source once the spt is successfully built, the source side dr can forward multicast packets directly to the rp along this tree, freeing both the source side dr and the rp from the frequent encapsulation and decapsulation process member side dr triggered spt switchover the member side dr periodically monitors the forwarding rate of multicast packets once it detects that the forwarding rate for an (s, g) stream exceeds a configured threshold, it triggers an spt switchover the member side dr sends a join message hop by hop towards the source side dr, creating (s, g) entries and establishing an spt directly from the source side dr to itself after the spt is established, the member side dr sends a prune message hop by hop up the rpt towards the rp, removing the corresponding downstream interface from the ( , g) entry once pruning is complete, the rp stops forwarding the multicast traffic for that group down the rpt to this member side dr if the newly built spt does not pass through the rp, the rp will then send a prune message hop by hop towards the source side dr, removing the corresponding downstream interface from the (s, g) entry on that path after this pruning, the source side dr stops forwarding multicast packets for that group along the "source side dr > rp" segment of the spt by default, devices generally do not have a multicast packet forwarding rate threshold configured therefore, both the rp and the member side dr typically trigger their respective spt switchover processes upon receiving the first multicast packet for a given (s, g) stream assert mechanism assert mechanism when multiple pim routers connected to the same network segment pass the rpf check and attempt to forward multicast packets onto that segment, the assert mechanism is needed to ensure that only one pim router forwards the multicast packets onto the segment after receiving identical multicast packets from a neighbor router, a pim router sends an assert message to all pim routers on the segment via multicast, using the permanent group address 224 0 0 13 as the destination upon receiving the assert message, other pim routers compare their own parameters with those carried in the received message to participate in an assert election the election rules are as follows the router with the higher unicast routing protocol preference wins if the preferences are equal, the router with the lower metric (cost) to the multicast source wins if the above are all equal, the router with the numerically higher downstream interface ip address wins based on the assert election result, routers perform different actions the downstream interface of the winner is called the assert winner and becomes responsible for subsequently forwarding multicast packets onto that network segment the downstream interface of the loser is called the assert loser it will not forward multicast packets onto that segment subsequently, and the pim router also removes it from the downstream interface list in the (s, g) entry after the assert election concludes, only one downstream interface remains active on the segment, transmitting only one copy of the multicast packet all assert losers can periodically resume multicast packet forwarding, thereby triggering periodic assert elections pim configuration pim configuration pim interface pim interface operation command description enter the system configuration view configure enter the interface view interface ethernet interface id enable pim functionality ip pim configure static rp configure static rp operation command description enter the system configuration view configure configure static rp ip pim rp a b c d a b c d/m a b c d is the rp address; a b c d/m is the multicast group address (with subnet mask) configuring the source side dr configuring the source side dr operation command description enter the system configuration view configure enter the interface view interface ethernet interface id interface connected to the multicast source enable pim functionality ip pim enable source side dr registration unknown multicast trap at the system configuration level, configure to send unknown multicast packets to the cpu configuring the member side dr configuring the member side dr operation command description enter the system configuration view configure enter the vlanif view interface vlan vlan id vlan connected to host terminals enable pim functionality ip pim enable igmp functionality ip igmp configure static multicast route configure static multicast route operation command description enter the system configuration view configure enter the interface view interface ethernet interface id configure static multicast route ip mroute ethernet interface id a b c d a b c d display and maintenance display and maintenance operation command description display pim interface information show ip pim interface display pim neighbor information show ip pim neighbor display rp information show ip pim rp info display multicast routing information show ip mroute display rpf interface information show ip pim rpf configuration example configuration example network requirements the host and the multicast source are interconnected at layer 3 through three devices, with all devices running the ospf protocol the requirement is for host pc to be able to subscribe to services from the multicast source over the layer 3 network procedure 1 dut3 assign ip addresses to interfaces sonic(config)# interface ethernet 8 sonic(config if 8)# ip address 1 1 1 1/24 sonic(config if 8)# interface ethernet 14 sonic(config if 14)# switchport access vlan 100 sonic(config if 14)# interface ethernet 15 sonic(config if 15)# switchport access vlan 100 sonic(config if 15)# exit sonic(config)# interface vlan 100 sonic(config vlanif 100)# ip address 10 1 1 1/24 sonic(config vlanif 100)# exit configure ospf sonic(config)# router ospf sonic(config router)# ospf router id 10 1 0 218 sonic(config router)# network 1 1 1 0/24 area 10 sonic(config router)# network 10 1 1 0/24 area 10 sonic(config router)# exit configure pim related settings sonic(config)# interface ethernet 8 sonic(config if 8)# ip pim sonic(config if 8)# exit sonic(config)# interface vlan 100 sonic(config vlanif 100)# ip pim sonic(config vlanif 100)# ip igmp sonic(config vlanif 100)# exit sonic(config)# ip pim rp 2 1 1 1 224 10 10 0/24 sonic(config)# unknown multicast trap 2 dut2 assign ip addresses to interfaces sonic(config)# interface ethernet 8 sonic(config if 8)# ip address 1 1 1 2/24 sonic(config if 8)# interface ethernet 10 sonic(config if 10)# ip address 2 1 1 1/24 sonic(config if 10)# exit configure ospf sonic(config)# router ospf sonic(config router)# ospf router id 10 1 0 217 sonic(config router)# network 1 1 1 0/24 area 10 sonic(config router)# network 2 1 1 0/24 area 10 sonic(config router)# exit configure pim related settings sonic(config)# interface ethernet 8 sonic(config if 8)# ip pim sonic(config if 8)# interface ethernet 10 sonic(config if 10)# ip pim sonic(config)# ip pim rp 2 1 1 1 224 10 10 0/24 sonic(config)# unknown multicast trap 3 dut1 assign ip addresses to interfaces sonic(config)# interface ethernet 10 sonic(config if 10)# ip address 2 1 1 2/24 sonic(config if 8)# interface ethernet 14 sonic(config if 14)# ip address 3 1 1 1/24 sonic(config if 14)# exit configure ospf sonic(config)# router ospf sonic(config router)# ospf router id 10 1 0 212 sonic(config router)# network 2 1 1 0/24 area 10 sonic(config router)# network 3 1 1 0/24 area 10 sonic(config router)# exit configure pim related settings sonic(config)# interface ethernet 10 sonic(config if 10)# ip pim sonic(config if 8)# interface ethernet 14 sonic(config if 14)# ip pim sonic(config)# ip pim rp 2 1 1 1 224 10 10 0/24 sonic(config)# unknown multicast trap verify configuration the device establishes pim dynamic forwarding entries, enabling the on demand multicast data to be correctly forwarded to the pc
