6.3. Configuring PIM-SM
Overview
Function Introduction
The Protocol Independent Multicasting-Sparse Mode (PIM-SM) is a multicast routing protocol designed to operate efficiently across Wide Area Networks (WANs) with sparsely distributed groups. It helps network nodes that are geographically dispersed to conserve bandwidth, and reduces traffic by simultaneously delivering a single stream of information to multiple locations.
PIM-SM uses the IP multicast model of receiver-initiated membership, supporting both shared and shortest-path trees, and uses soft-state mechanisms to adapt to changing network conditions. It relies on a topology-gathering protocol to populate a multicast routing table with routes.
Principle Description
The PIM-SM module is based on the following IETF standard: RFC 4601
Terminology:
Rendezvous Point (RP) A Rendezvous Point (RP) router is configured as the root of the non-source-specific distribution tree for a multicast group. Join messages from receivers for a group are sent towards the RP. Data from senders is sent to the RP so that receivers can discover who the senders are, and receive traffic destined for the group.
Multicast Routing Information Base (MRIB) The MRIB is a multicast topology table derived from the unicast routing table. In PIM-SM, the MRIB is used to decide where to send Join/Prune messages. It also provides routing metrics for destination addresses. These metrics are used when sending and processing Assert messages.
Reverse Path Forwarding Reverse Path Forwarding (RPF) is a concept of an optimized form of flooding, where the router accepts a packet from SourceA through Interface IF1 only if IF1 is the interface the router would use in order to reach SourceA. It determines whether the interface is correct by consulting its unicast routing tables. The packet that arrives through interface IF1 is forwarded because the routing table lists this interface as the shortest path to the network. The router’s unicast routing table determines the shortest path for the multicast packets.
Because a router accepts a packet from only one neighbor, it floods the packet only once, meaning that (assuming point-to-point links) each packet is transmitted over each link once in each direction.
Tree Information Base (TIB) The TIB is the collection of state at a PIM router storing the state of all multicast distribution trees at that router. It is created by receiving Join/Prune messages, Assert messages, and IGMP information from local hosts.
Upstream Towards to root of the tree. The root of the tree might be either the Source or the RP.
Downstream Away from the root of the tree. The root of tree might be either the Source or the RP.
Source-Based Trees In the Source-Based Trees concept, the forwarding paths are based on the shortest unicast path to the source. If the unicast routing metric is hop counts, the branches of the multicast Source-Based Trees are minimum hop. If the metric is delay, the branches are minimum delay. For every multicast source, there is a corresponding multicast tree that directly connects the source to all receivers. All traffic to the members of an associated group passes along the tree made for their source. Source-Based Trees have two entries with a list of outgoing interfaces the source address and the multicast group.
Shared Trees Shared trees or RP trees (RPT) rely on a central router called the Rendezvous Point (RP) that receives all traffic from the sources, and forwards that traffic to the receivers. All hosts might not be receivers. There is a single tree for each multicast group, regardless of the number of sources. Only the routers on the tree know about the group, and information is sent only to interested receivers. With an RP, receivers have a place to join, even if no source exists. The shared tree is unidirectional, and information flows only from the RP to the receivers. If a host other than the RP has to send data on the tree, the data must first be tunneled to the RP, and then multicast to the members. This means that even if a receiver is also a source, it can only use the tree to receive packets from the RP, and not to send packets to the RP (unless the source is located between the RP and the receivers).
Bootstrap Router (BSR) When a new multicast sender starts sending data packets, or a new receiver starts sending the Join message towards the RP for that multicast group, it needs to know the next-hop router towards the RP. The BSR provides group-to-RP mapping information to all the PIM routers in a domain, allowing them to map to the correct RP address.
Sending out Hello Messages PIM routers periodically send Hello messages to discover neighboring PIM routers. Hello messages are multicast using the address 224.0.0.13 (ALL-PIM-ROUTERS group). Routers do not send any acknowledgement that a Hello message was received. A hold time value determines the length of time for which the information is valid. In PIM-SM, a downstream receiver must join a group before traffic is forwarded on the interface.
Electing a Designated Router In a multi-access network with multiple routers connected, one of them is selected to act as a designated router (DR) for a given period of time. The DR is responsible for sending Join/Prune messages to the RP for local members.
Determining the RP PIM-SM uses a Bootstrap Router (BSR) to originate Bootstrap messages, and to disseminate RP information. The messages are multicast to the group on each link. If the BSR is not apparent, the routers flood the domain with advertisements. The router with the highest priority (if priorities are same, the higher IP address applies) is selected to be the RP. Routers receive and store Bootstrap messages originated by the BSR. When a DR gets a membership indication from IGMP for (or a data packet from) a directly connected host, for a group for which it has no entry, the DR maps the group address to one of the candidate RPs that can service that group. The DR then sends a Join/Prune message towards that RP. In a small domain, the RP can also be configured statically.
Joining the Shared Tree To join a multicast group, a host sends an IGMP message to its upstream router, after which the router can accept multicast traffic for that group. The router sends a Join message to its upstream PIM neighbor in the direction of the RP. When a router receives a Join message from a downstream router, it checks to see if a state exists for the group in its multicast routing table. If a state already exists, the Join message has reached the shared tree, and the interface from which the message was received is entered in the Outgoing Interface list. If no state exists, an entry is created, the interface is entered in the Outgoing Interface list, and the Join message is again sent towards the RP.
Registering with the RP A DR can begin receiving traffic from a source without having a Source or a Group state for that source. In this case, the DR has no information on how to get multicast traffic to the RP through a tree. When the source DR receives the initial multicast packet, it encapsulates it in a Register message, and unicasts it to the RP for that group. The RP decapsulates each Register message, and forwards the extracted data packet to downstream members on the RPT. Once the path is established from the source to the RP, the DR begins sending traffic to the RP as standard IP multicast packets, as well as encapsulated within Register messages. The RP temporarily receives packets twice. When the RP detects the normal multicast packets, it sends a Register-Stop message to the source DR, meaning it should stop sending register packets.
Sending Register-Stop Messages When the RP begins receiving traffic from the source, both as Register messages and as unencapsulated IP packets, it sends a Register-Stop message to the DR. This notifies the DR that the traffic is now being received as standard IP multicast packets on the SPT. When the DR receives this message, it stops encapsulating traffic in Register messages.
Pruning the Interface Routers attached to receivers send Prune messages to the RP to disassociate the source from the RP. When an RP receives a Prune message, it no longer forwards traffic from the source indicated in the Prune message. If all members of a multicast group are pruned, the IGMP state of the DR is deleted, and the interface is removed from the Source and Group lists of the group.
Forwarding Multicast Packets PIM-SM routers forward multicast raffic onto all interfaces that lead to receivers that have explicitly joined a multicast group. Messages are sent to a group address in the local subnetwork, and have a Time to Live (TTL) of 1. The router performs an RPF check, and forwards the packet. Traffic that arrives on the correct interface is sent onto all outgoing interfaces that lead to downstream receivers if the downstream router has sent a join to this router, or is a member of this group.
Configuration
PIM-SM is a soft-state protocol. The main requirement is to enable PIM-SM on desired interfaces, and configure the RP information correctly, through static or dynamic methods. All multicast group states are maintained dynamically as the result of IGMP Report/Leave and PIM Join/Prune messages.
This section provides PIM-SM configuration examples for two relevant scenarios. The following graphic displays the network topology used in these examples:
Configuring General PIM Sparse-mode (static RP)
In this example, using the above topology, Switch1 is the Rendezvous Point (RP), and all routers are statically configured with RP information. While configuring the RP, make sure that:
Every router includes the ip pim rp-address 11.1.1.1 statement, even if it does not have any source or group member attached to it.
There is only one RP address for a group scope in the PIM domain.
All interfaces running PIM-SM must have sparse-mode enabled.
Here is a sample configuration:
step 1 Enter the configure mode
Switch# configure terminal
step 2 Enter the interface configure mode set the attributes and ip address, and enable pim-sm
Configuring on Switch1:
Switch(config)# interface eth-0-1
Switch(config-if)# no shutdown
Switch(config-if)# no switchport
Switch(config-if)# ip address 11.1.1.1/24
Switch(config-if)# ip pim sparse-mode
Switch(config-if)# exit
Switch(config)# interface eth-0-9
Switch(config-if)# no shutdown
Switch(config-if)# no switchport
Switch(config-if)# ip address 12.1.1.1/24
Switch(config-if)# ip pim sparse-mode
Switch(config-if)# exit
Configuring on Switch2:
Switch(config)# interface eth-0-1
Switch(config-if)# no shutdown
Switch(config-if)# no switchport
Switch(config-if)# ip address 22.1.1.2/24
Switch(config-if)# ip pim sparse-mode
Switch(config-if)# exit
Switch(config)# interface eth-0-9
Switch(config-if)# no shutdown
Switch(config-if)# no switchport
Switch(config-if)# ip address 12.1.1.2/24
Switch(config-if)# ip pim sparse-mode
Switch(config-if)# exit
step 3 Add static routes
Configuring on Switch1:
Switch(config)# ip route 22.1.1.0/24 12.1.1.2
Configuring on Switch2:
Switch(config)# ip route 11.1.1.0/24 12.1.1.1
step 4 Configure the static rp address
Switch(config)# ip pim rp-address 11.1.1.1
step 5 Exit the configure mode
Switch(config)# end
step 6 Validation
Use the following command to show ip pim sparse-mode rp mapping. 11.1.1.1 is the RP for all multicast groups 224.0.0.0/4 which is statically configured.
Switch# show ip pim sparse-mode rp mapping
PIM group-to-RP mappings
Group(s): 224.0.0.0/4, Static
RP: 11.1.1.1
Uptime: 00:08:21
Use the following command to show the interface information:
Switch# show ip pim sparse-mode interface
Address Interface VIFindex Ver/ Nbr DR DR HoldTime
Mode Count Prior
11.1.1.1 eth-0-1 2 v2/S 0 1 11.1.1.1 105
12.1.1.1 eth-0-9 0 v2/S 1 1 12.1.1.2 105
Use the following command to show the pim sparse-mode multicast routes:
Switch1
Switch# show ip pim sparse-mode mroute detail
IP Multicast Routing Table
(*,*,RP) Entries: 0
(*,G) Entries: 1
(S,G) Entries: 0
(S,G,rpt) Entries: 0
FCR Entries: 0
(*, 224.1.1.1) Uptime: 00:01:32
RP: 11.1.1.1, RPF nbr: None, RPF idx: None
Upstream:
State: JOINED, SPT Switch: Enabled, JT: off
Macro state: Join Desired,
Downstream:
eth-0-9:
State: JOINED, ET Expiry: 179 secs, PPT: off
Assert State: NO INFO, AT: off
Winner: 0.0.0.0, Metric: 4294967295, Pref: 4294967295, RPT bit: on
Macro state: Could Assert, Assert Track
Join Olist:
eth-0-9
Switch2
Switch# show ip pim sparse-mode mroute detail
IP Multicast Routing Table
(*,*,RP) Entries: 0
(*,G) Entries: 1
(S,G) Entries: 0
(S,G,rpt) Entries: 0
FCR Entries: 0
(*, 224.1.1.1) Uptime: 00:00:43
RP: 11.1.1.1, RPF nbr: 12.1.1.1, RPF idx: eth-0-9
Upstream:
State: JOINED, SPT Switch: Enabled, JT Expiry: 18 secs
Macro state: Join Desired,
Downstream:
eth-0-1:
State: NO INFO, ET: off, PPT: off
Assert State: NO INFO, AT: off
Winner: 0.0.0.0, Metric: 4294967295, Pref: 4294967295, RPT bit: on
Macro state: Could Assert, Assert Track
Local Olist:
eth-0-1
Configuring General PIM Sparse-mode (dynamic RP)
A static configuration of RP works for a small, stable PIM domain; however, it is not practical for a large and not-suitable internet work. In such a network, if the RP fails, the network administrator might have to change the static configurations on all PIM routers.
Another reason for choosing dynamic configuration is a higher routing traffic leading to a change in the RP.
We use the BSR mechanism to dynamically maintain the RP information. For configuring RP dynamically in the above scenario, Switch1 on eth-0-1 and Switch2 on eth-0-9 are configured as Candidate RP using the ip pim rp-candidate command. Switch2 on eth-0-9 is also configured as Candidate BSR. Since no other router has been configured as Candidate BSR, the Switch2 becomes the BSR router, and is responsible for sending group-to-RP mapping information to all other routers in this PIM domain.
step 1 Enter the configure mode
Switch# configure terminal
step 2 Enter the interface configure mode set the attributes and ip address, and enable pim-sm
Configuring on Switch1:
Switch(config)# interface eth-0-1
Switch(config-if)# no shutdown
Switch(config-if)# no switchport
Switch(config-if)# ip address 11.1.1.1/24
Switch(config-if)# ip pim sparse-mode
Switch(config-if)# exit
Switch(config)# interface eth-0-9
Switch(config-if)# no shutdown
Switch(config-if)# no switchport
Switch(config-if)# ip address 12.1.1.1/24
Switch(config-if)# ip pim sparse-mode
Switch(config-if)# exit
Configuring on Switch2:
Switch(config)# interface eth-0-1
Switch(config-if)# no shutdown
Switch(config-if)# no switchport
Switch(config-if)# ip address 22.1.1.2/24
Switch(config-if)# ip pim sparse-mode
Switch(config-if)# exit
Switch(config)# interface eth-0-9
Switch(config-if)# no shutdown
Switch(config-if)# no switchport
Switch(config-if)# ip address 12.1.1.2/24
Switch(config-if)# ip pim sparse-mode
Switch(config-if)# exit
step 3 Add static routes
Configuring on Switch1:
Switch(config)# ip route 22.1.1.0/24 12.1.1.2
Configuring on Switch2:
Switch(config)# ip route 11.1.1.0/24 12.1.1.1
step 4 Configure the rp candidate
Configuring on Switch1:
Switch(config)# ip pim rp-candidate eth-0-1
Configuring on Switch2:
Switch(config)# ip pim rp-candidate eth-0-9
Switch(config)# ip pim bsr-candidate eth-0-9
The highest priority router is chosen as the RP. If two or more routers have the same priority, a hash function in the BSR mechanism is used to choose the RP, to make sure that all routers in the PIM-domain have the same RP for the same group. Use the ip pim rp-candidate IFNAME PRIORITY command to change the default priority of any candidate RP.
step 5 Exit the configure mode
Switch(config)# end
step 6 Validation
Use the show ip pim sparse-mode rp mapping command to display the group-to-RP mapping details. The output displays information about RP candidates. There are two RP candidates for the group range 224.0.0.0/4. RP Candidate 11.1.1.1 has a default priority of 192, whereas, RP Candidate 12.1.1.2 has been configured to have a priority of 2. Since RP candidate 12.1.1.2 has a higher priority, it is selected as RP for the multicast group 224.0.0.0/24. Only permit filters would be cared in group list.
Switch2:
Switch# show ip pim sparse-mode rp mapping
PIM group-to-RP mappings
This system is the bootstrap router (v2)
Group(s): 224.0.0.0/4
RP: 12.1.1.2
Info source: 12.1.1.2, via bootstrap, priority 2
Uptime: 01:55:20, expires: 00:02:17
RP: 11.1.1.1
Info source: 11.1.1.1, via bootstrap, priority 192
Uptime: 01:55:23, expires: 00:02:13
To display information about the RP router for a particular group, use the following command. This output displays that 12.1.1.2 has been chosen as the RP for the multicast group 224.1.1.1.
Switch2:
Switch# show ip pim sparse-mode rp-hash 224.1.1.1
RP: 12.1.1.2
Info source: 12.1.1.2, via bootstrap
After RP information reaches all PIM routers in the domain, various state machines maintain all routing states as the result of Join/Prune from group membership. To display information on interface details and the multicast routing table, refer to the Configuring RP Statically section above.
Configuring Boostrap Router
Every PIM multicast group needs to be associated with the IP address of a Rendezvous Point (RP). This address is used as the root of a group-specific distribution tree whose branches extend to all nodes in the domain that want to receive traffic sent to the group. For all senders to reach all receivers, all routers in the domain use the same mappings of group addresses to RP addresses. In order to determine the RP for a multicast group, a PIM router maintains a collection of group-to-RP mappings, called the RP-Set.
The Bootstrap Router (BSR) mechanism for the class of multicast routing protocols in the PIM domain use the concept of a Rendezvous Point as a means for receivers to discover the sources that send to a particular multicast group. The BSR mechanism is one way that a multicast router can learn the set of group-to-RP mappings required in order to function.
Some of the PIM routers within a PIM domain are configured as Candidate-RPs (C-RPs). A subset of the C-RPs will eventually be used as the actual RPs for the domain. An RP configured with a lower value in the priority field has higher a priority.
Some of the PIM routers in the domain are configured to be Candidate-BSRs (C-BSRs). One of these C-BSRs is elected to be the bootstrap router (BSR) for the domain, and all PIM routers in the domain learn the result of this election through BSM (Bootstrap messages). The C-BSR with highest value in priority field is Elected-BSR.
The C-RPs then reports their candidacy to the elected BSR, which chooses a subset of the C-RPs and distributes corresponding group-to-RP mappings to all the routers in the domain through Bootstrap messages.
step 1 Enter the configure mode
Switch# configure terminal
step 2 Configure the bsr candidate and rp candidate
Switch1
Switch(config)# ip pim bsr-candidate eth-0-1
Switch2
Switch(config)# ip pim bsr-candidate eth-0-1 10 25
Switch(config)# ip pim rp-candidate eth-0-1 priority 0
step 3 Configure the priority of rp candidate
Switch(config)# ip pim rp-candidate eth-0-1 priority 0
step 4 Configure the priority of dr and enable receive and send unicast bsm packets
Switch(config)# interface eth-0-1
Switch(config-if)# ip pim dr-priority 10
Switch(config-if)# ip pim unicast-bsm
step 5 Exit the configure mode
Switch(config-if)# end
step 6 Validation
Verify the C-BSR state on rtr1
Switch# show ip pim sparse-mode bsr-router
PIMv2 Bootstrap information
This system is the Bootstrap Router (BSR)
BSR address: 20.0.1.21
Uptime: 00:37:12, BSR Priority: 64, Hash mask length: 10
Next bootstrap message in 00:00:04
Role: Candidate BSR
State: Elected BSR
Verify the C-BSR state on rtr2:
Switch# show ip pim sparse-mode bsr-router
PIMv2 Bootstrap information
BSR address: 20.0.1.21
Uptime: 00:02:39, BSR Priority: 64, Hash mask length: 10
Expires: 00:00:03
Role: Candidate BSR
State: Pending BSR
Switch# show ip pim sparse-mode bsr-router
PIMv2 Bootstrap information
BSR address: 20.0.1.21
Uptime: 00:40:20, BSR Priority: 64, Hash mask length: 10
Expires: 00:02:07
Role: Candidate BSR
State: Candidate BSR
Verify RP-set information on E-BSR:
Switch# sh ip pim sparse-mode rp mapping
PIM Group-to-RP Mappings
This system is the Bootstrap Router (v2)
Group(s): 224.0.0.0/4
RP: 20.0.1.11
Info source: 20.0.1.11, via bootstrap, priority 0
Uptime: 00:00:30, expires: 00:02:04
Verify RP-set information on C-BSR:
Switch# show ip pim sparse-mode rp mapping
PIM Group-to-RP Mappings
Group(s): 224.0.0.0/4
RP: 20.0.1.11
Info source: 20.0.1.21, via bootstrap, priority 0
Uptime: 00:00:12, expires: 00:02:18
Configuring PIM-SSM feature
The Source Specific Multicast feature is an extension of IP multicast where datagram traffic is forwarded to receivers from only those multicast sources to which the receivers have explicitly joined. For multicast groups configured for SSM, only source-specific multicast distribution trees (no shared trees) are created.
PIM-SSM is the routing protocol that supports the mplementation of SSM and is derived from PIM sparse mode (PIM-SM).
PIM-SSM can work with PIM-SM on the multicast router. By default, PIM-SSM is disabled.
step 1 Enter the configure mode
Switch# configure terminal
step 2 Enable ssm
Enable by default range
Switch(config)# ip pim ssm default
Enable pim-ssm on the switch and set the ssm group range as group range specified in an access list:
Switch(config)# ip pim ssm range ipacl
The 2 commands above are alternative. The final configuration should over write the previous one and take effect.
step 3 Exit the configure mode
Switch(config)# end
step 4 Validation
Switch# show running-config | include pim
ip pim ssm range ipacl
Application cases
N/A