All lessons are free · No login · No trackingStart learning

Network Stories 21 · Beginner

Unicast, Broadcast, Multicast & Anycast

Two TVs want to watch the same live match. Should we send two copies, or one copy to the whole house?

Starring: Pip, Rue, Octo, MacAbout 10 min read

Recommended first: Lesson 3, Lesson 4, Story 1: “Switch Basics”

1. The Story

Press "Next" to go through it step by step. At each step, a character appears and explains what they are doing.

Prologue: a quick review

Step 1 of 10

Unicast: one to one

Normally my backpack names one receiver, for example the TV. This is called Unicast: one to one.

Animation text version (all steps)
  1. Prologue: a quick review
  2. Unicast: one to one · Pip: Normally my backpack names one receiver, for example the TV. This is called Unicast: one to one.
  3. Broadcast: one to all · Octo: Sometimes Mac needs to ask the whole house a question, like ARP's "Who is 192.168.1.1?". The receiver is FF:FF:FF:FF:FF:FF, so I copy it and send it out of every Port. This is called Broadcast: one to all.
  4. Act 1: Everyone wants to watch the live match
  5. Two devices, one match · Mac: There's a live football match tonight. The TV and the desktop computer both want to watch it, but I need to do my homework in peace, so I do not want the live stream.
  6. Method 1: Unicast, one copy each · Rue: With Unicast, every device that wants to watch needs its own copy. If 2 are watching, 2 identical copies of the live stream have to travel from the Internet to me; if 100 are watching, 100 copies!
  7. Method 2: Broadcast, the whole house gets it · Rue: With Broadcast only one copy is sent, but even Mac, who doesn't want to watch, has to receive it. The bigger problem: Broadcasts cannot pass through a Router, so the live stream from the Internet could never get in at all.
  8. Act 2: One to a club
  9. Sending to a group · Pip: A new method: Multicast! My receiver isn't one device but a group, 233.252.0.1, like a "football club". From the Internet to Rue, only one copy needs to travel.
  10. Groups have MAC Addresses too · Octo: Inside the LAN, Pip's receiver MAC Address becomes 01:00:5E:7C:00:01, calculated from the group address. But I don't know who has joined this group, so I have to send a copy out of every Port, just like a Broadcast.
    • 01:00:5E + last 23 bits of 233.252.0.1 = 01:00:5E:7C:00:01
  11. Keep it if you want it, throw it away if you don't · Mac: My network card has a "mail list" of what to accept, and 01:00:5E:7C:00:01 is not on it, so it throws the frame away and I'm not disturbed at all. The TV and the desktop computer have joined the group, so they keep it and play it.
  12. One step still missing · Octo: But Mac's network cable still carried a copy of the live stream for nothing. If there are several live channels, the cables and the Wi-Fi will get jammed. How can I find out who wants to watch? Find out in the next story!
  13. Epilogue: one more way to send
  14. Anycast: one to the nearest one · Rue: There is one more way to send, called Anycast: several servers in different parts of the world share the same address, for example 192.0.2.53. I just need to deliver Pip to the nearest one. Story 23 will explain it in detail.

2. Where Is the Problem

Until now, Pip has had only two ways of sending a letter:

  • Unicast: a letter addressed to one receiver. One to one.
  • Broadcast: a letter sent to every device in the same LAN (Local Area Network). One to all.

One evening, the TV in the living room and the desktop computer both want to watch the same live football match, while Mac just wants to do his homework in peace. The live stream comes from an IPTV (Internet Protocol Television) service, and every second of the picture is a huge pile of Packets.

  • With Unicast: if 2 devices are watching, 2 identical copies of the data must be sent. If 100 are watching, 100 copies.
  • With Broadcast: only 1 copy is sent, but even Mac, who doesn't want to watch, has to receive it. And Broadcasts cannot pass through a Router, so the live stream could never get into the house at all.

Is there a way to send just one copy, and only to the devices that want it?

3. How the Network Solves It

Imagine a school with a football club. The teacher doesn't need to post a notice to each of the 30 students one by one, or announce it to the whole school. He just pins the notice on the "Football Club" noticeboard, and the students who want to join go and read it.

Multicast is this "club" way of sending: a letter is addressed to a Multicast Group instead of one device. Only one copy of the data is sent, and it is copied along the way only where needed. Devices that want it join the group and receive it; devices that haven't joined simply throw it away.

4. A Closer Look

Four ways to send a letter

Method Relationship Who is the receiver? IPv4 example Everyday example
Unicast One to one One specific device 192.168.1.10 Opening the example.com web page
Broadcast One to all Every device in the same LAN 255.255.255.255 ARP (Address Resolution Protocol) asking "Who is 192.168.1.1?"
Multicast One to a club Devices that have joined a certain group 233.252.0.1 IPTV live streams, OSPF (Open Shortest Path First) Hellos
Anycast One to "the nearest one" The nearest of several servers that share the same address 192.0.2.53 DNS Root Servers

An Anycast address looks exactly like a Unicast address. The difference is that "the same address is placed in several places", and Routers deliver the Packet to the nearest one. Story 23 explains this in detail.

Multicast IP Addresses

IPv4 sets aside a whole block of addresses for Multicast: 224.0.0.0 to 239.255.255.255, that is 224.0.0.0/4. These addresses can only be used as the "receiver". No device may use one as its own address.

Range Use
224.0.0.0/24 Used only within the same LAN; Routers do not forward it. For example 224.0.0.1 (all hosts), 224.0.0.2 (all Routers), 224.0.0.5 (OSPF)
232.0.0.0/8 SSM (Source-Specific Multicast): receivers can choose to accept data from only one particular source
233.252.0.0/24 Reserved for examples in documentation and teaching materials; this website uses this block
239.0.0.0/8 For use inside an organisation, a bit like Private IP addresses

IPv6 has no Broadcast at all. Every job that Broadcast used to do is done with Multicast instead. For example, ff02::1 means all devices in the same LAN.

Multicast MAC Addresses

A Frame in a LAN must carry a MAC Address. A group has no network card, so where does its MAC Address come from? The answer: it is "calculated" by a rule.

Multicast MAC Address = 01:00:5E + last 23 bits of the IP Address

233.252.0.1
 Last 23 bits: 252 minus its highest bit → 124 (7C), 0 (00), 1 (01)
 → 01:00:5E:7C:00:01
  • The lowest bit of the first byte 01 is 1, which means "this is a group". The FF of a Broadcast is the same, so a Switch knows at a glance that this is not addressed to a single device.
  • An IPv4 Multicast address has 28 bits that can change, but the MAC Address only has room for 23 bits, so every 32 Multicast IP Addresses share the same MAC Address. For example, 239.124.0.1 also maps to 01:00:5E:7C:00:01. After the network card accepts it, the computer still has to check the IP Address again to know whether it really wants it.

Who keeps it, and who throws it away?

Every computer's network card has a "mail list" of what to accept: its own MAC Address, Broadcast, and the Multicast groups it has joined. When the TV joins 233.252.0.1, 01:00:5E:7C:00:01 is added to its list. Mac hasn't joined, so when his network card sees it is not on the list, it throws it away right there in the hardware, without even bothering the CPU.

The problem not yet solved

By default, a Switch in a LAN doesn't know who has joined which group, so it treats Multicast like a Broadcast and sends it out of every Port. Mac throws it away, but his network cable still has to carry a copy of the live stream. In the next story, Octo learns how to tell who wants to watch.

As for Multicast across Routers, it relies on protocols such as PIM (Protocol Independent Multicast) to build a "distribution tree", which this story won't go into. Home Routers usually use an IGMP Proxy to sign up with the ISP (Internet Service Provider) and bring the live stream into the house.

5. Try It Yourself

Task: see which groups your computer has joined

Your computer actually uses Multicast every day. Open Terminal or Command Prompt and type:

System Command
Windows netsh interface ipv4 show joins
macOS netstat -g
Linux ip maddr

You will very likely see 224.0.0.1 (all hosts) and 224.0.0.251. The latter is mDNS (Multicast DNS), which printers, smart speakers and other devices use to find each other in the LAN.

Mini game

Which way of sending is this?

Sort each card into the correct way of sending.

  1. 1Mac opens the example.com web page

  2. 2ARP asks "Who is 192.168.1.1?"

  3. 3Two TVs watch the same IPTV channel at the same time

  4. 4An OSPF Hello is sent to 224.0.0.5

  5. 5A query to a DNS Root Server is answered by the nearest one

  6. 6The receiver MAC Address is FF:FF:FF:FF:FF:FF

  7. 7The receiver MAC Address is 01:00:5E:7C:00:01

  8. 8The TV sends a photo to the desktop computer

6. Where the Analogy Breaks

  • A club noticeboard is in one fixed place, but Multicast has no "one place" where the letter sits. With Multicast, network devices copy the data along the way and send it in the directions where it is needed. The letter is not left somewhere for people to collect.
  • Students have to walk over to read the noticeboard, but computers don't have to go and fetch anything. A computer just "registers" to join the group, and the data arrives by itself.
  • Multicast does not guarantee delivery. Live streams mostly use UDP (User Datagram Protocol), so lost Packets are not resent, and the picture may briefly break up into blocks.
  • In the animation, Mac "throwing away" Pip is done by the network card in hardware. Mac's apps never notice a thing.

7. Quiz

Question 1 of 3Which of these is an IPv4 Multicast address?
Question 2 of 3What is the Multicast MAC Address for 233.252.0.1?
Question 3 of 3What does Anycast mean?

8. Key Notes

  • Four ways of sending: Unicast is one to one, Broadcast is one to all, Multicast is one to a club, Anycast is one to the nearest one.
  • Multicast sends only one copy of the data, and network devices copy it where needed. It is perfect for cases like live streams, where "lots of people watch the same thing at the same time".
  • IPv4 Multicast addresses are 224.0.0.0/4; this website's examples use 233.252.0.0/24, which is reserved for documentation.
  • Multicast MAC Address = 01:00:5E + last 23 bits of the IP Address; network cards that haven't joined the group simply throw it away.
  • IPv6 has no Broadcast and uses Multicast for everything instead.

Further reading

Multicast solves the problem of "how many copies to send", but Octo still doesn't know who wants to watch, so he has to send the live stream out of every Port. In the next story, Octo learns to listen in on IGMP (Internet Group Management Protocol) sign-up messages: .