The Two Names of a Device
Deconstructing MAC and IP Addressing
1. MAC Address: The Permanent ID
The Media Access Control (MAC) address is a 48-bit hexadecimal string (e.g., 00:0A:95:9D:68:16). It is "Burned-In" to the hardware of your Network Interface Card (NIC).
- OUI: The first 24 bits identify the manufacturer (e.g., Apple, Intel, Cisco).
- Device ID: The last 24 bits are unique to that specific piece of hardware.
2. IP Address: The Dynamic Label
The Internet Protocol (IP) address is a logical address. It tells the internet where you are relative to other routers. Unlike the MAC address, which stays with the hardware, the IP address often changes as you move between different WiFi networks or offices. This identity is typically assigned by a DHCP server.
3. The Interaction: Delivery vs Routing
If we compare a network to the postal service:
IP Address: The Street Address and Zip Code. It tells the mail trucks (Routers) which city to drive to. This is the core of logical routing.
MAC Address: The specific name of the resident. It ensures the mail is delivered to the correct person inside the building.
4. Layer 2 vs Layer 3 Intelligence
| Feature | MAC Address | IP Address |
|---|---|---|
| OSI Layer | Layer 2 (Data Link) | Layer 3 (Network) |
| Scope | Local Network ONLY | Global (Internet Path) |
| Hardware Device | Network Switch | Network Router |
5. Why do we need both?
Your computer uses IP to find the destination in a logic city, but it uses MAC to find the destination in a physical room. Without MAC, your switch wouldn't know which port your computer is plugged into. Without IP, your computer would never find a way out of the local building.
6. The Binding Protocol: ARP and NDP
The link between these two addresses is maintained by specific protocols. In IPv4, the ARP (Address Resolution Protocol) maps them. In IPv6, the NDP (Neighbor Discovery Protocol) handles the job. These protocols are the reason your "Logical" data package correctly hits the "Physical" cable. See the IPv6 Header Breakdown ; for more.
Conclusion: The Two Halves of a Map
Understanding the difference between MAC and IP is the first step toward understanding network architecture. One represents the unchangeable hardware, and the other represents the temporary logical location. Together, they allow billions of devices to communicate with perfect accuracy across global distances.
Frequently Asked Questions
Can I hide my MAC address?
No. You need a source MAC address to send an Ethernet frame. However, you can use MAC Randomization (common on Android and iOS) which generates a fake, random MAC for every new network you join to prevent tracking.
What is a 'Loopback' address?
The loopback IP (127.0.0.1) is a logical IP that refers only to 'this' computer. It never reaches the physical NIC or uses a MAC address, allowing software to test network logic without needing a cable.
Which address does a Switch care about?
A standard Layer 2 switch only cares about the MAC address. It builds a 'Source Address table' to remember which MAC address is on which physical port, ensuring data only goes to the intended recipient.