Address Resolution Protocol (ARP)
What is ARP?
- ARP stands for Address Resolution Protocol.
- Used to resolve IP addresses to MAC addresses.
- MAC address: A physical address that is globally unique to every network interface card.
Purpose of ARP
- Enables communication between devices on a local area network by acquiring the MAC address needed for communication.
Example Scenario
- Computer A wants to communicate with Computer B.
- Computer A knows Computer B's IP address but needs its MAC address to communicate.
- IP address locates a device on a network, while MAC address identifies the actual device.
ARP Process
- Check ARP Cache: Computer A checks its ARP cache for Computer B's MAC address.
- Use command:
arp -a
to see ARP cache on Windows.
- If empty, it indicates no entries.
- Broadcast Message: Computer A broadcasts a message on the network asking which computer has the IP address and requests the MAC address.
- Response: The computer with the matching IP address responds with its MAC address.
- Store in ARP Cache: Once Computer A receives the MAC address, it stores the information in the ARP cache.
- This avoids the need for future broadcasts for the same device.
ARP Cache
- Purpose: Makes the network more efficient by storing IP to MAC address associations.
- Types of Entries:
- Dynamic Entries: Automatically created when a device sends a broadcast to request a MAC address.
- Not permanent and periodically flushed to avoid cache overflow.
- Static Entries: Manually entered using the ARP command-line utility.
- Command example:
arp -s [IP address] [MAC address]
Static vs. Dynamic ARP Entries
- Dynamic: Efficient for temporary associations, auto-flushed.
- Static: Useful for reducing unnecessary ARP broadcast traffic and ideal for devices that communicate constantly.
Practical Use
- Network administrators use static ARP entries to ensure efficient communication and to minimize broadcast traffic when devices frequently communicate.
Why is the MAC address still needed even if you know the IP address?
- IP is for Routing, MAC is for Delivery:
The IP address is like the street address of a building, which helps you get to the right network (the right street or neighborhood). It helps routers figure out where to send the data (which network or segment the data should go to). But once the data reaches the local network (the correct neighborhood), it still needs to go to the specific device (the specific apartment). That’s where the MAC address comes in.
IP address helps you get to the right network.
MAC address is used for delivering the actual data to the correct device on that network.
It’s a two-step process:
The IP address tells you "where," but the MAC address tells you "how" to actually get there within the local network.