how/network
You know the IP, but how does the packet even leave the network card? First you need the neighbor's MAC. ARP does this with one broadcast.
You know the IP address of a neighbor on the network, say 192.168.1.20. But
the network card cannot work with IP. It deals in [[mac-address|
MAC addresses]], the "number" of a physical network interface, like
bb:bb:bb:22:22:22.
To send any packet, the laptop must wrap it in an [[ethernet-frame|Ethernet frame]]. And in the frame, the recipient slot needs a MAC, not an IP. Where do you get it if all you know is the IP?
ARP (Address Resolution Protocol) is that "directory service":
you send a broadcast "who has 192.168.1.20?", and the owner answers "that's me, my
MAC is such and such". You remember it, then send directly from there on.
Press ▶ to see how this exchange happens in 2 packets.
Host A wants to send a packet to 192.168.1.20. From
the subnet mask it figures out: "this is my network, I send directly".
But the [[ethernet-frame|Ethernet frame]] needs the recipient's MAC, and it is not in the cache:
$ ip neigh
# (empty for 192.168.1.20)
Without the MAC, the frame cannot be built. You have to ask.
recap
What to keep in mind:
FF:FF:FF:FF:FF:FF. The switch must flood it to all ports, so
every neighbor receives the request, but only the one whose
IP matched answersTo see your ARP cache live, run ip neigh.