ARP in practice: ping, arp -a and Wireshark
Sign in to read this lesson
Computer A pings Computer B. It knows the IP address, but an Ethernet frame also needs B's MAC address. The ARP Request asks "who has 192.168.1.2?" as a broadcast (FF:FF:FF:FF:FF:FF), and B sends its MAC straight back to A in an ARP Reply. The result appears in the ARP table with arp -a, and the whole process can be followed step by step in Wireshark.
What you will learn
- Ping uses the ICMP protocol. The IP packet has source IP
192.168.1.1and destination IP192.168.1.2(Layer 3). - The packet goes into an Ethernet frame: source MAC AAA, destination MAC BBB (Layer 2). We type the IP, but A has no way of knowing B's MAC: ARP (Address Resolution Protocol) solves this.
- The ARP Request is a broadcast: destination MAC
FF:FF:FF:FF:FF:FF, asking "Who has 192.168.1.2, and what is your MAC address?" Every computer on the network receives it. - The ARP Reply is unicast: source BBB, destination AAA, saying "192.168.1.2 is me, here is my MAC address." A writes the answer into its ARP table.
arp -ashows the ARP table: an entry learned through ARP is dynamic; broadcast and multicast entries are static. In Wireshark the request shows Opcode: request (1) and Target MAC 00:00:00:00:00:00; the reply shows Opcode: reply (2).
The lesson has 5 key points, an explanation and 5 questions. It opens with a package.