Vous êtes sur la page 1sur 5

DHCP

DHCP is a network protocol that automatically assigns TCP/IP information to client machines. Each DHCP client connects to the centrally located DHCP server, which returns that client's network configuration (including the IP address, gateway, and DNS servers). DHCP uses the concept of a "lease" or amount of time that a given IP address will be valid for a computer. The lease time can vary depending on how long a user is likely to require the Internet connection at a particular location. It's especially useful in education and other environments where users change frequently. Using very short leases, DHCP can dynamically reconfigure networks in which there are more computers than there are available IP addresses. DHCP supports static addresses for computers containing Web servers that need a permanent IP address

DHCP consists of two components: A protocol for delivering host-specific configuration parameters from a server to a host A mechanism for allocation of network addresses to hosts.
IP Address Allocation

DHCP supports three mechanisms for IP address allocation. Automatic allocation -- in which a permanent IP address is assigned to the client. Dynamic allocation -- in which the address is assigned for a limited period of time (a "lease"). Manual allocation -- in which the address is assigned manually by the network administrator.

PROTOCOL STRUCTURE - DHCP DYNAMIC HOST CONFIGURATION PROTOCOL

Op -- DHCP message operation code: either BOOTREQUEST or BOOTREPLY. Htype -- The hardware address type. Hlen -- The hardware address length. Xid -- The transaction ID. Secs -- The seconds elapsed since the client began the address acquisition or renewal process. Flags -- The flags. Ciaddr -- The client IP address. Yiaddr -- The "Your" (client) IP address. Siaddr -- The IP address of the next server to use in bootstrap. Giaddr -- The relay agent IP address used in booting via a relay agent. Chaddr -- The client hardware address. sname -- Optional server host name, null terminated string File -- Boot file name, null terminated string; "generic name or null in DHCPDISCOVER, fully qualified directory-path name in DHCPOFFER. Options -- Optional parameters field. See the options documents for a list of defined options.

DHCP OPERATION
A DHCP server is needed which distributes the IP addresses. This machine will serve as a base for all DHCP requests and must also have a fixed IP address. Therefore, on a network there can only be one machine with a fixed IP address, the DHCP server.
The technique used is the broadcast: to find and talk with a DHCP server, the machine will simply send a special broadcast packet over the local network. When the DHCP receives the broadcast packet, it will send back another broadcast containing all the information required for the client. It could be believed that one single packet is enough for the protocol to work. In fact, there are several types of DHCP packets likely to be issued either by the client for the server(s), or by the servers to a client:

DHCPDISCOVER (to locate available DHCP servers)

DHCPOFFER (server response to a DHCPDISCOVER packet, which contains the initial parameters) DHCPREQUEST (varied request from the client for example to extend itslease) DHCPACK (server response which contains the parameters and IP address of the client) DHCPNAK (server response to indicate to the client that its lease has expired or if the client announces a bad network configuration) DHCPDECLINE (the client announces to the server that the address is already in use) DHCPRELEASE (the client releases its IP address) DHCPINFORM (the client requests local parameters, it already has its IP address)

The first packet issued by the client is a DHCPDISCOVER type packet. The server responds with a DHCPOFFER packet, particularly in order to submit an IP address to the client. The client establishes its configuration and then makes a DHCPREQUEST to validate its IP address (a broadcast request since DHCPOFFER does not contain the IP address). The server simply responds with a DHCPACK with the IP address for confirmation of the allocation. Normally, this is enough for the client to obtain an effective network configuration, but it can be longer or shorter according to whether the client accepts the IP address or not.

CLIENT/SERVER MODEL
DHCP is based on a client/server model. DHCP clients send a request to a server to which the server responds. A client sends requests using MAC broadcasts to reach all devices in the LAN. A DHCP relay might be needed to forward requests across interworking units to a DHCP server

The most common settings provided by a DHCP server to DHCP clients include: IP address and netmask IP address of the default-gateway to use IP addresses of the DNS servers to use DHCP server can also supply configuration properties such as: Host Name Domain Name Time Server Print Server

Consider the scenario where there is one client and two servers are present. A typical initialization of a DHCP client is shown below:

The client broadcasts a DHCPDISCOVER into the subnet. There might be a relay to forward this broadcast. In the case shown, two servers receive this broadcast and determine the configuration they can offer to the client. Servers reply to the clients request with DHCPOFFER and offer a list of configuration parameters. The client can now choose one of the configurations offered. The client in turn replies to the servers, accepting one of the configurations and rejecting the others using DHCPREQUEST. If a server receives a DHCPREQUEST with a rejection, it can free the reserved configuration for other possible clients. The server with the configuration accepted by the client now confirms the configuration with DHCPACK. This completes the initialization phase. If a client leaves a subnet, it should release the configuration received by the server using DHCPRELEASE. Now the server can free the context stored for the client and offer the configuration again. The configuration a client gets from a server is only leased for a certain amount of time; it has to be reconfirmed from time to time. Otherwise the server will free the configuration. This timeout of configuration helps in the case of crashed nodes or nodes moved away without releasing the context.

DHCP USES
DHCP is useful for automatic configuration of client network interfaces. When configuring the client system, the administrator chooses DHCP instead of specifying an IP address, netmask, gateway, or DNS servers. The client retrieves this information from the DHCP server. DHCP is also useful if an administrator wants to change the IP addresses of a large number of systems. Instead of reconfiguring all the systems

BENEFITS OF USING DHCP


DHCP provides the following benefits for administering the network: Safe and reliable configuration DHCP minimizes configuration errors caused by manual IP address

configuration, such as typographical errors, or address conflicts caused by the assignment of an IP address to more than one computer at the same time.. Reduces configuration management DHCP includes the following features to reduce network administration:

Centralized and automated TCP/IP configuration. The ability to define TCP/IP configurations from a central location. The ability to assign a full range of additional TCP/IP configuration values by means of DHCP options. The efficient handling of IP address changes for clients that must be updated frequently, such as those for portable computers that move to different locations on a wireless network. The forwarding of initial DHCP messages by using a DHCP relay agent, thus eliminating the need to have a DHCP server on every subnet.

ADVANTAGES OF DHCP
DHCP has a number of advantages: There is no need to manually configure each client with an IP address. Not necessary to keep a record of the IP addresses that have assigned. Can automatically assign a new IP address if a client moves to a different subnet. Can release the IP address of a computer that is offline and reassign the address to another computer. Address duplication is eliminated as DHCP automatically tracks IP address assignments. The DHCP server can detect unauthorised DHCP servers on the network DHCP is very flexible and allows the network administrator to set up the server one time to serve many thousands of clients.

DISADVANTAGE OF DHCP:
The DHCP server can be a single point of failure in networking environments that only have one DHCP server. If your network has multiple segments, you have to perform either of the following additional configurations: Place a DHCP server on each segment Place a DHCP relay agent on each segment Configure routers to forward Bootstrap Protocol (BootP) broadcasts. All incorrectly defined configuration information will automatically be propagated to your DHCP clients. There are a few DHCP client implementations that do not function correctly with a Windows Server 2003 DHCP server