What is DHCP, and when & where is it used? Components of DHCP BOOTP and DHCP relation DHCP message format DHCP procedures allocating new address lease renewal State machine Questions & answers re. DHCP Benefits of DHCP
Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified by Prof. M. Veeraraghavan
What is DHCP ?
Dynamic Host Configuration Protocol
Used for dynamic allocation of IP addresses used for hosts that run only client applications Allows for host-specific configuration parameters to be delivered from a DHCP server to a host
e.g., used on the Poly campus on our 802.11 wireless network, where many students, faculty and staff members use their wireless cards for access to the Poly campus network
3
Internet, a client host dynamically obtains an address for a short period of time and releases it for use by some other client
users incoming mail server, but not the mail server itself e.g. Windows PCs have ftp clients but not ftp servers
Then, the end host can simply connect to the network at any point of attachment, obtain a network address and start receiving information
Therefore, such end hosts do not need a permanent address that potentially callees will need to know
5
Components
DHCP client: a host using DHCP to
obtain an IP address and other configuration information DHCP server: a host that returns IP addresses and other configuration information BOOTP relay agents: host or router that passes DHCP messages between DHCP clients and DHCP servers
9
First operation, get Ethernet and IP address for itself and the address of a server and bootfile name (diskless client) Second operation, uses TFTP to download bootfile
67 for the server port 68 for the client port
10
hops(1)
flags (2)
BACK
13
BACK
DHCP options
DHCP Message Type
(must in all messages) Requested IP Address Server identifier IP Address Lease Time Renewal Time Value (T1) Rebinding Time Value (T2) Client identifier
Router option
specifies IP addresses of DNS servers available to client specifies IP addresses of routers on the clients subnet
Max Datagram
17
DHCP procedures
Obtaining a new address Reusing a previously allocated address
18
Client
Server (selected)
DHCP DISC.
DHCP DISC.
Also broadcast
DHCP REQ.
Collects replies
DHCP REQ.
Client selects configuration; in DCHP REQ it accepts one servers offer (server identifier option) and implicitly reject rest
19
Discard lease
Obtaining an IP address
DHCPDISCOVER is broadcast because client
does not know IP address of DHCP server; BOOTP relay agents may relay it to other DHCP servers One or more DHCP servers respond with DHCPOFFER, which carry yiaddr (Your IP address, i.e., client address)
is free ping needed because often a user will leave without graceful release of address
recommended check: SHOULD instead of MUST server uses ICMP echo request (ping) to check if address
21
Reuse of address
Server
DHCP REQ.
Client
Server
DHCP REQ.
Locates Config.
DHCPACK
Servers with knowledge of the client's configuration parameters respond with a DHCPACK message to the client.
Locates Config.
DHCPACK
Initialization Complete
(Subsequent DHCP Packets Ignored)
24
Reuse of IP address
DHCP REQUEST - client message to
servers
requesting offered parameters from one server and implicitly declining offers from all others confirming correctness of previously allocated address after, e.g., system reboot, extending the lease on a particular network address.
25
26
State machine
init with known network address
INIT/ REBOOT Send DHCPREQUEST DHCPNAK Restart REBOOTING DHCPACK/Record lease, set timers Send DHCPDISCOVER SELECTING
DHCPNAK/ Discard
REQUESTING DHCPACK/ Record lease, set Timers T1,T2 DHCPOFFER/ Discard DHCPACK/ Record lease, set timersT1, T2
REBINDING
RENEWING
27
Timers
T1 is the time at which the client enters the
RENEWING state and attempts to contact the server that originally issued the client's network address. T2 is the time at which the client enters the REBINDING state and attempts to contact any server. T1 MUST be earlier than T2 T2 MUST be earlier than the time at which the client's lease will expire.
28
server on every subnet giaddr (gateway address) is poorly named it exists to facilitate relaying of BOOTP messages and is not a general or gateway IP router address giaddr should be 0 in DHCPDiscover (says BOOTPRequest in RFC 1542) BOOTP relay agent should not be confused with an IP router: former terminates BOOTP messages, processes them and generates new ones; it does not simply forward packets if giaddr is 0 when a BOOTP relay agent receives a message, it sets it to the IP address of the interface on which it was received in the new message it relays to the next agent if giaddr is non-zero, then it MUST not be modified
allows the DHCP server to determine subnet of client
29
Questions on DHCP
What happens if there is no DHCP server on a
network and an IP host connects to it with the Obtain IP address automatically option selected? Who makes and sells DHCP servers? Are these standalone entities or are they add-ons to IP routers? Use a sniffer, capture DHCP messages and explain procedure and parameters.
30
What happens if there is no DHCP server on a network and an IP host connects to it with the Obtain IP address automatically
option selected?
31
What happens if there is no DHCP server on a network and an IP host connects to it with the Obtain IP address automatically
option selected?
If there is no DHCP server, and no BOOTP relay agent, then no IP address will be assigned and hence host cannot communicate; In this case Static Addressing needs to be used In static addressing, the following fields: Gateway, DNS Configuration and IP Address would have to be manually set for a host to have connectivity into the network.
32
Who makes and sells DHCP servers? Are these standalone entities or are they add-ons to IP routers?
33
34
35
36
37
process to set IP addresses, DNS server addresses, gateways, etc. Configuration information can be administered from a single point. Major network resource changes (e.g. a router changing an interface address) requires an update of only the DHCP server, rather than every system. 38 Caveat: cannot allocate temporary addresses to servers/routers
References
RFC 2131: DHCP RFC 2132: DHCP options RFC 951: Bootstrap protocol (BOOTP) RFC 1542: BOOTP relay agents Steven M. Glass, Use of DHCP in Mobile IP, 2000,
http://www.ietf.org/proceedings/00jul/SLIDES/mobileipdhcpinmip/index.htm
39