Motivation for DHCP Configuration parameters for network hosts IP address Router Address Subnet Mask Before DHCP Manual assignment BOOTP
DHCP Dynamic Host Configuration Protocol (DHCP) From 1993 An extension of BOOTP, very similar to DHCP Extensions: Supports temporary allocation (“leases”) of IP addresses DHCP client can acquire all IP configuration parameters needed to operate DHCP is the preferred mechanism for dynamic assignment of IP addresses DHCP can interoperate with BOOTP clients.
DHCP Features Protocol for providing configuration parameters to hosts over network Dynamic allocation of IP addresses Minimal human intervention
Preliminaries DHCP DHCP Server ClientsUDP Port UDP Port UDP Port UDP Port68 68 68 67 RouterSample Network Internet
Preliminaries DHCP Server: UDP port 67 DHCP Client: UDP port 68 Client-Server Exchange
Preliminaries DHCP Message = DHCP Packet Client = DHCP Client Server = DHCP Server Broadcast and unicast used for Packets’s in both directions “Broadcast”: link and IP addresses are broadcast “Unicast”: link and IP addresses are unicast
Initial Message FlowServer A Client Server B Client attempts to discover DHCPDISCOVE DHCPDISCOVE available DHCP servers R R Servers reply with offers DHCPOFFE DHCPOFFE R R Client collects offers and decides which offer to accept Client broadcasts request for DHCPREQUES DHCPREQUES one of the received offers T T Server acknowledges client’s Configuration complete DHCPAC use of IP address K Graceful shutdown Client explicitly releases DHCPRELEA use of IP address SE
Message TypesDHCPDISCOVER: Broadcast by a client to find availableDHCP servers.DHCPOFFER: Response from a server to aDHCPDISCOVER and offering IP address and otherparameters.DHCPREQUEST: Message from a client to servers thatdoes one of the following: Requests the parameters offered by one of the serversand declines all other offers. Verifies a previously allocated address after a systemor network change (a reboot for example). Requests the extension of a lease on a particularaddress.
Contd…..DHCPACK: Acknowledgement from server to clientwith parameters,including IP address.DHCPNACK: Negative acknowledgement from serverto client, indicating that the clients lease has expiredor that a requested IP address is incorrect.DHCPRELEASE: Message from client to servercanceling remainder of a lease and relinquishingnetwork address.DHCPINFORM : Message from a client that already hasan IP address (manually configured for example),requesting further configuration parameters from theDHCP server.
DHCP OperationDCHP REQUESTAt this time, the DHCPclient can start to use theIP addressRenewing a Lease(sent when 50% of lease has expired) If DHCP server sends DHCPNACK, then address is released. 13
DHCP OperationDCHP RELEASEAt this time, the DHCPclient has released the IPaddress 14
Lease Renewal Times (Client) T1 < T2 < Lease time T1 default value = 1/2 of lease time T2 default value = 7/8 of lease time Communicated via DHCPOFFER, DHCPACK Client actions when times elapse T1: client must renew address with the DHCP server T2: client must renew address with any DHCP server Lease time: client must stop using IP address
Renewal Message FlowServer A Client Server B T1 elapses Client unicasts request to DHCPREQUES continue using IP address T Server acknowledges Configuration complete request and updates lease DHCPACK T1 elapses Client unicasts request to DHCPREQUES continue using IP address T T2 elapses Client broadcasts request to DHCPREQUES DHCPREQUES continue using IP address T T Server acknowledges request Configuration complete and updates lease DHCPAC K
Server Storage Permanent storage Pool of available IP addresses Local configuration parameters Mapping between clients and leases
Server Logic Event Action Taken If current lease for client exists, send DHCPOFFERDHCPDISCOVER Else, if IP address available, send DHCPOFFER Else, do nothingDHCPREQUEST If IP address available, send DHCPACK Else, send DHCPNAKDHCPRELEASE Mark IP address available, delete leaseDHCPINFORM Send DHCPACK with configuration parametersLease expiration Mark IP address available, delete lease
Advantages It relieves the network administrator of a great deal of manual configuration work. The ability for a device to be moved from network to network and to automatically obtain valid configuration parameters for the current network can be of great benefit to mobile users. Because IP addresses are only allocated when clients are actually active, it is possible, by the use of reasonably short lease times and the fact that mobile clients do not need to be allocated more than one address, to reduce the total number of addresses in use in an organization.
Disadvantages Uses UDP, an unreliable and insecure protocol. DNS cannot be used for DHCP configured hosts. Potentially unauthorized clients Malicious client could exhaust address pool Malicious server (Rogue server) Supply incorrect configuration parameters