PIM-SM (ASM Model)
Implementation
In Any-Source Multicast (ASM) implementation, PIM-Sparse Mode (PIM-SM) forwards multicast packets in pull mode and is for use on large-scale networks with sparsely distributed group members. Devices on the PIM-SM network work as follows:
A Rendezvous Point (RP), an important PIM router, is available to provide services for group members or multicast sources that appear anytime. All PIM routers on the network know the position of the RP.
When a new group member appears on the network (that is, a user host joins a multicast group G through IGMP), the last-hop router sends a Join message to the RP. A (*, G) entry is created hop by hop, and an RPT with the RP as the root is generated.
When an active multicast source appears on the network (that is, the multicast source sends the first multicast packet to a multicast group G), the first-hop router encapsulates the multicast data in a Register message and sends the Register message to the RP in unicast mode. The RP then creates an (S, G) entry and registers multicast source information.
PIM-SM uses the following mechanisms in the ASM model: neighbor discovery, DR election, RP discovery, RPT setup, multicast source registration, SPT switchover, and assertion. You can also configure a Bootstrap router (BSR) to implement fine-grained management in a single PIM-SM domain. For details about all of these mechanisms, see the sections below.
Neighbor Discovery
Neighbor discovery in PIM-SM is similar to that in PIM-DM. For details, see "PIM-DM Neighbor Discovery".
DR Election
The network segment where a multicast source or group member resides is usually connected to multiple PIM routers. These PIM routers exchange Hello messages to set up PIM neighbor relationships. The Hello messages carry the DR priority and the interface address of the network segment. Each PIM router compares its own information with the information carried in the messages sent by its neighbors. A DR is then elected for multicast data forwarding on the source side or the receiver side. The election rules are as follows:
If all PIM routers on the network segment allow Hello messages to carry DR priorities, the PIM router with the highest DR priority is elected as the DR.
If PIM routers have the same DR priority or at least one PIM router does not allow Hello messages to carry the DR priority, the PIM router with the largest IP address is elected as the DR.
If an existing DR becomes faulty, PIM neighbor relationships time out, and a new DR election is triggered among PIM neighbors.
As shown in Figure 4-7, there are two types of DRs in the ASM model:
Source DR: DR connected to the multicast source. On the shared network segment connected to the multicast source, the source DR is responsible for sending Register messages to the RP.
Receiver DR: DR connected to group members. On the shared network segment connected to group members, the receiver DR is responsible for sending Join messages to the RP.
RP Discovery
An RP is responsible for processing Register messages from the multicast source and Join messages from group members. All PIM routers on the network know the position of the RP.
An RP can serve multiple multicast groups simultaneously, but each multicast group can be associated with only one RP. RPs can be configured either static or dynamic:
Static RP: All the PIM routers on the network are manually configured with the same RP address.
Dynamic RP: Several PIM routers in the PIM domain are configured as Candidate-RPs (C-RPs) and an RP is elected from the candidates. One or more PIM routers are configured as Candidate-BSRs (C-BSRs). The C-BSRs automatically elect a BSR, and this BSR is responsible for collecting and advertising C-RP information.
During a BSR election, each C-BSR considers itself the BSR and sends the entire network a BootStrap message that carries its address and priority. Each PIM router compares the Bootstrap messages it receives from the C-BSRs. The BSR is elected based on the result of the comparison:
If the C-BSRs have different priorities, the C-BSR with the highest priority (largest priority value) is elected as the BSR.
If the C-BSRs have the same priority, the C-BSR with the largest IP address is elected as the BSR.
Figure 4-8 shows the C-RP election process:
C-RPs send Advertisement messages to the BSR. An Advertisement message carries the address of the C-RP, the range of the multicast groups that it serves, and its priority.
The BSR collects the information in an RP-Set, encapsulates the RP-Set in a Bootstrap message, and advertises the message to each PIM-SM router on the network.
- The routers elect an RP from multiple C-RPs that serve a specific multicast group based on the RP-set and the following election rules:
The C-RP with the longest mask length of the served group address range matching the multicast group that users have joined wins.
If the mask length is the same, the C-RP with the highest priority (smallest priority value) wins.
If the priority is the same, C-RPs use a hash algorithm to calculate their hash values, and the C-RP with the largest hash value wins.
If all the preceding values are the same, the C-RP with the largest IP address wins.
PIM routers save the relationship between this multicast group and its RP for subsequent multicast operations. This relationship is the same on all PIM routers because they use the same RP-Set and the same election rules.
RPT Setup
A PIM-SM RPT is a multicast distribution tree (MDT) that uses an RP as the root and group member routers as leaves. As shown in Figure 4-9, when a group member appears on the network (that is, a user host joins a multicast group G through IGMP), the receiver DR sends a Join message to the RP. A (*, G) entry is created hop by hop, and an RPT with the RP as the root is generated.
During RPT setup, PIM routers perform RPF check before sending a Join message. Each router searches for a unicast route toward the RP, in which the outbound interface is the upstream interface and the next hop is the RPF neighbor. Join messages are forwarded from the receiver DR to the RP hop by hop along the unicast route.
Multicast Source Registration
As shown in Figure 4-10, a new multicast source on the PIM-SM network must register with the RP so that the RP can forward multicast data to group members. The registration and forwarding process is as follows:
- The multicast source sends a multicast packet to the source DR.
- After receiving the multicast packet, the source DR encapsulates the multicast packet into a Register message and sends the Register message to the RP.
- After receiving the Register message, the RP decapsulates it, creates an (S, G) entry, and sends multicast data to group members along the RPT.
SPT Switchover
A multicast group on a PIM-SM network can be associated with only one RP and sets up only one RPT. Under normal circumstances, all multicast packets destined for a multicast group are encapsulated in Register messages and sent to the RP. The RP then decapsulates the packets and forwards them along the RPT to multicast group members. All multicast packets pass through the RP. If the number of multicast packets increases dramatically, the RP becomes heavily burdened. To resolve this problem, PIM-SM allows the RP or the receiver DR to trigger an SPT switchover.
SPT switchover triggered by the RP
After receiving a Register message from the source DR, the RP decapsulates the Register message and forwards multicast packets along the RPT to group members. The RP also sends a Join message to the source DR to set up an SPT from the RP to the source.
After the SPT is set up, the source DR forwards multicast packets directly to the RP. After the switchover, the source DR and RP do not need to encapsulate or decapsulate packets.
SPT switchover triggered by the receiver DR
As shown in Figure 4-11, the receiver DR periodically checks the forwarding rate of multicast packets. When the receiver DR finds that the forwarding rate is higher than a configured threshold, it triggers an SPT switchover.
- The receiver DR sends a Join message to the source DR hop by hop, creates an (S, G) entry hop by hop, and then sets up an SPT from the source DR to the receiver DR.
- After the SPT is set up, the receiver DR sends Prune messages along the RPT to the RP and deletes the downstream interface connected to it from the (*, G) entry. After the prune action is complete, the RP does not forward multicast packets along the RPT.
- Because the SPT does not pass through the RP, the RP continues to send Prune messages along the RPT to the source DR and deletes the downstream interface connected to it from the (S, G) entry. After the prune action is complete, the source DR does not forward multicast packets along the SPT to the RP.
By default, no threshold for the multicast packet forwarding rate is configured on the device. Therefore, an SPT switchover is triggered when the RP or receiver DR receives the first multicast packet from the multicast source.
Assert
The Assert mechanism in PIM-SM is similar to that in PIM-DM. For details, see "PIM-DM Assert".
BSR Administrative Domain
To provide fine-grained network management, a PIM-SM network has both a global domain and multiple BSR administrative domains. This reduces the workload on individual BSRs and allows provisioning of special services to users in a specific domain by using private group addresses.
Each BSR administrative domain maintains only one BSR that serves multicast groups within a specific group address range. The global domain maintains a BSR that serves multicast groups not served by an administrative domain.
This section describes the relationship between BSR administrative domains and the global domain in terms of domain space, group address ranges, and multicast functions.
Domain space
Figure 4-12 Relationship between BSR administrative domains and the global domain from in terms of domain spaceAs shown in Figure 4-12, BSR administrative domains for the same group address contain different PIM routers. A PIM router belongs to only one BSR administrative domain. BSR administrative domains are independent of and isolated from each other. Each BSR administrative domain manages the multicast groups within a specific group address range. Multicast packets within this range can be transmitted only within this administrative domain and cannot cross its border.
The global domain contains all PIM routers on the PIM-SM network. A multicast packet that does not belong to any BSR administrative domain can be transmitted throughout the entire PIM network.
Group address range
Figure 4-13 Relationship between BSR administrative domains and the global domain in terms of group address rangesEach BSR administrative domain provides services for multicast groups within a specific group address range. The group address ranges served by different BSR administrative domains can overlap. As shown in Figure 4-13, the group address range of BSR1 overlap that of the BSR3. The address of a multicast group that a BSR administrative domain serves is used as a private group address and is valid only in its BSR administrative domain.
The global domain serves all multicast groups that do not belong to a BSR administrative domain. As shown in Figure 4-13, the group address range of the global domain is G-G1-G2.
Multicast function
As shown in Figure 4-12, the global domain and each BSR administrative domain have their respective C-RP and BSR devices. These devices function only in the domain where they reside. Each domain holds independent BSR and RP elections.
Each BSR administrative domain has a border. Multicast messages from this domain, such as C-RP Advertisement messages or BSR BootStrap messages, can be transmitted only within the domain where they originate. Multicast messages from the global domain can be transmitted throughout the entire global domain and traverse any BSR administrative domain.