MAC Addressing
[!NOTE] This module explores the core principles of MAC Addressing, deriving solutions from first principles and hardware constraints to build world-class, production-ready expertise.
1. What is a MAC Address?
Imagine trying to deliver mail in a town where every house looks exactly the same and no one has a name. Chaos, right? In the networking world, before we even think about higher-level addresses like IP addresses (which are like mailing addresses that can change when you move), we need a fundamental, unchangeable identity for every device.
A Media Access Control (MAC) address is this fundamental identity. It is a unique, hardcoded identifier assigned to a Network Interface Controller (NIC) for use as a network address in communications within a local network segment. Because it’s tied to the hardware itself, it is also known as a Physical Address. Think of it as the Social Security Number or VIN (Vehicle Identification Number) of your computer’s network card.
2. Structure (48-bits)
A MAC address is a 48-bit value, usually represented as 12 hexadecimal digits grouped in pairs (e.g., 00:0A:95:9D:68:16). This structure is cleanly split into two halves:
- OUI (Organizationally Unique Identifier): The first 24 bits (e.g.,
00:0A:95). This acts as the vendor or manufacturer ID (e.g., Apple, Intel, Cisco). It’s like the make of a car. - NIC Specific: The last 24 bits (e.g.,
9D:68:16). This is a unique serial number assigned by the manufacturer to ensure no two network cards in the world have the same MAC address. It’s like the specific serial number of that car.
3. Address Types
Just like a radio station can broadcast to everyone, or you can have a private phone call with one person, MAC addresses support different communication scopes:
- Unicast: Sent to one specific NIC (a private conversation).
- Multicast: Sent to a specific group of NICs (e.g.,
01:00:5E:XX:XX:XX). (A group chat where only interested devices listen). - Broadcast: Sent to EVERY NIC on the local network segment. The address is always
FF:FF:FF:FF:FF:FF(using a megaphone in a crowded room).
4. Interactive: MAC Lookup
Identify the manufacturer.
5. The CAM Table (Content Addressable Memory)
A switch doesn’t just blindly broadcast every packet (which would be chaotic and slow). It acts like an intelligent mail sorter by maintaining a CAM Table, a mapping of MAC Address → Port.
- Learning: When a packet arrives on Port 1 from a device with MAC
AAA, the switch examines the source MAC address and remembers:Device AAA is connected to Port 1. - Forwarding: When a subsequent packet arrives destined for MAC
AAA, the switch looks upAAAin its CAM table and sends the packet only out of Port 1, avoiding unnecessary network congestion.
[!NOTE] If the destination MAC is not yet in the CAM table, the switch performs Flooding: it sends the packet out of all ports except the one it received the packet on. Once the target device replies, the switch learns its port and adds it to the CAM table.