PIM-SM implements P2MP data transmission on large-scale networks on which multicast data receivers are sparsely distributed. PIM-SM forwards multicast data only to network segments with receivers that have required the data.
PIM-SM assumes that no host wants to receive multicast data. Therefore, PIM-SM sets up an MDT only after a host requests multicast data, and then sends the data to the host along the MDT.
Basic PIM-SM concepts are described based on the networking shown in Figure 1.
A router that runs PIM is called a PIM device. A router interface on which PIM is enabled is called a PIM interface.
A network constructed by PIM devices is called a PIM network.
A PIM-SM network can be divided into multiple PIM-SM domains by configuring BSR boundaries on router interfaces to restrict BSR message transmission. PIM-SM domains isolate multicast traffic between domains and facilitate network management.
In PIM-SM, a multicast source's DR is a PIM device directly connected to a multicast source and is responsible for sending Register messages to a Rendezvous Point (RP).
A receiver's DR is a PIM device directly connected to receivers and is responsible for sending Join messages to an RP and forwarding multicast data to the receivers.
An RP is the forwarding core in a PIM-SM domain, used to process join requests of the receiver's DR and registration requests of the multicast source's DR. An RP constructs an MDT with itself at the root and creates (S, G) entries to transmit multicast data to hosts. All routers in the PIM-SM domain must know the RP's location. The following table lists the types of RPs.
A static RP is manually configured. If a static RP is used, the same RP address must be configured on all PIM devices in the same domain.
Static RPs are recommended on small-/medium-sized networks because such networks are stable and have low requirements on network devices.
If only one multicast source exists on the network, setting the device directly connected to the multicast source as a static RP is recommended. In this case, the RP is also the source's DR, avoiding the process that the source's DR registers with the RP.
To use a static RP, ensure that all routers, including the RP, have the same RP and multicast group address range information.
A dynamic RP is elected among candidate-RPs (C-RPs) in the same PIM domain. The BSR sends Bootstrap messages to collect all C-RP information as an RP-Set, and advertises the RP-Set information to all PIM devices in the domain. Then, all the PIM devices use the same RP-Set information and follow the same rules to elect an RP. If the elected RP fails, the other C-RPs start an election process again to elect a new RP.
Dynamic RPs can be used on large-scale networks to improve network reliability and maintainability.
To use a dynamic RP, you must configure a BSR that dynamically advertises group-to-RP mapping information.
Embedded-RP is a mode used by a router in the ASM model to obtain RP addresses and is used either in an IPv6 PIM-SM domain or between IPv6 PIM-SM domains. An RP address is embedded in an IPv6 group address. Therefore, when obtaining an IPv6 group address, a router also obtains the RP address to which the IPv6 group address corresponds.
MSDP does not support IPv6 networks. As a result, it cannot allow IPv6 PIM-SM domains to learn RP information from each other, which leads to a multicast traffic interruption. Embedded-RP resolves this problem.
A BSR on a PIM-SM network collects RP information, summarizes that information into an RP-Set (group-RP mapping database), and advertises the RP-Set to the entire PIM-SM network.
A network can have only one BSR but can have multiple C-BSRs. If a BSR fails, a new BSR is elected from the C-BSRs.
An RPT is an MDT with an RP at the root and group members at the leaves.
An SPT is an MDT with the multicast source at the root and group members at the leaves.
By default, a PIM device permits other PIM control messages or multicast packets from a neighbor, regardless of whether the PIM device has received Hello messages from the neighbor. However, if a PIM device has the neighbor check function, it permits other PIM control messages or multicast packets from a neighbor only after the PIM device has received Hello messages from the neighbor.
PIM devices exchange Hello messages to elect a DR on a shared network segment. The receiver's DR is the only multicast data forwarder on a shared network segment. The source's DR is responsible for forwarding multicast data received from the multicast source to the RP.
An RP is the forwarding core in a PIM-SM domain. A dynamic or static RP forwards multicast data over the entire network.
PIM-SM assumes that no hosts want to receive multicast data. Therefore, PIM-SM sets up an RPT only after a host requests multicast data, and then sends the data from the RP to the host along the RPT.
A multicast group in a PIM-SM domain is associated with only one RP and one RPT. All multicast data packets are forwarded by the RP. The path along which the RP forwards multicast data may not be the shortest path from the multicast source to receivers. The load of the RP increases when the multicast traffic volume increases. If the multicast data forwarding rate exceeds a configured threshold, an RPT-to-SPT switchover can be implemented to reduce the burden on the RP.
If multiple multicast data forwarders exist on a network segment, each multicast packet is repeatedly sent across the network segment, generating redundant multicast data. To resolve this issue, the Assert mechanism can be used to select a unique multicast data forwarder on a network segment.
If the role of an interface on a PIM device is changed from DR to non-DR, the PIM device immediately stops using this interface to forward data. If the new DR has not received multicast data, multicast data traffic is temporarily interrupted. If a DR switchover delay is configured, the interface continues to forward multicast data until the delay expires. Setting a DR switchover delay prevents multicast data traffic from being interrupted.
The detailed PIM-SM implementation process is as follows:
The destination address is 220.127.116.11, indicating that this packet is destined for all PIM devices on the same network segment as the interface that sends this packet.
The source address is an interface address.
The TTL value is 1, indicating that the packet is sent only to neighbor interfaces.
Hello messages are used to discover neighbors, adjust protocol parameters, and maintain neighbor relationships.
Discovering PIM neighbors
All PIM devices on the same network segment must receive multicast packets with the destination address 18.104.22.168. Directly connected multicast routers can then learn neighbor information from the received Hello messages.
Adjusting protocol parameters
A Hello message carries the following protocol parameters:
DR_Priority: priority used by each router to elect a DR. The higher a router's priority is, the higher the probability that the router will be elected as the DR.
Holdtime: timeout period during which the neighbor remains in the reachable state.
LAN_Delay: delay for transmitting a Prune message on the shared network segment.
Override-Interval: interval carried in a Hello message for overriding a Prune message.
Maintaining neighbor relationships
PIM devices periodically exchange Hello messages. If a PIM device does not receive a new Hello message from its PIM neighbor within the Holdtime, the router considers the neighbor unreachable and deletes the neighbor from its neighbor list.
PIM neighbor relationship changes cause the multicast topology to change. If an upstream or a downstream neighbor is unreachable, multicast routes re-converge, and the MDT is updated.
The network segment on which a multicast source or group members reside is usually connected to multiple PIM devices, as shown in Figure 2. The PIM devices exchange Hello message to set up PIM neighbor relationships. A Hello message carries the DR priority and the address of the interface that connects the PIM device to this network segment. The router compares the local information with the information carried in the Hello messages sent by other PIM devices to elect a DR. This process is a DR election. The election rules are as follows:
The PIM router with the highest DR priority wins.
If PIM devices have the same DR priority or PIM devices that do not support Hello messages carrying DR priorities exist on the network segment, the PIM device with the highest IP address wins.
A static RP is specified using a command. A static RP's address needs to be manually configured on other routers so they can find and use this RP for data forwarding.
A dynamic RP is elected from a set of PIM devices.
In Figure 3, the dynamic RP election rules are as follows:
To use a dynamic RP, configure C-BSRs to elect a BSR among the set of C-BSRs.
Each C-BSR considers itself a BSR and advertises a Bootstrap message. The Bootstrap message carries the address and priority of the C-BSR. Each router compares the information contained in all received Bootstrap messages to determine which C-BSR becomes the BSR. The election rules are as follows:
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 highest IP address is elected as the BSR.
All routers use the same election rule and therefore they will elect the same BSR and learn the BSR address.
The C-RPs send C-RP Advertisement messages to the BSR. Each of the message carries the address of the C-RP that sent it, the range of multicast groups that the C-RP serves, and the priority of the C-RP.
The BSR collects the received information as an RP-Set, encapsulates the RP-Set information in a Bootstrap message, and advertises the Bootstrap message to all PIM-SM devices.
The C-RP with the longest mask length of the served group address range matching the specific multicast group wins.
If group addresses that all C-RPs serve have the same mask length, the C-RP with the highest priority wins (a larger priority value indicates a lower priority).
In case of the same priority, hash functions are operated. The C-RP with the greatest calculated value wins.
If all the preceding factors are the same, the C-RP with the highest IPv6 address wins.
Because all routers use the same RP-Set and the same election rules, the mapping between the multicast group and the RP is the same for all the routers. The routers save the mapping to guide subsequent multicast operations.
If a router needs to interwork with an auto-RP-capable device, auto-RP listening must be enabled. After auto-RP listening is enabled, the router can receive auto-RP announcement and discovery messages, parse the messages to obtain source addresses, and perform RPF checks based on the source addresses.
Auto-RP listening is supported only in IPv4 scenarios.
Embedded-RP is a mode used by the router in the ASM model to obtain an RP address and applies only to IPv6 PIM-SM. To ensure consistent RP election results, an RP obtained in embedded-RP mode takes precedence over RPs elected using other mechanisms. The address of an RP obtained in embedded-RP mode must be embedded in an IPv6 multicast group address, which must meet both of the following conditions:
After a router calculates the RP address from the IPv6 multicast group address, the router uses the RP address to discover a route for forwarding multicast packets. The process for calculating the RP address is as follows:
Figure 4 shows the mapping between the IPv6 multicast group address and RP address.
In a traditional PIM-SM domain, each multicast group is mapped to only one RP. When the network is overloaded or traffic is heavy, many network problems can occur. For example, if the RP is overloaded, routes will converge slowly, or the multicast forwarding path will not be optimal.
Through MSDP: Multiple RPs with the same address are configured in a PIM-SM domain and MSDP peer relationships are set up between the RPs to share multicast data sources.
This mode is only for use on IPv4 networks. For details about the implementation principles, see Anycast-RP in MSDP.
Through PIM: Multiple RPs with the same address are configured in a PIM-SM domain and the device where an RP resides is configured with a unique local address to identify the RP. These local addresses are used to set up connectionless peer relationships between the devices. The peers share multicast source information by exchanging Register messages.
This mode is for use on both IPv4 and IPv6 networks.
These two modes cannot be both configured on the same device in a PIM-SM domain. If Anycast-RP is implemented through PIM, you can also configure the device to advertise the source information obtained from MSDP peers in another domain to peers in the local domain.
Receivers and the multicast source each select the RPs closest to their own location to create RPTs. After receiving multicast data, the receiver's DR determines whether to trigger an SPT switchover. This ensures the optimal RPT and load sharing. The following section covers the principles of Anycast-RP in PIM.
Configure RP1 and RP2 and assign both the same IP address (address of a loopback interface). Assume that the IP address is 10.10.10.10.
Set up a connectionless peer relationship between RP1 and RP2 using unique IP addresses. Assume that the IP address of RP1 is 22.214.171.124 and the IP address of RP2 is 126.96.36.199.
U1 joins the RPT with RP1 as the root, and RP1 creates an (*, G) entry.
U2 joins the RPT with RP2 as the root, and RP2 creates an (*, G) entry.
After receiving the (S1, G) Register message from DR1, RP1 replaces the source and destination addresses with 188.8.131.52 and 184.108.40.206, respectively, and re-encapsulates the message and sends it to RP2. Upon receiving the specially encapsulated Register message from peer 220.127.116.11, RP2 processes this Register message without forwarding it to other peers.
After receiving the (S2, G) Register message from DR2, RP2 replaces the source and destination addresses with 18.104.22.168 and 22.214.171.124, respectively, and re-encapsulates the message and sends it to RP1. Upon receiving the specially encapsulated Register message from peer 126.96.36.199, RP1 processes this Register message without forwarding it to other peers.
After receiving multicast data, the receiver's DR determines whether to trigger an SPT switchover.
Setting up an RPT creates a forwarding path for multicast data. Figure 6 shows the networking.
When a multicast source sends the first multicast packet of a multicast group to its DR, the source's DR encapsulates the multicast packet in a Register message and unicasts the Register message to the RP. The RP creates an (S, G) entry to register the multicast source information.
When a receiver joins a multicast group through IGMP, the receiver's DR sends a Join message to the RP. An (*, G) entry is then created on each hop, and an RPT is created.
When a receiver joins a multicast group and a multicast source sends a multicast packet for the group, the multicast source's DR encapsulates the multicast packet in a Register message and unicasts the Register message to the RP. The RP then forwards the multicast data along the RPT to group members.
The RPT implements on-demand multicast data forwarding, which reduces bandwidth consumption.
To reduce the RPT forwarding loads and improve multicast data forwarding efficiency, PIM-SM supports SPT switchovers, allowing a multicast network to set up an SPT with the multicast source as the root. Then, the multicast source can send multicast data directly to receivers along the SPT.
In a PIM-SM domain, a multicast group interacts with only one RP, and only one RPT is set up. If SPT switchover is not enabled, all multicast packets must be encapsulated in Register messages and then sent to the RP. After receiving the packets, the RP de-encapsulates them and forwards them along the RPT.
Since all multicast packets forwarded along the RPT are transferred by the RP, the RP may be overloaded when multicast traffic is heavy. To resolve this problem, PIM-SM allows the RP or the receiver's DR to trigger an SPT switchover.
An SPT switchover can be triggered by the RP or by the receiver's DR:
SPT switchover triggered by the RP
Register messages sent from the source's DR are decapsulated by the RP, which then forwards multicast data along the RPT to group members. In addition, the RP sends SPT Join messages to the source's DR to set up an SPT from the RP to the source.
After the SPT is set up and starts carrying multicast data packets, the RP stops processing Register messages. This frees the source's DR and RP from encapsulating and decapsulating packets. Multicast data is sent from the router directly connected to the multicast source to the RP along the SPT and then forwarded to group members along the RPT.
As shown in Figure 7, multicast data is forwarded along the RPT. The receiver's DR (DeviceD) sends (*, G) Join messages to the RP. Multicast data is sent to the receiver's DR (DeviceD) along the path multicast source's DR (DeviceA) -> RP (DeviceB) -> receiver's DR (DeviceD).
The receiver's DR periodically checks the forwarding rate of multicast packets. If the receiver's DR finds that the forwarding rate is greater than the configured threshold, the DR triggers an SPT switchover.
The receiver's DR sends (S, G) Join messages to the source's DR. After receiving multicast data along the SPT, the receiver's DR discards multicast data received along the RPT and sends a Prune message to the RP to delete the receiver from the RPT. The switchover from the RPT to the SPT is complete.
Multicast data is forwarded along the SPT. Specifically, multicast data is transmitted to receivers along the path multicast source's DR (DeviceA) -> receiver's DR (DeviceD).
An SPT is set up from the source to group members, and therefore subsequent packets may bypass the RP. The RPT may not be an SPT. After an SPT switchover is performed, delays in transmitting multicast data on the network are reduced.
If one source sends packets to multiple groups simultaneously and an SPT switchover policy is specified for a specified group range:
Either of the following conditions indicates other multicast forwarders are present on the network segment:
A multicast packet fails the RPF check.
The interface that receives the multicast packet is a downstream interface in the (S, G) entry on the local router.
If other multicast forwarders are present on the network segment, the router starts the Assert mechanism.
The router sends an Assert message through the downstream interface. The downstream interface also receives an Assert message from a different multicast forwarder on the network segment. The destination address of the multicast packet in which the Assert message is encapsulated is 188.8.131.52. The source address of the packet is the downstream interface address. The TTL value of the packet is 1. The Assert message carries the route cost from the PIM device to the source or RP, priority of the used unicast routing protocol, and the group address.
The router that runs a higher priority unicast routing protocol wins.
If the routers have the same unicast routing protocol priority, the router with the smaller route cost to the source wins.
If the routers have the same priority and route cost, the router with the highest IP address for the downstream interface wins.
The router performs the following operations based on the Assert election result:
If the router wins the election, the downstream interface of the router is responsible for forwarding multicast packets on the network segment. The downstream interface is called an Assert winner.
If the router does not win the election, the downstream interface is prohibited from forwarding multicast packets and is deleted from the downstream interface list of the (S, G) entry. The downstream interface is called an Assert loser.
After Assert election is complete, only one upstream router that has a downstream interface exists on the network segment, and the downstream interface transmits only one copy of each multicast packet. The Assert winner then periodically sends Assert message to maintain its status as the Assert winner. If the Assert loser does not receive any Assert message from the Assert winner throughout the timer of the Assert loser, the loser re-adds downstream interfaces for multicast data forwarding.
If an existing DR fails, the PIM neighbor relationship times out, and a new DR election is triggered.
By default, when an interface changes from a DR to a non-DR, the router immediately stops using the interface to forward data. If the new DR has not received multicast data, multicast data traffic is temporarily interrupted.
When a PIM-SM interface that has a PIM DR switchover delay configured receives Hello messages from a new neighbor and changes from a DR to a non-DR, the interface continues to function as a DR and to forward multicast packets until the delay times out.
If the router that has a DR switchover delay configured receives packets from a new DR before the delay expires, the router immediately stops forwarding packets. When a new IGMP Report message is received on the shared network segment, the new DR (instead of the original DR configured with a DR switchover delay) sends a PIM Join message to the upstream device.
If the new DR receives multicast data from the original DR before the DR switchover delay expires, an Assert election is triggered.
A PIM-SM network is divided into a global domain and multiple BSR administrative domains to simplify network management. Dividing the network into domains can reduce the workloads of a single BSR and can use private group addresses to provide special services for users in a specific domain.
Each BSR administrative domain has only one BSR that serves a multicast group for a specific address range. The global domain has a BSR that serves the other multicast groups.
The relationship between the BSR administrative domain and the global domain is described as follows in terms of the domain space, group address range, and multicast function.
As shown in Figure 8, different BSR administrative domains contain different routers. A router cannot belong to multiple BSR administrative domains. Each BSR administrative domain is independent and geographically isolated from other domains. A BSR administrative domain manages a multicast group for a specific address range. Multicast packets within this address range can be transmitted only in this BSR administrative domain and cannot exit the border of the domain.
The global domain contains all the routers on the PIM-SM network. Multicast packets that do not belong to a particular BSR administrative domain can be transmitted over the entire PIM network.
Group address range
Each BSR administrative domain provides services to the multicast group within a specific address range. The multicast groups that different BSR administrative domains serve can overlap. However, a multicast group address that a BSR administrative domain serves is valid only in its BSR administrative domain because a multicast address is a private group address. As shown in Figure 9, the group address range of BSR1 overlaps with that of BSR3.
The multicast group that does not belong to any BSR administrative domain belongs to the global domain. That is, the group address range of the global domain is G-G1-G2.
As shown in Figure 8, the global domain and each BSR administrative domain have their respective C-RP and BSR devices. Devices only function in the domain to which they are assigned. Each BSR administrative domain has a BSR mechanism and RP elections that are independent of other domains.
Each BSR administrative domain has a border. Multicast information for this domain, such as the C-RP Advertisement messages and BSR Bootstrap message, can be transmitted only within the domain. Multicast information for the global domain can be transmitted throughout the entire global domain and can traverse any BSR administrative domain.