Training
Certifications
Books
Special Offers
Community




 
ALS Microsoft® Windows® 2000 Network Infrastructure Administration, Second Edition
Author Microsoft Corporation
Pages 864
Disk N/A
Level Beg/Int
Published 01/15/2003
ISBN 9780735618701
 

More Information

About the Book
Table of Contents
Sample Chapter
Index
Related Series
Related Books
About the Author

Support: Book & CD

 

 


Chapter 5: Implementing the Dynamic Host Configuration Protocol



Chapter 5   Implementing the Dynamic Host Configuration Protocol

About This Chapter

Dynamic Host Configuration Protocol (DHCP) is a service that enables computers on a network to automatically request and receive Transmission Control Protocol/Internet Protocol (TCP/IP) configuration settings from a central server, rather than through a manual configuration process. Using DHCP relieves network administrators of several onerous chores, including the assignment and tracking of IP addresses and the need to travel to each computer to configure it individually. In this chapter, you learn how DHCP works and how to implement it on your own network.

Before You Begin

To fully understand the benefits of DHCP, you should be familiar with the TCP/IP protocols and particularly with the IP addressing process, as discussed in Chapter 2, "Introducing TCP/IP." To perform the exercises in this chapter, you must have two Microsoft Windows 2000 computers connected to a local area network (LAN). One of the computers must be running Windows 2000 Server and have Network Monitor installed; the other computer can be running any version of Windows 2000 and must be configured to function as a DHCP client.

Lesson 1: Introducing DHCP

The use of the TCP/IP protocol suite on a private network provides a number of distinct advantages, such as the ability of the protocols to support any computing platform. The main element that provides this cross-platform interoperability is the independent IP addressing scheme that uniquely identifies every computer on the network. Unfortunately, this great advantage is also the cause of a major administrative problem. Assigning unique IP addresses to every computer on a large network is difficult, and manually configuring every computer to use those addresses is extremely time-intensive and labor-intensive. As a solution to this problem, DHCP automates the IP address assignment process and eliminates the need to configure every TCP/IP computer on the network.


After this lesson, you will be able to

  • Describe the development of DHCP
  • Describe the DHCP message format
  • Understand DHCP communications

Estimated lesson time: 45 minutes


Understanding the Origins of DHCP

The roots of DHCP began in the days when it was common to use diskless workstations—that is, computers with no disk drives—on local area networks for economic reasons. To use a diskless workstation on a TCP/IP network, the computer still had to have a unique IP address, so a group of developers created a protocol called the Reverse Address Resolution Protocol (RARP) to make IP address assignment possible. RARP is standardized in a Request For Comments (RFC) document, published by the Internet Engineering Task Force (IETF), called RFC 903. It is closely related to the Address Resolution Protocol (ARP) still used on TCP/IP networks today. The difference between the two is that with RARP, a computer transmits a message containing its data-link layer hardware address to a server and receives in reply a message containing an IP address for it to use. ARP, by contrast, is used to resolve IP addresses into hardware addresses.

A RARP server uses the same message format as ARP and is a simple mechanism for assigning IP addresses over the network. RARP is insufficient for the configuration of a modern TCP/IP client, however, for several reasons. Chief among these is that RARP assigns a workstation an IP address only; it cannot assign a subnet mask or other TCP/IP configuration parameters. Also, an administrator must configure a RARP server with the individual IP address assignments, so it provides no help in tracking address assignments.

The next step in the development of an automated TCP/IP configuration solution is called the Bootstrap Protocol (BOOTP), which is based on a standard published as RFC 951 with extensions in the RFC 1533 and RFC 1542 documents. BOOTP offers several improvements over RARP, including the ability to supply clients with subnet masks, router addresses, and other TCP/IP configuration parameters in addition to IP addresses. Diskless workstations can also download an executable boot file from a BOOTP server using the Trivial File Transfer Protocol (TFTP).

BOOTP messages are carried in User Datagram Protocol (UDP) datagrams, whereas RARP messages are carried directly in data-link layer protocol frames. BOOTP also has a mechanism to support clients on other LANs through the use of BOOTP relay agents, which forward messages to a BOOTP server on another network.

The drawback of BOOTP, as with RARP, is that an administrator must create a configuration for each client on the BOOTP server. BOOTP therefore does nothing to prevent configuration errors such as duplicate or incorrect IP addresses.

To address these shortcomings, a group of developers set out to define an improvement to BOOTP that would provide a complete, automated TCP/IP client configuration solution. The result was the Dynamic Host Configuration Protocol (DHCP), as defined in RFC 2131. The developers' design goals in creating DHCP included the following:

  • DHCP client computers should require no manual configuration. Each client should be able to discover appropriate local configuration parameters without user intervention and incorporate the parameters into its own configuration.
  • DHCP clients should require no manual configuration. Under normal circumstances, the user or network administrator should not have to enter any per-client configuration parameters.
  • DHCP should not require a server on each subnet. To allow for scalability and economy, DHCP must be able to function across routers or through the intervention of BOOTP relay agents.
  • DHCP clients must be capable of handling multiple responses to a request for configuration parameters. This is to enable the installation of multiple, overlapping DHCP servers to provide fault tolerance and increase performance.
  • DHCP must coexist with statically configured, nonparticipating hosts and with existing network protocol implementations.
  • DHCP must be capable of providing service to existing BOOTP clients.
  • DHCP must be able to ensure that any specific network address will not be in use by more than one DHCP client at a time.
  • DHCP clients must retain their configurations across a DHCP client reboot. A DHCP client should, whenever possible, be assigned the same configuration parameters in response to each request.
  • DHCP clients must retain their configuration across a DHCP server reboot. Whenever possible, a DHCP client should be assigned the same configuration parameters despite restarts of the DHCP server mechanism.
  • DHCP must support fixed or permanent allocation of configuration parameters to specific clients.

The resulting DHCP mechanism is a combination of a client/server application and a protocol that performs two basic tasks: IP address assignment and configuration of other TCP/IP client parameters. As illustrated in Figure 5.1, each time a DHCP client starts, it requests IP addressing information from a DHCP server, including the IP address, the subnet mask, and optional values. The optional values might include a default gateway address, Domain Name System (DNS) address, and Windows Internet Name Service (WINS) server address.

Click to view graphic
Click to view graphic

Figure 5.1   How a DHCP client interacts with a DHCP server

When a DHCP server receives a request, it selects IP addressing information from a pool of addresses defined in its database and offers it to the DHCP client. If the client accepts the offer, the IP addressing information is leased to the client for a specified period of time. If no available IP addressing information is in the pool to lease to a client, the client cannot initialize TCP/IP.

Assigning IP Addresses

To assign IP addresses to clients, DHCP uses a pool of addresses called a scope. When you configure the DHCP server, you create a scope consisting of a range of IP addresses for each of your subnets. When a DHCP client requests an address from a DHCP server, the server assigns an address from the appropriate scope and updates its internal database to show that address as being in use. This is an improvement over BOOTP, which relies on an administrator to configure the server with an IP address for each client. A DHCP server cannot assign the same IP address to two different computers and continuously maintains a record of addresses currently in use.

To fulfill the developers' intentions, DHCP can assign IP addresses using three methods:

  • Manual allocation.  The assignment of a single predetermined IP address to a specific DHCP client, identified by its data-link layer hardware address. Manual allocation is intended for use on clients that must have particular IP addresses permanently assigned to them, such as Internet servers. Using manual allocation rather than configuring these clients by hand prevents the IP addresses from being duplicated because of human error.
  • Automatic allocation.  The permanent assignment of IP addresses from a scope. When a client is assigned an address, it retains it until an administrator manually changes the configuration. Automatic allocation is intended for networks where client computers are rarely moved between subnets, there is no shortage of IP addresses, and administrators want to minimize the network traffic generated by DHCP.
  • Dynamic allocation.  The assignment of IP addresses from a scope on a leased basis. When a client is assigned an address, a lease timer begins counting down until the lease is renewed by the client or it expires, in which case the IP address is returned to the scope. Dynamic allocation makes it possible for client computers to be moved to other subnets without depleting the supply of IP addresses.

Configuring TCP/IP Parameters

IP address assignment is only a part of DHCP's functionality. To support large network installations, TCP/IP client workstations have to be assigned a subnet mask and usually other settings, such as default gateway and DNS server addresses, as well. DHCP makes this possible by providing support for a large number of options that correspond to the configuration parameters for a wide variety of DHCP client configurations. The object is to provide support for all the possible TCP/IP configuration parameters required by the many computing platforms that use DHCP. DHCP also supports a vendor-specific information option that enables third-party developers and network administrators to create customized options that they can apply to specific clients.

RFC 2132, "DHCP Options and BOOTP Vendor Extensions," contains a list of the options that DHCP server implementations should support. Vendors can submit options designed to support their products for evaluation and inclusion in the document.

DHCP Messaging

DHCP consists of the following three parts:

  • A service that responds to DHCP requests from clients and maintains records of IP address assignments
  • A client that generates requests for TCP/IP parameters and configures the TCP/IP client
  • The protocol that the clients and server use to communicate

DHCP is an application layer protocol that generates messages that are transmitted using UDP. Both the DHCP client and the DHCP server have well-known port numbers assigned to them. The DHCP client uses port 68 and the DHCP server uses port 67. These are the same port numbers used by BOOTP, which is one factor that helps DHCP servers provide support for earlier BOOTP clients.

DHCP clients and servers use just one basic message format for their communications, which is illustrated in Figure 5.2.

Click to view graphic
Click to view graphic

Figure 5.2  The DHCP message format

The functions of the message fields are as follows:

  • Op (1 byte).  Specifies whether the message originated at a client or a server
  • Htype (1 byte).  Specifies the type of hardware address in the Chaddr field
  • Hlen (1 byte).  Specifies the length of the hardware address in the Chaddr field, in bytes
  • Hops (1 byte).  Specifies the number of routers in the path between the client and the server
  • Xid (4 bytes).  Contains a transaction identifier used to associate requests and replies
  • Secs (2 bytes).  Specifies the elapsed time (in seconds) since the beginning of an address allocation or lease renewal process
  • Flags (2 bytes).  Indicates whether DHCP servers and relay agents should use broadcast transmissions instead of unicast transmissions to communicate with a client
  • Ciaddr (4 bytes).  Contains the client computer's IP address when it is in the bound, renewal, or rebinding state
  • Yiaddr (4 bytes).  Contains the IP address being offered to a client by a server
  • Siaddr (4 bytes).  Specifies the IP address of the next server in a bootstrap sequence; used only when the DHCP server supplies an executable boot file to a diskless workstation
  • Giaddr (4 bytes).  Contains the IP address of a DHCP relay agent located on a different network, when necessary
  • Chaddr (16 bytes).  Contains the hardware address of the client system, using the type and length specified in the Htype and Hlen fields
  • Sname (64 bytes).  Contains either the host name of the DHCP server or overflow data from the Options field
  • File (128 bytes).  Contains the name and path to an executable boot file for diskless workstations
  • Options (variable).  Contains a series of DHCP options, which specify the configuration parameters for the client computer

The Options field is where DHCP messages carry all the TCP/IP configuration parameters other than the IP address. The field can contain multiple options, each of which (in most cases) consists of three subfields (see Figure 5.3).

Click to view graphic
Click to view graphic

Figure 5.3  The DHCP Option field format

The three subfields of the Options field are as follows:

  • Code (1 byte).  Specifies the function of the option
  • Length (1 byte).  Specifies the length of the Data field
  • Data (variable).  Contains information specific to the option type

DHCP messages can carry a great many options in the Options field, some of which are listed in the following sections.

The Message Type Option

Although it sounds like a contradiction in terms, one option is required in every DHCP message. This is the DHCP Message Type option, which contains a code that specifies the function of each message. This option has eight possible values, as follows:

  • 1—DHCPDISCOVER.  Used by clients to request configuration parameters from a DHCP server
  • 2—DHCPOFFER.  Used by servers to offer IP addresses to requesting clients
  • 3—DHCPREQUEST.  Used by clients to accept or renew an IP address assignment
  • 4—DHCPDECLINE.  Used by clients to reject an offered IP address
  • 5—DHCPACK.  Used by servers to acknowledge a client's acceptance of an offered IP address
  • 6—DHCPNAK.  Used by servers to reject a client's acceptance of an offered IP address
  • 7—DHCPRELEASE.  Used by clients to terminate an IP address lease
  • 8—DHCPINFORM.  Used by clients to obtain additional TCP/IP configuration parameters from a server

The Pad Option

The Pad option does not use the three subfields listed earlier and does not carry any additional information. The option consists of a 1-byte code field with a value of 0 that the transmitting computer uses to pad out other options so that their boundaries fall between 8-byte words.

The End Option

The End option indicates the end of the Options field.

The Option Overload Option

When a DHCP message includes a large number of options, it can exceed the maximum size of the Options field, which is itself limited by the 576-byte maximum size for an IP datagram. To carry the maximum amount of option information in a message, it's possible for the transmitting system to utilize the Sname and File fields to carry additional options. These two fields are holdovers from BOOTP that are rarely used today. By including the Option Overload option, the transmitting computer can specify whether the Sname field, the File field, or both, carry option information. Together, these two fields can hold an extra 192 bytes of option information.

BOOTP Vendor Information Extensions

RFC 2132 is the latest version of a document that has undergone several revisions and updates over the years. The original version of the document, RFC 1497, contained the most basic of the DHCP options, the ones that you are most likely to use today to support your TCP/IP clients. In addition to the Pad and End options already discussed, these original DHCP options include the following:

  • Subnet Mask.  Specifies which bits of the IP address identify the host system and which bits identify the network where the host system is located
  • Router.  Specifies the IP address of the router (or default gateway) on the local network that the client should use to transmit data to systems on other networks
  • Domain Name Server.  Specifies the IP addresses of the servers that the client will use for DNS name resolution
  • Host Name.  Specifies the DNS host name that the client system will use
  • Domain Name.  Specifies the name of the DNS domain in which the system is located

The Vendor-Specific Information Option

The Vendor-Specific Information option is designed to enable third-party developers to use DHCP to deliver configuration information required for their products. The option can itself contain multiple options, each of which has its own Code, Length, and Data field, plus an End option to indicate the end of the vendor-specific options. To ensure that the vendor-specific option information is delivered only to the computers using the vendor's product, you assign a unique value to those systems using the Vendor Class Identifier option in the DHCP messages. You then configure the DHCP clients using the vendor's product with the same class identifier so that they know to process the vendor-specific options.

Other Options

The other options defined in the RFC 2132 document are grouped into several different categories, such as the following:

  • Host-specific IP layer parameters.  Configure various Internet Protocol settings on the client computer, such as the default Time to Live settings and whether the client system should be configured to route IP packets
  • Interface-specific IP layer parameters.  Configure settings that are particular to the network interface over which the DHCP message arrives, such as the maximum transmission unit (MTU) size for the interface and the broadcast address it should use
  • Link layer parameters.  Configure settings specific to the link (or data-link) layer protocol running on the client computer, such as the ARP cache timeout interval and the Ethernet frame type the system should use
  • TCP parameters.  Configure TCP-specific settings on the client, such as the TCP Time to Live value
  • Application and service parameters.  Configure settings for specific application layer processes, including the NetBIOS over TCP/IP parameters used to control the use of WINS on Windows systems
  • DHCP extensions.  Configure settings that control the behavior of the DHCP client itself, such as the length of the DHCP address lease and the renewal and rebinding time values

Although most, if not all, DHCP server implementations support the use of all these options, not all DHCP clients can process them, even if the option represents a configurable parameter on the client computer. In other words, even though you might be able to manually modify the ARP cache timeout setting on a given workstation, this does not necessarily mean that including the DHCP ARP Cache Timeout option in your DHCP messages can automatically configure that setting.

Understanding DHCP Communications

Activating a DHCP client causes it to initiate communications with DHCP servers whenever the computer starts, as illustrated in Figure 5.4. The client generates a series of DHCP packets using the DHCPDISCOVER message type, which it transmits as broadcasts. The function of these messages is to locate DHCP servers and to request an IP address assignment from them. Broadcasts are the client's only option at this point because it has no IP address yet, and it is therefore said to be in the init state. Like all broadcasts, these transmissions are limited to the client's local network and, under normal conditions, reach only the DHCP servers located on that network. However, administrators can install a DHCP Relay Agent service on a computer on the LAN, which relays the DHCPDISCOVER messages to DHCP servers on other networks. This enables a single DHCP server to service clients on multiple LANs.

When a DHCP server receives a DHCPDISCOVER message from a client, it generates a response using the DHCPOFFER message type, containing an IP address and whatever other DHCP options the server is configured to supply. How the server transmits the DHCPOFFER message to the client is determined by a variety of factors. Chief among these is the state of the "broadcast bit," which is included in the Flags field of the DHCPDISCOVER message. This bit indicates whether the server should transmit its responses as broadcasts or unicasts. In most cases, the server transmits the DHCPOFFER message as a broadcast, because the client still does not have an IP address that the server can use for a unicast transmission. If the broadcast bit is not enabled, however, the server can generate a unicast transmission, using the IP address it is offering (found in the Yiaddr field) and the data-link layer hardware address specified in the Chaddr field of the DHCPDISCOVER message.

Click to view graphic
Click to view graphic

Figure 5.4  DHCP client/server communications

When the server receives the DHCPDISCOVER message through a DHCP relay agent, the server sends the DHCPOFFER message as a unicast to the relay agent address specified in the Giaddr field, and the relay agent either broadcasts or unicasts it to the client, based on the same criteria. It is also possible for a DHCP client to request a specific IP address in its DHCPDISCOVER messages by including an address in the Ciaddr field. The server can then send its DHCPOFFER messages as unicasts directly to the client using that address.

The internal behavior of a server when it offers an IP address and other configuration parameters to a client is left up to the individual implementation. In some cases, the server checks that the address it intends to offer is not already in use by transmitting an Internet Control Message Protocol (ICMP) Echo Request message to that address and then waiting to make sure that no reply arrives. The server also might reserve the offered address until it receives a response from the client.

Because the client broadcasts its DHCPDISCOVER messages, more than one server might receive them, and the client might therefore receive DHCPOFFER responses from multiple servers. After a specified period of time, the client stops its broadcasting and accepts one of the offered IP addresses. To signal its acceptance, the client generates a DHCPREQUEST message, which includes the address of the server from which it is accepting the offer in the Server Identifier option, along with the offered IP address in the Requested IP Address option. The client always transmits the DHCPREQUEST message as a broadcast, both because it is not yet configured to use the offered IP address and to inform the other DHCP servers that it is rejecting their offers.

If the client receives no DHCPOFFER message in response to a DHCPDISCOVER message, it times out and repeats the DHCPDISCOVER broadcast. If, after repeated DHCPDISCOVER broadcasts, the client receives no DHCPOFFER messages in response, the DHCP address assignment procedure is considered to have failed. In some cases, client computers are permitted no further TCP/IP communications except for repeated DHCPDISCOVER broadcasts at regular intervals. In other cases (as with most of the Windows operating systems), the client automatically assigns itself an IP address, which might or might not enable it to interact with other computers on the network.

On receipt of the DHCPREQUEST message, the server whose offer the client is accepting commits the offered IP address and other settings to its database using a combination of the client's hardware address and the offered IP address as a unique identifier for the assignment. This is known as the lease identification cookie. To conclude its part of the transaction, the server sends a DHCPACK message to the client, which contains the same offered IP address and other options as in the DHCPOFFER message. This acknowledges the server's completion of the address assignment process. If the server cannot complete the assignment (because it has already assigned the offered IP address to another system, for example), it transmits a DHCPNAK message to the client and the whole process begins again with DHCPDISCOVER broadcasts.

After receiving a DHCPACK message from the server, the client performs a final test by generating a series of ARP broadcasts to ensure that no other system on the network is using the assigned IP address. If the DHCP client receives no response to the ARP transmissions, it configures the TCP/IP client with the IP address and other settings obtained by the server and notes the length of the lease that the server has offered. At this point the client enters what is known as the bound state. If another computer on the network does respond to the ARP broadcasts, the client cannot use the offered IP address and transmits a DHCPDECLINE message to the server, nullifying the transaction. The client can then reissue a series of DHCPDISCOVER messages, restarting the whole process.

DHCP Leasing

The process by which a DHCP server assigns configuration parameters to a client is the same whether the server uses manual, automatic, or dynamic allocation. With manual and automatic allocation, the process described in the previous section is the end of the automated DHCP client/server communications. The client retains the settings assigned to it by the server until someone explicitly changes them or forces a reassignment. However, when the server uses dynamic allocation, the client leases its IP address for a certain period of time (configured at the server) and must periodically renew the lease to continue using it.

The length of an IP address lease is typically measured in days and is usually based on whether computers are frequently moved to different subnets (requiring a new IP address) or whether IP addresses are in short supply. Shorter leases generate more network traffic but enable servers to reclaim unused addresses faster. For a relatively stable network, longer leases reduce the amount of traffic that DHCP generates.

The lease renewal process, illustrated in Figure 5.5, begins when a bound client reaches what is known as the renewal time value, or T1 value, of its lease. By default, the renewal time value is 50 percent of the lease period. When a client reaches this point, it enters the renewing state and begins generating DHCPREQUEST messages. The client transmits the messages to the server that holds the lease as unicasts, unlike the broadcast DHCPREQUEST messages the client generates while in the init state. If the server is available to receive the message, it responds with either a DHCPACK message, which renews the lease and restarts the lease time clock, or a DHCPNAK message, which terminates the lease and forces the client to begin the address assignment process again from the beginning. The most common reason for a DHCPNAK message is that the client computer has been moved to a different subnet and its IP address is no longer valid.

Click to view graphic
Click to view graphic

Figure 5.5  The DHCP lease renewal process

If the server does not respond to the DHCPREQUEST unicast message, the client continues to send requests at regular intervals until it reaches the rebinding time value or T2 value, which defaults to 87.5 percent of the lease period. At this point, the client enters the rebinding state and begins transmitting DHCPREQUEST messages as broadcasts, soliciting an address assignment from any DHCP server on the network. Again, a server can respond with either a DHCPACK or DHCPNAK message. If the lease time expires with no response from any DHCP server, the client's IP address is released and all its TCP/IP communication ceases, except for the transmission of DHCPDISCOVER broadcasts.

Releasing an IP Address

It is also possible for a client to terminate an IP address lease at any time by transmitting a DHCPRELEASE message containing the lease identification cookie to the server. On a Windows 2000 system, for example, you can do this manually, using the Ipconfig.exe utility.

Exercise 1: DHCP Message Types

  1. Place the following DHCP message types in the order in which a successful IP address assignment procedure uses them.
    1. DHCPACK
    2. DHCPOFFER
    3. DHCPREQUEST
    4. DHCPDISCOVER

  2. Place the following DHCP message types in the proper order for an unsuccessful attempt to renew an IP address lease.
    1. DHCPDISCOVER
    2. DHCPREQUEST (broadcast)
    3. DHCPREQUEST (unicast)
    4. DHCPNAK

Lesson Review

  1. What happens to a DHCP client when its attempts to renew its IP address lease fail and the lease expires?
  2. Which of the following message types is not used during the DHCP lease assignment process?
    1. DHCPDISCOVER
    2. DHCPRELEASE
    3. DHCPOFFER
    4. DHCPREQUEST

  3. What is the name of the time during the lease renewal process when a DHCP client begins broadcasting DHCPREQUEST messages?
    1. Lease identification cookie
    2. Rebinding time
    3. Renewal time
    4. Init value

Lesson Summary

  • DHCP is a combination of a client, a server, and a protocol that can automatically configure the TCP/IP clients on computers all over the network.
  • DHCP is capable of leasing IP addresses from a common pool to client computers, reclaiming them when they are no longer in use, and then returning them to the pool for reassignment.
  • In addition to the standard fields, DHCP messages also contain options, such as the message Type option, which describes the function of the message.
  • DHCP options contain the parameters used by DHCP clients to configure their TCP/IP clients.
  • The DHCP standard provides the ability for third-party vendors to use DHCP to deliver product-specific information to clients.

Lesson 2: Using the DHCP Server

The DHCP standards define precisely the functions of DHCP servers and clients. DHCP clients are nearly always integrated into an operating system's TCP/IP implementation, but DHCP servers are available for many computing platforms, either as integrated components or separate products. All Windows operating systems include a DHCP client, which Windows uses by default. A DHCP server is included with all the Windows 2000 Server and Microsoft Windows NT Server products.


After this lesson, you will be able to

  • Install and configure a Windows 2000 DHCP server
  • Create and configure scopes
  • Configure scope and server options

Estimated lesson time: 45 minutes


Implementing DHCP

Although Windows DHCP clients naturally work well together with DHCP servers, it is also possible for a Windows 2000 DHCP server to support clients running other operating systems and for Windows clients to function with other DHCP server implementations. You can therefore use the Windows 2000 DHCP servers for your entire network, even if you run various client operating systems.

When planning a DHCP implementation, you must consider a number of factors, including the following:

  • The number of clients you intend to support.  A single DHCP server can theoretically support 1000 scopes with a total of 10,000 clients, depending on the other factors. However, most medium to large networks have at least two DHCP servers so that service can continue if one server fails. To provide fault tolerance, you should divide the range of IP addresses you plan to assign on each subnet between two DHCP servers in an 80/20 split. It is important to understand that DHCP servers do not work together; each server has its own range of addresses to assign. If you configure two DHCP servers with the same identical scope, they will attempt to assign the same IP addresses to clients.
  • The configuration of your internetwork.  The number of networks that make up your internetwork and the technologies used to connect them can have a great effect on your DHCP implementation. The use of DHCP relay agents prevents you from having to install a DHCP server on every network segment. When branch offices are connected together using relatively slow wide area network (WAN) links, it is generally not a good idea to have DHCP clients that rely on servers at distant locations.
  • The performance capabilities of your servers.  DHCP is a highly disk- intensive service. If you plan to have DHCP servers with heavy client loads, you should make sure that your server hardware is fast enough to avoid becoming a performance bottleneck. To ensure proper performance, you should plan your server hardware implementation around a worst-case DHCP traffic scenario, such as the end of a brief power outage in which all your client computers are attempting to contact the DHCP server at nearly the same time.

Installing Windows 2000 DHCP Server

Although the DHCP client is an integral part of the Windows operating systems and is installed automatically with the TCP/IP protocols on every computer, installation of Windows 2000 DHCP Server is optional. You can elect to install the DHCP server during the operating system installation, or you can do it any time afterward. The process of installing the DHCP Server included with Windows 2000 and preparing it for use consists of the following steps:

  1. Install the DHCP Server software.
  2. Authorize the server in the Active Directory service.
  3. Create one or more scopes on the server.
  4. Configure DHCP options.
  5. Activate the scope or scopes.

To install the DHCP Server, use the following procedure:

  1. Click Start, point to settings, and select Control Panel.
  2. Double-click the Add/Remove Programs icon in the Control Panel to open the Add/Remove Programs dialog box.
  3. Click Add/Remove Windows Components to open the Windows Components Wizard (see Figure 5.6).
  4. Click to view graphic
    Click to view graphic

    Figure 5.6  The Windows Components Wizard

  5. Select Networking Services in the Components list and click Details to open the Networking Services dialog box (see Figure 5.7).
  6. Click to view graphic
    Click to view graphic

    Figure 5.7  The Networking Services dialog box

  7. Select the check box next to the Dynamic Host Configuration Protocol (DHCP) entry in the Subcomponents Of Networking Services list and click OK to return to the Windows Components Wizard.
  8. Click Next to install the DHCP Server service. You might have to supply your Windows 2000 Server distribution disk.
  9. Click Finish to complete the installation and close the Windows Components Wizard.
  10. Click Yes in the System Settings Change message box to restart the computer.

When you restart the computer, the DHCP Server service will be running, and it will load every time you restart the server. You can modify the service's startup behavior by opening the Services console and changing its Startup Type value from Automatic to Manual or Disabled.

Authorizing a DHCP Server

The Windows 2000 DHCP Server includes a feature that enables the computer to detect unauthorized DHCP servers, called rogues, and prevent them from starting. In the past, the existence of improperly configured DHCP servers on a network was a relatively common problem. The DHCP Server service is easily installed with the Windows 2000 operating system. If someone creates a scope using improper IP addresses or other bad TCP/IP configuration information and activates it, whether out of curiosity, experimentation, or malice, the result can be improperly configured and malfunctioning workstations all over the network.

To prevent rogue DHCP servers from operating on a network, Windows 2000 requires each DHCP Server installation to be authorized with Active Directory. To be authorized, a computer running the DHCP Server service must be either an Active Directory domain controller or a member server.

To authorize a DHCP server, use the following procedure:

  1. Log on to the network using an account that is a member of the Enterprise Admins group.
  2. Click Start, point to Programs, and select DHCP from the Administrative Tools program group to open the DHCP console (see Figure 5.8).
  3. Click to view graphic
    Click to view graphic

    Figure 5.8  The DHCP console with an unauthorized server

  4. Select the server you installed on the local computer in the scope pane and select Authorize from the Action menu.
  5. Press the F5 key to refresh the server display and then click the DHCP header at the root of the scope tree. Notice that the Status of the server has changed from Not Authorized to Running (see Figure 5.9)
  6. Click to view graphic
    Click to view graphic

    Figure 5.9  The DHCP console with an authorized server

When you authorize a DHCP server, its IP address is added to a list of authorized servers in the Active Directory database. Whenever a Windows 2000 DHCP server starts, it compiles a list of the other DHCP servers on the network by broadcasting DHCPINFORM messages that contain vendor-specific options recognized only by other Windows 2000 DHCP servers. The other servers on the network respond to the DHCPINFORM message with a DHCPACK message, also containing vendor-specific options that supply information about themselves. When the server has compiled a list of the other DHCP servers, it obtains the list of the authorized servers from an Active Directory domain controller. If the server's own address is on the list, it begins to service clients. If the server's address is not on the list, it does not service clients.

Creating a Scope

After a DHCP server is authorized, it is capable of functioning on the network, but it cannot actually service DHCP clients until it is configured with a scope of IP addresses to assign. When creating scopes, consider the following restrictions:

  • You can create only one scope per subnet on a single DHCP server. If the IP addresses you want to assign are not consecutive, you must create a scope out of the largest possible address range and then exclude specific addresses or address ranges from the scope.
  • Reservations must be included in a scope. When using reservations to permanently assign IP addresses to specific computers, do not exclude the reserved addresses from the scope. Excluded addresses are not available for assignment to clients, even using reservations.
  • Statically configured IP addresses must not be included in a scope. If you have computers that you've manually configured to use specific IP addresses (without using the DHCP client), you must exclude them from the scope. The DHCP server has no way of knowing that these addresses exist, and if you include them in the scope, the server will attempt to assign them to other clients.

To create a scope, use the following procedure:

  1. Click Start, point to Programs, and select DHCP from the Administrative Tools program group to open the DHCP console.
  2. Select the entry for your DHCP server in the scope pane and select New Scope from the Action menu to open the New Scope Wizard.
  3. Click Next to bypass the Welcome page and proceed to the Scope Name dialog box (see Figure 5.10).
  4. Click to view graphic
    Click to view graphic

    Figure 5.10  The Scope Name dialog box in the New Scope Wizard

  5. In the Name and Description boxes, type a name and (optionally) a descriptive string for the scope you are creating. Typically, these fields should identify the subnet that the scope will service. Click Next to proceed to the IP Address Range page (see Figure 5.11).
  6. Click to view graphic
    Click to view graphic

    Figure 5.11  The IP Address Range page in the New Scope Wizard

  7. Type the beginning and ending IP addresses of the address range you want the DHCP server to assign in the Start IP Address and End IP Address fields.
  8. Specify the subnet mask for the addresses that the server will assign either by indicating the number of bits in the network identifier in the Length selector or by typing the mask in the Subnet Mask box using dotted decimal notation. Click Next to proceed to the Add Exclusions dialog box (see Figure 5.12).
  9. When you type the range of IP addresses in the Start IP Address and End IP Address boxes, the wizard automatically supplies values in the Length and Subnet Mask boxes, based on the class of the IP address values you specified. The only time you have to change these default subnet mask values is if you have subnetted your network by using a nonstandard number of bits in the network identifier of your IP addresses.

    Click to view graphic
    Click to view graphic

    Figure 5.12  The Add Exclusions dialog box in the New Scope Wizard

  10. Type a range of addresses that you want to exclude from the range you specified in the IP Address Range page in the Start IP Address and End IP Address box and click Add to add the range to the Excluded Address Range List. Repeat the procedure to exclude additional address ranges. Click Next to proceed to the Lease Duration page (see Figure 5.13).
  11. Excluding multiple address ranges from the IP address range you originally supplied for the scope enables you to select any group of addresses you want for a particular subnet. To exclude a single address from the range, type the same value in the Start IP Address and End IP Address boxes.

    Click to view graphic
    Click to view graphic

    Figure 5.13  The Lease Duration page in the New Scope Wizard

  12. Specify the time interval (in days, hours, or minutes, or all three) for the IP address leases the server will assign for this scope. Click Next to proceed to the Configure DHCP Options page (see Figure 5.14).
  13. The default IP address lease duration is 8 days. For a network in which computers (such as laptops and other portables) are frequently moved to other subnets, you can decrease the lease duration value. For more stable networks, you can increase the value. You cannot configure a scope with an unlimited lease (resulting in automatic allocation) using the New Scope Wizard. You can, however, modify the properties of the scope after you create it to change its lease duration to Unlimited.

    Click to view graphic
    Click to view graphic

    Figure 5.14  The Configure DHCP Options page in the New Scope Wizard

  14. Click No, I Will Configure These Options Later and click Next to proceed to the Completing The New Scope Wizard page.
  15. Answering Yes, I Want To Configure These Options Now causes the wizard to display four additional pages, enabling you to configure the Router (Default Gateway), Domain Name and DNS Servers, and WINS Servers options and to activate the scope. These are the most commonly used options on a typical TCP/IP network, and activating the scope completes the process of making the DHCP server functional and active. See the next section in this lesson for more information about configuring these options.

  16. Click Finish to close the wizard and create the scope. Notice that the scope now appears in the DHCP console, subordinate to the server on which you created it (see Figure 5.15).
  17. Click to view graphic
    Click to view graphic

    Figure 5.15  The DHCP console with a newly created scope

Activating a Scope

After you have created a scope, you must activate it before the server can use it to assign IP addresses to clients. To activate a scope, use the following procedure:

  1. Click Start, point to Programs, and select DHCP from the Administrative Tools program group to open the DHCP console.
  2. Select the scope you just created and select Activate from the Action menu. Notice that the status of the scope now shows it as being active (see Figure 5.16).
  3. Click to view graphic
    Click to view graphic

    Figure 5.16  The DHCP console with a newly activated scope

Creating a Superscope

A superscope is an administrative grouping of multiple scopes that enables you to support DHCP clients on a single physical network segment that hosts multiple IP subnets. If, for example, you have a large switched network that you've split into five logical subnets, you can create a separate scope for each subnet and then create a superscope with the five scopes as members. Creating the superscope enables you to manage all five of the member scopes as a single administrative entity.

To create a superscope, you select a DHCP server in the DHCP console and select New Superscope from the Action menu. This launches the New Superscope wizard, in which you select the scopes that you want to group together into the superscope. The superscope appears in the scope pane hierarchy as an object beneath the server, with its member scopes subordinate to it. After you've created the superscope, you can activate all the member scopes at one time by simply activating the superscope.

Configuring DHCP Options

Creating a scope enables a DHCP server to assign IP addresses and a subnet mask to the clients on a particular subnet, but the clients' TCP/IP configuration process will not be complete until they receive other parameters, such as a default gateway, as well. As discussed earlier, you can configure the most commonly used DHCP options when you create the scope. However, when you configure the options after creating the scope, you have access to the full range of options supported by the DHCP server.

Windows 2000 DHCP Server enables you to configure DHCP options at the server level or the scope level. If all the DHCP clients on your network will be using the same default gateway, DNS servers, and so on, you can configure server options that apply to all your scopes. If you need to specify different options for the computers on different scopes, you can create scope options that apply only to the client in that scope. If you have some options that apply to all the computers on the network (such as DNS server addresses, for example) and some that are scope-specific (such as default gateway addresses), you can create both server options and scope options; the server will combine them when actually configuring a client computer.

To configure the most commonly used DHCP options, use the following procedure:

  1. Click Start, point to Programs, and select DHCP from the Administrative Tools program group to open the DHCP console.
  2. Select the Server Options heading or the Scope Options heading beneath a particular scope and select Configure Options from the Action menu to display the Server Options or Scope Options dialog box (see Figure 5.17).
  3. Click to view graphic
    Click to view graphic

    Figure 5.17  The Server Options dialog box

  4. Highlight the 003 Router entry in the Available Options list. Notice that additional controls for this particular option appear in the bottom half of the dialog box (see Figure 5.18).
  5. Click to view graphic
    Click to view graphic

    Figure 5.18  The Server Options dialog box with the 003 Router controls displayed

  6. Select the check box next to the 003 Router entry. Notice how the Server Name and IP Address fields in the bottom half of the dialog box are now activated (see Figure 5.19).
  7. Many of the various options supported by Windows 2000 DHCP Server require different types of controls to configure them. The controls that appear in the bottom half of the dialog box vary, depending on the option you select.

    Click to view graphic
    Click to view graphic

    Figure 5.19  The Server Options dialog box with the 003 Router controls activated

  8. Type the name of the router that you want the DHCP clients to use as their default gateway in the Server Name box.
  9. If you already know the IP address of the router, you can type it in the IP Address box and proceed to step 8.

  10. Click Resolve to resolve the name you supplied into an IP address and add the address to the IP Address box.
  11. Click Add to add the IP address to the list of default gateway addresses.
  12. Repeat steps 5 through 7 to add additional router addresses to the list.
  13. Select the check box next to the 003 DNS Servers entry in the Available Options list. Notice that the controls for this option are the same as those for the 003 Router option. This is because both options require a list of IP addresses that you can either enter directly or resolve from names.
  14. Using the same procedure outlined in steps 5 through 7, specify the names or IP addresses of the DNS servers that you want your DHCP clients to use.
  15. Scroll down in the Available Options list and select the check box next to the 044 WINS/NBNS Servers option.
  16. Using the same procedure outlined in steps 5 through 7, specify the names of IP addresses of the WINS server that you want your DHCP clients to use.
  17. Click OK to apply the options you have configured. Notice that the configured options now appear in the details pane of the DHCP console.

Deploying DHCP Options with User Classes

In some cases, you might want to configure certain DHCP clients with parameters that are different from those of the other clients on the same subnet. One example in which this might be the case is when you have a group of laptop computers that are frequently moved throughout your enterprise network. To adequately support these computers, you want to configure them with a short DHCP lease duration, such as four hours. However, specifying a four-hour lease duration for all the computers on your network would result in excessive amounts of DHCP traffic and server disk activity. To address this problem, you can create a separate user class for the laptops and configure DHCP options that apply only to that user class.

The process of assigning option values with user classes consists of three procedures:

  • Create a user class
  • Configure options for the class
  • Configure clients to use the class

To create a new user class, use the following procedure:

  1. Click Start, point to Programs, and select DHCP from the Administrative Tools program group to open the DHCP console.
  2. Select the server you want to modify and select Define User Classes from the Action menu to open the DHCP User Classes dialog box (see Figure 5.20).
  3. Click to view graphic
    Click to view graphic

    Figure 5.20  The DHCP User Classes dialog box

  4. Click Add to open the New Class dialog box (see Figure 5.21).
  5. Click to view graphic
    Click to view graphic

    Figure 5.21  The New Class dialog box

  6. Type a descriptive name for the class you are creating (such as "Laptops") in the Display Name box. You can add information in the description box.
  7. Enter a class ID that the server will use to identify the computers in the class in the box at the bottom of the New Class dialog box. To enter the class ID in hexadecimal form, click the left side of the box. To enter the class ID using ASCII text, click the right side of the box. Whichever notation you use, the dialog box translates it into the other one as you type it in. For the sake of this example, type w2klaptops in the ASCII side of the display.
  8. Click OK to create the new class. Notice that the class you've created now appears in the Available Classes list in the DHCP User Classes dialog box (see Figure 5.22).
  9. Click to view graphic
    Click to view graphic

    Figure 5.22  The DHCP User Classes dialog box with a newly created class

  10. Click Close to close the DHCP User Classes dialog box.

To configure options for the new user class you created, use the following procedure:

  1. Click Start, point to Programs, and select DHCP from the Administrative Tools program group to open the DHCP console.
  2. Select the Server Options heading or the Scope Options heading beneath a particular scope and select Configure Options from the Action menu to display the Server Options or Scope Options dialog box.
  3. Click the Advanced tab to change the appearance of the dialog box to that shown in Figure 5.23.
  4. Click to view graphic
    Click to view graphic

    Figure 5.23  The Advanced tab in the Scope Options dialog box

  5. In the User Class box, use the drop-down list to select the user class you created in the previous procedure.
  6. Select the DHCP options you want to configure in the Available Options list and configure them in the usual manner.
  7. Click OK to configure the options you selected. Notice that the options you configured now appear in the details pane of the DHCP console with the user class you created appearing in the Class column (see Figure 5.24).
  8. Click to view graphic
    Click to view graphic

    Figure 5.24  User class-specific server options

To configure a DHCP client to be a member of a specific user class, use the following procedure:

  1. Open a Command Prompt window on the Windows 2000 client computer.
  2. Type the command ipconfig /setclassid "Local Area Connection" classID at the command prompt, where the classID variable contains the class ID (that is, w2klaptops) you specified while creating the user class. If the network interface you want to configure is named differently in the Network And Dial-Up Connections window, replace "Local Area Connection" with the appropriate name.
  3. Type the command ipconfig /renew "Local Area Connection" to renew the client's DHCP lease, using the class ID you specified to obtain the correct options from the server.
  4. Close the Command Prompt window.

Creating a Reservation

Manual IP address allocation is implemented in DHCP Server in the form of reservations, which you create to assign a specific IP address to a specific computer. When you create a reservation, the IP address you specify is always assigned to the same DHCP client. Although it might be just as easy to manually configure a computer with a static IP address, using DHCP reservations is recommended because they prevent the addresses you reserve from being assigned to other computers.

To create a reservation, use the following procedure:

  1. Click Start, point to Programs, and select DHCP from the Administrative Tools program group to open the DHCP console.
  2. In the scope pane, expand the scope in which you want to create the reservation.
  3. Select the Reservations heading and select New Reservation from the Action menu to display the New Reservation dialog box (see Figure 5.25).
  4. Click to view graphic
    Click to view graphic

    Figure 5.25  The New Reservation dialog box

  5. Type a name for the reservation in the Reservation Name box.
  6. Type the IP address you want to assign in the IP Address box.
  7. Type the data-link layer hardware address of the computer to which you want to assign the IP address in the MAC Address box.
  8. To determine the hardware address of a Windows 2000 computer, type ipconfig /all at the command prompt. To view the hardware address of a remote computer on the network, open the Computer Management console, connect to the desired computer, expand the System Information heading to display the Components/Network/Adapter entry, and view the MAC Address listing in the details pane.

  9. Click Add to create the reservation.
  10. Repeat steps 4 through 7 to create additional reservations for the scope, or click Close to close the New Reservation dialog box. Notice that the reservations you created now appear in the details pane of the DHCP console (see Figure 5.26).
  11. Click to view graphic
    Click to view graphic

    Figure 5.26  The DHCP console with an IP address reservation

Exercise 1: Examining DHCP Traffic

In this exercise, you use the Network Monitor application supplied with Windows 2000 Server to capture samples of DHCP messages on your network and examine their contents. This exercise assumes that you have a Windows 2000 Server computer with Network Monitor installed and connected to a LAN with a DHCP server present. You also need a second Windows 2000 computer configured to function as a DHCP client. For instructions about how to install and use Network Monitor, see Lesson 1 in Chapter 14, "Monitoring Network Activity."

  1. On the Windows 2000 DHCP server, click Start and select Network Monitor from the Administrative Tools program group. If necessary, select the network interface corresponding to the LAN adapter.
  2. Select Start from the Capture menu to begin capturing the packets transmitted over the network.
  3. On the Windows 2000 DHCP client computer, click Start, point to Programs, and select Command Prompt from the accessories program group to open a Command Prompt window.
  4. Type ipconfig /release at the command prompt.
  5. Type ipconfig /renew at the command prompt.
  6. Return to the Network Monitor window and select Stop And View from the Capture menu to display a Capture window.
  7. Select Filter from the Display menu to open the Display Filter dialog box.
  8. Double-click the Protocol==Any branch of the decision tree to open the Expression dialog box.
  9. Confirm that the Protocol tab is selected and click Disable All to remove all entries from the Enabled Protocols list.
  10. Select DHCP in the Disabled Protocols list and click Enable to add it to the Enabled Protocols list.
  11. Click OK to close the Expression dialog box and click OK again to close the Display Filter dialog box. What happens to the Capture window display (see Figure 5.27 on the following page)?
  12. Click to view graphic
    Click to view graphic

    Figure 5.27  The Network Monitor Capture window filtered to display only DHCP messages

  13. Double-click the first packet you see with Release in the Description column. In the bottom pane of the Capture window, expand the DHCP portion of the packet to display the message fields, as shown in Figure 5.28.
  14. Click to view graphic
    Click to view graphic

    Figure 5.28  A captured DHCPRELEASE message

    What caused the DHCPRELEASE message to be generated?

  15. Expand the Option Field heading to display the options included in the message (see Figure 5.29).
  16. Notice that the DHCP Message Type option indicates that this is a DHCPRELEASE message.

    Click to view graphic
    Click to view graphic

    Figure 5.29  The Options field of a DHCPRELEASE packet

  17. Click the Discover message that follows the Release message and expand the DHCP message section (see Figure 5.30).
  18. Click to view graphic
    Click to view graphic

    Figure 5.30  A captured DHCPDISCOVER message

    What initiated the creation of the DHCPDISCOVER message?

    Why do the four IP address fields (Ciaddr, Yiaddr, Siaddr, and Giaddr) all contain values of 0.0.0.0?

  19. Expand the Option field.
  20. Notice that, in this case, the client has included the Requested Address option containing the IP address it had been using up to the time of its recent release. In this DHCP implementation, the client attempts to maintain the use of the same IP address whenever possible.

  21. Click the Offer message that follows the Discover message. Expand the message and its Option field (see Figure 5.31).
  22. What IP address has the server offered the client?

    What are the functions of the options listed in the Option field?

    Click to view graphic
    Click to view graphic

    Figure 5.31  A captured DHCPOFFER message

  23. Click the Request message that follows the Offer message. Expand the message and its Option field (see Figure 5.32).
  24. Click to view graphic
    Click to view graphic

    Figure 5.32  A captured DHCPREQUEST message

    What is the function of the Client-Identifier option in the Option field?

  25. Click the ACK message that follows the Offer message. Expand the message and its Option field (see Figure 5.33).
  26. Click to view graphic
    Click to view graphic

    Figure 5.33  A captured DHCPACK message

    The DHCPACK message contains all the options that were originally included in the DHCPOFFER message.

  27. Close Network Monitor, saving the capture for later study, if you want.

Exercise 2: Configuring Scopes

As the DHCP administrator for your organization, you are creating a scope for your 192.168.6.32/28 subnet. The router functioning as the default gateway for the subnet has been manually configured with the lowest available IP address on the subnet. There are also two Internet servers on the subnet for which you will create reservations using the three highest available IP addresses. Based on this information, answer the following questions.

  1. What value should you assign to the Router option for the scope?
    1. 192.168.6.32
    2. 192.168.7.32
    3. 192.168.6.33
    4. 192.168.6.34

  2. What IP addresses should you use when creating the reservations for the two Internet servers?
    1. 192.168.6.44 and 192.168.6.45
    2. 192.168.6.45 and 192.168.6.46
    3. 192.168.6.46 and 192.168.6.47
    4. 192.168.6.47 and 192.168.6.48

  3. What IP address range should you use when creating the scope for the subnet?
    1. 192.168.6.33-192.168.6.46
    2. 192.168.6.33-192.168.6.44
    3. 192.168.6.34-192.168.6.44
    4. 192.168.6.34-192.168.6.46

Lesson Review

  1. What is the function of a user class ID?
  2. What type of DHCP messages do servers use to compile a list of the other DHCP servers on the network?
  3. For a network with 9000 client workstations on 10 subnets at 6 locations, what is the minimum number of DHCP servers needed to service the entire network?
    1. 1
    2. 6
    3. 9
    4. 10

  4. When you create a reservation, how does the DHCP server know which computer should be assigned the IP address you specify?
  5. What program do you use to assign a user class to a specific DHCP client interface?

Lesson Summary

  • The DHCP Server service is not installed with Windows 2000 by default. You must either select it during the operating system installation or install it manually afterward.
  • On a Windows 2000 network using Active Directory, you must authorize a DHCP server before it can service clients.
  • You must create a scope for each subnet to be served by a DHCP server, each containing a range of IP addresses to be assigned.
  • Class IDs make it possible to assign different DHCP option values to a group of clients on a particular subnet.
  • In Windows 2000 DHCP Server, you can configure DHCP options for the entire server or for a specific scope.
  • Reservations are IP addresses that are permanently assigned to particular DHCP clients.


Next



Last Updated: January 8, 2003
Top of Page