Sub topic 5
Universal vs locally administered addresses
This chapter assumes you can read hexadecimal and binary, and that you know a MAC address is a 48-bit identifier made of six octets. It covers the second-lowest bit of the first octet, which says who assigned the address.
Two ways an address gets assigned
A MAC address can come from two sources.
- A universally administered address (UAA) is burned into the network interface by its manufacturer. The first three octets are the manufacturer's OUI, assigned by the IEEE, so the address is meant to be unique worldwide.
- A locally administered address (LAA) is set by software, an administrator, or an operating system. Nobody guarantees it is unique. The person or program that chose it is responsible for avoiding clashes on the LAN.
The first octet carries two flag bits:
| Bit (in first octet) | Mask | Value 0 | Value 1 |
|---|---|---|---|
| Least significant bit | 0x01 | Individual (unicast) | Group (multicast or broadcast) |
| Second-least significant bit | 0x02 | Universally administered | Locally administered |
The 0x01 bit was covered with unicast and multicast. This chapter is about the 0x02 bit, often called the U/L bit.
Reading the bit
Take the address 02:00:5e:10:00:01. The first octet is 0x02, which is 00000010 in binary. The 0x01 bit is 0, so it is a unicast address. The 0x02 bit is 1, so it is locally administered.
Now compare 00:1a:2b:3c:4d:5e. The first octet is 0x00, or 00000000. Both bits are 0, so it is a unicast, universally administered address.
A quick shortcut: in the first octet, look at the second hex digit. If it is 2, 6, A, or E, the address is locally administered unicast. If it is 0, 4, 8, or C, the address is universally administered unicast. Digits 1, 3, 5, 7, 9, B, D, and F also set the group bit, so they describe multicast addresses.
def classify(mac: str) -> str:
first = int(mac.replace('-', ':').split(':')[0], 16)
scope = 'locally administered' if first & 0x02 else 'universally administered'
kind = 'group' if first & 0x01 else 'unicast'
return f'{scope}, {kind}'
for m in ['00:1a:2b:3c:4d:5e', '02:00:5e:10:00:01',
'da:a1:19:4f:22:07', 'ff:ff:ff:ff:ff:ff']:
print(m, '->', classify(m))The output is:
00:1a:2b:3c:4d:5e -> universally administered, unicast
02:00:5e:10:00:01 -> locally administered, unicast
da:a1:19:4f:22:07 -> locally administered, unicast
ff:ff:ff:ff:ff:ff -> locally administered, groupThe broadcast address has every bit set, so it reports as locally administered and group. That is a side effect of all bits being 1, not a meaningful classification.
Where you meet locally administered addresses
- Virtual machines and containers. Hypervisors and container runtimes often generate addresses for virtual interfaces. Docker, for example, derives container MACs that start with
02:42, which sets the local bit. - Bridges, bonds, and VLAN or macvlan interfaces. Software-created interfaces may take a generated or copied address.
- Privacy features. Phones and laptops can use a random locally administered address per Wi-Fi network. The next chapters on randomization and tracking build on this.
- Manual changes. An administrator can set any address with a command such as
ip link set dev eth0 address 02:11:22:33:44:55. Setting the local bit is the correct practice, because it avoids impersonating a real vendor's OUI.
Common errors
- Looking up an LAA's OUI. The first three octets of a locally administered address are not a vendor prefix. A lookup either fails or returns a misleading match. Check the U/L bit before you query an OUI database.
- Assuming uniqueness. Two virtual machines cloned from the same image can end up with the same LAA. Duplicate MACs on one LAN cause switches to flip a single table entry between ports, and traffic reaches only one of the hosts at a time.
- Confusing the two flag bits. Testing
first & 0x01answers "is it multicast?", not "is it local?". Use0x02for the U/L bit. - Treating a universal address as proof of hardware. A UAA is only a convention. Software can set any value, so a universal-looking address may not match the real device.
Exercise
A laptop reports the Wi-Fi MAC a6:3f:91:0c:77:de. Is it universally or locally administered, and is it unicast or group? Should you look up its OUI?
Show answer
The first octet is 0xa6, which is 10100110 in binary. The 0x01 bit is 0, so it is unicast. The 0x02 bit is 1, so it is locally administered. Do not look up its OUI, because a locally administered address has no vendor-assigned prefix. This pattern is typical of a randomized Wi-Fi address.