DHCP
Dynamic Host Configuration Protocol (DHCP) is a network protocol used to dynamically assign IP addresses and other network configuration parameters to devices on a network. It provides an automated way of configuring hosts with network settings required to communicate on a network. In this blog post, we will explore the role of DHCP within the network, how it works, and the process involved in a DHCP registration.
What is DHCP?
DHCP is a client-server protocol that automatically assigns IP addresses to hosts on a network. It eliminates the need for network administrators to manually assign IP addresses to each device, thereby reducing the chances of errors and saving time.
Just like below picture , Network engineer stress about loosing static IP's
How does DHCP work?
DHCP uses a client-server model, where a DHCP server is responsible for assigning IP addresses and other network settings to clients on the network. The process of assigning an IP address to a client involves four stages, commonly known as DORA (Discover, Offer, Request, Acknowledge) stages.
DHCP Process:
Discover:
In the first stage, the client sends a broadcast message on the network requesting an IP address lease. The broadcast message is sent to the destination IP address of 255.255.255.255 or the limited broadcast address of the network.
Offer:
When the DHCP server receives the broadcast message, it replies with an IP address offer. This offer includes the IP address, subnet mask, default gateway, and other network configuration parameters. The server assigns an IP address from a pool of available addresses configured on the DHCP server.
Request:
If the client accepts the IP address offer, it sends a request message to the DHCP server. This request message contains the IP address offered to the client.
Acknowledge:
Finally, the DHCP server acknowledges the client’s request and sends a message to the client with the assigned IP address, subnet mask, default gateway, and other configuration parameters. The client then configures its network settings with the assigned IP address and can start communicating on the network.
Lets Take a Diagram showing DORA process for a PC getting an IP address from a DHCP server:
DHCP Discovery (DHCPDISCOVER): The PC sends a broadcast message to the network requesting an IP address. The source MAC address is that of the PC, and the destination MAC address is a broadcast MAC address. The source IP address is 0.0.0.0, and the destination IP address is 255.255.255.255.
DHCP Offer (DHCPOFFER): The DHCP server receives the broadcast message and sends a unicast message back to the PC offering an available IP address. The source MAC address is that of the DHCP server, and the destination MAC address is that of the PC. The source IP address is that of the DHCP server, and the destination IP address is that of the PC.
DHCP Request (DHCPREQUEST): The PC sends a broadcast message to the network requesting to use the offered IP address. The source MAC address is that of the PC, and the destination MAC address is a broadcast MAC address. The source IP address is 0.0.0.0, and the destination IP address is 255.255.255.255.
DHCP Acknowledgement (DHCPACK): The DHCP server receives the broadcast message and sends a unicast message back to the PC acknowledging that the PC can use the offered IP address. The source MAC address is that of the DHCP server, and the destination MAC address is that of the PC. The source IP address is that of the DHCP server, and the destination IP address is that of the PC.
DHCP Configuration:
To configure DHCP on a Cisco router, follow the below steps:
Configure a pool of IP addresses that the DHCP server can assign to clients.
Configure the DHCP server's default gateway, subnet mask, and DNS server information.
Enable the DHCP service on the router interface that connects to the client devices.
0 comments:
Post a Comment