A television channel, a market-data feed or a software image going to a thousand machines: the same bytes, wanted by many receivers at once. Multicast sends each packet across each link once and lets the routers copy it only where the paths to the receivers split. This chapter is about how routers learn who is listening, how they build the tree that carries the copies, and the one check that keeps that tree from turning into a storm.
Common mix-up: the multicast routing check looks backwards. A unicast router asks "where is the destination?" and looks up the destination address. A multicast router first asks "did this packet arrive on the interface I would use to reach its source?" and looks up the source address. If the answer is no, the packet is dropped, however correct its destination looks.
This chapter assumes you know how group addresses fit into the IPv4 and IPv6 address space, which IP addresses on networks.jelia.nyc covers, and what a broadcast domain is, which Ethernet on networks.jelia.nyc covers. Here we go past the address ranges and into the routers.
There are four ways to get one stream to many receivers. Replicated unicast is what most of the internet does: the sender opens one connection per viewer and sends a separate copy to each. It is simple and works everywhere, but the sender's link carries N copies, and so does every link that several of those copies share. Broadcast sends one copy to every host on a link, wanted or not, and stops at the first router. Multicast sends one copy addressed to a group; routers forward it only toward links where someone has asked to receive that group, and copy it only where the tree branches. Anycast, which route selection touches on, is the opposite case: one of many servers answers one client.
The saving is easy to state. Under replicated unicast, every link carries one copy for each receiver whose path crosses it. Under multicast, every link on the tree carries exactly one copy.
Worked example. A 5 Mb/s video channel goes to 2,000 set-top boxes behind one headend router. Replicated unicast puts 2,000 × 5 = 10,000 Mb/s, ten gigabits a second, on the headend's uplink. Multicast puts 5 Mb/s on it, plus one copy on each downstream link that has at least one viewer. That ratio is why every IPTV operator runs multicast inside its own network, even though the public internet does not.
| Method | Copies on the sender's link | Who gets it | Crosses routers? |
|---|---|---|---|
| Replicated unicast | N, one per receiver | Exactly the N receivers | Yes, everywhere |
| Broadcast | 1 | Every host on the link | No |
| Multicast | 1 | Hosts that joined the group | Yes, where multicast routing runs |
| Anycast | 1 | One nearest server of many | Yes |
RFC 1112, published in August 1989, set out the model that still holds. A multicast address does not name a machine; it names a host group, a set of zero or more receivers that can change at any time. Anyone may send to a group without joining it. Receivers join and leave on their own, and the sender never learns who they are. In IPv4 the groups live in 224.0.0.0/4, the old "class D", from 224.0.0.0 to 239.255.255.255. IANA divides it further.
| Block | Name | What it is for |
|---|---|---|
| 224.0.0.0/24 | Local network control | Link-local protocol traffic, never forwarded by routers whatever the TTL: 224.0.0.1 all systems, 224.0.0.2 all routers, 224.0.0.5 and .6 OSPF, 224.0.0.13 all PIM routers, 224.0.0.22 IGMPv3 reports |
| 224.0.1.0/24 | Internetwork control | Protocol groups that may be routed, such as NTP's 224.0.1.1 |
| 232.0.0.0/8 | Source-specific multicast | Groups that only make sense together with a named source, (S,G); RFC 4607 |
| 233.0.0.0/8 | GLOP | Static groups derived from a 16-bit AS number |
| 239.0.0.0/8 | Administratively scoped | Private groups that an organization keeps inside its own boundary, the multicast cousin of 10.0.0.0/8; RFC 2365 |
IPv6 builds scope into the address itself. Every multicast address starts with FF, then a flags nibble and a scope nibble. FF02::1 is all nodes on this link; FF05::2 is all routers in this site; FF0E:: addresses are global. RFC 4291 defines the scopes, and RFC 4607 sets aside FF3x::/32 for source-specific use. A router never forwards a packet beyond the scope its address names, which makes the boundary a property of the address and not of a filter someone has to remember to write.
On a LAN a multicast IP packet still needs a destination MAC address, and that address has to be computable without ARP, since no single host owns the group. RFC 1112 fixed the rule: take the Ethernet prefix 01:00:5E, set the next bit to zero, and copy the low 23 bits of the group address into the remaining 23 bits. A group has 28 significant bits, so 5 bits are simply thrown away, and 25 = 32 different groups land on every MAC address. A host's network card filters on the MAC, so a host that joined 239.1.1.1 will also hear 224.1.1.1, 225.129.1.1 and 29 others, and its IP stack has to discard the unwanted ones. IPv6 uses 33:33 followed by the low 32 bits of the group, per RFC 2464.
IANA holds one IEEE organizationally unique identifier, 00-00-5E, which gives it 224 multicast MAC addresses, 01-00-5E-00-00-00 to 01-00-5E-FF-FF-FF. RFC 7042 records how they are used: only the lower half, 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF, is assigned to IPv4 multicast. Half of a 24-bit space is a 23-bit space, so 23 bits of the group are all that fit; part of the upper half went to MPLS multicast. The cost is the 32-to-1 overlap, which matters most when two busy applications pick groups that collide: a switch filtering on MAC cannot tell them apart. Choosing groups that differ in their low 23 bits avoids it.
Type an IPv4 group (224.0.0.0 to 239.255.255.255) or an IPv6 multicast address (starting FF). The mapper classifies it, draws which bits survive into the Ethernet address, and, for IPv4, lists all 32 groups that end up on the same MAC.
A router does not need to know every receiver. It needs to know, for each of its LAN interfaces, whether at least one host there wants a group. Hosts tell it with IGMP, the Internet Group Management Protocol, in IPv4, and with MLD, Multicast Listener Discovery, in IPv6. The conversation has three moves.
IGMPv2 lets a host say only "I want group G". IGMPv3, first published as RFC 3376 in 2002 and now specified by RFC 9776 (March 2025), lets it say "I want G, but only from these sources" (INCLUDE mode) or "I want G from anyone except these" (EXCLUDE mode). That source list is what makes source-specific multicast possible. IGMPv3 reports all go to 224.0.0.22, which every IGMPv3 router listens to. MLDv2, RFC 3810 (June 2004), is the same design for IPv6, carried inside ICMPv6.
Membership is soft state: it lasts only as long as hosts keep answering queries. The timers come from RFC 9776.
| Timer | Default | What it does |
|---|---|---|
| Robustness Variable | 2 | How many lost packets the protocol tolerates: messages that matter are sent this many times |
| Query Interval | 125 s | Time between general queries from the querier |
| Query Response Interval | 10 s | The longest a host may wait before answering a general query |
| Group Membership Interval | 270 s | How long a router keeps a group alive with no reports |
Between the router and the hosts there is usually a switch, and a plain switch floods multicast frames out of every port, like broadcast. IGMP snooping fixes that: the switch reads the IGMP reports passing through it and forwards each group only to the ports where a report was heard, plus the port toward the router. RFC 4541 describes how switches should do it.
An IGMPv3 report carries any number of group records. Each record names a group, a record type and a list of sources. The six types say either what the host's state is (in reply to a query) or how it has just changed.
| Type | Name | Meaning |
|---|---|---|
| 1 | MODE_IS_INCLUDE | Current state: I want G only from the listed sources |
| 2 | MODE_IS_EXCLUDE | Current state: I want G from all sources except those listed |
| 3 | CHANGE_TO_INCLUDE_MODE | I have switched to INCLUDE; an empty list here means "I am leaving G" |
| 4 | CHANGE_TO_EXCLUDE_MODE | I have switched to EXCLUDE; an empty list here is the old "join G from anyone" |
| 5 | ALLOW_NEW_SOURCES | Add these sources |
| 6 | BLOCK_OLD_SOURCES | Stop sending me these sources |
The router merges every host's records into one state per group per interface. If any host is in EXCLUDE mode, the interface is in EXCLUDE mode, because some host wants traffic from sources nobody has listed. The merge rules fill several pages of RFC 9776.
A unicast router forwards a packet out of one interface, chosen by its destination. A multicast router may forward one packet out of many. That is the whole point, and also the danger: in any network with a loop, a router that copies a packet to all its neighbors will soon receive the copies back from them and copy those too. Without a rule, the copies multiply until links saturate.
The rule is the reverse-path forwarding check, or RPF check. For each arriving multicast packet, the router looks up the packet's source address in its ordinary unicast routing table and finds the interface it would use to send a packet back to that source. That is the RPF interface. If the packet arrived on it, the router accepts and forwards it. If the packet arrived on any other interface, the router drops it.
Why does this stop loops? Every router's RPF interface points one step closer to the source along a shortest path, so following RPF interfaces from any router always ends at the source and never goes round in a circle. Together they form a tree rooted at the source: the reverse shortest-path tree. A packet is accepted only when it travels down that tree, and a packet that has gone round a loop is, by definition, not on the tree when it comes back, so it is dropped the first time it arrives somewhere off the tree.
Notice what the check borrows. It never asks a multicast protocol where the source is; it uses whatever unicast table the router already has, filled by OSPF, IS-IS, BGP or static routes. That is the "protocol independent" in Protocol Independent Multicast. It also means a broken unicast table breaks multicast: if the route back to a source points somewhere the multicast traffic does not come from, every packet fails RPF and is silently dropped. "My stream reaches the router but goes no further" is very often an RPF failure.
Sometimes the path you want multicast to arrive on is not the path unicast uses back to the source, for example when a separate link carries only video. Routers let you install routes used only for RPF: static multicast routes, or a separate address family learned through Multiprotocol BGP (the IPv4 multicast SAFI). The check stays the same; only the table it looks in changes. On a shared LAN where two routers could both forward the same stream onto it, PIM runs an Assert election so only one does, with the router holding the better route back to the source winning and the highest address breaking ties (RFC 7761).
Source S sits behind R1. Each router has run Dijkstra over the link costs shown and found its route back to S; the cobalt arrow on each router points out of its RPF interface. Press Send to flood one packet: every router that accepts a copy forwards it out of all its other links, round by round. Each copy is RPF-checked on arrival. Then switch the RPF check off and send again. Click or tap a link (or pick it from the list) to change its cost and see whose RPF interface moves.
Flooding with an RPF check delivers everything everywhere exactly once, and that was the first design: PIM dense mode (RFC 3973) floods each new source's traffic to every router, and routers with no interested receivers send a Prune back upstream. Prunes expire after a few minutes, and unless optional State Refresh messages keep them alive, the flood starts again. That is fine when most links have listeners. When listeners are sparse, which is almost always, it wastes bandwidth and fills every router with state for every source.
PIM sparse mode, specified in RFC 7761 (March 2016), turns it around: nothing is sent anywhere until someone asks. Its problem is that receivers know a group but not who is sending to it. The answer is a meeting place, the rendezvous point or RP: one router that every router in the domain agrees is the root for a group. Sparse mode works in three phases.
When to switch is a local policy: RFC 7761 leaves it to the implementation. Many routers switch on the first packet; some can be told never to switch. All this state is soft: PIM routers resend their joins every 60 seconds, and state that is not refreshed expires. Neighbors find each other with Hellos to 224.0.0.13 every 30 seconds, and all PIM messages travel as IP protocol 103.
| State | Read as | Incoming interface | Built by |
|---|---|---|---|
| (*,G) | Group G, any source | RPF interface toward the RP | Joins from receivers' routers |
| (S,G) | Group G, from source S only | RPF interface toward S | Joins from the RP or from routers switching to the shortest path |
| (S,G,rpt) | Source S on G's shared tree | The shared tree's | Prunes that remove S from parts of the shared tree |
Every router must map each group to the same RP, or the trees never meet. There are three common ways. Static configuration: the same RP address typed into every router. The Bootstrap Router mechanism (RFC 5059): candidate RPs advertise themselves to an elected bootstrap router, which floods the list through the domain, and every router runs the same hash over the group address to choose among candidates, the highest hash winning and the highest address breaking ties (RFC 7761). And anycast RP (RFC 4610): several routers share one RP address, unicast routing sends each join to the nearest, and the RPs tell each other about their sources. The last one gives the RP redundancy without any multicast-specific failover.
Pick which hosts join the group, choose the RP, then flip between the shared tree and the shortest-path tree. The builder computes each router's unicast routes with Dijkstra, sends the joins along the RPF paths, applies the (S,G,rpt) prunes, and then forwards one packet from S through the resulting state using PIM's rules, RPF check included. The table shows every router's state; the readout compares the copies multicast sends with what one unicast stream per receiver would cost.
Solid cobalt links: copies forwarded by (S,G) state. Dashed amber: copies forwarded by (*,G) state on the shared tree. Thin dashed grey marked "pruned": a shared-tree branch that keeps (*,G) state but no longer carries S. "×2" marks a link that carries the same packet twice, once each way. In the (S,G) column, the outgoing list includes the (*,G) interfaces the router inherits.
| Router | (*,G) in → out | (S,G) in → out | Notes |
|---|
Most of PIM sparse mode's machinery, the RP, registers, the switchover and the (S,G,rpt) prunes, exists to solve one problem: receivers do not know who the source is. For most real applications they do. A television channel has one encoder, a market-data feed has a known publisher, and a receiver can be told the source address along with the group in the channel guide or configuration.
Source-specific multicast, RFC 4607 (August 2006), uses that. A receiver asks for a channel, the pair (S,G), with an IGMPv3 or MLDv2 INCLUDE report. Its router sends an (S,G) Join straight toward S, building the shortest-path tree from the start. There is no RP, no shared tree, no register and no switchover. Two different sources can use the same group number without colliding, because the channel is the pair. And an outsider cannot inject traffic into a channel by sending to G, because routers forward only what comes from S along the RPF path to S.
SSM uses 232.0.0.0/8 in IPv4 and FF3x::/32 in IPv6. Routers apply SSM rules to those ranges: they never build (*,G) state there. The price is that every receiver's host stack and every last-hop router must speak IGMPv3 or MLDv2.
| PIM sparse mode (any-source) | Source-specific multicast | |
|---|---|---|
| Receiver asks for | G | (S,G) |
| Rendezvous point | Required, agreed domain-wide | None |
| Trees | Shared tree, then optional shortest-path tree | Shortest-path tree only |
| Host protocol | IGMPv2 or later, MLDv1 or later | IGMPv3, MLDv2 |
| Address range | Most of 224/4 and FF00::/8 | 232/8 and FF3x::/32 |
Multicast thrives inside networks run by one organization that controls every router and has a real one-to-many problem. Telecom operators deliver IPTV channels to set-top boxes with it. Stock exchanges publish market data as multicast feeds, because the alternative, sending each subscriber a separate copy, would put some subscribers microseconds behind others. Financial firms, broadcast studios moving uncompressed video, and data centers distributing operating-system images or keeping cluster software in step use it for the same reason. Routing protocols themselves use link-local groups every second, as the OSPF and PIM addresses above show.
Across the public internet, multicast never became a general service. RFC 5110 (January 2008), an overview of inter-domain multicast, lays out why it is hard. Each network on the path has to run PIM, agree on RPs or share source information between domains, keep per-group and per-source state in its routers, and accept traffic whose volume it cannot easily bill for or control. A network that skips any of this breaks delivery for everyone behind it. Meanwhile replicated unicast from content delivery networks, with caches placed close to viewers, got cheap enough to carry video at internet scale. The experimental global multicast backbone of the 1990s, the MBone, was built as tunnels over networks that did not support multicast, which shows the gap from the start.
In data-center overlays, where one virtual network may need to flood a frame to all its endpoints, the same choice appears again: an underlay running PIM, or replication by the edge device. That trade-off belongs to data-center fabrics.
MSDP, the Multicast Source Discovery Protocol (RFC 3618, October 2003, Experimental), connects the RPs of different domains. When an RP learns of a new source through a Register, it sends a Source-Active message to its MSDP peers in other domains, which flood it on with an RPF check of their own. An RP that has receivers for that group can then join the source's tree across the boundary. MSDP is also how anycast RPs inside one domain have often learned of each other's sources.
BIER, Bit Index Explicit Replication (encapsulation in RFC 8296, January 2018), removes per-group state from the middle of the network. The ingress router writes a bit string into the packet header with one bit for each egress router that should receive it. Each router looks up which neighbors lead to which bits, copies the packet once per neighbor and clears the bits the other copies will handle. Core routers need only unicast-style forwarding tables, however many groups exist, at the cost of a header whose size grows with the number of egress routers in a set.