What Is DHCP?

Understanding Dynamic Host Configuration Protocol

DHCP is the short for Dynamic Host Configuration Protocol. Its purpose is to assign dynamic IP addresses to devices on a network. Dynamic addressing means that a device can have a different IP address every time it connects to the network.

In short, DHCP allows a computer to join a network without having a pre-configured IP address. It assigns unique IPs to computer devices and then releases and renews them every time the machine leaves and reconnects to the network.

DHCP features include allowing the user to define "pools" of IP addresses (DHCP terminology calls them scopes). The IP addresses are handed out by the server together with the related configuration settings like subnet mask (defines the boundaries of an IP subnet - grouping of connected network devices). DHCP also makes it easier for a client to move the computer from one subnet to another because it allocates IPs according to the subnet the request came from. Due to the dynamic allocation of the IPs, it is easy to recover the addresses that are no longer used and put them back in the unallocated scope.

The lease for allocating the IP to a certain computer in the network is a period of time during which the allocated IP is valid. After the lease period expires, the request for renewing the lease is sent to the DHCP server and a new IP is obtained. Largely put, the DHCP client sends a broadcast packet on the network with a DHCP request. The DHCP server picks up the request and allocates to the PC the IP address from the scopes available. The address is not allocated permanently (DHCP assigns dynamic IP addresses) and the IP is leased to the client. When the lease period expires, the client sends an IP lease renewal message.

The scopes or IP address "pools" are administrative grouping of IP addresses for computers on a subnet that are using the DHCP service. Configuring them implies defining some parameters used by clients, like the range of IPs (IP "pool" or scopes) from which to include or exclude addresses used for IP leases, the subnet mask, the scope name, etc.

The downfall of DHCP service in the case of routers of small networks is that the IP will be assigned to any device connecting to the network. The issue is significantly important when it comes to wireless devices. A wireless device in the range of your router will be automatically assigned an IP. Fortunately, there is a solution for this problem and that consists in turning off the DHCP. This way, you will be able to protect your network from unwanted intrusions.

DHCP traffic uses UDP (User Datagram Protocol) and the ports used for transmitting the messages are 67 and 68. The messages from the client to the server use UDP source port 68 and UDP destination port 67. No matter the sender and the receiver, the client will always use UDP port 68 for receiving and sending messages and the server will use UDP port 67 for the same activities.

The messages exchanged between client and server in DHCP communication cover the configuration process and include "notes" from client to server and back.

* DHCPDiscover is sent from the client to the server in order to discover the presence of the DHCP servers on the network

* DHCPOffer - the server responds to the client by providing the IP address configuration offered to the DHCP client request

* DHCPRequest - the client asks from a certain server a specific IP address configuration

* DHCPAck - the server acknowledges that the client has been allocated a specific IP address

* DHCPNack - the server acknowledges that the client cannot use a specific IP address (this happens when that address is already taken or when the client moves to a different subnet and tries to renew the lease on the previous IP)

* DHCPDecline - the client tells the server that the offered IP address is invalid (discovered the fact through other means that the IP is already in use and IP conflicts are prone to appear)

* DHCPRelease - the client sends this message to the DHCP server telling that the IP address is no longer in use (so it can be safely stored in the scope)

* DHCPInform - the client requests additional configuration settings.

That is the story with DHCP for IPv4. With an IPv6 network, you do not really need DHCP to configure the addresses because of the stateless address auto-configuration which removes the primary motivation for DHCP in IPv4. Nevertheless, the protocol can still be used to statefully assign addresses if more control over the addressing is what the network administrator wants.


Photo Gallery (4 Images)

Gallery Image
Gallery Image
Gallery Image
Gallery Image

Hot right now  ·  Latest news

1 Comment