Configuration Guide
IP Multicast Configuration
PIM-ASM Configuration
23 min
introduction introduction pim stands for protocol independent multicast, which means it can utilize the unicast routing table generated by static routing or any unicast routing protocol (including rip, ospf, is is, bgp, etc ) to provide routing for ip multicast multicast routing is independent of the unicast routing protocol used, as long as the corresponding multicast routing table entries can be generated through the unicast routing protocol as a multicast routing solution, it directly leverages the routing information from the unicast routing table to perform rpf (reverse path forwarding) checks on multicast packets once the checks are passed, multicast routing table 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) pim sm (asm) operates as a sparse network model, and its implementation involves the following key aspects maintenance of a critical pim router in the network the rendezvous point (rp), which serves any group members or multicast sources that may appear all pim routers in the network are aware of the rp's location 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 this process creates ( , g) entries hop by hop, forming a rendezvous point tree (rpt) rooted at the rp when an active multicast source emerges (the source sends the first multicast packet to group g), the first hop router encapsulates the multicast data in register messages and unicasts them to the rp the rp then creates (s, g) entries, registering the source information in the asm model, the key mechanisms of pim sm include neighbor discovery, dr (designated router) election, rp discovery, rpt construction, multicast source registration, spt (shortest path tree) switchover, and assert process basic concepts basic concepts rpt check rpt check the router looks up the egress interface corresponding to the multicast source or rp in the unicast routing table (when using spt, it looks up the egress interface for the multicast source; when using rpt, it looks up the egress interface for the rp) this egress interface is the rpf interface if the multicast packet is received from the rpf interface, the rpf check passes, and the packet is forwarded to downstream interfaces; otherwise, it is discarded in addition to correctly forwarding packets according to the multicast routing configuration, the rpf check can also prevent potential loops neighbor discovery neighbor discovery on a pim router, every interface enabled with the pim protocol will send 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 purpose of the hello message is to discover pim neighbors, negotiate various pim protocol parameters, and maintain neighbor relationships dr election dr election on a network segment where multicast sources or group members are located, multiple pim routers are typically connected these pim routers become neighbors by exchanging hello messages, which carry dr priority and the interface address of the segment each pim router compares its own conditions with the information in the received hello messages to elect a designated router (dr), which will be responsible for sending and receiving multicast packets on behalf of the source or group members the election rules are as follows the router with the higher dr priority wins (provided all pim routers on the segment support dr priority) if 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 higher ip address wins if the current dr fails, pim neighbor relationships will timeout, triggering a new round of dr election among the remaining pim neighbors in the asm model, the dr primarily serves the following functions on a shared segment connected to a multicast source, the dr is responsible for sending register messages to the rp the dr connected to the multicast source is referred to as the source side dr on a shared segment connected to group members, the dr is responsible for sending join messages toward the rp the dr connected to group members is referred to as the member side dr rp discovery rp discovery the rendezvous point (rp) is a critical pim router in the network, responsible for processing registration messages from source side drs and handling join requests from group members all pim routers in the network must be aware of the rp’s address, which functions as a central hub for coordinating multicast supply and demand information a single rp can serve multiple multicast groups simultaneously, but each multicast group can be associated with only one rp currently, the rp can be configured using the following methods static rp the same rp address is manually configured on all pim routers in the network, statically defining the location of the rp dynamic rp several pim routers within the pim domain are configured as candidate rps (c rps) to dynamically participate in rp election additionally, a candidate bsr (c bsr) must be configured and elected as the bootstrap router (bsr) the bsr collects advertisement messages from c rps and distributes the rp information to all pim routers within the pim sm domain currently, only static rp is supported rpt construction rpt construction the pim sm rpt (rendezvous point tree) is a multicast distribution tree with the rp as its root and pim routers connected to group members as leaves when a group member appears (e g , a user host joins multicast group g via igmp), the member side dr sends a join message toward the rp this process creates ( , g) entries hop by hop along the path to the rp, forming an rpt rooted at the rp during rpt construction, each pim router performing the join message forwarding conducts an rpf check it looks up the unicast route to the rp, where the egress interface of this route is considered the upstream interface, and the next hop becomes the rpf neighbor the join message is then forwarded hop by hop from the member side dr until it reaches the rp multicast source registration multicast 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 detailed process is as follows the multicast source sends multicast packets to the source side dr upon receiving these multicast packets, the source side dr encapsulates them within register messages and forwards them to the rp after receiving the register message, the rp decapsulates it, creates an (s, g) entry, and forwards the multicast data along the rpt to reach group members spt switchover spt switchover in a pim sm network, each multicast group is associated with only one rp and uses a single rpt without spt switchover, all multicast packets destined for the group must first be encapsulated in register messages and sent to the rp after decapsulation, the rp forwards the packets along the rpt as the rp serves as a mandatory relay point for all multicast traffic, it becomes heavily burdened when the multicast data rate increases significantly to address this issue, pim sm allows either the rp or the member side dr to trigger an spt switchover to reduce the load on the rp spt switchover triggered by the rp after receiving a register message from the source side dr, the rp forwards the encapsulated multicast packet along the rpt to group members simultaneously, the rp sends a join message hop by hop toward the source side dr during this process, (s, g) entries are created on pim routers, establishing an spt from the rp to the source once the spt is successfully built, the source side dr forwards multicast packets directly to the rp along this tree, eliminating the need for frequent encapsulation and decapsulation between the source side dr and the rp spt switchover triggered by the member side dr the member side dr periodically monitors the forwarding rate of multicast packets if the rate of (s, g) traffic exceeds a predefined threshold, it triggers an spt switchover the member side dr sends a join message hop by hop toward the source side dr, creating (s, g) entries along the path and establishing an spt from the source side dr to the member side dr after the spt is established, the member side dr sends a prune message hop by hop along the rpt toward the rp, removing the corresponding downstream interface from the ( , g) entry once pruning is complete, the rp stops forwarding multicast packets along the rpt to the member side dr if the spt does not pass through the rp, the rp will continue to send a prune message hop by hop toward the source side dr, removing the corresponding downstream interface from the (s, g) entry after pruning, the source side dr ceases forwarding multicast packets to the rp along the "source side dr – rp" spt by default, devices typically do not have a threshold set for the multicast packet forwarding rate both the rp and the member side dr trigger their respective spt switchovers upon receiving the first multicast packet assert assert when multiple pim routers connected to the same network segment pass the rpf check and attempt to forward multicast packets to that segment, the assert mechanism is used to ensure that only one pim router forwards multicast packets to the segment after receiving identical multicast packets from a neighbor router, a pim router multicasts an assert message to all pim routers on the local segment, 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 priority wins if priorities are equal, the router with the lower cost to the multicast source wins if all of the above are identical, the router with the highest ip address on the downstream interface wins based on the assert election result, routers perform the following actions the winning router's downstream interface is called the assert winner and is responsible for forwarding subsequent multicast packets to the segment the losing router's downstream interface is called the assert loser and will cease forwarding multicast packets to the segment the pim router also removes this interface from the downstream interface list in the (s, g) entry after the assert election, only one downstream interface remains active on the segment, forwarding only one copy of the multicast traffic all assert losers may periodically resume multicast packet forwarding, triggering recurring assert elections pim basic configuration pim basic configuration pim interface pim interface operation command description enter the system configuration view configure terminal enter interface view interface ethernet interface id interface id refers to the interface identifier, which can also be a vlanif/lagif interface enable pim ip pim enable pim on the interface enable multicast routing forwarding multicast enable enable multicast routing forwarding on the interface static rp configuration static rp configuration operation command description enter the system configuration view configure terminal config statis rp address ip pim rp a b c d a b c d/m a b c d represents the rp address; a b c d/m represents the multicast group address static mroute configuration static mroute configuration operation command description enter the system configuration view configure terminal enter interface view interface ethernet interface id interface id refers to the interface identifier, which can also be a vlanif/lagif interface config static mroute entry ip mroute ethernet interface id a b c d a b c d interface id refers to the outgoing interface in the multicast routing table entry; a b c d represent the parameters of the (s, g) entry when configuring static multicast routes, ensure that both the interface and outgoing interface have pim enabled display and maintenance display and maintenance operation command view the pim interface show ip pim interface view the pim neighbors show ip pim neighbors view the rp address show ip pim rp info view the mroute entries show ip mroute view the rpf interface show ip pim rpf configuration example configuration example the host and the multicast source are interconnected at layer 3 through three switches, with all switches running the ospf protocol the requirement is to enable the host (pc) to access video services from the multicast source via the layer 3 network through video on demand procedure procedure device a \# configure ip address of interfaces sonic(config)# interface ethernet 1 sonic(config if 1)# ip address 30 1 1 2/30 sonic(config)# interface ethernet 2 sonic(config if 2)# ip address 20 1 1 1/30 \# configure ospf neighbor and distribute route sonic(config)# router ospf sonic(config router)# ospf router id 30 1 1 2 sonic(config router)# network 30 1 1 0/30 area 0 0 0 0 sonic(config router)# network 20 1 1 0/30 area 0 0 0 0 \# configure the pim interface, enable multicast routing and forwarding, set a static rp address, and activate the source side dr's capability to forward unknown multicast traffic sonic(config)# interface ethernet 1 sonic(config if 1)# multicast enable sonic(config if 1)# ip pim sonic(config)# interface ethernet 2 sonic(config if 2)# multicast enable sonic(config if 2)# ip pim sonic(config)# ip pim rp 20 1 1 2 224 1 1 0/24 sonic(config)# unknown multicast trap device b \# configure ip address of interfaces sonic(config)# interface ethernet 1 sonic(config if 1)# ip address 10 1 1 1/30 sonic(config)# interface ethernet 2 sonic(config if 2)# ip address 20 1 1 2/30 \# configure ospf neighbor and distribute route sonic(config)# router ospf sonic(config router)# ospf router id 20 1 1 2 sonic(config router)# network 10 1 1 0/30 area 0 0 0 0 sonic(config router)# network 20 1 1 0/30 area 0 0 0 0 \# configure the pim interface, enable multicast routing and forwarding, set a static rp address, and activate the source side dr's capability to forward unknown multicast traffic sonic(config)# interface ethernet 1 sonic(config if 1)# multicast enable sonic(config if 1)# ip pim sonic(config)# interface ethernet 2 sonic(config if 2)# multicast enable sonic(config if 2)# ip pim sonic(config)# ip pim rp 20 1 1 2 224 1 1 0/24 device c \# configure ip address of interfaces sonic(config)# vlan 100 sonic(config)# interface ethernet 10 sonic(config if 10)# switchport access vlan 100 sonic(config)# interface ethernet 1 sonic(config if 1)# ip address 10 1 1 2/30 sonic(config)# interface vlan 100 sonic(config vlanif 100)# ip address 100 1 1 1/24 sonic(config vlanif 100)# exit \# configure ospf neighbor and distribute route sonic(config)# router ospf sonic(config router)# ospf router id 10 1 1 2 sonic(config router)# network 100 1 1 0/24 area 0 0 0 0 sonic(config router)# network 10 1 1 0/30 area 0 0 0 0 \# configure the pim interface, enable multicast routing and forwarding, set a static rp address, and activate the source side dr's capability to forward unknown multicast traffic sonic(config)# interface ethernet 1 sonic(config if 1)# multicast enable sonic(config if 1)# ip pim sonic(config)# interface vlan 100 sonic(config vlanif 100)# ip igmp sonic(config vlanif 100)# ip pim sonic(config)# ip pim rp 20 1 1 2 224 1 1 0/24 verify configuration verify configuration the pc initiates a video on demand request for multicast source video services devices a, b, and c can dynamically establish pim entries and perform guided forwarding
