Exploring multicast IP in Linux
Multicast Routing Protocols
Multicasting is so efficient that you might wonder why everyone isn't already using it. The problem is the need to include additional functionality in the transmission network that guarantees appropriate service and replication of the single data stream over a large routed network. Passing the data efficiently through a chain of routers requires a new class of special-purpose multicast routing protocols. Unfortunately, these protocols are rather complex and thus are not commonly implemented by Internet providers.
A multicast routing protocol must support the possibility of forwarding a single packet to multiple interfaces. Currently, the most popular multicast routing protocol is PIM-SM (Protocol-Independent Multicast--Sparse Mode). The principal task of the PIM-SM protocol is to build a multicast distribution tree that delivers multicast packets from the source to the receivers. For multicast transmission, PIM-SM maintains a separate routing table called the Multicast Forwarding Cache (MFC).
PIM-SM also uses a unicast routing table to provide a loop-free forwarding environment for multicast deliveries. Therefore, to guarantee the appropriate functioning of the PIM-SM protocol, it is also necessary to configure the unicast routing tables on the computers that are involved in the multicast transmission.
The PIM-SM protocol uses the concept of a rendezvous point to manage multicast communication. The rendezvous point is a router that will receive transmission requests from recipients. Transmission sources send their data to the rendezvous point. PIM-SM can assign the rendezvous point role dynamically, or the user can assign the role directly through the configuration.
Configuring Mulitcast Routing
XORP is a free routing suite that includes the exceptionally good implementation of the PIM-SM protocol . A quick look at mulitcast routing with XORP should give you a good idea of how to get started with your own mulitcasting experiments.
First, download the source code from the project website  (in this article, we use version 1.5 of July 22, 2008) and install it as follows:
tar xzf xorp-1.5.tar.gz ./configure make make check make install
In this discussion, we assume the modules servicing network cards have already been loaded or complied into the kernel and that the network has not been configured in any way. (Before you start the configuration, configuration tools such as NetworkManager should be switched off.)
The first step is to run the program that configures the XORP application with the command xorpsh (the executable files of the XORP application are in /usr/local/xorp/bin). Because XORP significantly affects the functioning of the system, it has two modes of operation: basic and enhanced. Working in the enhanced mode requires that anyone starting the program must belong to the xorp group.
Configuring the network and the PIM-SM protocol requires the following steps:
- activate the network interfaces and assign IP addresses
- configure unicast routing
- enable forwarding of multicast packets
- enable the PIM-SM protocol
- enable IGMP for routers in direct proximity of group transmission receivers
The XORP management interface is similar to the devices made by Juniper. Listing 1 shows the configuration of the network interfaces.
The first command in Listing 1 results in entering enhanced mode, in which a change in the configuration of the device is possible. The next two set interfaces commands are responsible for the configuration of the network interfaces. As you can see, the syntax of the command is very simple and does not require explanation. In the next steps, the interfaces are activated. The last command is commit, which allows the execution of the preceding commands.
Configuring the Network Interfaces
01 >configure 02 # set interfaces interface eth0 vif eth0 address 192.168.2.1 prefix-length 24 03 # set interfaces interface eth1 vif eth1 address 192.168.3.2 prefix-length 24 04 # set interfaces interface eth0 vif eth0 disable false 05 # set interfaces interface eth1 vif eth1 disable false 06 # commit
As stated earlier, the PIM-SM protocol uses a unicast routing table to know where to send the Join messages. Routing tables on individual routers can be configured manually with the route or ip commands. This approach, however, is troublesome and prone to error, requiring an intervention of the operator every time the configuration is to be changed.
Dynamic routing protocols allow automatic determination of routing tables. A common dynamic protocol supported by XORP is OSPF (Open Shortest Path First). A full discussion of unicast routing protocols exceeds the scope of this article; however, the configuration steps in Listing 2 show how to configure unicast routing with OSPF.
Also, you must enable unicast data forwarding with:
# set fea unicast-forwarding4 # commit
01 # set protocols ospf4 router-id 192.168.2.1 02 # set protocols ospf4 area 192.168.0.0 interface eth0 vif eth0 address 192.168.2.1 03 # set protocols ospf4 area 192.168.0.0 interface eth0 vif eth0 disable false 04 # set protocols ospf4 area 192.168.0.0 interface eth1 vif eth1 address 192.168.3.2 05 # set protocols ospf4 area 192.168.0.0 interface eth1 vif eth1 disable false 06 # commit
Buy this article as PDF
Innovative system adds a hard drive and Ubuntu Core to the RPi for an IoT hub.
Linux is two weeks younger than we thought!
The Apache Software Foundation considers retiring OpenOffice
Adobe won’t kill the plugin in 2017
Linux Foundation's big event celebrates the 25th anniversary of Linux
Competitors get in the game with RHEL without Red Hat
Security researchers have already notified Microsoft; some fixes are available
The company is collaborating with Google and Intel to use Kubernetes as an engine for Fuel