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 [1]. 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 [2] (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.

Listing 1

Configuring the Network Interfaces

 

Enabling Unicast

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

Listing 2

Configuring OSPF

 

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Core Technologies

    Prise the back off Linux and find out what really makes it tick.

  • Linux-Based IP-Video Monitoring Kit

    US vendor Micronas recently launched a Linux-based hardware and software developer kit for network-based DVD quality video monitoring.

  • IPv6

    Is the world ready for the next generation Internet Protocol? We take a look at Linux with IPv6.

  • IPv6 Pen Testing

    If you have enabled IPv6 on your network without considering basic security issues, you might have opened up a hole for attackers. In this article, we demonstrate a successful attack on a server via IPv6 and explain how the popular security tools handle IPv6.

  • CLUSTERIP

    Iptables gives admins the ability to set up clusters and distribute the load. But what about failover?

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News