PIM-SM Protocol Principle
PIM-SM Protocol Principle
PIM-SM Protocol Principle
PIM-SM is based on the assumption that the multicast members locate sparsely.
That is, near no network segment has multicast group members. Multicast route is
established only when a host in a network segment joins the multicast group. At this time,
the upstream node begins to forward multicast packets to this network segment.
The goal of the PIM-SM model is to establish and maintain a unidirectional shared tree.
A router in the PIM network is selected as the public root node of the shared tree.
The public root node is called the rendezvous point (RP). The RP forwards multicast packets
to receivers along the shared tree.
At the receiver's side, the router connected to the receiver sends the Join message to the
RP of the multicast group. The Join message is forwarded hop by hop and reaches the root
(RP). The path that the Join message passes by becomes a branch of the shared tree,
namely, the rendezvous point tree (RPT).
When the sender needs to send multicast data to a multicast group, the first-hop router
sends Register message to the RP. The Register message reaches the RP and triggers
establishment of the RPT. The multicast source then sends the multicast packet to the RP.
The multicast packet is duplicated on the RP and forwarded to the receivers along the RPT.
PIM-SM uses two types of trees: the shared tree and source path tree.
The path from the RP to the multicast receiver is the shared tree.
The path from the multicast source to the RP is the source path tree.
RPF check is performed according to the type of the tree.
On the shared tree, the RP address is used as the source address for RPF check.
On the source path tree, the address of the multicast source is used as thesource address
for RPF check.
The RPF check process will be described in Chapter 2 PIM-SM Protocol Mechanism.
Using the display pim neighbor command, you can view the information about PIM-SM
neighbors of the router. After the configuration, RTC has two PIMneighbors: RTA and RTB.
Using the display pim interface command, you can view the information about a PIM
interface. The display information includes whether PIM is enabled, PIM version, PIM mode,
PIM query interval and IP address of the DR.
Using the display pim routing-table command on RTB, you can see two entries:
an (S, G) entry and a (*, G) entry. It indicates that RTB has received the multicast packet
and can forward the packet.
As you know, the (S, G) entry is recorded in the routing table. S indicates the multicast
source and G indicates the multicast group. The routers on the source path tree (SPT) from
the multicast source to RP create such entries.
(*, G) is the entry for only PIM-SM. This entry is the entry of (any multicast source, multicast
group). The routers on the RPT create such entry.
In a PIM-SM network, a router needs to send Hello messages to discover its neighbors
upon startup. Routers periodically send Hello messages to maintain the neighbor relation.
Another function of the Hello message is electing the DR in a network segment containing
multiple routers. The DR acts as the IGMPv1 querier.
PIM-SM also elects the DR in a shared network (such as Ethernet). The DR is the only
multicast packet forwarder in the network segment.
In PIM-SM, all shared networks must have a DR, no matter whether the network is
connected to the multicast source or the receiver.
The DR at the receiver end sends the Join message to the RP.
The DR at the multicast source side sends the Register message to the RP.
Routers on the shared network send Hello messages (containing the DR priority option) to
each other. The router with the highest DR priority is elected as the DR in the network
segment.
If some routers have the same priority or at least one router in the network cannot adds
the priority option in the Hello message, the router with the largest IP address is elected as
the DR.
When the DR is Down, it cannot respond to the Hello message sent by other router within
the timeout duration. The neighbor routers then trigger the election of a new DR.
Using the pim timer hello interval command, you can set the interval of Hello messages in
the interface view. By default, the Hello interval is 30 seconds.
Using the pim hello-option holdtime interval command, you can change the value of the
Hello timeout duration. By default, the Hello timeout duration is 105 seconds.
In a PIM-SM network, the node acts as the root of the shared tree is called the rendezvous
point (RP).
The RP has the following functions:
1. Forwards all multicast flows through the shared tree to receivers.
2. Forwards multicast packets of some or all multicast groups. A network can have one or
more RPs.
The RP can be discovered in any of the following ways:
1. Manually specify the IP address of the RP on the DR, all leaf routers, and all routers that
forward multicast flows.
Use the static-rp rp-address command to specify the IP address of the RP.
2. Enable the BootStrap protocol to elect the RP through the bootstrap mechanism.
The RP is the core router in the PIM-SM domain. Is a simple small-sized network, one RP is
enough for packet forwarding, because the amount of multicast data is small. In this case,
you can manually specify the RP on all routers in the SM domain. But in most cases, the
PIM-SM network is very large and large amount of multicast packets forwarded by the RP.
In such a network, each multicast group needs an RP, thus the load on each RP is reduced
and the topology of the shared tree is optimized. In such network, RPs are elected through
the bootstrap mechanism. In this case, you need to configure the bootstrap router (BSR).
The BSR is the management core in the PIM-SM network. The BSR collects the
Advertisement messages sent by C-RPs, and then selects the C-RP information for each
multicast group to form an RP set (a database of mapping between multicast groups and
RPs). The BSR advertises the RP set to the entire network so that all routers (including the
DR) obtain the location of RPs.
A PIM-SM domain can also have multiple C-RPs. The RP for each multicast group is elected
through the BSR mechanism. In a network (or management domain ), only one router is
elected as the BSR, but multiple candidate BSRs (C-BSRs) can be configured. Once the BSR
is Down, a new BSR is elected through the bootstrap mechanism. Thus, the service is not
interrupted by fault of the BSR.
When a receiver host joins multicast group G, the host sends an IGMP packet to notify the
leaf router connected to it. The leaf router obtains the information about this receiver, and
then sends a Join message to the upstream node toward the RP.
Each router on the path from the leaf router to the RP generates a (*, G) entry in the
forwarding table. These routers form a branch of the rendezvous point tree (RPT). (*, G)
indicates that packets from any multicast source are sent to G. RP is the root of the RPT
and the receivers are leaves of the RPT.
After the packet sent from multicast source S to multicast group G reaches RP, the packet
will reach the leaf router and then the receiver host. If the receiver host does not want to
receive the information from this source, the nearest multicast router sends the Prune
message to the RP in the converse direction . When the first upstream router receives the
Prune message, the router deletes the interface, which connects to the downstream router,
from the interface list of multicast router.
The router check that other existing interface need to forward packets or not. If no need
such receivers exist, the router sends the Prune message to its upstream router.This
process is the same as the pruning process of PIM-DM.
When multicast source S sends a multicast packet to multicast group G, the router directly
connected to multicast source S encapsulates the multicast packet into the Register packet.
Then the router sends the packet to the corresponding RP in unicast mode to notify the RP
of the multicast source.
When receiving the Register message from multicast source S, the RP decapsulates the
message, and then forwards the message to the receiver along the RPT. In addition, the RP
sends the Join message in the converse direction to multicast source S. The Join message
contains the (S, G) entry, and thus all routers on the path between the RP and the
multicast source generates an (S, G) entry. These routers that the Join message passes form
a branch of the SPT. The multicast source is the root of the SPT, and the RP is the
destination of the SPT.
A multicast packet sent by multicast source S reaches the RP along the established SPT.
The RP then forwards the packet along the RPT to receivers. After the RP receives the
multicast flow forwarded along the SPT, the RP sends the Register-stop message to the
router directly connected to the multicast source. The multicast source registration process
is complete.
After the multicast source registers to the RP successfully, multicast packets is sent to the
RP along the SPT and then forwarded by the RP to the receivers along the RPT.
For a specified source, PIM-SM sets the bandwidth threshold for the SPT. Thus the last-hop
router (the DR closest to the receiver) can switch from the RPT to the SPT. When the last-
hop router detects that multicast packets sent from the RP to multicast group G exceeds
the threshold, the router sends a Join message with the (S, G) entry to the next-hop router
toward multicast group G according to the unicast routing table. The Join message reaches
the first-hop router (the DR closest to the multicast source) after passing the routers on the
path. All these routers create an (S, G) entry, and thus an SPT branch is established.
When the throughput of packets exceeds the preset value, PIM-SM switches the router
from the RPT to the SPT. On the VRP, by default, the router directly connected to the
receiver joins the SPT immediately after it detects the multicast source; that is, the router
receives the first data packet from the source.
The RPT switches to the SPT, multicast packets are sent from the multicast source directly
to the receiver. Through switchover between the RPT and the SPT, PIM-SM can establish
the SPT in a more economical way than PIM-DM does.
The last-hop router sends the Prune message to the RP. The Prune message contains the
RP information and reaches the RP hop by hop. After receiving the Prune message, the RP
forwards the Prune message in the converse direction. Thus, the multicast flow is switched
from the RPT to the SPT.
After switchover, an SPT is established between the multicast source and the receiver.
Neighbor discovery
In a PIM-SM network, multicast routers send Hello messages to discover neighbors, maintain the neighbor
relation, and negotiate protocol parameters.
Routers in the same network segment compare the priorities and IP addresses in Hello messages to elect the
DR. The DR acts as the IGMPv1 querier.
Assert
Routers in a shared network (such as an Ethernet) elects the designated forwarder.
DR election
Routers elects the designated router (DR) for the shared network between the multicast source and receivers.
RP discovery
The RP is specified manually or elected through the BSR messages.
Join
When a receiver host joins a multicast group G. The host send an IGMP packet to notify the leaf router directly
connected to it. The leaf router then sends the Join message to the upstream node toward the RP.
Prune
The pruning process is initiated by the leaf router. When all downstream members leave the multicast group,
the leaf router sends a Prune message to the upstream node to request the upstream node stop forwarding
packets to this branch.
Register
The Register messages notify the RP of the existence of the multicast source.
RTP-SPT switchover
PIM-SM sets a bandwidth threshold for the SPT. When the traffic exceeds this threshold, the last-hop router
(the DR at the receiver side) switches from the RPT to the SPT.