IP Multicast
Tags: internetprotocol, ipmulticast, cloud, network
Published: 2024-05-31 14:44:40

There are three different methods to deliver IP packets: unicast (one to one), broadcast (one to all), and multicast (one to many). Multicast sends packets only to destinations that have explicitly joined the multicast group. The routing devices replicate packets and forward copies to registered receivers while preventing routing loops. This article will cover multicast concepts like distribution trees, multicast addressing, forwarding, IGMP, and PIM.

## IP Multicast Basics
IP Multicast has its own set of terms and concepts centered around the idea of a multicast group, which is a set of receivers interested in particular data. Hosts join groups using IGMP. The router's job is to build a distribution tree connecting receivers to sources. The interface towards the source is the upstream interface. The interfaces towards the receivers are downstream interfaces.

Multicast uses the Class D IP address range 224.0.0.0 to 239.255.255.255. The source IP is a unicast address, while the destination IP is a multicast address. At layer 2, multicast MAC addresses have the 25th bit set to 1. Multiple IP multicast addresses can map to the same MAC address.
The Class D range has reserved blocks:
- 224.0.0.0/24: Link Local
- 224.0.1.0 - 238.255.255.255: Globally Scoped
- 232.0.0.0/8: Source-Specific Multicast
- 233.0.0.0/8: GLOP Addresses
- 239.0.0.0/8: Limited Scope

Link local addresses are used by routing protocols and are never forwarded. IPv6 uses the ff00::/8 range with specific allocations like IPv4.


## Multicast Distribution Trees
Distribution trees control the path multicast traffic takes through the network. The simplest is the Shortest Path Tree (SPT), which uses the shortest path between the source and receivers. The SPT is rooted at the source.
The SPT uses (S,G) state, where S is the source IP and G is the group address. Each source for a group has its own SPT. Below is an example SPT:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lw53yzm6z58vxsus9qvf.jpeg)
The second type of distribution tree is the shared tree, which uses a common root called the Rendezvous Point (RP). Source traffic goes to the RP over a source tree, then down the shared tree to receivers. The shared tree uses (*,G) state since all sources use the shared infrastructure.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jykjddhwwu1nlj2bwxsz.jpeg)
The advantage of SPTs is optimal paths, while shared trees require less state. However, shared tree latency can be higher.


## Multicast Forwarding
In multicast forwarding, the source sends traffic to a group of hosts. Routers track incoming and outgoing interfaces. They use Reverse Path Forwarding (RPF) to forward traffic away from the source to prevent loops.
RPF relies on the unicast routing table to determine upstream and downstream neighbors. A router forwards a multicast packet only if it arrives on the upstream interface. This check ensures delivery along a loop-free tree. Traffic passing the RPF check is forwarded, else it is dropped.
The RPF check logic:
- Check if the source is reachable via the input interface per the routing table
- If yes, traffic passes the RPF check and is forwarded
- If no, traffic fails the RPF check and is dropped

## IGMP
The Internet Group Management Protocol (IGMP) handles hosts joining multicast groups on a LAN. Routers use IGMP to learn group membership:
- Querier routers send queries to see if hosts want traffic
- Hosts send reports to confirm interest
IGMPv2 added a Leave Group message to reduce unwanted traffic. IGMPv3 supports source-specific groups and source filtering.


## Conclusion
IP multicast provides an efficient one-to-many transport model. Core concepts include multicast addressing, distribution trees, multicast forwarding with RPF checks, and IGMP for group management.
Multicast routing protocols like PIM build distribution trees between senders and receivers:
- PIM Dense Mode floods traffic then prunes branches
- PIM Sparse Mode starts with no flow and then builds shared trees

Multicast technologies enable scalable services like high-definition video streaming and software updates. Understanding the core concepts allows network engineers to effectively design, implement, and troubleshoot multicast networks.

This concludes our overview of IP multicast. The article covered addressing, forwarding, IGMP, distribution trees, and routing protocols. With this foundation, you can now configure and manage multicast services on real-world networks.


Read more at https://www.catchpoint.com/network-admin-guide/ip-multicast.