24 Multicast+Basics+-+PIM+Principles
24 Multicast+Basics+-+PIM+Principles
24 Multicast+Basics+-+PIM+Principles
PIM Introduction
PIM-DM
PIM-SM
R4 R5 R6
The multicast distribution tree is represented as (S, G)
or (*, G) multicast forwarding entries on each
multicast router.
Protocol Independent Multicast (PIM) is independent of any specific unicast routing protocol, so it
does not maintain unicast routing information. A PIM device directly uses routing information in a
unicast routing table to perform reverse path forwarding (RPF) check for packets. If a packet passes
the check, the device creates a multicast routing entry for the packet and forwards the packet.
PIM-DM, which forwards packets in "push" mode, is generally used on networks with a relatively
small number of densely distributed multicast group members.
PIM-DM assumes that multicast group members are densely distributed and exist on every network
segment. When a multicast source becomes active and sends multicast data, PIM-DM floods the
multicast data to every PIM router on the network, and then prunes the branches that do not need
the data.
PIM-DM periodically floods multicast data and prunes branches to establish and maintain a
unidirectional loop-free shortest path tree (SPT) between the multicast source and group members.
An SPT's root is the multicast source. New multicast group members on a pruned branch must wait
for the next round of flooding and pruning before their branch can be added back to the SPT. This
delays data receiving for the new receivers. To resolve this issue, the grafting mechanism is
provided, allowing the network to restore data forwarding to a pruned branch.
Key PIM-DM working mechanisms include neighbor discovery, flooding, pruning, grafting, assertion,
and state refresh. Flooding, pruning, and grafting are the main mechanisms used to build SPTs.
PIM-SM
PIM-SM, which forwards packets in "pull" mode, is generally used on networks with a relatively large
number of sparsely distributed multicast group members. PIM-SM is implemented as follows:
One router on the network is designated the rendezvous point (RP). The RP provides services for
multicast group members or sources that appear at any time. All PIM routers know the RP address.
When a multicast group member appears, the last-hop router sends a Join packet to the RP. During
the Join packet transmission, (*, G) entries are created hop by hop, and an RPT is then
established, with the RP at the root.
When a multicast source becomes active and sends the first multicast data packet of a multicast
group, the first-hop router encapsulates the data packet in a Register packet and sends the packet to
the RP. After receiving the Register packet, the RP creates an (S, G) entry and implements
registration for the source.
In the any-source multicast (ASM) model, major PIM-SM working mechanisms include neighbor
discovery, DR election, RP discovery, RPT setup, multicast source registration, SPT switchover, and
assert. In addition, a Bootstrap router (BSR) administrative domain can be configured to implement
refined management of single PIM-SM domains.
Contents
PIM Introduction
PIM-DM
PIM-SM
Used for requesting to be added to and removed from multicast distribution trees,
Join/Prune
respectively.
All PIM-enabled interfaces on a PIM router send Hello packets. The destination address of a Hello packet is
224.0.0.13 (indicating all PIM routers on the same network segment), the source address is the interface address,
and the TTL is 1.
Hello packets are used to discover PIM neighbors, negotiate PIM packet parameters, and maintain PIM neighbor
relationships.
A PIM neighbor relationship must be established before PIM routers can receive other types of PIM packets and
multicast routing entries can be created.
GE 0/0/0 GE 0/0/0
10.1.12.1 10.1.12.2
R1 R2
10.1.1.1
PC1 Multicast
data flow
Receiver
PIM Routing Table
C
PC2 After network convergence is complete, the SPT
A Receiver
becomes stable. Multicast traffic is sent from the
multicast source to receivers along the SPT, as
shown in the figure.
A router that does not need the multicast traffic of
B PC3
a group periodically sends a Prune packet to the
D upstream neighbor.
C
PC2 When a multicast group member appears on a
A Receiver
branch that is not on the SPT, the last-hop router
PI M sends a PIM Graft packet to the upstream
Gr PI M
af t Gr
- AC af t neighbor, requesting to be grafted to the SPT.
K
PC3
B
New Receiver
D
PC1
Receiver
PIM-DM: Graft Process
C
PC2 A new SPT is set up. Multicast traffic is sent from
A Receiver the source to receivers among the SPT.
PI M
Gr PI M
af t Gr
- AC af t
K
B PC3
New Receiver
D
PC1
Receiver
Prune Override
R1 PIM Prune R1
GE 0/0/0 PIM Join GE 0/0/0
1
2
GE 0/0/0 GE 0/0/0 GE 0/0/0 GE 0/0/0
R2 R3 R2 R3
Receiver Receiver
1. R2 does not need the (S, G) traffic any more and therefore sends a Prune packet to the upstream interface. Both R1 and R3 will
receive the packet. If R1 directly sets the packet receiving interface GE 0/0/0 to the pruned state, R3 will fail to receive the (S, G)
traffic.
2. If GE 0/0/0 on R1 is connected to multiple PIM neighbors, R1 does not set GE 0/0/0 to the pruned state immediately after receiving
a Prune packet. Instead, R1 starts a prune delay timer (3s by default). If GE 0/0/0 receives a Join packet before the timer expires,
R1 ignores the previously received Prune packet.
3. R3 sends a Join packet to R1 immediately after receiving a Prune packet from R2. This Join packet is used to deny the prune
request sent by R2.
Assert
R2
Multicast
Network
10.1.1.1
R1 R3
GE 0/0/1 GE 0/0/1
Multicast Data
R4
R1 and R3 receive multicast data from their RPF interfaces. If both of them forward the data through their GE 0/0/1 interfaces, R4
receives duplicate multicast data. To resolve this issue, PIM provides the assert mechanism.
If multiple PIM routers send duplicate multicast data packets to a network segment and all the packets have passed RPF check, a
single forwarding router is elected through the assert mechanism, so that only one PIM router can forward the multicast data packet
to the network segment. After receiving duplicate multicast data packets from two or more neighbors, a local PIM router sends a PIM
Assert packet to all PIM routers on the same network segment as the local PIM router, with the packet destination address being
224.0.0.13. After receiving the Assert packet, the other PIM routers compare their own parameters with the parameters carried in the
packet to elect a forwarding router.
Assert
PIM Assert
R2 Multicast
Network
10.1.1.1
R1 10.1.12.1 10.1.12.2 R3
Assert Packet GE 0/0/1 GE 0/0/1 Assert Packet
Source: 10.1.12.1 Source: 10.1.12.3 3
IP header
Destination: 224.0.0.13 Destination: 224.0.0.13
Group: 224.1.1.1 Group: 224.1.1.1
Assert payload Source: 10.1.1.1 R4 Source: 10.1.1.1
Priority: 10 Priority: 60 1
Cost: 2 Cost: 0
2
Assert election principles:
1. The router wins if its unicast route to the source (10.1.1.1) has a higher unicast protocol priority.
2. If their unicast protocol priorities are the same, the router wins if its unicast route to the source has
a smaller cost.
3. If their unicast route costs are also the same, the router wins if its interface IP address is higher.
Contents
PIM Introduction
PIM-DM
PIM-SM
PIM Introduction
PIM-DM
PIM-SM
About the RP
An RP is an important PIM router on a network. It is used to process registration messages sent
from multicast sources and multicast group join requests. An RP acts as an information
convergence center. All PIM routers on the network need to know the RP address.
An RP can synchronously serve multiple multicast groups, but each multicast group can be served
by only one RP.
RP discovery mechanism:
Static RP: Configure the same static RP address on all PIM routers on a network.
Dynamic RP: Configure several PIM routers in a PIM domain as candidate-RPs (C-RPs). An RP
will be dynamically elected among the C-RPs. In addition, configure candidate-BSRs (C-BSRs) to
elect a BSR. The elected BSR collects C-RP advertisement information and advertises the
information to all PIM routers in the PIM-SM domain.
PIM-SM Protocol Packets
Bootstrap Used for electing a BSR and sending C-RP summary information.
Assert Used for implementing the assert function.
Candidate-RP-
Used by C-RPs for sending advertisement information to BSRs.
Advertisement
RPT Join (from Receivers to an RP)
R2 R3 (RP) R4
in
Jo
packet to the downstream interface list of the entry.
G)
and then sends a (*, G) Join packet to the RP. 2
(* ,
IGMP Membership Report
R5 2 R6
PIM Join
R2 R3 (RP) R4
in
Jo
the downstream interface list of the entry, and then
G)
forwards the group's data through the corresponding 3
(* ,
IGMP Membership Report interface.
R5 2 R6
PIM Join
R5 6 5 R6
PIM Join
(*, G) Join
R2 R3 (RP) R4
R1
RPT
R5 R6
Receiver Receiver
Group: 224.1.1.1 Group: 224.1.1.1
RPT Prune
1
Receiver
Group: 224.1.1.1 The member leaves the group.
Source Registration
R1
PIM Register
Receiver Receiver
Group: 224.1.1.1 Group: 224.1.1.1
Source Registration
R2 R3 (RP) R4
PIM Join
PIM Register
Receiver Receiver
Group: 224.1.1.1 Group: 224.1.1.1
Source Registration
R2 R3 (RP) R4
R1
R5 R6
Multicast data
PIM Join
PIM Register
Receiver Receiver
Group: 224.1.1.1 Group: 224.1.1.1
Source Registration
R1
Multicast data R5 R6
PIM Join
PIM Register
Receiver Receiver
PIM Register-Stop Group: 224.1.1.1 Group: 224.1.1.1
Source Registration
The current shapes of the RPT and SPT are shown in the
following figure.
R2 R3 (RP) R4
R1
SPT
R5 R6
RPT
Receiver Receiver
Group: 224.1.1.1 Group: 224.1.1.1
SPT Switchover Process
Multicast data
R2 R3 (RP) R4
R1
R5 R6
The transmission paths for multicast traffic on R5 and R6 are not optimal. The RP may be
overburdened because all traffic passes through the it. To pass through it, PIM-SM provides
Receiver
the SPT switchover function, using which a last-hop router can directly receive multicast Group: 224.1.1.1
traffic from a source. The traffic will then not pass through the RP.
The receiver-side DR (R6) periodically checks the forwarding rate of multicast packets and
triggers an SPT switchover immediately after the (S, G) packet forwarding rate exceeds the
SPT switchover threshold. By default, the DR triggers an SPT switchover immediately after
receiving the first (S, G) packet on the RPT.
SPT Switchover Process
PIM Join
Source:10.1.1.1
R2 R3 (RP) R4
R1
(S
,G)
Jo
in
(S, G) Join
R5 adds the interface that received R5 R6
the Join packet to the downstream
interface list of the (S, G) entry and
sends an (S, G) Join packet to its
upstream neighbor R2. Receiver
Group: 224.1.1.1
R6 has learned the multicast source IP address. When
the multicast traffic rate exceeds the SPT switchover
threshold, R6 sends an (S, G) Join packet to the
source.
SPT Switchover Process
R2 R3 (RP) R4
R1
SPT
R5 R6
RPT
Receiver
Group: 224.1.1.1
The current shapes of the RPT and SPT are shown in this figure.
SPT Switchover Process
R2 R3 (RP) R4
R1
n e
ru
P
T)
RP
G,
,
(S
R5 R6
PIM Prune
R2 R3 (RP) R4
(S, G) Prune
R1
n e
ru
P
T)
RP
G,
,
(S
R5 R6
R2 R3 (RP) R4
R1
SPT
R5 R6
R1 R3
RP
Receiver
R2 R4
DR DR
The network segment where a multicast source or group members reside is generally connected to multiple PIM
routers. The PIM routers exchange Hello messages to set up PIM neighbor relationships. A Hello message carries a
DR priority and the interface address on the network segment. After receiving a Hello packet, each PIM router
compares its own DR priority and interface address with those carried in the Hello packet. A unique DR is then
elected to send and receive multicast packets on the multicast source or group member side. The DR election
principles are as follows:
The router with the highest DR priority wins (if all routers on the network segment support Hello packets carrying
DR priorities).
If the DR priorities are the same or one or more routers do not support Hello packets carrying DR priorities, the
router with the highest IP address wins.
If an elected DR becomes faulty, PIM neighbor relationships time out. A new DR election is conducted among the
other PIM neighbors.
On the shared network segment connected to a multicast source, the DR is responsible for sending Register
packets to the RP. The DR connected to a multicast source is called the source DR.
On the shared network segment connected to multicast group members, the DR is responsible for sending Join
packets to the RP. The DR connected to multicast group members is called the receiver DR.