What is DHCP and How does it work and benefits

      What is DHCP and how does it work
 DHCP (Dynamic Host Configuration Protocol) is a protocol that is commonly used in networks for dynamic IP addressing configuration. Every user’s device needs at least IP address to join the network and connect to services. When computer first connects to local network with cable or WiFi SSID, first thing is to look for IP address, netmask, default gateway and DNS servers.

  1. Host connecting to network (cable or wireless) sends DHCP discover message to all hosts in Layer 2 segment (destination address is FF:FF:FF:FF:FF:FF). Frame with this DISCOVER message hits the DHCP Server.
     2. After the DHCP Server receives discover message it suggests the IP addressing offering to the client host by unicast. This OFFER message contains:
  • proposed IP address for client (here 192.168.1.10)
  • subnet mask to identify the subnet space (here 255.255.255.0)
  • IP of default gateway for subnet (here 192.168.1.1)
  • IP of DNS server for name translations (here 8.8.8.8)
  • How DHCP work

    DHCP provides an automated way to distribute and update IP addresses and other configuration information on a network. A DHCP server provides this information to a DHCP client through the exchange of a series of messages, known as the DHCP conversation or the DHCP transaction.

    DHCP discovery

    The client computers broadcasts messages on the physical subnet to discover available DHCP servers. This client-computers creates a User Datagram Protocol (UDP) packet with the default broadcast destination of 255.255.255.255 or the specific subnet broadcast address if any configured.

    DHCP offer

    When a DHCP server receives an IP lease request from a client, it reserves an IP address for the client and extends an IP lease offer by sending a DHCPOFFER message to the client. This message contains the client's MAC address, the IP address that the server is offering, the subnet mask, the lease duration, and the IP address of the DHCP server making the offer.

    DHCP request

    In most companies, two DHCP servers provide fault tolerance of IP addressing if one server fails or must be taken offline for maintenance. So client could receive DHCP offers from multiple servers, but it will accept only one DHCP offer. In response to the offer Client requests the server. The client replies DHCP Request, unicast to the server, requesting the offered address. Based on the Transaction ID field in the request, servers are informed whose offer the client has accepted. When other DHCP servers receive this message, they withdraw any offers that they might have made to the client and return the offered address to the pool of available addresses. In some cases DHCP request message is broadcast, instead of being unicast to a particular DHCP server, because the DHCP client has still not received an IP address. Also, this way one message can let all other DHCP servers know that another server will be supplying the IP address without missing any of the servers with a series of unicast messages.

    DHCP acknowledgement

    When the DHCP server receives the DHCPREQUEST message from the client, the configuration process enters its final phase.
    The acknowledgement phase involves sending a DHCPACK packet to the client. This packet includes the lease duration and any other configuration information that the client might have requested. At this point, the IP configuration process is completed.


Key values to remember for a DHCPACK message are tabulated below.
DescriptionValue
Message DirectionDHCP Server to DHCP Client
Source MAC AddressInterface MAC Address of DHCP Server
Destination MAC Addressff:ff:ff:ff:ff:ff (Broadcast MAC Address)
Source IPv4 AddressInterface IPv4 Address of DHCP Server
Destination IPv4 Address255.255.255.255 (Limited Broadcast)
Source Port NumberUDP 67
Destination Port NumberUDP 68
Once the DHCPACK message is received from the DHCP Server, DHCP Client can start using that IPv4 Addrees.
You have learned Dynamic Host Configuration Protocol (DHCP) and how Dynamic Host Configuration Protocol (DHCP) works. To continue to the next part of Dynamic Host Configuration Protocol (DHCP
    



Comments

Post a Comment

Popular posts from this blog

What is Router ? and its Work - Definition from akhileshnetworking