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
« Previous 1 2 3 4 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
News
-
An All-Snap Version of Ubuntu is In The Works
Along with the standard deb version of the open-source operating system, Canonical will release an-all snap version.
-
Mageia 9 Beta 2 Ready for Testing
The latest beta of the popular Mageia distribution now includes the latest kernel and plenty of updated applications.
-
KDE Plasma 6 Looks to Bring Basic HDR Support
The KWin piece of KDE Plasma now has HDR support and color management geared for the 6.0 release.
-
Bodhi Linux 7.0 Beta Ready for Testing
The latest iteration of the Bohdi Linux distribution is now available for those who want to experience what's in store and for testing purposes.
-
Changes Coming to Ubuntu PPA Usage
The way you manage Personal Package Archives will be changing with the release of Ubuntu 23.10.
-
AlmaLinux 9.2 Now Available for Download
AlmaLinux has been released and provides a free alternative to upstream Red Hat Enterprise Linux.
-
An Immutable Version of Fedora Is Under Consideration
For anyone who's a fan of using immutable versions of Linux, the Fedora team is currently considering adding a new spin called Fedora Onyx.
-
New Release of Br OS Includes ChatGPT Integration
Br OS 23.04 is now available and is geared specifically toward web content creation.
-
Command-Line Only Peropesis 2.1 Available Now
The latest iteration of Peropesis has been released with plenty of updates and introduces new software development tools.
-
TUXEDO Computers Announces InfinityBook Pro 14
With the new generation of their popular InfinityBook Pro 14, TUXEDO upgrades its ultra-mobile, powerful business laptop with some impressive specs.