What is DHCP?
DHCP is the Dynamic Host Configuration Protocol. It is a network protocol that sends host configuration information to computers (and other devices) on the network. A DHCP server ‘leases’ an IP address to a client device. When the lease is up, the client needs to renew it, at which point it will receive an update of the configuration information, which makes the client configuration dynamic. Hence, "Dynamic Host Configuration Protocol".
Using DHCP has two major benefits:
1. It can manage your IP address pool. The system administrator gives the DHCP server an range of IP addresses to use. When a client sends a DHCP request, the server will allocate one address from the pool to that client (for the duration of that lease). The server will ensure that each address is leased only once.
2. DHCP can also provide other network configuration parameters to its clients. The network mask and default gateway are required for proper network operation, but it can also be configured to provide the addresses of DNS revolvers, the DNS domain name for the client, the addresses of time servers (NTP), and much more. By using DHCP you can ensure that all devices on the network use the same parameters, and if you need to change one of them, you only need to change it in one place.
DHCP is an internet standard, published as RFC2131. Implementations exist for many different platforms, covering clients and servers. As a standard protocol there is no need to run the same implementation on clients and servers. A Linux client will happily interact with for example a Microsoft DHCP Server, and Windows clients can retrieve their configuration from a Linux system running the DHCP daemon.
Why DHCP is important When connected to a network, every computer must be assigned a unique address.However, when adding a machine to a network, the assignment and configuration of network (IP) addresses has required human action. The computer user had to request an
address, and then the administrator would manually configure the machine. Mistakes in
the configuration process are easy for novices to make, and can cause difficulties for
both the administrator making the error as well as neighbors on the network. Also, when
mobile computer users travel between sites, they have had to relive this process for each
different site from which they connected to a network. In order to simplify the process of
adding machines to a network and assigning unique IP addresses manually, there is a
need to automate the task.
How does DHCP work When a client needs to start up TCP/IP operations, it broadcasts a request for address information. The DHCP server receives the request, assigns a new address for a specific time period (called a lease period) and sends it to the client together with the other
required configuration information. This information is acknowledged by the client, and
used to set up its configuration. The DHCP server will not reallocate the address during
the lease period and will attempt to return the same address every time the client
requests an address. The client may extend its lease with subsequent requests, and may
send a message to the server before the lease expires telling it that it no longer needs
the address so it can be released and assigned to another client on the network.
Can DHCP provide support for mobile users Yes. The benefits of dynamic addressing are especially helpful in mobile computing environments where users frequently change locations. Mobile users simply plug-in their laptop to the network, and receive their required configuration automatically. When moving to a different network using a DHCP server, then the configuration will be supplied by that network’s server. No manual reconfiguration is required at all.
· Computers don’t have to be individually configured; they get all the configuration information they need via DHCP, such as e.g., the gateway, a WINS server address, an IP address, a net mask, the name server addresses etc.
· A network can be easily readdressed, expanded or made smaller, without having to reconfigure individual machines.
· New services (e.g., WINS server, DNS Name server) can be easily installed, without having to manually configure each machine.
· Mobility is dead easy – a laptop can be removed from one network and connected to another and gets its correct configuration on the new network immediately- completely automatically. This is of interest to people who sometimes work and also to people who occasionally want to put their laptop on the network in a lecture theatre.
· Users who take their laptops home and have a small network at home can also set up DHCP at home. Plug out at ETH, plug in at home, done.
· You can get away with less IP addresses in a network where not all of the computers are in constant use.
· DHCP doesn’t rule out fixed addresses; you can have dynamic as well as static addresses in a network, if required.
A typical DHCP transaction looks like this:
· The client broadcasts a DHCPDISCOVER request ("hello, can anyone hear me? I need an IP address!").
· This request is transferred to the DHCP server by the router.
· All listening DHCP servers send an offer (DHCPOFFER) to the client ("here is an address, do you want it?"). Each offer contains a very short lease for the offered address – the client may use this address for a minute or two.
· The client chooses an offer and sends a DHCPREQUEST ("yes please, I’ll take this address") back to the offering DHCP server.
· Finally, the relevant DHCP server sends a DHCPACK back to the client ("OK, here is your address; you can use it for X seconds"). Contained in the DHCPACK is additional information such as name server addresses, a gateway address, a net mask etc.
1: IP addresses don’t "belong" to anybody
No IP address "belongs" to a person, a machine, an institute or a department. All IP addresses at ETHZ are managed by the Data Communications Group. Data Communications can demand the readdressing of a machine or a subnet for technical or other reasons.
2: DHCP-managed addresses must be entered in the DNS
IP addresses managed by the DHCP servers must be entered in the DNS before they are released as DHCP addresses. They will be identified as DHCP addresses in the DNS database. It is important for the service to know which addresses are in use, which addresses are managed by DHCP and which addresses are still available.
3: Be sparing with IP addresses
IP addresses are a scarce resource. DHCP ranges should not be designed for the "worst case" but rather for normal use. As a guide, you need one DHCP address per permanent employee. Fewer will suffice on large networks where it rarely happens that everyone is present at the same time. For guests and other "transient users", far fewer are needed. Where it is not customary to turn computers off in the evening, more addresses will be needed than on networks where computers are regularly turned off.
4: DHCP ranges should be scattered as little as possible
Each range has to be configured on the DHCP servers and means a load for that server. Furthermore, small scattered ranges make administration more difficult, because they are not clear. If IP addresses on a network are going to be allocated via DHCP, these addresses should exist in one block. In some circumstances it may be necessary to renumber other computers that have fixed addresses in order to make room.
5: Reserved addresses should be avoided
There are some computers that should always receive the same address. There are different reasons for this – e.g. because a computer is a server that has to always be found using the same address. Most computers however do not need this. Such a reservation is costly because it is not automatic. A reserved address is also not available for other computers.
Therefore, static addresses will not be reserved except for strictly technical reasons.
6: Reserved addresses in the same subnet must be consecutive
It is rarely the case that a computer that needs a reserved address needs a *particular* address; the most important thing is that it always has the same address.
If there is only one single such computer in a network, it doesn’t matter which address it gets. If there are several such computers however, they will be allocated consecutive addresses. In some circumstances it may be necessary to renumber other computers that have fixed addresses in order to make room.
7: DHCP addresses may not be "stolen"
If a DHCP server notices that an IP address from one of the ranges it manages is in use, but was not allocated by it, it tags this address as "abandoned"; the IP address is therefore no longer available to the server. IP addresses managed by a DHCP server may not therefore be appointed as static addresses, even temporarily!If a computer needs a fixed address, even for a short time, you must either request a reserved address or take an IP address that does not come from a DHCP range.
The Easiest way to show what’s going on between the clients.
This is what you would see if you were using a network monitor
How to setup DHCP on Windows 2000 Server.
1. Go to Start→Programs→Administrative Tools→DHCP this will bring up the DHCP
configuration Wizard which looks like this:
2. Next right click on the server you wish to create a scope then select NEW SCOPE.
3. Configuring Server Options
4. Adding a new scope wizard.
5. Click next on the Wizard and Select your Scope name and Description:
6. Click Next & Enter the Starting &Ending IP address used in DHCP range.
7. Excluded IP Addresses range.
8. Now specifying the lease duration for each client.
9. Select the choice for configuring scope options.
10. Entering the IP Address For Router
11. Entering the parent domain name and server name.
12. Completing the new scope wizard.
13. View of DHCP after completing the configuration.