Sub topic 4
The OUI: who made this network interface?
This chapter assumes you can read a MAC address in hex and know that its first octet carries the group bit and the locally administered bit. The chapter "Anatomy of a MAC address" covers both. You also need to be able to run Python 3 code.
What the OUI is
The first three octets of a universally administered MAC address are the Organizationally Unique Identifier (OUI). It is a 24-bit prefix that the IEEE Registration Authority assigns to one organization. The vendor then picks the remaining 24 bits for each interface it builds. A vendor that runs out of numbers can buy another OUI.
Two OUIs you will often see:
| Prefix | Registered to |
|---|---|
| `b8:27:eb` | Raspberry Pi Foundation |
| `00:50:56` | VMware, Inc. |
Reading the OUI correctly
The group bit and the locally administered bit sit inside the first octet, so they are part of those 24 bits. An OUI that the IEEE assigns always has both bits set to 0. If the second bit is 1, the address was set locally and the prefix does not name a vendor. For example, 02:00:5e:10:00:01 starts with 0x02, so the "OUI" part is not a registered prefix.
Block sizes: MA-L, MA-M, and MA-S
A 24-bit prefix gives a vendor about 16.7 million addresses, which is too many for a small vendor. The IEEE therefore sells three block sizes.
| Block | Prefix length | Addresses in the block |
|---|---|---|
| MA-L (large, the classic OUI) | 24 bits | 16,777,216 |
| MA-M (medium) | 28 bits | 1,048,576 |
| MA-S (small) | 36 bits | 4,096 |
MA-M and MA-S prefixes are longer than three octets. A lookup that compares only the first three octets can therefore match the wrong organization. Several small vendors can share the same first 24 bits, and each one owns a different longer prefix.
A small lookup tool
This script looks up the vendor from a short table. It first rejects locally administered addresses, because they have no vendor. A real tool would load the IEEE registry file instead of a hand-written table.
OUI_TABLE = {
"b8:27:eb": "Raspberry Pi Foundation",
"00:50:56": "VMware, Inc.",
}
def lookup_vendor(mac: str) -> str:
parts = mac.replace("-", ":").lower().split(":")
if len(parts) != 6:
raise ValueError("a MAC address has 6 octets")
if int(parts[0], 16) & 0x02:
return "locally administered (no vendor)"
oui = ":".join(f"{int(p, 16):02x}" for p in parts[:3])
return OUI_TABLE.get(oui, "unknown")
for address in ["B8-27-EB-12-34-56", "00:50:56:aa:bb:cc", "02:00:5e:10:00:01", "3c:00:00:00:00:01"]:
print(address, "->", lookup_vendor(address))The output is:
B8-27-EB-12-34-56 -> Raspberry Pi Foundation
00:50:56:aa:bb:cc -> VMware, Inc.
02:00:5e:10:00:01 -> locally administered (no vendor)
3c:00:00:00:00:01 -> unknownThe last address is a valid universal address, but it is not in this small table, so the result is "unknown".
Common errors when using OUIs
- Treating the vendor as the device maker. The OUI names the maker of the network chip or module. A laptop from one brand often shows the OUI of the company that made its Wi-Fi card.
- Trusting the result. Software can change a MAC address, so an OUI lookup is a hint and not proof of identity.
- Looking up randomized addresses. Many phones and laptops now use random addresses for Wi-Fi, and these have the locally administered bit set. No vendor lookup can work on them.
- Assuming virtual machines look like hardware. Hypervisors use their own prefixes (such as VMware's
00:50:56) or locally administered ranges. A vendor of "VMware" means the interface is virtual. - Using an outdated registry. The IEEE registers new prefixes continuously, so a copy of the registry that is a few years old returns "unknown" for newer devices.
Exercise
A device's MAC address is 06:11:22:33:44:55. Can you find its manufacturer by looking up 06:11:22 in the IEEE registry? Explain why or why not.
Show answer
No. The first octet is 0x06, which is 0000 0110 in binary. The second-lowest bit is 1, so the address is locally administered. It was set by software or a local administrator and is not an IEEE-assigned OUI, so no vendor owns that prefix. The lowest bit is 0, so it is still a unicast address.