Protocol Independent Multicast (Pim) in Sonic Using Gns3
Protocol Independent Multicast (Pim) in Sonic Using Gns3
Protocol Independent Multicast (Pim) in Sonic Using Gns3
Intended Audience
This document is tailored for data center experts and network engineers interested in
configuring PIM-SM in SONiC. It is designed for individuals with a solid understanding of
networking principles. Whether you are a network engineer, operator, or vendor, this
document aims to provide you with practical, step-by-step guidance, and best practices for
deploying, configuring, and setting up BFD for SONiC devices using the GNS3 network
simulation tool.
Multicast Forwarding
Multicast forwarding is the process of routing and transmitting multicast traffic within a
network. Multicast forwarding enables the efficient distribution of data from one sender to
multiple recipients who have expressed interest in receiving the multicast content.
In a multicast communication model, the sender (the source) sends data to a multicast
group address, and only those network devices (receivers) that have joined that multicast
group will receive the data. Multicast forwarding mechanisms are responsible for ensuring
that the data is delivered to all interested recipients while minimising network traffic and
resource usage.
There are different multicast forwarding methods and protocols, including PIM (Protocol
Independent Multicast), IGMP (Internet Group Management Protocol), and various routing
algorithms, which determine the path for multicast data to reach its intended recipients.
Multicast uses RPF (Reverse Path Forwarding) to prevent flooding/loops within the network.
The RPF check uses the routing table to check against the source IP within the packet. If the
packet comes in on an interface that is specified against the source of the multicast stream,
the RPF check succeeds, otherwise, the RPF check fails and the packet is dropped.
PIM Components
There are two key components: state and the multicast distribution tree.
State
Refers to the information that PIM routers maintain about the multicast distribution tree
and the multicast groups they are forwarding traffic for. This state information is used to
ensure the efficient routing and forwarding of multicast traffic within a network. The state
information is dynamic and is updated as the network topology and multicast group
membership change. PIM routers use this state information to make decisions about the
forwarding of multicast traffic, such as whether to prune or forward traffic on specific
interfaces to optimize the multicast delivery.
The choice between using a shared tree or a source-specific tree depends on the multicast
routing protocol and specific requirements of the multicast group. The distribution tree
helps multicast routers determine where to forward multicast traffic and optimizes its
delivery to the appropriate recipients.
RP (Rendezvous Point)
When configuring PIM-SM on a network, at least one router must be designated as a
Rendezvous Point (RP). An RP is a meeting point and is required in the shared tree to help
the source information passed to the receiver. An RP performs a critical function: it
establishes a common reference point from which multicast trees are grown.
(*,G) State
The (,G) state represents the shared tree state in PIM-SM. It indicates that a router is
interested in receiving traffic for a particular multicast group (G) from any source (). This
state is created toward the RP, and multicast traffic flows along the shared tree until it
reaches the Last Hop Router (LHR).
(S,G) State
The (S,G) state represents the source-specific tree state in PIM-SM. It indicates that a router
is interested in receiving traffic for a particular multicast group (G) from a specific source (S).
This state is created toward the source, and multicast traffic flows along the source-specific
tree.
Dynamic Adaptation
PIM-SDM allows routers to dynamically switch between shared trees and source trees based
on the density of group membership in different parts of the network. This adaptability
helps optimize multicast traffic forwarding for varying scenarios.
OSPF
OSPF Configurations for the FHR are shown below. All other routers in topology can be
configured in a similar way.
FHR
Step 1. Configure IPs on interfaces.
admin@sonic:~$ sudo config interface ip rem Ethernet0 10.0.0.0/31
admin@sonic:~$ sudo config interface ip rem Ethernet4 10.0.0.2/31
admin@sonic:~$ sudo config interface ip add Ethernet0 172.16.1.1/24
admin@sonic:~$ sudo config interface ip add Ethernet4 172.16.1.10/24
admin@sonic:~$ sudo config interface ip add Lopback1 172.16.1.0/32
sonic# configure
sonic(config)# ip rp 172.16.0.2
sonic(config)# exit
sonic# write
sonic# confiure
sonic(config)# interface Etherent0
sonic(config-if)# ip igmp version 3
sonic(config-if)# exit
sonic(config)# exit
sonic# write
Receiver
Initiate the IGMP join process by having Receiver-1 and Receiver-2 send IGMP join messages
to their corresponding LHR’s, expressing their interest in joining a specific multicast group.
This ensures that the LHR’s know the receivers' multicast group preferences and can
appropriately forward the multicast traffic to the intended recipients in the PIM-SM
configuration.
sonic# confiure
sonic(config)# interface Etherent0
sonic(config-if)# ip igmp join 224.1.1.1
sonic(config-if)# exit
sonic(config)# exit
sonic# write
Rendezvous Point
Step 1. Enable multicast routing on interfaces.
sonic# configure
sonic(config)# interface Ehernet0
sonic(config-if)# ip pim
sonic(config-if)# exit
sonic(config)# interface Ehernet4
sonic(config-if)# ip pim
sonic(config-if)# exit
sonic(config)# interface Ehernet8
sonic(config-if)# ip pim
sonic(config-if)# exit
sonic(config)# exit
sonic# write
sonic# configure
sonic(config)# ip rp 172.16.0.2
sonic(config)# exit
sonic# write
Results
In the network topology shown in Figure 3, OSPF was configured across all devices within
Area 0 to ensure efficient communication and routing. PIM-SM (Protocol Independent
Multicast - Sparse Mode) was configured, emphasizing a multicast approach for optimized
resource utilization. A specific device served as the RP (Rendezvous Point), managing
multicast group memberships. The experiment incorporated a multicast flow with one
device as the source, generating traffic for distribution, and two strategically placed
receivers explicitly joining the 224.1.1.1 multicast group. Two switches functioned as Last
Hop Routers (LHRs) near the receivers, and one as the First Hop Router (FHR) near the
source, allowing examination of multicast traffic traversal.
● First, OSPF neighborship among all switches was configured, confirming that they
communicate and share routing information effectively. re
sonic# show ip ospf
OSPF Routing Process, Router ID: 172.16.4.1
Supports only single TOS (TOS0) routes
This implementation conforms to RFC2328
RFC1583Compatibility flag is disabled
OpaqueCapability flag is disabled
Initial SPF scheduling delay 0 millisec(s)
Minimum hold time between consecutive SPFs 50
millisec(s)
Maximum hold time between consecutive SPFs 5000
millisec(s)
Hold time multiplier is currently 1
SPF algorithm last executed 2508480d00h00m ago
Last SPF duration 528 usecs
SPF timer is inactive
LSA minimum interval 5000 msecs
LSA minimum arrival 1000 msecs
Write Multiplier set to 20
Refresh timer 10 secs
● Check rp-info on each router. The parameter “ I am RP” shows whether this router is
RP or not. If it says “yes” than this router is RP and if it says “no” than this router is
not RP.
● Check multicast routes. Initially, when there is no receiver for a specific multicast
group there will be no multicast route in the multicast routing table. But when there
is a receiver then it will show multicast routes.