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
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.
News
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.
-
ZorinOS 17.1 Released, Includes Improved Windows App Support
If you need or desire to run Windows applications on Linux, there's one distribution intent on making that easier for you and its new release further improves that feature.
-
Linux Market Share Surpasses 4% for the First Time
Look out Windows and macOS, Linux is on the rise and has even topped ChromeOS to become the fourth most widely used OS around the globe.
-
KDE’s Plasma 6 Officially Available
KDE’s Plasma 6.0 "Megarelease" has happened, and it's brimming with new features, polish, and performance.
-
Latest Version of Tails Unleashed
Tails 6.0 is based on Debian 12 and includes GNOME 43.
-
KDE Announces New Slimbook V with Plenty of Power and KDE’s Plasma 6
If you're a fan of KDE Plasma, you'll be thrilled to hear they've announced a new Slimbook with an AMD CPU and the latest version of KDE Plasma desktop.
-
Monthly Sponsorship Includes Early Access to elementary OS 8
If you want to get a glimpse of what's in the pipeline for elementary OS 8, just set up a monthly sponsorship to help fund its continued existence.
-
DebConf24 to be Held in South Korea
Busan will be the location of the latest DebConf running July 28 through August 4
-
Fedora Unleashes Atomic Desktops
Fedora has combined its solid distribution with rpm-ostree system to make it possible to deliver a new family of Fedora spins, called Fedora Atomic Desktops.
-
Bootloader Vulnerability Affects Nearly All Linux Distributions
The developers of shim have released a version to fix numerous security flaws, including one that could enable remote control execution of malicious code under certain circumstances.