Multicast and Anycast Addresses in IPv4 and IPv6
How multicast group addresses are laid out in IPv4 (224.0.0.0/4 and its blocks) and IPv6 (ff00::/8 with flags and scopes), how they map to Ethernet addresses, how groups are allocated, and how anycast lets one unicast address be answered by the nearest of many servers.
kvi5hnuCode Sprout team member18 min readOn this page
Most addresses name one interface. Two kinds don't:
- A multicast address names a group. A packet sent to it is delivered to every interface that has joined the group, wherever members are, and the sender doesn't need to know who they are or how many.
- An anycast address is an ordinary unicast address configured in several places. A packet sent to it reaches one of them, normally the nearest one by routing.
This article covers how both kinds of address are written and allocated. How hosts join groups (with IGMP and MLD, the protocols hosts use to tell routers which groups they want) and how multicast traffic moves across a link come in articles 43 and 44.
Multicast basics
A sender transmits one copy of a packet to a group address. Routers and switches copy it only where there are members, so 1,000 receivers don't cost the sender 1,000 transmissions. Receivers join a group by telling their local router (and the operating system tells the network card which link-layer addresses to accept).
There are two service models:
- Any-source multicast (ASM), the original model: anyone may send to a group, and receivers join by group address alone.
- Source-specific multicast (SSM) (RFC 4607): a receiver joins a channel, written (S, G), meaning "group G, but only from source S". This avoids the hard problem of finding all senders of a group, so it's much simpler to run across networks.
On the public Internet, multicast between arbitrary sites basically doesn't exist; global multicast routing never became widely deployed. Multicast is very much alive inside networks, though: on every IPv6 link (neighbor discovery depends on it), for local service discovery (mDNS, multicast DNS, which lets devices find each other by name without a DNS server), in ISPs' (Internet service providers') IPTV networks, which deliver TV over IP, in trading systems that distribute market data, and in data-center and cluster protocols.
IPv4 multicast addresses
IPv4 multicast uses the old class D space, 224.0.0.0/4 (224.0.0.0 to 239.255.255.255). That leaves 28 bits for group numbers, about 268 million groups. The registry kept by IANA (the Internet Assigned Numbers Authority, which records protocol numbers; based on RFC 5771) divides it into blocks that are allocated and routed differently:
| Range | Use | Notes |
|---|---|---|
| 224.0.0.0/24 | Local network control | Never forwarded by routers. Examples: 224.0.0.1 all hosts, 224.0.0.2 all routers, 224.0.0.251 mDNS |
| 224.0.1.0/24 | Internetwork control | May be routed. Example: 224.0.1.1 NTP (the Network Time Protocol) |
| 224.0.2.0 – 224.0.255.255 | Ad hoc block I | Assigned to specific applications |
| 224.2.0.0/16 | SDP/SAP | Session announcements for multimedia sessions (the Session Description and Session Announcement Protocols) |
| 224.3.0.0 – 224.4.255.255 | Ad hoc block II | |
| 232.0.0.0/8 | Source-specific multicast | Only used as (S, G) channels |
| 233.0.0.0 – 233.251.255.255 | GLOP | A /24 for each 16-bit AS number |
| 233.252.0.0/14 | Ad hoc block III | 233.252.0.0/24 is for documentation |
| 234.0.0.0/8 | Unicast-prefix-based (UBM) | Groups derived from a unicast /24 or larger |
| 239.0.0.0/8 | Administratively scoped | Private to an organization, like RFC 1918 for multicast |
Most of the remaining space (parts of 224/8, and 225/8 to 231/8, 235/8 to 238/8) is reserved.
Two of these blocks hand out groups by formula, so nobody needs to ask a registry:
- GLOP (RFC 3180) puts a 16-bit autonomous system (AS) number (the number that identifies a network in Internet routing, see article 13) into the middle two bytes: AS X gets 233.high byte.low byte.0/24. It doesn't work for the newer 32-bit AS numbers.
- UBM (RFC 6034) puts a unicast prefix of /24 or shorter after 234: the owner of 198.51.100.0/24 gets the single group 234.198.51.100, and a /16 owner gets a /24 of groups. Shift a UBM group left by 8 bits and you find who owns it.
239.0.0.0/8 (RFC 2365) is the multicast counterpart of private addresses: an organization can use it internally, and routers at the edge block it. Two familiar examples in it are 239.255.255.250, used by SSDP (the Simple Service Discovery Protocol of UPnP, Universal Plug and Play) for device discovery, and the 239.255.0.0/16 "local scope".
Here are both formulas computed for documentation values (AS 64496 is a documentation AS number, RFC 5398), plus a check that the addresses are all multicast. For GLOP, 64496 in hex is fbf0 (251 × 256 + 240 = 64496), so the high byte is 251 and the low byte 240:
GLOP block for AS64496 (0xfbf0): 233.251.240.0/24
UBM block for 198.51.100.0/24: 234.198.51.100/32 (one group)
224.0.0.1 is_multicast=True
224.0.0.251 is_multicast=True
224.0.1.1 is_multicast=True
232.1.2.3 is_multicast=True
233.252.0.5 is_multicast=True
239.255.255.250 is_multicast=True
IPv6 multicast addresses
IPv6 relies on multicast much more heavily than IPv4. It has no broadcast at all, so jobs like address resolution use multicast instead (article 42). Multicast addresses are all in ff00::/8, and the next byte holds two 4-bit fields:
- Flags (
0RPT): T = 1 means a transient (dynamically assigned) group rather than a permanent one assigned by IANA. P = 1 means the group is based on a unicast prefix (below). R = 1 means a rendezvous point's address is embedded (below). The top bit is reserved. - Scope: how far the packet may travel. Routers enforce it, so a scope is a hard boundary, not a hint.
| Scope | Name | Meaning |
|---|---|---|
| 1 | Interface-local | Loopback only; never sent on the wire |
| 2 | Link-local | The local link |
| 3 | Realm-local | Defined by the network technology (RFC 7346) |
| 4 | Admin-local | The smallest scope set by administrators |
| 5 | Site-local | One site |
| 8 | Organization-local | Several sites of one organization |
| e | Global | Everywhere |
Values 0 and f are reserved, and the rest are unassigned or available to administrators.

Many permanent groups are defined once for every scope: the group ID is fixed and you choose the scope digit. For NTP the group ID is 101, so ff02::101 means "NTP servers on this link", ff05::101 "on this site" and ff0e::101 "anywhere". This is often written ff0x::101.
Some well-known IPv6 groups:
| Address | Group |
|---|---|
| ff01::1, ff02::1 | All nodes (interface-local, link-local) |
| ff02::2, ff05::2 | All routers |
| ff02::fb | mDNS |
| ff02::16 | MLDv2-capable routers (article 44) |
| ff02::1 | All DHCPv6 relay agents and servers |
| ff05::1 | All DHCPv6 servers in the site |
| ff02::1:ff00/104 | Solicited-node addresses (below) |
| ff3x::/32 | Source-specific multicast |
Here the lab decodes flags and scopes for a set of groups. The flags column shows the four flag bits and, in brackets, which of R, P and T are set. The scope is the digit right after ff, translated to its name:
ff02::1 flags 0000 (- ) scope 2 = link-local
ff02::2 flags 0000 (- ) scope 2 = link-local
ff02::fb flags 0000 (- ) scope 2 = link-local
ff02::1:ff00:5301 flags 0000 (- ) scope 2 = link-local
ff05::101 flags 0000 (- ) scope 5 = site-local
ff0e::101 flags 0000 (- ) scope e = global
ff3e::8000:1 flags 0011 (PT ) scope e = global
ff35:40:2001:db8:1::1 flags 0011 (PT ) scope 5 = site-local
Solicited-node addresses
Every IPv6 address a host has gives it a solicited-node group: ff02::1 followed by the last 24 bits of the address. For 2001:db8:1::10 that's ff02::1:ff00. When another host needs this host's link-layer address, it sends its neighbor solicitation (IPv6's "who has this address?" message) to this group instead of to every host on the link (article 42). Because the group depends only on the last 24 bits, a few addresses (for example a global and a link-local address with the same interface ID) usually share one group.
Here's the lab client's group list. ip maddr shows both the IP groups (inet and inet6) and the link-layer addresses the card is told to accept (link). Each link address is built from one of the groups by a formula shown later in this article: for example 33:33:00:00:00:01 belongs to ff02::1, and 01:00:5e:00:00:01 to 224.0.0.1:
12: eth0
link 33:33:00:00:00:01
link 01:00:5e:00:00:01
link 33:33:ff:00:01:10
link 33:33:ff:00:00:10
inet 224.0.0.1
inet6 ff02::1:ff00:10
inet6 ff02::1:ff00:110
inet6 ff02::1
inet6 ff01::1
The client is automatically in 224.0.0.1 (all IPv4 hosts), ff02::1 and ff01::1 (all IPv6 nodes), and one solicited-node group for each distinct 24-bit address ending: ff02::1:ff00:10 for 2001:db8:1::10, and ff02::1:ff00:110 for its link-local address, whose interface ID ends in 00:01:10.
Groups derived from unicast prefixes
Like IPv4's UBM, IPv6 lets a unicast prefix owner build globally unique groups without asking anyone (RFC 3306). With P and T set, the address carries the prefix length and up to 64 bits of the unicast prefix, followed by a 32-bit group ID. The owner of 2001:db8:1::/64 can use ff3x:40:2001:db8:1:0:gggg for any scope x, where 40 is hex for 64. With the prefix length and prefix set to zero, you get ff3x::/32, the SSM range.
Two variations build on this:
- Link-scoped groups from an interface ID (RFC 4489): for link-local or smaller scopes, the prefix-length byte is 255 (ff) and the host's 64-bit interface ID goes where the prefix would be. A host can create unique groups without any coordination, even on a link with no router.
- Embedded rendezvous point (RFC 3956): sparse-mode multicast routing (PIM-SM, Protocol Independent Multicast in Sparse Mode) needs a rendezvous point (RP), a router where senders and receivers meet. With R set, the group address carries the RP's address: take the prefix, add the 4-bit RIID (rendezvous point interface ID) as the last digits, and you have it. Here's the example from the diagram worked out:
group ff75:940:2001:db8:dead:beef:f00d:face: RIID 9, prefix length 64, embedded RP address 2001:db8:dead:beef::9
From multicast IP to Ethernet addresses
A multicast packet on Ethernet needs a multicast destination MAC address (the hardware address in the Ethernet header, article 14) that every member's network card will accept. Both IP versions build it from the group address by formula:
- IPv4: 01:00, then a 0 bit, then the low 23 bits of the group (RFC 1112).
- IPv6: 33 followed by the low 32 bits of the group (RFC 2464).

Take 239.1.2.3. In binary it's 11101111 00000001 00000010 00000011. The first 4 bits (1110) are the same for every multicast address, and the next 5 are dropped. The low 23 bits are 0000001 00000010 00000011, which is 01:02:03 in hex, so the MAC address is 01:00:5e:01:02.
IPv4 loses 5 bits, so 32 groups share each MAC address (2⁵ = 32). The network card may accept frames for groups the host never joined, so the IP layer checks the full group address. It's also why administrators avoid groups like 239.0.0.x and 239.128.0.x: they map to the same MACs as 224.0.0.x, which snooping switches (switches that track group membership, see the callout below) flood to every port, so their traffic would be flooded too.
In the lab, two hosts on the server-side network join 239.1.2.3 and the router sends one datagram to the group. Both receive it. While the server is a member, its card also accepts 01:00:5e:01:02, as the first two lines (from ip maddr on the server) show:
link 01:00:5e:01:02:03
inet 239.1.2.3
r1 sent 1 datagram to 239.1.2.3
server received b'one datagram, two receivers' from 198.51.100.1
dns received b'one datagram, two receivers' from 198.51.100.1
How multicast addresses are allocated
Group addresses get assigned in three ways:
- Statically by IANA, for groups that software hard-codes, such as 224.0.0.251 and ff02::fb for mDNS. Global static IPv4 groups are scarce and only go to protocols any site might use.
- By formula from something the organization already owns: GLOP from an AS number, UBM and RFC 3306 groups from a unicast prefix, and RFC 4489 groups from an interface ID.
- Locally, from scoped ranges that can be reused in every network: 239/8 in IPv4 and IPv6 scopes smaller than global. An administrator picks them, or applications pick them at random.
The guidelines are RFC 5771 for IPv4 and RFC 3307 for IPv6, and RFC 6308 describes the overall architecture. SSM can use the 232/8 and ff3x::/32 ranges, and because a channel is identified by both source and group, two sources can use the same group number without clashing.
Anycast addresses
An anycast address looks exactly like a unicast address. The difference is that the same address is configured on several servers in different places, and each location's routers advertise a route to it. Each sender's routers pick the best route they know, so each sender reaches the nearest instance in routing terms. If one instance fails, its route is withdrawn and traffic flows to the next-nearest one, without clients changing anything.

The lab builds exactly this: two UDP servers both use 203.0.113.53, and each router prefers its local copy. Each client asks the anycast address which instance answered:
cA (192.0.2.10) -> 203.0.113.53 answered by instance X (near rA)
cB (192.0.2.140) -> 203.0.113.53 answered by instance Y (near rB)
Router rA has two routes to the anycast address. The one with the lower metric (10) wins, and it points out of srv, the interface toward instance X. The backup with metric 100 goes out of core toward rB:
203.0.113.53 via 203.0.113.1 dev srv metric 10
203.0.113.53 via 198.51.100.1 dev core metric 100
When instance X fails and rA's route to it is removed (on the Internet, its announcement in BGP, the routing protocol networks use to tell each other about address blocks, would be withdrawn), cA's next query goes to instance Y:
203.0.113.53 via 198.51.100.1 dev core metric 100
cA (192.0.2.10) -> 203.0.113.53 answered by instance Y (near rB)
cB (192.0.2.140) -> 203.0.113.53 answered by instance Y (near rB)
Anycast is everywhere in Internet infrastructure:
- All 13 DNS root server identities are anycast, served from well over a thousand sites around the world, and so are most large DNS providers and public resolvers.
- CDNs (content delivery networks, which serve websites from many locations) and protection services against DDoS (distributed denial-of-service) attacks anycast their addresses so that users reach a nearby data center and attack traffic is spread across many sites.
- Some protocol helpers have well-known anycast addresses, such as the PCP (Port Control Protocol) and TURN (a relay service for traffic that can't get through NAT) anycast addresses in 192.0.0.0/24 (article 11). The old 6to4 relay anycast address 192.88.99.1 was deprecated in 2015 (RFC 7526).
Anycast works best for short exchanges such as DNS over UDP. A long TCP connection could break if routing changes mid-connection and later packets reach a different instance, which has no record of the connection. In practice routes are stable enough that CDNs run TCP over anycast routinely, and operators follow the guidance in RFC 4786 to keep it that way.
IPv6's built-in anycast
IPv6 defines one anycast address on every subnet: the subnet-router anycast address, which is the subnet prefix with an all-zero interface ID (RFC 4291). Every router on the subnet must answer it. Linux routers install it automatically, as anycast routes in the local table. Here are router r1's (one for each of its subnet prefixes, plus fe80:: for the link-local prefix on every interface), and a ping from the client to 2001:db8:1:: that r1 answers:
anycast 2001:db8:1:: dev eth0 proto kernel metric 0 pref medium
anycast 2001:db8:2:: dev br1 proto kernel metric 0 pref medium
anycast fe80:: dev eth0 proto kernel metric 0 pref medium
anycast fe80:: dev br1 proto kernel metric 0 pref medium
anycast fe80:: dev s0 proto kernel metric 0 pref medium
anycast fe80:: dev s1 proto kernel metric 0 pref medium
PING 2001:db8:1:: (2001:db8:1::) 56 data bytes
64 bytes from 2001:db8:1::1: icmp_seq=1 ttl=64 time=462 ms
The reply comes from r1's unicast address 2001:db8:1::1, not from the anycast address. That's normal, and it's why anycast is usually used with protocols that don't care which reply address they get. Don't read anything into the 462 ms: this lab adds no link delay. The ping was sent immediately after the lab created the addresses, so it waited while the hosts were still setting up their interfaces and resolving each other with Neighbor Discovery (article 42). Repeating the ping a moment later gives about 0.1 ms.
Common questions
Can I receive multicast from the Internet?
Usually not. Global multicast routing between ISPs was never widely deployed. Some networks bridge the gap with AMT (Automatic Multicast Tunneling, RFC 7450), which tunnels multicast over unicast to receivers on networks that don't support it.
Why does ff02::1 work on every IPv6 link without configuration?
Every IPv6 node joins the all-nodes group automatically on every interface, and the scope 2 keeps packets to that group on the link. Pinging ff02::1 with an interface (ping ff02::1%eth0) gets a reply from every IPv6 host on the link.
What's the difference between anycast and load balancing?
Anycast lets routing pick a destination: every instance shares one address, and each client reaches the nearest one. A load balancer is a device or service at one address that spreads connections over several servers behind it. Large services often combine both: anycast to reach a nearby site, then load balancers inside it.
Why does IPv6 have no broadcast?
Broadcast disturbs every host on a link even when only one needs the message. IPv6 uses specific multicast groups instead, such as solicited-node groups for address resolution, so most hosts can ignore most traffic in their network card.
Is 224.0.0.0/24 safe to use for my own application?
No. It's reserved for local network control protocols, and routers never forward it. For a private application, pick a group in 239.0.0.0/8, or request an assignment if the application will be used across the Internet.
Do switches forward multicast to every port?
Without IGMP or MLD snooping, yes: they treat multicast like broadcast. With snooping, they learn which ports have joined each group and forward traffic only there. Groups in 224.0.0.0/24 are always flooded, since their control protocols must reach every router.
Summary
- Multicast sends one packet to a group. ASM accepts any sender. SSM joins a (source, group) channel and is simpler to operate. Multicast is common inside networks but rare across the Internet.
- IPv4 multicast is 224.0.0.0/4: 224.0.0/24 is link-local control (never forwarded), 232/8 is SSM, 233/8 is GLOP (from 16-bit AS numbers), 234/8 is UBM (from unicast /24s), and 239/8 is administratively scoped.
- IPv6 multicast is ff00::/8, with flags (0RPT) and a scope digit (1 interface, 2 link, 4 admin, 5 site, 8 organization, e global). Permanent groups often exist in every scope, such as ff0x::101 for NTP.
- Every IPv6 address has a solicited-node group, ff02::1 plus its last 24 bits, used for address resolution.
- Unicast-prefix-based groups (P flag) give prefix owners their own groups, ff3x::/32 is the SSM range, and embedded-RP groups (R flag) carry the rendezvous point's address.
- On Ethernet, IPv4 groups map to 01:00 plus their low 23 bits (32 groups per MAC), and IPv6 groups to 33 plus their low 32 bits.
- Anycast puts one unicast address in many places, so routing delivers each sender to the nearest instance and fails over automatically. DNS roots and CDNs depend on it. IPv6 gives every subnet a subnet-router anycast address,
prefix::.
Practice questions
1. Which Ethernet address does a host listen on after joining 239.200.10.20?
Answer
Take the low 23 bits: the second byte 200 is c8 in hex, and dropping its top bit gives 48. The third and fourth bytes are 0a and 14. The address is 01:00:5e:48:0a.
2. Which other IPv4 group in 224.0.0.0/24 shares a MAC address with 239.128.0.251?
Answer
224.0.0.251 (mDNS). 128 is 80 in hex, and its top bit is dropped, so the low 23 bits are the same as 0.0.251. Both map to 01:00:5e:00:00.
3. What is the solicited-node group for 2001:db8:2::a1b2?
Answer
ff02::1 followed by the last 24 bits, b2, which gives ff02::1:ffb2.
4. What does the scope digit of ff08::101 mean, and who receives packets sent to it?
Answer
Scope 8 is organization-local. The group ID 101 is NTP, so the packet reaches NTP servers that joined the group anywhere within the organization's multicast boundary.
5. Which GLOP block belongs to AS 64511?
Answer
64511 is fbff in hex, so the block is 233.251.255.0/24.
6. Is ff3e::1234 a permanent group?
Answer
No. The flag digit 3 sets P and T, so it's a dynamically assigned group, and with the prefix length and prefix all zero it's in the SSM range ff3x::/32. The scope e means global.
7. A DNS provider serves its resolver address from 50 cities. A user's ISP connects to the provider in two of them. Which one answers the user's queries?
Answer
Whichever site the ISP's routers consider best by their BGP policy and path selection. That's usually the nearest, but not always: routing chooses by policy and AS path, not by geographic distance.
Previous: Special-Use Addresses: Private, Loopback, Link-Local, Documentation and Shared Ranges
Next: Who Gets Addresses: Registries, IPv4 Exhaustion, Provider Assignments and Multihoming

More in TCP/IP Course
Quiz: TCP/IP Delicate Details
Twenty-five questions on the details that catch out experienced engineers: sequence numbers for SYN and FIN, TIME_WAIT versus tcp_fin_timeout, Karn's algorithm, socket buffer doubling, even and odd ephemeral ports, IPv6 checksums and fragmentation, negative DNS caching, and capture filter traps.
Quiz: TCP/IP Interview Questions
Thirty-three networking questions of the kind asked in developer, SRE and network engineering interviews: what happens when you load a URL, TCP versus UDP, handshakes, closing and TIME_WAIT, subnetting, NAT, DNS, MTU problems, congestion, TLS and QUIC, and debugging slow or failing connections.
Quiz: TCP/IP Course Final Exam (All Parts)
The final exam for the TCP/IP course: thirty questions across all fourteen parts, from packets and addressing through Ethernet, ARP, IP, DHCP, NAT, ICMP, UDP, DNS, TCP connections, reliability, congestion control, security, QUIC and troubleshooting.
Quiz: Modern Transports and Troubleshooting (TCP/IP Part 14)
Review modern transports and troubleshooting: QUIC packets, handshakes, 0-RTT, streams and connection migration, HTTP/3, Multipath TCP, SCTP multihoming, and a layered method for diagnosing real network faults.
Discussion
Sign in to ask a question or share what you learned.