DHCP Protocol

Enterprise networks are often comprised of multiple end systems that require IP address assignment in order to connect with the network segment to which the end system is attached. For small networks, a minimal number of end systems attached to the network allows for simple management of the addressing for all end systems.

For medium and large-scale networks however, it becomes increasingly difficult to manually configure IP addresses with increased probability of duplication of addressing, as well as misconfiguration due to human error, and therefore the necessity to implement a centralized management solution over the entire network becomes ever more prominent. The Dynamic Host Configuration Protocol (DHCP) is implemented as a management solution to allow dynamic allocation of addresses for existing fixed and temporary end systems accessing the network domain.

In cases it is also possible that there may be more hosts than available IP addresses on a network. Some hosts cannot be allocated a fixed IP address and need to dynamically obtain IP addresses using the DHCP server. Only a few hosts on a network require fixed IP addresses.


DHCP supports three mechanisms for IP address allocation. The method of automatic allocation involves DHCP assigning a permanent IP address to a client. The use of dynamic allocation employs DHCP to assign an IP address to a client for a limited period of time or at least until the client explicitly relinquishes the IP address.

The third mechanism is referred to as manual allocation, for which a client's IP address is assigned by the network administrator, and DHCP is used only to handle the assignment of the manually defined address to the client. Dynamic allocation is the only one of the three mechanisms that allows automatic reuse of an address that is no longer needed by the client to which it was assigned. Thus, dynamic allocation is particularly useful for assigning an address to a client that will be connected to the network only temporarily, or for sharing a limited pool of IP addresses among a group of clients that do not need permanent IP addresses.

Dynamic allocation may also be a good choice for assigning an IP address to a new client being permanently connected to a network, where IP addresses are sufficiently scarce that addresses are able to be reclaimed when old clients are retired. Manual allocation allows DHCP to be used to eliminate the error-prone process of manually configuring hosts with IP addresses in environments where it may be more desirable to meticulously manage IP address assignment.

A DHCP server and a DHCP client communicate with each other by exchanging a range of message types. Initial communication relies on the transmission of a DHCP Discover message. This is broadcast by a DHCP client to locate a DHCP server when the client attempts to connect to a network for the first time. A DHCP Offer message is then sent by a DHCP server to respond to a DHCP Discover message and carries configuration information.

A DHCP Request message is sent after a DHCP client is initialized, in which it broadcasts a DHCP Request message to respond to the DHCP Offer message sent by a DHCP server. A request message is also sent after a DHCP client is restarted, at which time it broadcasts a DHCP Request message to confirm the configuration, such as the assigned IP address. A DHCP Request message is also sent after a DHCP client obtains an IP address, in order to extend the IP address lease. 

A DHCP ACK message is sent by a DHCP server to acknowledge the DHCP Request message from a DHCP client. After receiving a DHCP ACK message, the DHCP client obtains the configuration parameters, including the IP address. Not all cases however will result in the IP address being assigned to a client. The DHCP NAK message is sent by a DHCP server to in order reject the DHCP Request message from a DHCP client when the IP address assigned to the DHCP client expires, or in the case that the DHCP client moves to another network.

A DHCP Decline message is sent by a DHCP client, to notify the DHCP server that the assigned IP address conflicts with another IP address. The DHCP client will then apply to the DHCP server for another IP address.

A DHCP Release message is sent by a DHCP client to release its IP address. After receiving a DHCP Release message, the DHCP server assigns this IP address to another DHCP client.

A final message type is the DHCP Inform message, and is sent by a DHCP client to obtain other network configuration information such as the gateway address and DNS server address after the DHCP client has obtained an IP address.

The AR2200 and S5700 series devices can both operate as a DHCP server to assign IP addresses to online users. Address pools are used in order to define the addresses that should be allocated to end systems. There are two general forms of address pools which can be used to allocate addresses, the global address pool and the interface address pool.

The use of an interface address pool enables only end systems connected to the same network segment as the interface to be allocated IP addresses from this pool. The global address pool once configured allows all end systems associated with the server to obtain IP addresses from this address pool, and is implemented using the dhcp select global command to identify the global address pool. In the case of the interface address pool, the dhcp select interface command identifies the interface and network segment to which the interface address pool is associated. 

The interface address pool takes precedence over the global address pool. If an address pool is configured on an interface, the clients connected to the interface obtain IP addresses from the interface address pool even if a global address pool is configured. On the S5700 switch, only logical VLANIF interfaces can be configured with interface address pools.

The acquisition of an IP address and other configuration information requires that the client make contact with a DHCP server and retrieve through request the addressing information to become part of the IP domain. This process begins with the IP discovery process in which the DHCP client searches for a DHCP server. The DHCP client broadcasts a DHCP Discover message and DHCP servers respond to the Discover message.

The discovery of one or multiple DHCP servers results in each DHCP server offering an IP address to the DHCP client. After receiving the DHCP Discover message, each DHCP server selects an unassigned IP address from the IP address pool, and sends a DHCP Offer message with the assigned IP address and other configuration information to the client.

If multiple DHCP servers send DHCP Offer messages to the client, the client accepts the first DHCP Offer message received. The client then broadcasts a DHCP Request message with the selected IP address. After receiving the DHCP Request message, the DHCP server that offers the IP address sends a DHCP ACK message to the DHCP client. The DHCP ACK message contains the offered IP address and other configuration information. 

Upon receiving the DHCP ACK message, the DHCP client broadcasts gratuitous ARP packets to detect whether any host is using the IP address allocated by the DHCP sever. If no response is received within a specified time, the DHCP client uses this IP address. If a host is using this IP address, the DHCP client sends the DHCP Decline packet to the DHCP server, reporting that the IP address cannot be used, following which the DHCP client applies for another IP address.

After obtaining an IP address, the DHCP client enters the binding state. Three timers are set on the DHCP client to control lease update, lease rebinding, and lease expiration. When assigning an IP address to a DHCP client, a DHCP server specifies values for the timers.

If the DHCP server does not set the values for the timers, the DHCP client uses the default values. The default values define that when 50% of the lease period remains, the release renewal process should begin, for which a DHCP client is expected to renew its IP address lease. The DHCP client automatically sends a DHCP Request message to the DHCP server that has allocated an IP address to the DHCP client.

If the IP address is valid, the DHCP server replies with a DHCP ACK message to entitle the DHCP client a new lease, and then the client re-enters the binding state. If the DHCP client receives a DHCP NAK message from the DHCP server, it enters the initializing state.

After the DHCP client sends a DHCP Request message to extend the lease, the DHCP client remains in an updating state and waits for a response. If the DHCP client does not receive a DHCP Reply message from the DHCP server after the DHCP server rebinding timer expires which by default occurs when 12.5% of the lease period remains, the DHCP client assumes that the original DHCP server is unavailable and starts to broadcast a DHCP Request message, for which any DHCP server on the network can reply with a DHCP ACK or NAK message. 

If the received message is a DHCP ACK message, the DHCP client returns to the binding state and resets the lease renewal timer and server binding timer. If all of the received messages are DHCP NAK messages, the DHCP client goes back to the initializing state. At this time, the DHCP client must stop using this IP address immediately and request a new IP address. 

The lease timer is the final timer in the expiration process, and if the DHCP client does not receive a response before the lease expiration timer expires, the DHCP client must stop using the current IP address immediately and return to the initializing state. The DHCP client then sends a DHCP DISCOVER message to apply for a new IP address, thus restarting the DHCP cycle. 

There are two forms of pool configuration that are supported in DHCP, these include defining a global pool or an interface based pool. The dhcp select interface command is used to associate an interface with the interface address pool in order to provide configuration information to connected hosts. The example demonstrates how interface Gigabit Ethernet 0/0/0 has been assigned as part of an interface address pool 

Each DHCP server will define one or multiple pools which may be associated globally or with a given interface. For determining the pool attributes associated with an interface, the display ip pool interface <interface> command is used. The DHCP pool will contain information including the lease period for each IP addressthat is leased, as well as the pool range that is supported. In the event that other attributes are supported for DHCP related propagation to clients such as with the IP gateway, subnet mask, and DNS server, these will also be displayed. 

The example demonstrates the DHCP configuration for a global address pool that is assigned to the network 10.2.2.0. The dhcp enable command is the prerequisite for configuring DHCP-related functions, and takes effect only after the dhcp enable command is run. A DHCP server requires the ip pool command be configured in the system view to create an IP address pool and set IP address pool parameters, including a gateway address, the IP address lease period etc. The configured DHCP server can then assign IP addresses in the IP address pool to clients.

A DHCP server and its client may reside on different network segments. To enable the client to communicate with the DHCP server, the gateway-list command is used to specify an egress gateway address for the global address pool of the DHCP server. The DHCP server can then assign both an IP address and the specified egress gateway address to the client. The address is configured in dotted decimal notation for which a maximum of eight gateway addresses, separated by spaces, can be configured. 

The information regarding a pool can be also observed through the used of the display ip pool command. This command will provide an overview of the general configuration parameters supported by a configured pool, including the gateway and subnet mask for the pool, as well general statistics that allow an administrator to monitor the current pool usage, to determine the number of addresses allocated, along with other usage statistics. 

SUMMARY

IP addresses that are used for server allocation such as any local DNS servers in order to avoid address conflicts.

The default lease period for DHCP assigned IP addresses is set at a period equal to one day.