← All chapters
Chapter 8· 8 min read · illustrated

MAC vs IP

Why we need two different addresses — and what each one is really for

A natural question: if every device already has an IP, why does it also need a MAC? They seem redundant. They are not. This chapter compares them head-to-head and shows why both are indispensable — one gets you across the internet, the other delivers to the exact machine.

01

Side by side

The quickest way to see the difference is a direct comparison across a few properties: size, format, whether it changes, whether it can repeat, and its role.

IP
32-bit · dotted · can change · can repeat across networks · logical (routable).
MAC
48-bit · colon/dash · fixed by maker · globally unique · physical (local delivery).
Tap to enlarge
02

How they look

An IP is 32 bits, four decimal octets separated by dots (192.168.1.4). A MAC is 48 bits, six hex bytes separated by colons or dashes (FA:34:AF:09:00:BA). Different lengths, different notation.

Tap to enlarge
03

Changeable vs fixed

An IP can change — the router may hand your device a different one each time it connects. A MAC is hardcoded onto the NIC by the manufacturer and stays constant.

Caveat: A MAC can be spoofed at the OS level, but normally it is fixed. IPs, by contrast, routinely change.

Tap to enlarge
04

Reusable vs universally unique

The same IP can be reused in different networks. Two different homes, two separate isolated networks — both can have a device at 192.168.1.4, and that is fine because the networks never mix. A MAC, however, is globally unique: no two interfaces in the world share one. Even two NICs in the same laptop have different MACs.

Tap to enlarge
05

IP has logical meaning (routing)

Say you request an EC2 instance by its public IP. Your subnet-mask check shows it is not local, so it goes to your gateway. That router checks whether the IP is in a network it knows; if not, it forwards to the next router (its own gateway), and so on — hop after hop — until it reaches the AWS data center.

The point: At every hop the IP is used to make a routing decision. IP has logical significance — you can compute where to send next from it.

Tap to enlarge
06

MAC is for physical delivery

A MAC address is essentially random — there is no logic in it to route by. But once the packet finally reaches the destination’s local network, the MAC is exactly what is needed to hand the data to the one specific machine whose interface matches.

Scope: MAC only matters inside the local network — for the last step of delivery to the exact device.

Tap to enlarge
07

ARP bridges IP → MAC

So how does a device get the MAC for a given IP when it needs to deliver locally? With ARP (Address Resolution Protocol), which takes an IP and returns the matching MAC. Every device keeps an ARP table mapping IPs to MACs — the subject of the next chapter.

Tap to enlarge
08

The division of labour

Put simply: IP is globally significant and gets your data across the internet to the right local network. MAC works only inside that local network to reach the exact device. Neither can do the other’s job — which is why we need both.

Tap to enlarge