Thursday, February 4, 2010

DHCP Basics

Introducing Dynamic Host Configuration Protocol (DHCP)

1. DHCP benefits

Without correct and consistent configuration, TCP/IP hosts are unable to communicate successfully.
Dynamic Host Configuration Protocol (DHCP) is a client/server protocol that automatically assigns TCP/IP configuration to client computers on a network. DHCP ensures that each host has a subnet mask, a default gateway, and a unique IP address.
All configuration parameters that DHCP assigns are set on a central DHCP server.
A central DHCP server on a network controls whether the addresses it provides to clients are permanent or leased for a specific period of time.
When a DHCP server allocates leased addresses, clients revalidate their addresses and renew their leases by regularly checking with the DHCP server.
DHCP performs address allocation, leasing, and lease renewal transparently, thereby reducing the need for administrative input in TCP/IP address assignment.
Using DHCP on a network provides a number of significant benefits, including
• lower administrative overhead
• fewer address conflicts
• standards-based multi-platform support
lower administrative overhead
DHCP reduces administrative overhead by automatically assigning IP addresses to clients. It also provides a centralized base for managing and deploying IP address and configuration information.
Deployment is simplified by the inclusion of TCP/IP configuration information – default gateway, DNS suffix, and WINS server information – with each IP address assigned to a client. DHCP servers can register their clients' IP addresses and Fully Qualified Domain Names (FQDNs) with DNS servers on the network.
Fewer address conflicts
DHCP reduces the possibility of address conflicts by automatically assigning IP addresses to TCP/IP clients and monitoring the addresses it assigns. In this way, each assigned address is unique to the network.
Standards-based multi-platform support
DHCP is standards-based and is therefore supported by a range of operating systems and applications. Operation systems that support DHCP include Apple Mac, Linux, Windows, and UNIX.
2. The DORA process
DHCP clients and servers follow a formal request process by which clients obtain an IP address and other configuration information from the DHCP server.
The IP addresses that the DHCP server assigns are taken from a range of IP addresses known as an address pool or a scope.
DHCP also supports scope options, which provide particular addresses to specific systems – for example, a default gateway.
The request process between a DHCP client and server follows four formal steps – Discover, Offer, Request, Acknowledgement (DORA) – that are based on four message types exchanged between the two systems.
• DHCP Discover
• DHCP Offer
• DHCP Request
• DHCP Ack

DHCP Discover:-
When a client joins a network, it broadcasts a DHCP Discover message that contains the client's identity and a request for an IP address. The DHCP Discover message also requests IP configuration information, such as the address of the default gateway, the subnet mask, the domain name, and any static routes. This request is often termed an IP lease request.
All DHCP servers on the network segment receive and respond to a DHCP Discover message. If a single DHCP server is required to service more than one network segment, you need to configure the segment's routers to forward DHCP messages so that they can reach the shared DHCP server on a linked network.
If the routers cannot be configured to forward DHCP messages, then a DHCP relay agent may be configured on the subnet. The relay agent will pick up the Discover messages and forward them directly to the DHCP server.

DHCP Offer:-
Any DHCP server that has spare IP addresses and receives an IP lease request – in the form of a DHCP Discover message – responds by sending a DHCP Offer message to the client.
The DHCP server checks whether an IP address from its pool is in use on the network. If the address is unassigned, it then reserves the IP address until the client has accepted or rejected the offer.
Before sending a DHCP Offer, the DHCP server checks its scope details to see if a reservation exists for the client. If a reservation exists and the clients MAC address matches it, then the DHCP server offers the IP address corresponding to the reservation.
Clients may receive several offers from different DHCP servers but normally accept the first offer that they receive.

DHCP Request:-
Once a client has received and accepted a DHCP Offer message, it sends a DHCP Request message, asking to be assigned the IP address that the server offered. When the DHCP server receives the DHCP Request that accepts the IP address, the server marks the address as leased.
If a DHCP server receives a DHCP Request message stating that the client has accepted another server's offer or if the server does not receive a response within the allocated time, it returns the address to the address pool.

DHCP Ack:-
When a selected DHCP server receives an acceptance DHCP Request message and marks an address as leased, it generates a DHCP Ack message.
The DHCP Ack message confirms the client's address and includes additional configuration information for the client.
The client then checks this information and if it is valid, the client configures itself with the IP address and configuration information and can now communicate on the network.

The DORA process between client and server must move through each of the four steps:-

The client configures itself to use the IP address once it receives the DHCP Ack message. In the DHCP Request message the client accepts or rejects an IP address offer and the server receives the request for an IP address in the DHCP Discover message. The server sends an IP address to the client using the DHCP Offer message.
The DHCP Ack message contains confirmation of the IP address lease and further configuration information. If the client accepts this information as valid, it forms a binding relationship with the server and starts using its IP address lease.
The DHCP Discover message is a broadcast request by the client for an IP address lease.
The DHCP Offer message is sent by the server and contains an available IP address, which is offered to the client.
The DHCP Request message is sent by a client in response to a DHCP server's offer of an IP address. The client can respond by requesting or rejecting the IP address and lease offered by the server.

3. Lease renewal and reservations
A DHCP lease is a configurable time-span during which a client has permission to use a particular IP address. The default lease duration in Windows Server 2003 is eight days.
However, clients monitor when their lease is due to expire. When a lease is halfway through, a client sends a renewal request to the DHCP server.

If the renewal is approved, the client receives a DHCP Ack with a new expiry date. If the request is denied, the client attempts another lease renewal when the lease is 87.5 percent complete.
If a client's second renewal request fails, then the client will continue to use its current IP configuration until the lease expires.
When the lease expires, the client starts the DORA cycle from the beginning.
When a DHCP client with an active IP address lease is moved to a new or different subnet, it is unable to communicate on that subnet.
To ensure that a client reconfigures its lease settings, you need to manually release and renew the lease.
To manually release and renew the lease you type ipconfig /release followed by ipconfig /renew at the command prompt.
Relay agents are typically routers configured to forward Bootstrap Protocol (BOOTP) and DHCP requests to a DHCP server on a separate subnet.
The relay agents are configured with the DHCP server's address and forward DHCP packets

Summary:-
Dynamic Host Configuration Protocol (DHCP) is a client/server protocol that automatically assigns TCP/IP configuration to client computers on a network. The DHCP client and server applications are responsible for address allocation, leasing, and lease renewal. Benefits of DHCP include lower administrative overhead, fewer address conflicts, and standards-based multi-platform support.
DHCP clients and servers follow a formal request process by which clients obtain an IP address and other configuration information through the server. This process involves DHCP Discover, Offer, Request, and Ack messages and is known as DORA.
A DHCP lease is a configurable time-span during which a client has permission to use a particular IP address. When a DHCP client with an active IP address lease is moved to a new or different subnet, it is necessary to manually release and renew its lease. Additionally, relay agents can allow a single DHCP server to service clients across where the routers cannot forward DHCP messages.
blog comments powered by Disqus
 

About Me

A Networking Media Copyright © 2010 Community is Customised by Steptotech