P. 1


|Views: 35|Likes:
Published by Jack Hue

More info:

Published by: Jack Hue on Jan 01, 2011
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PPT, PDF, TXT or read online from Scribd
See more
See less






Dynamic Host Configuration Protocol

CIS 856: TCP/IP and Upper Layer Protocols Presented by Kyle Getz October 20, 2005

Motivation for DHCP 

Configuration parameters for network hosts 

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 and unicast used for PDU s in both directions   Broadcast : link and IP addresses are broadcast Unicast : link and IP addresses are unicast .

Initial Message Flow Server A DHCPDISCOVER Client DHCPDISCOVER Server B Client attempts to discover available DHCP servers Servers reply with offers 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 Server acknowledges client¶s use of IP address Graceful shutdown DHCPRELEASE Client explicitly releases use of IP address .

DHCP Message Types DHCP Message DHCPDISCOVER DHCPOFFER DHCPREQUEST DHCPDECLINE DHCPACK DHCPNAK DHCPRELEASE DHCPINFORM 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 Server to client response denying a request Client to server request to relinquish IP address Client to server request for configuration parameters .

Lease Renewal Times (Client)      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 .

Renewal Message Flow Server A Client T1 elapses Client unicasts request to continue using IP address Server acknowledges request and updates lease Server B DHCPREQUEST Configuration complete DHCPACK T1 elapses Client unicasts request to continue using IP address DHCPREQUEST T2 elapses DHCPREQUEST DHCPREQUEST Configuration complete Client broadcasts request to continue using IP address Server acknowledges request and updates lease DHCPACK .

T2 T1/ Unicast DHCPREQUEST Select offer/DHCPREQUEST SELECTING DHCPOFFER/ Process offer BOUND . Lease expires/ Stop using IP address DHCPNAK/ Stop using IP address T2/Broadcast DHCPREQUEST RENEWING REBINDING DHCPNAK/ Discard offer DHCPACK/Set T1.Client FSM (Simplified) INIT DHCPNAK.T2 -/DHCPDISCOVER REQUESTING DHCPACK/Set T1.T2 DHCPACK (in use)/ DHCPDECLINE DHCPACK/Set T1.

+1] Maximum base delay: 64 seconds  Recommendations    .Retransmissions   Client responsible for all retransmissions Retransmission strategy   Exponential backoff Randomized Base delay doubled for each retransmission Random number picked from [-1.

Server Storage  Permanent storage    Pool of available IP addresses Local configuration parameters Mapping between clients and leases When DHCPOFFER sent When DHCPACK sent  Flexibility concerning storage update   .

Server Logic (Simplified) Event DHCPDISCOVER Action Taken If current lease for client exists. send DHCPOFFER Else. delete lease Send DHCPACK with configuration parameters Mark IP address available. send DHCPACK Else. send DHCPOFFER Else. if IP address available. send DHCPNAK Mark IP address unavailable. do nothing If IP address available. delete lease DHCPREQUEST DHCPDECLINE DHCPRELEASE DHCPINFORM Lease expiration . notify network administrator Mark IP address available.

DHCP PDU Format 32 Bits Operation Code Hardware Type Hardware Length Hop Count Transaction ID Seconds Elapsed B Client IP address Your IP address Server IP address Relay agent IP address Client hardware address (16 bytes) Server host name (64 bytes) Boot file name (128 bytes) Magic Cookie Options (up to 312 bytes) Must Be Zero (MBZ) .

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: 4 255 255 255 0 0 255 Padding End of options .

Another Sample Network DHCP Clients Relay Agent within Router 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 pUnicast to server(s) Broadcast from server p Broadcast to client Unicast from server p Unicast to client  Server to client relay   .

Demonstration .

Advanced Topics     Lease times Dynamic DNS Reliability Security .

Lease Times      Anywhere from 15 minutes 1 year Common lease times & rationales 15 minutes: Maximum number of addresses free 3 days: Microsoft default 4 months: Students can keep lease over summer  Tradeoff .

DNS entry is wrong Client or server can update DNS Option 81: Client FQDN 81 1 byte Length 1 byte Flags rcode1 rcode2 Name Length bytes .Dynamic DNS    If IP address changes due to DHCP.

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)   Supply incorrect configuration parameters Supply malicious configuration parameters .

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->