Title: Guide To TCPIP, Second Edition
1Guide To TCP/IP, Second Edition
- Chapter 8
- The Dynamic Host Configuration Protocol (DHCP)
2Objectives
- Basic DHCP services
- History and Origins of DHCP
- DHCP leases
- Basic DHCP software components
- IP address management using DHCP
- DHCP Discovery, renewal, and release processes
3Objectives (cont.)
- DHCP packet structure
- Types of DHCP messages
- Broadcast and unicast addressing
- DHCP server selection
- DHCP relay agents
- Microsoft DHCP scopes and classes
- DHCP troubleshooting utilities
4Introducing DHCP
- Lets client computer request an IP address
- DHCP delivers the necessary configuration
information - IP address
- Subnet mask
- IP Gateways
- Address for DNS servers
- Address for WINS servers
5Introducing DHCP (cont.)
- Centralized administration of client IP address
assignments - Address pool or address scope
- IP address ranges
- Address exclusion
- Address lease
6How DHCP Works
- Client perspective on DHCP
- Client is configured to Obtain an IP address
automatically - At boot-up the client broadcasts DHCP address
request - DHCP servers reply offers an address lease
- Client accepts address lease offer
- Server offers an IP address with a lease time
limit - Half the lease time the client attempts to renew
lease
7How DHCP Works (cont.)
8The Role Of Leases
- Length of leases vary
- 1 to 3 weeks is typical
- 1 to 3 days for networks with temps or roving
workers - 4 to 8 hours are common on ISP networks
9DHCP Software Elements
- Three elements to DHCP software
- DHCP client
- Built-in DHCP client software in Windows and UNIX
operating systems - DHCP Server
- Manages address pools and related configuration
of Windows and UNIX servers - DHCP relay agent
- Intercepts address requests
- Repackages requests and unicasts to a DHCP server
10DHCP Lease Types
- Two types of address leases
- Manual address lease
- Dynamic address lease
- Typical IP addressing schemes
- Servers have fixed IP addresses
- Routers have fixed IP addresses
- Clients use dynamic IP Addresses
11More About DHCP Leases
- IPCONFIG command supports the /release and /renew
switches - How DHCP integrates with DSN
- Server address are advertised using DNS
- DNS is not a dynamic environment
- Client address are resolved when using email
addresses - User_at_domain.name
12Understanding IP Address Management With DHCP
- Booting for the first time or after a lease
expires - DHCP Discovery
- Discovery broadcast
- Renewal process
- Rebinding process
- Client must completely release its address if
rebinding fails - Servers and clients use PING and ARP as error
prevention methods
13The Standard Address Discovery Process
- DHCP Discovery process uses four packets
- DHCP Discover packet
- DHCP Offer packet
- DHCP Request packet
- DHCP Acknowledgment packet
14The Standard Address Discovery Process (cont.)
15The Discover Packet
- Client broadcasts a Discover Packet
- Client hardware address
- Source IP address 0.0.0.0
- Destination address 255.255.255.255
- Preferred address
- Message Type value 1
- Client Identifier
- DHCP options
16The Discover Packet (cont.)
- DHCP options
- Option 1 Clients subnet mask
- Option 3 Routers on the clients subnet
- Option 6 Domain name servers
- Option 15 Domain name
- Option 44 NetBIOS over TCP/IP name servers
- Option 46 NetBIOS over TCP/IP node type
- Option 47 NetBIOS over TCP/IP scope
- Option 57 Maximum DHCP message size
- Option 255 End of options
17The Discover Packet (cont.)
18The Offer Packet
- DHCP server sends the Offer packet
- An IP address is offered
- Packet is sent by unicast
19The Offer Packet (cont.)
20The Request Packet
- DHCP Request packet
- DHCP Decline packet
21The Request Packet (cont.)
22The Acknowledgment Packet
- Sent from Server
- Contains configuration options requested by
client - Duplicate IP address test
23The Acknowledgment Packet (cont.)
24The Renewal Process
- The Renewal Time (T1)
- Renewal packet is unicast directly to the DHCP
server - 0.5 duration_or_lease (i.e., lease time)
- The rebinding Time (T2)
- Broadcast a renewal request to any listening DHCP
servers - 0.875 duration_of_lease
- Continues rebinding process until one minute from
the lease expiration time - Client releases it address if unsuccessful and
reinitializes to start DHCP Discovery process
25The Renewal Process (cont.)
26The Renewal Process (cont.)
27The DHCP Address Release Process
- DHCP Release packet
- Sent over UDP
- DHCP server does not send acknowledgements
28DHCP Packet Structures
- DHCP packet fields
- Operation Code (OPCODE) Field
- DHCP Request (0x01)
- DHCP Reply (0x02)
- Hardware Type Field
- Hardware Length Field
- Hops Field
- Transaction ID Number Field
29DHCP Packet Structures (cont.)
- DHCP packet fields (cont.)
- Seconds Since Boot Field
- Flags Field
- Client IP Address Field
- Your IP Address Field
- Server IP Address Field
- Gateway IP Address Field
30DHCP Packet Structures (cont.)
- DHCP packet fields (cont.)
- Client Hardware Address Field
- Server Host Name Field
- Boot File Field
- DHCP Options
- Expand the data that is included in the packet
- DHCP Option 53 Message Type
- Required in all DHCP packets
31DHCP Packet Structures (cont.)
32DHCP Packet Structures (cont.)
33Broadcast And Unicast in DHCP
34Communications With A DHCP Relay Agent
- Routers do not forward broadcasts
- Relay agents accepts discovery broadcasts and
unicasts them to the DHCP server - Relay agent function is usually enabled on a
router
35Communications With A DHCP Relay Agent (cont.)
36Communications With A DHCP Relay Agent (cont.)
37Microsoft DHCP Scopes And Classes
- Scope is a range of consecutive IP addresses
- Superscope is a group of non-consecutive IP
address - A collection of scopes
38Troubleshooting DHCP
- Troubleshoot DHCP with an analyzer
- IPCONFIG utility
- ipconfig /release
- ipconfig /renew
39Troubleshooting DHCP (cont.)
40Chapter Summary
- DHCP provides a way for computers to obtain
usable, unique IP addresses and necessary TCP/IP
configurations even when no IP addresses were
assigned to those machines - As long as a DHCP server or relay is available on
the cable segment where an initial DHCP Request
message is broadcast, the DHCP service makes it
easy and automatic to include computers on a
TCP/IP network
41Chapter Summary (cont.)
- From the administrative side, DHCP makes is easy
to define and manage pools of IP addresses, which
Microsoft calls a scope when referring to a set
of IP addresses under DHCPs management, and a
superscope when referring to a collection of IP
address scopes
42Chapter Summary (cont.)
- DHCPs origins lie in an earlier TCP/IP
Application layer protocol, called BOOTP, used to
enable diskless workstations to boot remotely
across a network - Basic BOOTP and DHCP formats are entirely
compatible, so that by configuring a router to
forward BOOTP, it also forwards DHCP packets
43Chapter Summary (cont.)
- DHCP supports two types of address allocation
manual, in which administrators directly manage
all addresses and dynamic, in which addresses
are allocated with explicit expiration intervals
called leases - Many of DHCPs functions and messages relate to
obtaining, renewing, and releasing dynamic
address leases, primarily for client machines
44Chapter Summary (cont.)
- When a DHCP client starts, it begins the DHCP
Discovery process, during which the client
receives an IP address and lease - In the middle of the lease time, the client
starts a renewal process to determine if it can
keep the address past the lease time - If not, the client releases its IP address and
starts the Discovery process over
45Chapter Summary (cont.)
- DHCP supports a wide variety of message types and
options, but only Message Type 53 (DHCP Message)
is mandatory for any given DHCP message - Because DHCP can ferry a surprisingly large range
of configuration information (including all kinds
of network services, such as e-mail and NetBIOS
over TCP/IP), the protocol makes use of several
message options - A protocol analyzer is especially effective when
diagnosing DHCP difficulties, particularly those
related to the DHCP boot sequence