Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 43

Course Objectives

After completing this course, you will be able to:

 Understand the basic concepts of multicast routing protocols.

 Understand the usage scenarios and working mechanism of PIM-DM.

 Have a good command of PIM-DM configurations.

 Understand the usage scenarios and working mechanism of PIM-SM.

 Have a good command of PIM-SM configurations.


Contents

PIM Introduction

PIM-DM

Basic PIM-DM Configurations

PIM-SM

Basic PIM-SM Configurations


Multicast Routing Protocol Overview

Source  A multicast router copies data and


No signaling
forwards the data to network
protocol required
1 branches that require the data or
R1
have multicast receivers.
 How is the forwarding path of
Multicast
R2 R3 routing protocols multicast traffic determined?
For example, PIM  How can traffic be forwarded only
3 to branches that require the data or
R4 R5 R6
have receivers?
Multicast member
management protocol
 How can loops be prevented during
PC1 PC2 PC3 IGMP multicast traffic forwarding?
2 Receiver Receiver
Main Functions of Routing Protocols

Source  After receiving a multicast packet, a device checks


whether the packet is received from the correct
R1
interface to ensure loop-free forwarding of multicast
data.

R2 R3  A path for forwarding multicast traffic, known as an


multicast distribution tree (MDT) is established.

R4 R5 R6
 The multicast distribution tree is represented as (S, G)
or (*, G) multicast forwarding entries on each
multicast router.

PC1 PC2 PC3


Receiver Receiver
PIM Overview

 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.

 On live networks, the following three types of PIM are used:


 PIM-Dense Mode (PIM-DM)
 PIM-Sparse Mode (PIM-SM)
 Bidirectional PIM (BIDIR-PIM)
PIM-DM

 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

Basic PIM-DM Configurations

PIM-SM

Basic PIM-SM Configurations


PIM-DM Protocol Packets

Packet Type Packet Function

Hello Used for establishing and maintaining PIM neighbor relationships.

Used for requesting to be added to and removed from multicast distribution trees,
Join/Prune
respectively.

Graft Used for grafting branches to multicast distribution trees.

Graft-ACK Used for acknowledging the completion of graft requests.

Assert Used for implementing the assert function.


PIM Neighbor Relationships

 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

[R1] display pim neighbor


VPN-Instance: public net
Total Number of Neighbors = 1
Neighbor Interface Uptime Expires Dr-Priority BFD-Session
10.1.12.2 GE0/0/0 00:02:47 00:01:27 1 N
PIM-DM: Initial Flooding Process

10.1.1.1

Initially, multicast traffic is flooded to every corner


C
of the network. A branch can therefore receive
PC2
A Receiver the traffic even if it does not have any multicast
group members.
Each multicast router creates (S, G) entries in its
multicast routing table. In this example, if the
B PC3 multicast traffic is sent from the source 10.1.1.1
to the group 239.1.1.1, the (S, G) entry is
D
(10.1.1.1, 239.1.1.1).

PC1 Multicast
data flow
Receiver
PIM Routing Table

[Huawei] display pim routing-table


VPN-Instance: public net
Total 0 (*, G) entry; 1 (S, G) entry This is an (S, G) entry, where
(10.1.1.1, 239.1.1.1) S indicates the multicast
source, and G indicates the
Protocol: pim-dm, Flag: ACT multicast group.
UpTime: 00:14:22
Upstream interface: GigabitEthernet0/0/0 Upstream interface (RPF
interface)
Upstream neighbor: 10.1.12.1
RPF prime neighbor: 10.1.12.1
Downstream interface list
Downstream interface(s) information: that contains the outbound
interfaces of multicast data
Total number of downstreams: 1
1: GigabitEthernet0/0/1
Protocol: pim-dm, UpTime: 00:00:15, Expires: never
Multicast Routing Table

[Huawei] display multicast routing-table


Multicast routing table of VPN-Instance: public net This is an (S, G) entry,
where S indicates the
Total 1 entry multicast source, and G
indicates the multicast
00001. (10.1.1.1, 239.1.1.1) group.
Uptime: 00:00:06 Upstream interface (RPF
interface)
Upstream Interface: GigabitEthernet0/0/0
Downstream interface list
List of 1 downstream interface that contains the outbound
interfaces of multicast data
1: GigabitEthernet0/0/1
PIM-DM: Prune Process

If a branch does not need the multicast traffic of


C (10.1.1.1, 239.1.1.1), the branch's router sends a
PC2
A Receiver PIM Prune packet, requesting to be pruned from
the multicast distribution tree.
After receiving the Prune packet, the upstream
router removes the interface that received the
B PC3
packet from the downstream outbound interface
D list of the (10.1.1.1, 239.1.1.1) entry.

PC1 PIM Prune


Receiver
PIM-DM: New SPT Setup

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.

PC1 PIM Prune


Receiver
PIM-DM: Graft Process

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

Basic PIM-DM Configurations

PIM-SM

Basic PIM-SM Configurations


Basic Commands

 Command for enabling multicast routing:


[Huawei] multicast routing-enable

 Command for enabling PIM-DM on an interface:


[Huawei] interface GigabitEthernet 0/0/0
[Huawei-GigabitEthernet 0/0/0] pim dm

 Command for querying PIM neighbors:


[Huawei] display pim neighbor
Contents

PIM Introduction

PIM-DM

Basic PIM-DM Configurations

PIM-SM

Basic PIM-SM Configurations


Rendezvous Point (RP)

 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

Packet Type Packet Function

Hello Used for establishing and maintaining PIM neighbor relationships.


Register Used for registering multicast sources with RPs.
Sent by an RP to instruct the first-hop router to stop sending
Register-Stop
multicast traffic through Register packets.

Used for requesting to be added to and pruned from multicast


Join/Prune
distribution trees, respectively.

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

R1 R5 creates a (*, G) PIM routing entry, adds the


interface that received the IGMP Membership Report

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

A new receiver joins the group.


RPT Join

R2 R3 (RP) R4

R1 The RP creates a (*, G) PIM routing entry,


adds the interface that received the (*, G) Join packet to

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

A new receiver joins the group.


RPT Join

R5 receives the (*, G) Join packet from R6. R5


has created the (*, G) routing entry and therefore
adds the interface that received the Join packet
to the downstream interface list of the (*, G) entry.6
R2 R3 (RP) R4

R1 R6 creates a (*, G) routing entry, adds the interface


that received the IGMP Membership Report packet
to the downstream interface list of the entry, and
then sends the (*, G) Join packet to the RP. 5
IGMP Membership Report

R5 6 5 R6
PIM Join
(*, G) Join

Receiver A new receiver joins the group.


RPT Join

The current shape of the RPT is shown in the following figure.

R2 R3 (RP) R4

R1

RPT
R5 R6

Receiver Receiver
Group: 224.1.1.1 Group: 224.1.1.1
RPT Prune

R5 receives a (*, G) Prune packet and removes the packet


receiving interface from the downstream interface list of
the (*, G) entry. Other users still need the group data from
R5, and therefore R5 remains on the RPT, without sending
a Prune packet to the upstream device. 3
R2 R3 (RP) R4

R1 R6 receives an IGMP Leave packet and confirms that no group


members exist on the interface any more. R6 removes the interface
from the downstream interface list of the (*, G) entry. After detecting that
the list is empty, R5 sends a (*, G) Prune packet to the upstream device. 2
IGMP Leave
R5 3 2 R6
PIM Prune (*, G) Prune

1
Receiver
Group: 224.1.1.1 The member leaves the group.
Source Registration

The RP decapsulates the Register packet and identifies


the target group (in this example, G) of the multicast
data. The local downstream interface list of this group's
A source starts to entry contains interfaces. Therefore, the RP forwards
send the first the multicast data through these interfaces. 3
multicast data 1
packet of the 2 R2 R3 (RP) R4
multicast group G.

R1

R1, functioning as the DR, 3


encapsulates the multicast data packet
in a unicast PIM Register packet, and 2
then sends the packet to the RP.
R5 R6
Multicast data

PIM Register
Receiver Receiver
Group: 224.1.1.1 Group: 224.1.1.1
Source Registration

The RP sends an (S, G) Join packet to the source,


attempting to set up an SPT with the source. The RP can
then directly receive multicast traffic from the source.

R2 R3 (RP) R4

(S, G) Join (S, G) Join


R1

Encapsulating multicast data continuously in


PIM Register packets is inefficient.
R5 R6
Multicast data

PIM Join

PIM Register
Receiver Receiver
Group: 224.1.1.1 Group: 224.1.1.1
Source Registration

After the (S, G) Join packet sent by the RP reaches


R1, an SPT is set up. The SPT can then be used to
directly forward the multicast traffic of the (S, G) group
from R1 to the RP.

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

The RP can already receive multicast data from S1


and does not need unicast Register packets any more.
Therefore, the RP sends a Register-Stop packet. After
receiving the Register-Stop packet, R1 stops
encapsulating unicast data in Register packets.
R2 R3 (RP) R4

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

(S, G, RPT) Prune

R2 R3 (RP) R4

R1

n e
ru
P
T)
RP
G,
,
(S
R5 R6

R5 is on branches of both the SPT and RPT and has


started to receive (S, G) traffic from the SPT. Therefore, Receiver
R5 does not need to receive traffic from the RP any more. Group: 224.1.1.1
R5 sends an (S, G, RPT) Prune packet to the RP,
instructing the RP to prune R5 from the RPT.
SPT Switchover Process

PIM Prune

R2 R3 (RP) R4

(S, G) Prune
R1

n e
ru
P
T)
RP
G,
,
(S
R5 R6

After receiving the Prune packet from R5, the RP removes


the interface that received from the downstream interface
list of the (S, G) entry and detects that the list is empty. Receiver
Group: 224.1.1.1
Therefore, the RP sends an (S, G) Prune packet to the
upstream neighbor R2 to trigger a prune of the RP from
the SPT.
SPT Switchover Process

R2 R3 (RP) R4

R1

SPT
R5 R6

The current shape of the SPT


is shown in the following figure.
Receiver
Group: 224.1.1.1
PIM-SM Designated Router (DR)

R1 R3

RP

Receiver
R2 R4

DR DR

PIM Register PIM Join


PIM-SM 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.

You might also like