Ray Patrick Soucy

IP Multicast Explained

IP multicast addressing often confuses people.  So here is a breakdown of what you need to know to get started.

This document assumes that you know what IP multicast is.  The focus here is usage and deployment.

Addressing

IP multicast makes use of addresses 224.0.0.0 through 239.255.255.255.  Many of these addresses are reserved or assigned for other purposes, such as routing protocols.

Essentially, there are only three ranges of IP multicast addresses that may be used by the public.

The first two are defined by RFC 2365 and can be used on any network.  They are Administratively Scoped IP multicast addresses.

Organization-Local Scoped addresses are used for multicast that crosses one or more gateway to reach its destination (e.g. every network within and organization).

Site-Local Scoped addresses are for use on a single LAN, that is to say they will not cross a gateway to reach another network.  Unless you are using a multicast routing protocol, such as PIM-SM, you should be using this scope.

The third available address range is Globally Scoped as defined by RFC 3180.  This range can only be used by networks that have registered a unique AS number with their regional addressing authority (ARIN in North America).

This address scope provides 255 useable addresses (the last octet) that are guaranteed to be globally unique to each AS holder.

The prefix for this scope is determined by inserting your 16-bit AS number in place of the 2nd and 3rd octets.  For example, 233.i.j.0 to 233.i.j.255, where i.j is replaced by your AS number.  64496 in 16-bit binary would be 1111101111110000, when split into two 8-bit segments: 11111011 11110000, or 251 and 240 in decimal. This results in a Global Scope address range of 233.251.240.0 to 233.251.240.255 for AS 64496.

Global Scope IP multicast addressing is only relevant if you are connected to a service provider that provides global IP multicast transit.

IP Multicast Routing

Though there are several multicast routing protocols, the most widely used is PIM-SM, or Protocol Independent Multicast Sparse Mode, and is the only IP multicast routing protocol currently supported by the XORP project.

PIM is protocol independent in the sense that it builds its network topology by using other routing protocols such as RIP or BGP.

A multicast group is synonymous with a multicast IP address.  Or rather, the group ID of a multicast group is the multicast IP address.

Using PIM-SM when a host expresses interest in joining a multicast group, it does so using IGMP.  For each network, a single router is elected to be the Designated Router, or DR, for the network.

When an IGMP message is seen by the DR it then uses PIM to send a message to the Rendezvous Point, or RP, for the multicast group.

The RP is a PIM-SM router that has been designated (configured) to act as the coordinator for a multicast group, usually for an entire group prefix.

When there are no longer any receiving hosts on a network for a multicast group, the DR issues a message to the RP to stop sending group traffic.

Hosts sending to a multicast group have their traffic encapsulated into PIM by the DR and directed to the RP for the group.  When the traffic is received by the RP, it is decapsulated and forwarded to the DR(s) for each network participating in the group.

PIM-SM routers need to know the address of the RP for each multicast group they wish to route traffic for.  This is achieved by designating group prefixes for each RP.  Each RP group prefix should be with the Organization-Local Scope range of multicast addresses, 239.192.0.0 to 239.251.255.255.

Only group identifiers that fall within a group prefix that has a registered RP in the PIM domain will be routed.

A more detailed explanation, and information on configuring PIM-SM for XORP is available in the XORP manual.  As of version 1.6 XORP PIM-SM is ready for production use.

Layer-2 Addressing and Multicast on the LAN

Routed IP multicast depends on IGMP, which operates in Layer-3 space.

IGMP operates by hosts participating in a IP multicast group announcing their participation.  This allows for routers to determine if any hosts on a network are interested in a particular multicast group.

On the Ethernet (Layer-2) side of things, each IP multicast group address is mapped to a special Ethernet address, rather than sent using the Ethernet broadcast address of FF-FF-FF-FF-FF-FF (as many assume).

This address is derived from a base of 01-00-5E-00-00-00 with the last 23 bits of the address replaced by the last 23 (low order) bits of the group address.  This means that there is ambiguity in packet delivery.  If two groups on the same network differ only in the last 23 bits they will each receive packets for both groups.

On the LAN, network hubs were originally used in Ethernet networks to repeat transmission from one host to all others connected.  As networks grew in size and traffic, it became clear that more intelligence was needed in packet delivery; otherwise each host would become overwhelmed by traffic directed to it as networks scaled.

The solution to this was the network switch.  A network switch works by building a table of Ethernet source address to port associations.  If a source address is in the table, it only sends packets for the address of the host to the port it was seen on.  If an address isn't in the table it is forwarded to all ports on the switch until a host responds with that address as its source and an entry is created in the forwarding table.

In IP multicast, packets are sent to an Ethernet address that will never be used as a source address in an Ethernet frame.  This means that multicast Ethernet addresses never make it into the forwarding table for a switch, essentially making the switch a Hub for these packets.

For large networks this can be disastrous, as large multicast streams can be flooded across the entire LAN.

For this reason, it is important to know if your network switches support a feature called IGMP snooping before you attempt to use IP multicast.

IGMP snooping is a process where a network switch observes IGMP packets and builds a table of multicast group memberships.  This allows the switch to selectively send multicast packets only to hosts that are members of the multicast group; providing a solution to the problem above.

Unfortunately, most consumer-grade and SMB switches do not support IGMP snooping.  While it isn’t a problem for networks that make use of a single switch and only a handful of hosts, it can quickly escalate to a traffic storm for multi-switch networks.