The DHCP Handbook

Preface

Early in the development of the TCP/IP protocols, little motivation existed for automating the configuration of devices using TCP/IP.  Few computers used TCP/IP, and the computers that were networked weren't very portable.  Perhaps most significantly, the majority of computers were shared among many users, and had a designated administrator who managed many operational details, including TCP/IP configuration.

Today, everything is different. An organization may have thousands-in some cases, tens of thousands-of computers on its internal network. Devices ranging from mainframes to desktop computers to PDAs (Personal Digital Assistants) to embedded processors are all networked. Computers are highly mobile so that laptops, PDAs and similar devices may move between network segments many times during the course of a single day. And today's computers are not typically managed by a trained system administrator. Most computers are set up and installed by users who aren't familiar with (and who probably don't want to know about) the arcane details of the TCP/IP protocol suite.

To meet the demands of "plug-and-play" operation through automating the configuration of networked computers, the IETF (Internet Engineering Task Force) developed DHCP (Dynamic Host Configuration Protocol). DHCP provides automated, managed configuration of computers and other devices using TCP/IP. Through DHCP, a network administrator can assign a network address, supply a subnet mask and a default router. DHCP is built around a client-server model, in which networked computers (the clients) contact a centralized configuration server for configuration parameters. The administrator supplies the server with a description of the network infrastructure and rules about how to assign addresses and other configuration parameters. The server interacts directly with clients, according to the rules provided by the administrator. Thus, the DHCP server acts as the network administrator's agent for managing the configurations of DHCP clients.

Through the DHCP server, you can control the assignment of addresses and the configuration of other TCP/IP protocol parameters in whatever way is appropriate for your network and your organization. You can use fully dynamic address assignment, pre-assign a specific address to every computer, or use a mixed strategy in which your server computers are assigned fixed addresses and other computers are assigned addresses on demand.

The bottom line is that DHCP allows you to build a networking system in which your users can freely add new computers, replace existing computers and move computers between networked locations, all without explicit intervention on the part of the users or a network administrator. In fact, this preface was written on a laptop that was connected to the campus network from Ralph Droms' home through an ADSL link, a campus office, and two campus classrooms (while he gave two final exams). Although each of these locations is serviced by a different part of the campus network, the author was able to simply turn on his laptop in each location and use the network immediately.

Objectives of this book

As we wrote this book, we set as our goal the development of a complete resource for understanding DHCP, designing DHCP services, and debugging problems with DHCP clients and servers. We start with the background and theory of DHCP, including message exchanges between clients and server, message formats and an introduction to the ISC DHCP server. Next, we describe the implementation and operation of DHCP servers and clients. More time is spent describing the DHCP server than the client; the DHCP server is more interesting because it is the component that the network administrator usually interacts with, while the DHCP client simply runs automatically and in the background. We also discuss practical aspects of DHCP-why you should use it, when to use it, as well as how to design and run an efficient DHCP service.

We have included examples and case studies of DHCP in operation throughout the book. The case studies are drawn from our experience with DHCP in real IP networks, while the examples are constructed to illustrate specific concepts and ideas. Along with these examples and case studies, we have included notes, hints, remarks and warnings, based on experience with the design of DHCP, the implementation of DHCP clients and servers, and the application of DHCP to production networks. We include this material to flesh out the framework of the theory and principles of DHCP with as much information about DHCP in practice as we can.

Audience

This book is intended for network planners, implementors and administrators; in short, anyone who must design, implement, manage or debug a network that uses DHCP. Planners considering the use of DHCP or designing a DHCP service will find the protocol description and design guidelines of particular value. If you are not already familiar with the use and architecture of DHCP, the first three chapters introduce DHCP through an example, and explain some of the details of DHCP.

The discussion of DHCP and its applications assumes some familiarity with the details of the TCP/IP protocols. In particular, we assume you understand hardware and IP addressing, subnetting, routing and some of the application layer services like DNS. We review some aspects of TCP/IP that are specific to understanding and using DHCP in Chapter 4. For a more comprehensive introduction to TCP/IP, we recommend either Internetworking with TCP/IP, by Doug Comer or TCP/IP Illustrated by W. Richard Stevens.

Readers who are already using DHCP will find the material on configuring and tuning a DHCP server of particular interest. Anyone running a large installation will want to read about reliable DHCP service.

The later chapters are intended for anyone who is tracking and planning for future developments in DHCP. The authors are both participants in the IETF working group that is responsible for DHCP, and they have included material on current work within the IETF in areas like authentication, inter-server communication, DHCP/LDAP integration and DHCP for IPv6.

Organization

The book is written in three parts. Part I, "Introduction to DHCP," introduces DHCP through examples, and provides some background on configuring TCP/IP protocol stacks.

Part II, "DHCP Theory of Operation," focuses on the specification and operation of DHCP. This partsection of the book begins with an explanation of the objectives of DHCP and the motivation behind the design decisions in DHCP. Part II also includes detailed descriptions of the DHCP message formats and message exchanges between clients and servers, as well as the role of relay agents in those message exchanges.

Part III, "DHCP Servers and Clients," begins with a description of the operation of the ISC and Microsoft DHCP servers and clients. Next, we explain how to configure the ISC server with several specific examples. In the following chapters, we discuss more advanced topics in DHCP service design such as customized client configurations, reliable DHCP service, tuning your DHCP service, and setting up DHCP in a small office or at home. Part III concludes with material on current work in DHCP, including authentication, interaction between DHCP and DNS, communication between DHCP servers, and the development of DHCP for IPv6.

Throughout the book, we give examples which use the ISC DHCP server. This server is freely available and therefore accessible even to readers whose employer may already have purchased a commercial DHCP server and thus who would not be in a position to purchase whatever commercial DHCP server we might have used in our examples. Appendix A includes a list of examples and expository text for the Microsoft DHCP server, keyed to the examples throughout the book that use the ISC DHCP server. This server is the commercial server to which a reader is most likely to have ready access.

We would have liked to provide examples for a wider variety of DHCP servers, but unfortunately, every DHCP server has a different configuration syntax, and we simply couldn't provide examples for all of them. We believe that by showing examples presented for two DHCP servers with very different configuration mechanisms, a reader using a third DHCP server will have a very good chance of being able to understand each example as it relates to whatever configuration mechanism that server uses.

Background on DHCP

DHCP is currently a Draft Standard of the IETF. It is an open, vendor-independent standard. The specifications for DHCP are written in RFC2131 and RFC2132, which are available from http://www.rfc-editor.org. DHCP clients and servers are widely available from major software vendors as well as from the Internet Software Consortium.

DHCP is a product of the Dynamic Host Configuration (DHC) working group of the IETF. The DHC working group first met at the IETF meeting in Cocoa Beach, Florida in April, 1989. At that meeting, the basic problem was defined to be working group defined the problem it would address to be the automated configuration of TCP/IP hosts, including allocation of a network address and transmission of other parameters such as the subnet mask and a default router.

DHCP is loosely based on BOOTP (BOOTstrap Protocol) (RFC951). DHCP retains the basic message format of BOOTP and the operation of BOOTP relay agents, and shares the UDP ports initially assigned to BOOTP (67 and 68). This backward compatibility with BOOTP allows DHCP to use the installed base of BOOTP relay agents and avoid the requirement of a DHCP server on every network segment.

DHCP is still a work in progress. The DHC working group has several additional functions under development for DHCP, which are described in the last few chapters of this book. For current information on the status of DHCP and the activities of the DHC working group, visit http://www.dhcp.org or http://www.ietf.org/html.charters/dhc-charter.html.