Sub topic 3
Unicast, multicast, and broadcast destinations
This chapter assumes you can read hexadecimal and binary, and that you know the 48-bit MAC address layout from the previous chapter. It covers the three kinds of destination address a frame can carry and how a single bit decides which kind it is.
One bit decides the type
The destination MAC address of a frame tells the network who should receive it. The kind of destination is set by the least significant bit of the first octet. This bit is called the individual/group bit, or I/G bit.
- If the bit is 0, the address is unicast. It names exactly one interface.
- If the bit is 1, the address is a group address. It names a set of interfaces. Group addresses are either multicast or broadcast.
The first octet is written first in the usual notation, but Ethernet transmits the least significant bit of each octet first. So the I/G bit is the first bit of the address to go on the wire. A receiver can decide very early whether a frame is meant for one device or for many.
The three types
Unicast
A unicast frame is for one interface. Example: 00:1a:2b:3c:4d:5e. The first octet 00 is 00000000 in binary, so the last bit is 0. A switch forwards this frame only toward the port where it learned that address. Other hosts may still see it if the switch has not learned the address yet, but they ignore it because it is not addressed to them.
Broadcast
The broadcast address is ff:ff:ff:ff:ff:ff, with all 48 bits set to 1. Every interface on the LAN accepts a frame sent to it, and switches flood it out of every port in the same broadcast domain except the one it arrived on. ARP requests use broadcast, as you will see in a later chapter.
Multicast
A multicast address has the I/G bit set to 1 but is not the broadcast address. Interfaces accept it only if they have been told to join that group. Two common ranges:
| Range | Used for |
|---|---|
| `01:00:5e:00:00:00` to `01:00:5e:7f:ff:ff` | IPv4 multicast, such as `224.0.0.251` (mDNS) |
| `33:33:xx:xx:xx:xx` | IPv6 multicast, with the last 32 bits copied from the IPv6 group address |
Note that 01 is 00000001 and 33 is 00110011. Both have a last bit of 1, so both are group addresses.
Checking the bit in code
This Python function classifies a destination address using the rule above.
def classify_destination(mac: str) -> str:
parts = mac.replace('-', ':').split(':')
if len(parts) != 6:
raise ValueError('a MAC address has 6 octets')
octets = bytes(int(p, 16) for p in parts)
if octets == b'\xff' * 6:
return 'broadcast'
if octets[0] & 0x01:
return 'multicast'
return 'unicast'
for addr in ['00:1a:2b:3c:4d:5e', 'ff:ff:ff:ff:ff:ff',
'01:00:5e:00:00:fb', '33:33:00:00:00:01']:
print(addr, classify_destination(addr))The output is unicast, broadcast, multicast, multicast in that order. The broadcast test must come first, because broadcast also has the I/G bit set.
What the network does with each type
| Type | Who accepts it | Switch behavior |
|---|---|---|
| Unicast | The one matching interface | Forwards to the learned port, or floods if unknown |
| Multicast | Interfaces that joined the group | Floods by default, unless the switch uses snooping to limit it |
| Broadcast | Every interface | Floods to all other ports in the broadcast domain |
Broadcast and multicast cost something. Every receiving host must spend CPU time on the frame, even if it ignores it. A LAN with too many broadcasts wastes capacity, which is one reason large networks are split into separate broadcast domains.
Common mistakes
- Treating multicast as a form of broadcast. Broadcast reaches every interface. Multicast reaches only interfaces that joined the group, at least at the network card level.
- Forgetting that the I/G bit is the last bit of the first octet, not the first bit when written in binary.
01is a group address.80is not. - Assuming a unicast frame never reaches other ports. A switch floods a unicast frame with an unknown destination, which is covered in the switching chapter.
Exercise
Classify these destination MAC addresses as unicast, multicast, or broadcast: (a) ff:ff:ff:ff:ff:ff, (b) 01:80:c2:00:00:00, (c) 3c:22:fb:10:20:30, (d) 80:00:00:00:00:01.
Show answer
(a) Broadcast, since all bits are 1. (b) Multicast, since 01 ends in a 1 bit and the address is not all ones. (c) Unicast, since 3c is 00111100 and ends in 0. (d) Unicast, since 80 is 10000000 and its last bit is 0. The high bit does not matter for this classification.
Exercise
An IPv6 host joins the multicast group ff02::1:ff00:42. What destination MAC address does its Ethernet frame use?
Show answer
IPv6 multicast maps to 33:33 followed by the last 32 bits of the IPv6 address. The last 32 bits are ff00:0042, so the MAC is 33:33:ff:00:00:42.