Address Resolution Protocol (ARP) and Dynamic Host Configuration Protocol (DHCP) are two protocols used in associating IP addresses to host devices in a network.
ARP is a protocol that is used to map an IP address to a physical machine (mac address) by sending a multicast message on a LAN and recording the mac address of the host device, which replies to the message on the ARP table.
DHCP, on the other hand, is a protocol used to dynamically assign an IP address to a host device once the device is connected to the network.
In this post, I will be guiding you on ARP vs. DHCP, showing you in depth what each protocol does in a network and how they differ.
What is ARP?
ARP, or Address Resolution Protocol, is a fundamental protocol that helps in connecting an IP address to the corresponding MAC address in a local area network (LAN). It enables a device to be accurately located by other devices in the network.
The MAC address is used to identify a device at the datalink layer (layer 2), and the IP address is used to identify a device at the network layer (layer 3) of the OSI model. Hence, ARP is a protocol that works between the data link layer and the network layer of the OSI model.
Here is how ARP works.
When a host device seeks to communicate with a newly connected host in the network, with the help of the IP address of the destination host, it initiates a request for the MAC address associated with that IP. If the destination host resides within the same local area network, it will respond with its MAC address, and the device can now send a packet to the destination host.
However, if the destination host is located outside the LAN, layer 3 devices such as routers come into play. These devices forward the request to all networks connected to them. Before doing so, the layer 3 device consults its ARP Table, a cache in memory containing previously learned MAC addresses associated with IPs during past network communications.
If the ARP table holds the required information, the layer 3 device replies to the sender with the specific MAC address corresponding to the IP in question. After that, the sender can successfully transmit its packet to the intended destination.
In the absence of a matching entry in the ARP table, the layer 3 device broadcasts the request to all host devices on the same local network segment. The host possessing the requested IP responds with its MAC address, and this mapping is then added to the ARP table for future reference.
What is DHCP?
Dynamic Host Configuration Protocol (DHCP) is a protocol used to dynamically assign an IP address and others like a DNS server address, default gateway address, and subnet mask address to host devices in a network.
When there are a smaller number of host devices in a network, like 5 to 10, it is relatively easy to assign an IP address manually to each of the host devices on the network. However, as the number of host devices increases to maybe 100 to 1000, it becomes almost impossible for network administrators to assign IP addresses one-by-one to each of these host devices. DHCP helps to dynamically assign IP addresses to all these host devices from the pool of IP addresses specified by the network administrator.
DHCP comprises three components: the DHCP server, the DHCP client, and the DHCP relay agent.
DHCP Server
The DHCP server is the network device that dynamically releases an IP address to a host device newly connected to a network. A router, layer 3 switch, or dedicated server can be configured as a DHCP server. To configure any of these devices as DHCP servers, the network administrator just needs to create a DHCP pool and specify the default gateway IP address and DNS address for that pool. We written a separate post on how to configure DHCP server in packet tracer.
DHCP Client
A DHCP client is any host device that automatically obtains an IP address from the DHCP server in a network. This could be a PC, phone, or printer. Once a new host device is connected to a network, it will request an IP address from the DHCP server. If the requested IP address is available, the server will simply release it to the client; however, if the requested IP address is not available, the client will be supplied with another IP address.
DHCP Relay Agent
The DHCP Relay agent helps extend DHCP requests to and fro between the DHCP client and the DHCP server.
In a small network, DHCP server and DHCP client is always in the same network. However, when the network grows big, some DHCP client will appear to be in a different subnetwork with DHCP server. For such Client to be able to obtain IP address still from the server, the layer 3 device interfacing the two subnetwork need to to be configured as a DHCP relay agent. This will enhance the layer 3 device to forward any DHCP request/reply between the DHCP server and DHCP client. We have written a post on how to configure DHCP relay agent.
ARP vs DHCP: Key differences
Here are the key differences between DHCP and ARP:
- Purpose: ARP maps the IP address of a host device to its corresponding MAC address within a local network, while DHCP dynamically assigns IP addresses to a host device and provides configuration information such as a subnet mask, default gateway, and DNS servers to devices when they join a network.
- Layer Of Operation: ARP operates at the Data Link Layer (Layer 2) of the OSI model, while DHCP operates at the Application Layer (Layer 7) of the OSI model.
- ARPs come in during an ongoing communication after a device has obtained an IP address using DHCP.
- Communication Type: ARP facilitates point-to-point communication within the same local network, while DHCP facilitates one-to-many communication, where a centralized DHCP server assigns IP addresses and configurations to multiple devices.
ARP vs DHCP: FAQs
Here are some frequently asked questions and their answers concerning ARP vs. DHCP.
What is the exact difference between ARP and DHCP?
ARP resolves IP addresses to MAC addresses for local communication, while DHCP dynamically assigns IP addresses and provides network configuration to host devices newly connected to a network.
What Comes First, DHCP or ARP?
Once a new device is connected to a network, it first uses DHCP to obtain an IP address. ARPs come in when there is communication between the host device and other devices in the network.
Does a DHCP server have an ARP table?
Yes, a DHCP server may have an ARP table. However, its primary function is to manage IP address assignments. ARP tables are more commonly associated with routers and switches.
What does ARP do?
ARP maps an IP address to the corresponding MAC address within a local network, facilitating communication between devices on the same network segment.
I am a passionate Networking Associate specializing in Telecommunications.
With a degree in Electronic engineering, I possess a strong understanding of electronic systems and the intricacies of telecommunications networks. I gained practical experience and valuable insights working for a prominent telecommunications company.
Additionally, I hold certifications in networking, which have solidified my expertise in network architecture, protocols, and optimization.
Through my writing skills, I aim to provide accurate and valuable knowledge in the networking field.
Connect with me on social media using the links below for more insights.
You can contact me using [email protected] or connect with me using any of the social media account linked below