Internet Educational Series #9: Multicast

How to reach multiple destinations from the same source sender?

Internet Educational Series #9: Multicast
Photo by Tara Scahill on Unsplash

Today we will talk about the Multicast technology, how do we send the same datagrams to a certain group of devices without having to send them to everyone (broadcast).

To understand Multicasting we first need to understand Unicasting.

In unicasting, there is a single sender (source) and a single receiver (destination).

When unicast routing, the router forwards the received packet through only one of its interfaces.

On the other hand, multicasting is when there is a single sender and multiple receivers. The several receivers form part of a multicast group.

When multicast routing, the router forwards the received packets through several of its interfaces.

However, we did already know what broadcasting was (sending to everyone reachable), so how do we differentiate between them?

Receivers need to request forwarding to be part of the multicast group.

This way routers know where they need to send their multicast packets.

When we want to use Multicast and send a packet from a source, the packet must include the normal source address, and a specific multicast address specified as the destination.

Moreover, the outgoing network interface and the TTL of that packet need to be specified too.

If we are one of the receivers of the multicast group, we must indicate that we want to get inside that group until we do not want to be part of it no more.

We can do so with some commands that we will see later on, but the actions that need to be performed for all multicast receivers are the following:

  • Join-IP-Multicast-Group (group-address, interface)
  • Leave-IP-Multicast-Group (group-address, interface)

Before digging deeper into the protocol, this are some examples of Applications of Multicasting:

One to many

  • Scheduled audio-video distribution (TV, meetings, lectures…)
  • File distribution and caching (website contents, file-based updates…)
  • Monitoring (stock prices, telemetry)

Many to many

  • Multimedia conferencing (whiteboards, audio/video)
  • Concurrent processing (distributed parallel processing)
  • Collaboration (shared document editing)
  • Distance learning (one-to-many + feedback)
  • Chat groups
  • Multiplayer games

Multicast Addressing

Link-Layer Transmission/Reception

How are Transmissions?

  • An IP multicast packet is transmitted as a link-layer multicast, on those links that support multicast.
  • The link-layer destination address is determined by an algorithm specific to the type of link.

How are Receptions?

  • Necessary steps are taken to receive desired multicasts on a particular link, such as modifying address reception filters on LAN interfaces
  • Multicast routers must be able to receive all IP multicasts on a link, without knowing in advance which groups will be used.

So, we need to modify certain fields to be able to use multicast. Let’s see which ones and how do we modify them.

Address Structure

As you know, IP addresses have 32 bits. These 32 bits are splitted into two parts:

  • NetID
  • HostID

If the destination @IP has the same NetID as mine, we know that this host is in my same data-link network, and the HostID identifies the host within each network.

Additionally, you know that IPv4 addresses have 5 possible divisions:

  • Class A: 0.0.0.0 → 127.255.255.255 (Network 10 is private and Network 127 is internal)
  • Class B → 128.0.0.0–191.255.255.255 (Private addresses 172.16.0.0–172.31.255.255)
  • Class C → 192.0.0.0–223.255.255.255 (Private addresses 192.168.0.0–192.168.255.255)
  • Class D → 224.0.0.0–239.255.255.255 MULTICAST ADDRESSES
  • Class E → 240.0.0.0–255.255.255.254 (Reserved for future use)

So yeah, until now we did talk only about classes from A to C, but of course the remaining ones are important, and in today’s article Class D takes the podium place.

Multicast addresses are inside the range 224.0.0.0 to 239.255.255.255.

However it is impossible to add all the hosts inside this range, so to solve this, hosts join multicast groups, and then they are identified inside that groups.

How are hosts identified inside a multicast group? By SIMPLE MAPPING.

The devices are identified with their MAC address, and to indicate that these hosts have joined a multicast group, we do MAP directly the multicast identifier onto the 23 least significant bits of the MAC address. Take a look at the following picture:

When a router fins a destination address that forms part of a multicast group, it will know that it has to send the packet to that specific group.

To identify how/where to send a certain packet when it is received, the MAC layer (Ethernet interface) works as follows:

As you can see, there are several steps that need to be executed before checking if the packet is part of a multicast group.

IGMP

How do hosts tell the multicast group that they want to join it?

This is when IGMP (Internet Group Management Protocol) comes into play.

When hosts want to either join, leave or indicate that they want to continue being part of a certain group, they must use IGMP messages.

Routers also use this messages to discover group members.

The different types of IGMP messages are the following:

Membership Report

Used when a host or router can join a group.

Each host maintains a list of processes that have interest in a group.

Join operation:

  • When a process wants to join a new group, it sends its request to the host.
  • The host then adds the name of the process and the name of the requested group to its list.
  • The host sends the membership report to the router (for fiability purposes it can be sent twice).

Leave Report

When a host sees that no process is interested in a specific group, it sends a leave report.

If a router receives a leave report it will not purge the list if there are still other hosts interested in that group.

For that purpose, routers send a special query message with a specified response time for the group in question to see if there is anyone interested in that group.

If there is no response, it purges the list.

General Query Message

Membership report and leave report are not enough to maintain the membership information.

To keep a host inside a group, hosts and routers periodically send general query messages.

Then hosts and routers respond by sending membership reports if they still have interest in those groups.

But be careful!To keep the traffic low, the response to a general query message must be done by only one host for a given group.

When a hosts receives a general query message, it delays the response: It sets a timer for each group to a different random value between 0 and 10 seconds.

If the host receives a response from another host, whose time for that group has expired earlier, the host cancels its response.

Note: Only one router on the LAN is designated for sending the query messages (the querier router).

Finally it is worth mentioning that IGMP messages are encapsulated inside IP datagrams.

To identify if an IP datagram is a multicast one, we must take a look at the PROTOCOL NUMBER field, if it is a 2, it means that it is using IGMP, multicasting.

MBONE (Multicast Backbone)

As the internet has been growing bigger and bigger, so have done applications that need to use multicasting. Multimedia and real-time applications have been the ones that needed to use it the most.

However, only a small fraction of the Internet routers support multicasting.

The solution is to use tunneling, as it provides a logical connection of multicast routers through non-multicast routers, called multicast backbone.

Unicast vs Multicast

To finish this article, let’s take a look at the main differences between unicast and multicast routing.

Unicast:

  • Unicast routing is concerned about where the packet is going
  • The destination IP address directly indicates where to forward the packet
  • Forwarding is done hop-by-hop
  • The routing table determines the interface and the next-hop router to forward the packet

Multicast:

  • Multicast routing is concerned about where the packet came from
  • The destination IP address (group) does not directly indicate where to forward the packet
  • Receivers must be “connected” to the tree before the traffic begins to flow

Note that the multicast trees are spanning trees, where the source is located at the root of the tree, and the group members are the leaves of the tree.

The basic requirements that a group must fulfill to use multicast are the following:

  • Every group member should receive only one copy of the multicast packet
  • Non member must not receive a copy.
  • A multicast packet must not be received by a router more than once (no loops)
  • Paths from the source to each destination must be optimal (shortest path)

As you see, multicast is a technology with a HUGE amount of possibilities, almost every streaming service uses multicast nowadays.

I hope you liked this brief explanation about the topic.

In case you want to learn more about other Internet related topics, feel free to check my previous articles:

Finally, this series will reach to the 10th episode, so if you’ve liked my content please leave a clap, it makes a huge difference for me and keeps me motivated to write more articles!