Lesson 1: Introducing and Installing DHCP

DHCP automatically assigns IP addresses to computers. DHCP overcomes the limitations of configuring TCP/IP manually. This lesson gives you an overview of DHCP and how it works.


After this lesson, you will be able to

  • Describe the difference between manual and automatic configuration of TCP/IP
  • Identify TCP/IP configuration parameters that can be assigned by a DHCP server
  • Describe IP Lease Requests and Offers
  • Install DHCP in Windows 2000

Estimated lesson time: 20 minutes


DHCP Overview

DHCP is an extension of the Boot Protocol (BOOTP). BOOTP enables clients without disks to start up and automatically configure TCP/IP. DHCP centralizes and manages the allocation of TCP/IP configuration information by automatically assigning IP addresses to computers configured to use DHCP. Implementing DHCP eliminates some of the configuration problems associated with manually configuring TCP/IP.

As illustrated in Figure 11.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 may include a default gateway address, Domain Name System (DNS) address, and Windows Internet Name Service (WINS) server address.

Figure 11.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 there is no available IP addressing information in the pool to lease to a client, the client cannot initialize TCP/IP.

Manual vs. Automatic Configuration

To understand why DHCP is beneficial in configuring TCP/IP on client computers, it is useful to contrast the manual method of configuring TCP/IP with the automatic method using DHCP.

Configuring TCP/IP Manually

Configuring TCP/IP manually means that users can easily pick a random IP address instead of getting a valid IP address from the network administrator. However, using incorrect addresses can lead to network problems that can be very difficult to trace to the source.

In addition, typing the IP address, subnet mask, or default gateway can lead to problems ranging from trouble communicating if the default gateway or subnet mask is wrong to problems associated with a duplicate IP address.

Another limitation of configuring TCP/IP manually is the administrative overhead on internetworks where computers are frequently moved from one subnet to another. For example, when a workstation is moved to a different subnet, the IP address and default gateway address must be changed for the workstation to communicate from its new location.

Configuring TCP/IP Using DHCP

Using DHCP to automatically configure IP addressing information means that users no longer need to acquire IP addressing information from an administrator to configure TCP/IP. The DHCP server supplies all of the necessary configuration information to all of the DHCP clients. Using DHCP eliminates many difficult-to-trace network problems.

TCP/IP configuration parameters that can be assigned by the DHCP server include

  • IP addresses for each network adapter in a client computer
  • Subnet masks that are used to identify the IP network portion from the host portion of the IP address
  • Default gateways (routers) that are used to connect a single network segment to others
  • Additional configuration parameters that can optionally be assigned to DHCP clients (such as IP addresses for DNS or WINS servers a client may use)

How DHCP Works

DHCP uses a four-phase process to configure a DHCP client, as shown in Table 11.1. If a computer has multiple network adapters, the DHCP process occurs separately over each adapter. A unique IP address is assigned to each adapter in the computer. All DHCP communication is done over User Datagram Protocol (UDP) ports 67 and 68.

Most DHCP messages are sent by broadcast. For DHCP clients to communicate with a DHCP server on a remote network, the IP routers must support forwarding DHCP broadcasts. DHCP configuration phases are shown in Table 11.1.

Table 11.1 Four Phases of DHCP Client Configuration

PhaseDescription
IP lease discoverThe client initializes a limited version of TCP/IP and broadcasts a request for the location of a DHCP server and IP addressing information.
IP lease offerAll DHCP servers that have valid IP addressing information available send an offer to the client.
IP lease requestThe client selects the IP addressing information from the first offer it receives and broadcasts a message requesting to lease the IP addressing information in the offer.
IP lease acknowledgmentThe DHCP server that made the offer responds to the message, and all other DHCP servers withdraw their offers. The IP addressing information is assigned to the client and an acknowledgment is sent. The client finishes initializing and binding the TCP/IP protocol. Once the automatic configuration process is complete, the client can use all TCP/IP services and utilities for normal network communications and connectivity to other IP hosts.

IP Lease Discover and Offer

As illustrated in Figure 11.2, in the first two phases of DHCP client configuration, the client broadcasts for a DHCP server and a DHCP server offers an IP address to the client.

Figure 11.2 IP lease discover and offer

IP Lease Discover

During its boot process, a client requests to lease an IP address by broadcasting a request to all DHCP servers. Because the client does not have an IP address or know the IP address of a DHCP server, it uses 0.0.0.0 as the source address and 255.255.255.255 as the destination address.

The request for a lease is sent in a DHCPDISCOVER message. This message also contains the client's hardware address and computer name so that DHCP servers know which client sent the request.

The IP lease process is used when one of the following events occurs:

  • TCP/IP is initialized for the first time as a DHCP client.
  • The client requests a specific IP address and is denied, possibly because the DHCP server dropped the lease.
  • The client previously leased an IP address but has released the lease and now requires a new lease.

IP Lease Offer

All DHCP servers that receive the request and have a valid configuration for the client broadcast an offer with the following information:

  • The client's hardware address
  • An offered IP address
  • Subnet mask
  • Length of the lease
  • A server identifier (the IP address of the offering DHCP server)

A broadcast is used because the client does not yet have an IP address. As illustrated in Figure 11.3, the offer is sent as a DHCPOFFER message. The DHCP server reserves the IP address so that it will not be offered to another DHCP client. The DHCP client selects the IP address from the first offer it receives.

Figure 11.3 Sending a DHCPOFFER message

When No DHCP Servers Are Online

The DHCP client waits 1 second for an offer. If an offer is not received, the client is not able to initialize and it rebroadcasts the request three times (at 9-, 13-, and 16-second intervals, plus a random length of time between 0 and 1000 milliseconds). If an offer is not received after four requests, the client retries every 5 minutes.

Windows 2000-based clients can automatically configure an IP address and subnet mask if a DHCP server is unavailable at system start time. This is a new feature of Windows 2000 called Automatic Private IP Addressing (APIPA). This is useful for clients on small private networks, such as small business offices, home offices, or remote access clients. The Windows 2000 DHCP client service uses the following process to autoconfigure the client:

  1. The DHCP client attempts to locate a DHCP server and obtain an address and configuration.
  2. If a DHCP server cannot be found or does not respond, the DHCP client autoconfigures its IP address and subnet mask using a selected address from the Microsoft-reserved Class B network, 169.254.0.0, with the subnet mask 255.255.0.0.

    The DHCP client tests for an address conflict to make sure that the IP address it has chosen is not already in use on the network. If a conflict is found, the client selects another IP address. The client retries autoconfiguration for up to 10 addresses.

  3. Once the DHCP client succeeds in self-selecting an address, it configures its network interface with the IP address. The client then continues, in the background, to check for a DHCP server every 5 minutes. If a DHCP server is found later, the client abandons its autoconfigured information. The DHCP client then uses an address offered by the DHCP server (and any other provided DHCP option information) to update its IP configuration settings.

IP Lease Request and Acknowledgment

In the last two phases of DHCP client configuration, the client selects an offer and the DHCP server acknowledges the lease.

IP Lease Request

After the client receives an offer from at least one DHCP server, it broadcasts to all DHCP servers that it has made a selection by accepting an offer.

The broadcast is sent in a DHCPREQUEST message and includes the server identifier (IP address) of the server whose offer was accepted. All other DHCP servers then retract their offers so that their IP addresses are available for the next IP lease request.

IP Lease Acknowledgment (Successful)

The DHCP server with the accepted offer broadcasts a successful acknowledgment to the client in the form of a DHCPACK message. This message contains a valid lease for an IP address and possibly other configuration information. When the DHCP client receives the acknowledgment, TCP/IP is completely initialized and is considered a bound DHCP client. Once bound, the client can use TCP/IP to communicate on the internetwork.

IP Lease Acknowledgment (Unsuccessful)

An unsuccessful acknowledgment in the form of a DHCPNACK message is broadcast if the client is trying to lease its previous IP address and the IP address is no longer available. It is also broadcast if the IP address is invalid because the client has been physically moved to a different subnet. When the client receives an unsuccessful acknowledgment, it returns to the process of requesting an IP lease.

Installing a DHCP Server

Before you install a DHCP server, you should identify the following:

  • The hardware and storage requirements for the DHCP server
  • Which computers you can immediately configure as DHCP clients for dynamic TCP/IP configuration and which computers you should manually configure with static TCP/IP configuration parameters, including static IP addresses
  • The DHCP option types and their values to be predefined for DHCP clients

Before you install DHCP, answer the following questions:

  • Will all of the computers become DHCP clients? If not, consider that non-DHCP clients have static IP addresses, and static IP addresses must be excluded from the DHCP server configuration. If a client requires a specific address, the IP address needs to be reserved.
  • Will a DHCP server supply IP addresses to multiple subnets? If so, consider that any routers connecting subnets act as DHCP relay agents. If your routers are not acting as DHCP relay agents, at least one DHCP server is required on each subnet that has DHCP clients. The DHCP server could be a DHCP relay agent or a router that has BOOTP enabled.
  • How many DHCP servers are required? Consider that a DHCP server does not share information with other DHCP servers. Therefore, it is necessary to create unique IP addresses for each server to assign to clients.
  • What IP addressing options will clients obtain from a DHCP server? The IP addressing options determine how to configure the DHCP server, and whether the options should be created for all of the clients in the internetwork, clients on a specific subnet, or individual clients. The IP addressing options might be:
    • Default gateway
    • DNS server
    • NetBIOS over TCP/IP name resolution
    • WINS server
    • NetBIOS scope ID

Follow these steps to install a DHCP server:

  1. Open the Windows Components wizard by clicking Start, pointing to Settings, and clicking Control Panel.

    When Control Panel opens, double-click Add/Remove Programs, and then click Add/Remove Windows Components.

  2. Under Components, scroll to and click Networking Services.
  3. Click Details.
  4. Under Subcomponents Of Networking Services, select Dynamic Host Configuration Protocol (DHCP), click OK, and then click Next.

    If prompted, type the full path to the Windows 2000 distribution files and click Continue. Required files will be copied to your hard disk.

  5. Click Finish to close the Windows Components wizard.

    NOTE


    It is strongly recommended that you manually configure the DHCP server computer to use a static IP address. The DHCP server cannot be a DHCP client. It must have a static IP address, subnet mask, and default gateway address.

Ipconfig

Ipconfig is a command-line tool that displays the current configuration of the installed IP stack on a networked computer. It can display a detailed configuration report for all interfaces, including any configured wide area network (WAN) miniports, such as those used for remote access or virtual private network (VPN) connections. A sample report is illustrated in Figure 11.4.

Figure 11.4 Report displayed for Ipconfig /all

Ipconfig Switches

The Ipconfig command is of particular use on systems running DHCP, as it allows users to determine which TCP/IP configuration values have been configured by DHCP. Table 11.2 explains the switches used with the Ipconfig command.

Table 11.2 Ipconfig Command-Line Switches

SwitchEffect
/allProduces a detailed configuration report for all interfaces
/flushdnsRemoves all entries from the DNS name cache
/registerdnsThe DNS domain name for client resolutions
/displaydnsDisplays the contents of the DNS resolver cache
/release <adapter>Releases the IP address for a specified interface
/renew <adapter>Renews the IP address for a specified interface
/showclassid <adapter>Displays all the DHCP class IDs allowed for the adapter specified
/setclassid <adapter> <classID to set>Changes the DHCP class ID for the adapter specified
/? Displays the items in this table

NOTE


Output can be redirected to a file and pasted into other documents.

Follow these steps to verify, release, or renew a client address lease:

  1. On a DHCP-enabled client computer running Windows 2000, open a command prompt.
  2. Use the Ipconfig command-line utility to verify, release, or renew the lease of the client with a DHCP server, as follows:
    • To verify the current DHCP and TCP/IP configuration, type ipconfig /all.
    • To release a DHCP client lease, type ipconfig /release.
    • To renew a DHCP client lease, type ipconfig /renew.

The Ipconfig utility is also supported for use in Windows NT 4.0 Server. For Windows 95 and Windows 98 clients, use Winipcfg, which is the Windows IP configuration program, to perform these tasks. To run Winipcfg on supporting clients, type winipcfg at either an MS-DOS command prompt or in the Run command window. When using Winipcfg to release or renew leases, click Release or Renew to perform these respective tasks.

DHCP Relay Agent

A relay agent is a small program that relays DHCP/BOOTP messages between clients and servers on different subnets. The DHCP Relay Agent component provided with the Windows 2000 router is a BOOTP relay agent that relays DHCP messages between DHCP clients and DHCP servers on different IP networks. For each IP network segment that contains DHCP clients, either a DHCP server or a computer acting as a DHCP relay agent is required.

Follow these steps to add the DHCP Relay Agent:

  1. Click Start, point to Programs, point to Administrative Tools, and then click Routing And Remote Access.
  2. In the console tree, click Server Name\IP Routing\General.
  3. Right-click General, and then click New Routing Protocol.
  4. In the Select Routing Protocol dialog box, click DHCP Relay Agent, and then click OK.

Lesson Summary

DHCP was developed to solve configuration problems by centralizing IP configuration information for allocation to clients. DHCP uses a four-phase process to configure a DHCP client. The phases are: lease discover, lease offer, lease request, and lease acknowledgment. In addition to verifying a computer's IP configuration, you can use the Ipconfig utility to renew options, lease time, and relinquish a lease.



MCSE Training Kit(c) Microsoft Windows 2000 Accelerated 2000
MCSE Training Kit(c) Microsoft Windows 2000 Accelerated 2000
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 244

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net