Professional Documents
Culture Documents
Dynamic Host Configuration Protocol: CIS 856: TCP/IP and Upper Layer Protocols Presented by Kyle Getz October 20, 2005
Dynamic Host Configuration Protocol: CIS 856: TCP/IP and Upper Layer Protocols Presented by Kyle Getz October 20, 2005
Dynamic Host Configuration Protocol: CIS 856: TCP/IP and Upper Layer Protocols Presented by Kyle Getz October 20, 2005
CIS 856: TCP/IP and Upper Layer Protocols Presented by Kyle Getz October 20, 2005
IP address Router Subnet Mask Many more Manual assignment RARP BOOTP
Before DHCP
DHCP Features
Protocol for providing configuration parameters to hosts over network Dynamic allocation of IP addresses Minimal human intervention
Sample Network
DHCP Clients DHCP Server
UDP Port 68
UDP Port 68
UDP Port 68
UDP Port 67
Router
Internet
Preliminaries
(DHCP) Message = DHCP-PDU (A-PDU) Client = DHCP Client Server = DHCP Server Well-known port numbers
DHCP Server: UDP port 67 DHCP Client: UDP port 68 No ephemeral ports
Broadcast: link and IP addresses are broadcast Unicast: link and IP addresses are unicast
Client
DHCPDISCOVER
Server B
Client attempts to discover available DHCP servers
DHCPOFFER
DHCPOFFER
Client collects offers and decides which offer to accept Client broadcasts request for one of the received offers
DHCPREQUEST
DHCPREQUEST
Configuration complete
DHCPACK
Graceful shutdown
DHCPRELEASE
Use
Client broadcast to locate available servers
Server to client response offering configuration parameters Client broadcast requesting offered parameters Client to server notification that IP address is in use Server to client response confirming a request
DHCPNAK
DHCPRELEASE DHCPINFORM
T1 < T2 < Lease time T1 default value = 1/2 of lease time T2 default value = 7/8 of lease time Communicated via DHCPOFFER, DHCPACK Client actions when times elapse
T1: client must renew address with the DHCP server T2: client must renew address with any DHCP server Lease time: client must stop using IP address
Server B
DHCPREQUEST
Configuration complete
DHCPACK
DHCPREQUEST
T2 elapses
DHCPREQUEST
DHCPREQUEST
Configuration complete
Client broadcasts request to continue using IP address Server acknowledges request and updates lease
DHCPACK
RENEWING
T2/Broadcast DHCPREQUEST
REBINDING
DHCPACK/Set T1,T2
-/DHCPDISCOVER
REQUESTING
DHCPACK/Set T1,T2
Select offer/DHCPREQUEST
SELECTING
BOUND
Retransmissions
Exponential backoff Randomized Base delay doubled for each retransmission Random number picked from [-1,+1] Maximum base delay: 64 seconds
Recommendations
Server Storage
Permanent storage
Pool of available IP addresses Local configuration parameters Mapping between clients and leases When DHCPOFFER sent When DHCPACK sent
Action Taken
If current lease for client exists, send DHCPOFFER Else, if IP address available, send DHCPOFFER Else, do nothing
If IP address available, send DHCPACK Else, send DHCPNAK Mark IP address unavailable, notify network administrator Mark IP address available, delete lease Send DHCPACK with configuration parameters Mark IP address available, delete lease
DHCP Options
Magic Cookie:
99
130
4 bytes
83
99
Option format:
Code
1 byte
Length
1 byte
Data
Length bytes
Subnet Mask:
1
One-byte options:
255
255
255
0 255
Internet
DHCP Server
Relay Agents
Remove restriction of having DHCP server on every network Listen for DHCP messages and transmit them to appropriate machine Client to server relay
Broadcast from client Unicast to server(s) Broadcast from server Broadcast to client Unicast from server Unicast to client
Demonstration
Advanced Topics
Lease Times
Tradeoff
Dynamic DNS
If IP address changes due to DHCP, DNS entry is wrong Client or server can update DNS Option 81: Client FQDN
Length
1 byte
81
1 byte
Flags
rcode1
rcode2
Name
Length bytes
Reliability
Two synchronized DHCP servers on the same network: Primary, Secondary Permanent storage constantly communicated Failure: Secondary server takes over
Primary Server Secondary Server
DHCP Clients
Security
Potentially unauthorized clients Malicious client could exhaust address pool Malicious server (Rogue server)