ARP Cheat Sheet

Overview

  • ARP (Address Resolution Protocol) is used to map IP addresses to MAC (Media Access Control) addresses. It operates at the Data Link Layer (Layer 2) of the OSI model.

Common Uses

  • Resolving IP addresses to MAC addresses for communication within a local area network (LAN).

ARP Message Types

ARP TypeDescriptionPurpose
ARP RequestA request to find the MAC address associated with an IP address.Used to dynamically discover MAC addresses.
ARP ReplyResponse to an ARP request, containing the MAC address corresponding to the requested IP.Provides the MAC address for the IP address asked.

ARP Packet Structure

FieldSize (bits)Description
Hardware Type16Type of network (Ethernet is 1)
Protocol Type16Protocol type (IPv4 is 0x0800)
Hardware Address Length8Length of the MAC address (typically 6)
Protocol Address Length8Length of the IP address (typically 4)
Operation161 = Request, 2 = Reply
Sender MAC Address48MAC address of the sender (the requester)
Sender IP Address32IP address of the sender
Target MAC Address48MAC address of the target (empty in ARP requests)
Target IP Address32IP address of the target