About DHCP

komputergeek

komputergeek

@komputergeek-Yf5hJ4 Oct 25, 2024
Here is a short description of how DHCP works.

DHCP stands for dynamic host configuration protocol. It's a protocol that lets network admin to automate the assignment of IP addresses in network. Each machine connecting to internet using TCP/IP needs unique IP address. Without DHCP, the ip address must to be entered manually at each machine and if that machine moves to other subnet, a new ip adress must be entered. When DHCP is used, new ip address is assigned automaticaly when computer connects to network.
How it works :

  • When DHCP client needs an ip address, it broadcasts DHCP Discover packet i.e. a requests for configuration information.
  • In response to this message all servers on that subnet unicast a DHCP Offer packet to that client.
  • Client selects one of these servers and broadcasts a DHCP Request packet which contains host name of selected DHCP server and its ip address.DHCP Request packet also contains mac address of client machine.Other servers treat this as rejection.
  • Server then respnds with DHCP Ack packet.This packet contains ip address for client, lease time and other configuration info which is requested by client.
  • When client wants to disconnect it sends DHCP Release packet.Server then marks that ip address as unused.
  • When half the lease time is over, client broadcasts anothoer DHCP Request packet containing current ip address and server address in configuration.
  • Client can remember last used ip address in non volatile memory.Next time when it boots it can request for same ip address.This way client may have same ip address over long period of time.
DHCP server can be configured to assign a fixed ip address to a particular client based on his mac address.Other addresses are assigned from a pool of ip addresses. By default, all client requests are on UDP port 68. The server replies on UDP port 67.

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • durga ch

    durga ch

    @durga-TpX3gO Jun 4, 2011

    "Client can remember last used ip address in non volatile memory.Next time when it boots it can request for same ip address.This way client may have same ip address over long period of time."

    tend to happen only when the requested IP is available with the server.

    Good information KG
  • komputergeek

    komputergeek

    @komputergeek-Yf5hJ4 Jun 4, 2011

    durga
    tend to happen only when the requested IP is available with the server.
    Yes very true.
  • Sachin Jain

    Sachin Jain

    @sachin-0wuUmc Jun 5, 2011

    Nice Information KG.......Thanks..
  • synergynext

    synergynext

    @synergynext-FdHLd3 Jun 6, 2011

    great! thanks for the info 😀