PIM
This chapter covers some aspects related to the protocols pim
tool, which allows
you to configure the Protocol Independent Multicast (PIM) in OSDx, specifically
in its PIM Sparse Mode (PIM-SM) variant.
PIM is a family of multicast routing protocols for the Internet protocol IP that provides one-to-many and many-to-many distribution of data over a LAN, WAN or Internet.
PIM-SM is named protocol-independent because it is not dependent on any particular unicast routing protocol for topology discovery, and sparse-mode because it is suitable for groups where a very low percentage of the nodes (and their routers) will subscribe to the multicast session.
PIM-SM is a protocol for efficiently routing IP packets to multicast groups that may span wide-area and inter-domain internets. To do this, PIM-SM explicitly builds unidirectional Shared-Trees (ST) rooted at a Rendezvous-Point (RP) per group, and optionally, creates Shortest-Path-Trees (SPT) per source.
The Rendezvous-Point (RP) is a PIM node responsible for coordinating all multicast traffic from a set of multicast groups.
All PIM routers in a domain must execute the same group mapping to RP since there can be more than one possible RP. But each group must be able to uniquely associate to an RP. Therefore it’s essential that all PIM routers in the domain share the same RPs information, known as RP-Set. Each of its entries are associated with an RP, defined by its IP address, with a range of multicast groups, described by a range initial group and mask.
In OSDx, all the RPs that make up the RP-Set must be statically configured identically
in all PIM routers in the domain. And this can be configured using the rp
field.
address
: to specify the IP addresses for the static RPs.group
: to define the multicast groups that are associated with the previous RP.
All routers interested in receiving multicast traffic from a group send JOIN/PRUNE
messages to an upstream router going toward the source or toward the RP, to build and
maintain the corresponding tree. The join-prune-interval
command allows you to adjust
the interval at which these messages are sent (60 seconds by default).
Through the JOIN/PRUNE messages, the multicast routing tables of all PIM routers are
configured. However, the entries in this routing table are not permanent; instead, when a
source stops sending traffic to a multicast group, the corresponding entry eventually
times out and is removed from the multicast routing table. The keep-alive-timer
command allows you to adjust this times out interval (210 seconds by default).
The rp keep-alive-timer
command is similar to the above, but used on the RP when a
REGISTER-STOP message is sent. By default: 3 * register-suppress-time + 5
All routers behaving as Designated Router (DR) encapsulate multicast packets from local
sources to the RP, using REGISTER messages. The encapsulation process is very inefficient
and the RP can stop this process by sending a REGISTER-STOP message to the DR. When the DR
receives this message, it starts a timer that, if it expires, will cause the DR to resume
the encapsulation process. The register-suppress-time
command allows you to adjust
this times out interval (60 seconds by default).
In addition, it is possible to prevent unauthorized sources from registering with an RP.
If an unauthorized source sends a REGISTER message to the RP, then the RP immediately
sends a REGISTER-STOP in response. The register-accept-list
command allows you to
adjust, through a prefix-list, the sources that are permitted and denied.
The Last Hop Router (LHR) is the first PIM router the multicast receivers come across which must be directly connected to them. Through the LHR, the multicast traffic reaches the receiver, but not necessarily by the shortest route. In such a case, the LHR has to decide whether it wants the traffic to arrive through the shortest path, attaching itself to the SPT. There are various possible options:
Switch to SPT after receiving the first multicast traffic packet.
Never switch to the SPT, maintaining the minimum information on the protocol. This can be configured using the
never-spt-switchover
field.Control which groups to switch or not switch. This can be configured by adding the optional
prefix-list
field to the above command.The SPT switchover does not happen for the groups that are permitted.
The SPT switchover happens for the groups that are denied.
In OSDx, it also possible to configure the PIM Source-Specific Multicast (PIM-SSM)
variant. PIM-SSM builds trees that are rooted in just one source, offering a more secure
and scalable model for a limited amount of applications (mostly broadcasting of content).
In SSM, an IP datagram is transmitted by a source S to an SSM destination address G, and
receivers can receive this datagram by subscribing to channel (S,G). PIM-SSM variant can
be considered a subset of PIM-SM and can co-exist in the same router. PIM-SSM imposes a
series of additional conditions to the PIM operations in a range of multicast IP
addresses. IANA has reserved the 232.0.0.0/8 address range for use in SSM, although the
never-ssm-list
command allows you you to adjust, through a prefix-list, the
multicast address range that are permitted and denied to do SSM over.
The configurations explained so far are common to all the interfaces of the PIM routers. However, there is another set of configurations that can be applied to each of the interfaces independently.
For the correct operation of PIM, a procedure is required to discover those neighboring
routers that support PIM-SM. To do this, all PIM routers periodically send HELLO messages
through those interfaces where the PIM protocol has been enabled. The ip pim
command
allows you to enable PIM on a specific interface. And also, the ip pim hello
command
allows you to modify the interval in which the HELLO messages are sent (30 seconds by
default).
In addition, several PIM-SM routers can exist on a LAN. However, only one of them can act
as Designated Router (DR). The election of the DR is carried out through a simple process
that can be influenced by modifying the DR priorities of each of the interfaces of the PIM
routers. The ip pim drpriority
command allows you to set the DR priority of a specific
interface (1 by default).
In OSDx, it is possible to configure the router interfaces to avoid processing some PIM control messages.
ip pim disable-bsm
: to disable sending and receiving bootstrap messages.ip pim disable-unicast-bsm
: to disable sending and receiving unicast bootstrap messages.ip pim passive
: to disable sending and receiving all PIM control messages (such as: ASSERT, BSM, HELLO, JOIN, PRUNE, REGISTER, REGISTER-STOP).
Those PIM routers that perform the role of LHR require that IGMP be enabled on those
interfaces that are in direct contact with the receiving hosts. The ip igmp
command
allows you to enable IGMP on a specific interface. And also, the ip igmp version
command allows you to modify IGMP version used (3 by default).
In a network connected to an IGMP router interface, there can be other multicast routers executing IGMP protocol. However only one router can launch IGMP queries in the same segment: this router is the IGMP Querier. In order to select the querier, this chooses the IGMP router with the lowest IP address.
IGMP query messages are sent from the Querier to find out if there is a host in the local
network that is interested in receiving traffic from a multicast group. The
ip igmp query-interval
command allows you to modify the interval in which the IGMP
query messages are sent (125 seconds by default).
If, after sending an IGMP query message, no response is received from any host interested
in a specific multicast traffic, then the IGMP routers stop forwarding said multicast
traffic to the local network. The ip igmp query-max-response-time
command allows you
to adjust this times out interval (100 deciseconds by default).
Apart from this, there are other parameters that can be configured for the IGMP protocol:
The
ip igmp last-member-query-count
command allows you to modify the IGMP last member query count (2 by default).The
ip igmp last-member-query-interval
command allows you to modify the IGMP last member query interval (10 deciseconds by default).
On the other hand, with the ip igmp join
command it is possible to emulate a host that
wishes to receive multicast traffic from a specific group.
Finally, the ip multicast boundary-list
command allows you to control, on a specific
interface, for which groups to accept or ignore received IGMP report or PIM join messages.
Configuration
This is the syntax to configure the protocols pim
:
set protocol pim [ ... ]
Examples
Configuring an LHR to never switch to the SPT
Imagine that you want to configure the PIM protocol on a router that is going to be the LHR for the multicast traffic of group ‘238.1.1.0/24’ (whose RP has the IP address 10.0.0.1) and that you also want it to never switch to SPT. The ‘eth1’ interface is directly connected to the hosts that want to receive multicast traffic from that group.
In OSDx, this can be achieved by setting the following commands:
set interfaces ethernet eth0 ip pim
set interfaces ethernet eth1 ip igmp
set interfaces ethernet eth1 ip pim
set protocols pim rp address 10.0.0.1 group 238.1.1.0/24
set protocols pim never-spt-switchover