An IP address gets data to the right network. But on your local network, switches and Wi-Fi deliver frames using a different address: the MAC address, burned into every network card.
A MAC address looks like 3c:22:fb:9a:41:0e. The first half identifies the manufacturer, which is why tools like Nmap can sometimes tell you a device is made by Apple or Samsung.
How ARP connects the two
When your laptop wants to send data to the router at 192.168.1.1, it needs the router's MAC address. So it shouts to the whole network, "who has 192.168.1.1?", and the router replies with its MAC. Your laptop saves the answer in its ARP table so it doesn't have to ask every time.
See your own ARP table:
ip neigh # Linux
arp -a # Windows
Why ARP is a security problem
ARP was designed decades ago, when everyone on a network was trusted. It has no authentication. Any device can send a reply saying "I'm 192.168.1.1", even if nobody asked.
That's ARP spoofing. An attacker on the same Wi-Fi tells your laptop "I'm the router" and tells the router "I'm the laptop". Now all your traffic flows through the attacker. This is a classic man-in-the-middle attack, and tools like Ettercap and Bettercap can do it in a lab.
How networks defend against it
- Dynamic ARP Inspection on managed switches checks ARP replies against known addresses.
- HTTPS everywhere means that even if traffic is intercepted, the attacker can't read or change it easily.
- Watching for changes: if the router's MAC in your ARP table suddenly changes, something is wrong. Tools like arpwatch alert on this.
This is also why public Wi-Fi is risky: you share the network, and the ARP trust, with strangers.