Address Resolution Protocol
Table of Contents
Address Resolution Protocol
Overview
- ARP is a crucial network protocol that translates logical IP Address into physical Media Access Control Address.
- This translation is essential for devices on a local network to communicate with each other.
- IP addresses are used for routing data across different networks, while MAC addresses are unique identifiers for devices on a specific network segment.
Key Features
- IP to MAC Address Mapping: ARP's primary function is to dynamically discover the MAC address associated with a given IP address.
- ARP Cache: Devices maintain an ARP cache, which stores recently learned IP-to-MAC address mappings. This cache improves efficiency by avoiding repeated requests for the same information.
- Broadcast Requests: When a device needs to find the MAC address of a destination IP address, it broadcasts an ARP request to all devices on the local network.
- Unicast Replies: The device with the matching IP address responds with a unicast ARP reply, providing its MAC address to the requesting device.
Process
- IP Address Lookup: When a device wants to send data to another device on the same network, it first checks its ARP cache for the destination IP address.
- Cache Hit: If the MAC address is found in the cache, the device directly sends the data frame using the MAC address.
- Cache Miss: If the MAC address is not found in the cache, the device broadcasts an ARP request.
- ARP Request Broadcast: The ARP request includes the destination IP address and the sender's IP and MAC addresses.
- ARP Reply: The device with the matching IP address receives the ARP request and sends a unicast ARP reply containing its MAC address.
- Cache Update: The sender updates its ARP cache with the newly learned IP-to-MAC address mapping.
- Data Transmission: The sender can now send data frames directly to the destination device using its MAC address.
Diagram
@startuml
title ARP Process
participant Sender
participant Target
activate Sender
Sender -> Sender : Check ARP Cache
alt Cache Hit
Sender -> Target : Send Data Frame
else Cache Miss
Sender -> Broadcast : Send ARP Request
note right of Broadcast : Includes Sender IP/MAC and Target IP
activate Target
Target -> Sender : Send ARP Reply
note left of Target : Includes Target MAC
deactivate Target
Sender -> Sender : Update ARP Cache
Sender -> Target : Send Data Frame
end
deactivate Sender
@enduml