DHCP Dynamic Host Configuration Protocol (RFC 2131) Michael Sadowsky CISC University of Delaware October 12, 2004 BOOTP Bootstrap Protocol (RFC 951) and
Why BOOTP? Internet Router Boot Server DNS Server File Server What’s my IP address? 2.What’s my subnet mask? 3.Who’s my router? 4.Who’s my DNS server? Diskless Workstations ee:ee:ee:ee:ee:01 ee:ee:ee:ee:ee:02 ee:ee:ee:ee:ee:03 ee:ee:ee:ee:ee:04
BOOTP: Bootstrap Protocol RFC 951 Designed for diskless workstations Supplies static configuration: –IP address –Subnet mask –Router IP address –Name server IP address –Boot image
BOOTP Operation Port 67/UDPPort 68/UDP ff:ff:ff:ff:ff:ff | ee:ee:ee:ee:ee: | | 68 BOOTP request ee:ee:ee:ee:ee:05 | ee:ee:ee:ee:ee: | | 68 BOOTP reply BOOTP Client (A) BOOTP Server (B) BOOTP UDPIPEthernet
BOOTP PDU Format Operation CodeHardware TypeHardware LengthHop Count Transaction ID Number of secondsUnused Client IP address Your IP address Server IP address Gateway IP address Client hardware address (16 bytes) Server name (64 bytes) Boot file name (128 bytes) Options (up to 64 bytes) 4 bytes
BOOTP Problem Internet Router Boot Server DNS Server File Server I don’t know, I’ve never seen you here before. New Roaming Client What is my network configuration? ee:ee:ee:ee:ee:01 ee:ee:ee:ee:ee:02 ee:ee:ee:ee:ee:03 ee:ee:ee:ee:ee:04
BOOTP Limitations Static configuration Does not dynamically allocate IP addresses Manual administrator intervention to add/remove clients
DHCP Motivations Automatic network configuration for clients No administrator intervention Effective allocation of limited addresses Support for transient/roaming systems
DHCP Evolution DHCP is an extension of Bootstrap Protocol Uses same basic PDU format for backwards compatibility Introduces pool of IP addresses for dynamic assignment Concept of temporary leased addresses
DHCP PDU Format Operation CodeHardware TypeHardware LengthHop Count Transaction ID Number of secondsFlag (1 bit) | (15 unused bits MBZ) Client IP address Your IP address Server IP address Gateway IP address Client hardware address (16 bytes) Server name (64 bytes) Boot file name (128 bytes) Options (up to 312 bytes) 4 bytes
DHCP PDU Format Broadcast bit is to inform server if it can respond with unicast IP PDUs or if it must instead broadcast the reply to the entire network. DHCP PDU has 312 bytes for options versus 64 bytes in BOOTP PDU DHCP messages carried in options portion of the PDU
Typical Options Tag(0) TagLength(N)Value Tag (255) Padding N bytes End of options Tag IDFunctionTag IDFunction 1Subnet Mask13Boot File size 37TCP Default TTL72WWW Server 69SMTP Server61Client Identifier 54Server Identifier66TFTP Server 3Time server53DHCP Message 4DNS name server55Parameter Request List
Message Types Type identified by value field of option with tag 53: –DHCPDISCOVER (1) –DHCPOFFER (2) –DHCPREQUEST (3) –DHCPDECLINE (4) –DHCPACK (5) –DHCPNACK (6) –DHCPRELEASE (7) –DHCPINFORM (8)
DHCP Client State Diagram Selecting Requesting BOUND RenewingRebinding Initializing DHCPDISCOVER DHCPREQUEST DHCPACK DHCPOFFER Lease 87.5% Expired DHCPREQUEST DHCPACK DHCPNACK DHCPRELEASE Lease Cancelled Lease Expired Lease 50% Expired DHCPREQUEST DHCPNACK Lease Expired
Allocating New Address DHCP Server DHCP Client DHCPDISCOVER DHCPOFFER DHCPREQUEST DHCPACKDHCPRELEASE Client attempts to discover available DHCP servers Servers reply with address offers Client selects which offer to accept Client notifies servers of choice Server acknowledges client use of address Client gives up use of address
Address Renewing Scenario DHCP Server DHCP Client DHCPREQUEST DHCPACK DHCPREQUEST DHCPNACK DHCPDISCOVER DHCPREQUEST Client makes request Server acknowledges request; lease begins Time passes; 50% of lease expires Client makes request to renew address No response from server, client times out and sends request again Server responds with negative acknowledgement, address can not be renewed Client begins discovery phase to find a new address to lease
Renewing a Previous Address DHCPACK DHCPREQUEST DHCP Server DHCP Client DHCPACK DHCPREQUEST Client requests its previously assigned address. Servers respond granting the request. Ignore DHCPACKs when a connection has been established.
DHCP Problem Router DHCP Server DNS Server File Server What is the problem here? Routers do not forward IP broadcast PDUs ee:ee:ee:ee:ee:01 ee:ee:ee:ee:ee:02 ee:ee:ee:ee:ee:03 ee:ee:ee:ee:ee:04
DHCP Infrastructure Use relay agents to transmit DHCP messages between physical networks Prohibitive/costly to have DHCP server on each physical LAN segment
DHCP Security Considerations Hostile environments with open physical access to network Rouge DHCP server on network Denial of service by exhausting address pool Authentication introduced in RFC 3118 but not implemented