Dynamic Host Configuration Protocol
(DHCP)
1
Dynamic Assignment of IP addresses
• Dynamic assignment of IP addresses is desirable for several
reasons:
– IP addresses are assigned on-demand
– Avoid manual IP configuration
– Support mobility of laptops
2
Solutions for dynamic assignment of IP addresses
• Reverse Address Resolution Protocol (RARP)
– Works similar to ARP
– Broadcast a request for the IP address associated
with a given MAC address
– RARP server responds with an IP address
– Only assigns IP address (not the default router and
subnetmask)
ARP Ethernet MAC
IP address
address
(32 bit)
(48 bit)
RARP
3
BOOTP
• BOOTstrap Protocol (BOOTP)
• From 1985
• Host can configure its IP parameters at boot time.
• 3 services.
– IP address assignment.
– Detection of the IP address for a serving machine.
– The name of a file to be loaded and executed by the client machine
(boot file name)
– Not only assign IP address, but also default router, network mask, etc.
– Sent as UDP messages (UDP Port 67 (server) and 68 (host))
– Use limited broadcast address ([Link]):
• These addresses are never forwarded
4
Dynamic Host Configuration Protocol
(DHCP)
Relates to Lab 7.
Module about dynamic assignment of IP addresses with DHCP.
5
DHCP
• Dynamic Host Configuration Protocol (DHCP)
– From 1993
– An extension of BOOTP, very similar to DHCP
– Same port numbers as BOOTP
– Extensions:
• Supports temporary allocation (“leases”) of IP addresses
• DHCP client can acquire all IP configuration parameters
needed to operate
– DHCP is the preferred mechanism for dynamic assignment
of IP addresses
– DHCP can interoperate with BOOTP clients.
6
BOOTP Interaction
(b)
Argon
(a) Argon
[Link]
[Link] BOOTP Server [Link] DHCP Server
BOOTP Response:
IP address: [Link]
BOOTP Request
[Link] Server IP address: [Link]
Sent to [Link] Boot file name: filename
• BOOTP can be used for
Argon
[Link]
(c) downloading memory
[Link] DHCP Server
image for diskless
TFTP
“filename”
workstations
• Assignment of IP addresses
[Link]
to hosts is static
7
DHCP Interaction (simplified)
Argon
[Link] DHCP Server
DHCP Request
[Link]
Sent to [Link]
Argon
[Link]
[Link] DHCP Server
DHCP Response:
IP address: [Link]
Default gateway: [Link]
Netmask: [Link]
8
BOOTP/DHCP Message Format
Hardware Address
OpCode Hardware Type Hop Count
Length
Unused (in BOOTP)
Number of Seconds
Flags (in DHCP)
Transaction ID
Client IP address
Your IP address
Server IP address
Gateway IP address
Client hardware address (16 bytes)
Server host name (64 bytes)
Boot file name (128 bytes)
Options
(There are >100 different options) 9
BOOTP/DHCP
• OpCode: 1 (Request), 2(Reply)
Note: DHCP message type is sent in an option
• Hardware Type: 1 (for Ethernet)
• Hardware address length: 6 (for Ethernet)
• Hop count: set to 0 by client
• Transaction ID: Integer (used to match reply to response)
• Seconds: number of seconds since the client started to boot
• Client IP address, Your IP address, server IP address,
Gateway IP address, client hardware address, server
host name, boot file name:
client fills in the information that it has, leaves rest blank
10
DHCP Message Type
• Message type is sent as an Value Message Type
option.
1 DHCPDISCOVER
2 DHCPOFFER
3 DHCPREQUEST
4 DHCPDECLINE
5 DHCPACK
6 DHCPNAK
7 DHCPRELEASE
8 DHCPINFORM
11
Other options (selection)
• Other DHCP information that is sent as an option:
Subnet Mask, Name Server, Hostname, Domain Name,
Forward On/Off, Default IP TTL, Broadcast Address, Static
Route, Ethernet Encapsulation, X Window Manager, X
Window Font, DHCP Msg Type, DHCP Renewal Time, DHCP
Rebinding, Time SMTP-Server, SMTP-Server, Client FQDN,
Printer Name, …
12
DHCP Operation
DHCP Client
[Link] DHCP Server
DHCPDISCOVER
• DCHP DISCOVER Sent to [Link]
DHCP Server
DHCP Client
[Link] DHCPOFFER DHCP Server
DHCPOFFER
• DCHP OFFER
DHCP Server
13
DHCP Operation
DHCP Client
[Link] DHCP Server
DHCPREQUEST
• DCHP DISCOVER DHCPACK
At this time, the DHCP client can start to use the IP
address DHCP Server
DHCP Client
[Link] DHCP Server
DHCPREQUEST
• Renewing a Lease
(sent when 50% of lease has expired)
If DHCP server sends DHCPNACK, then address is released.
DHCPACK
DHCP Server
14
DHCP Operation
DHCP Client
[Link] DHCP Server
DHCPRELEASE
• DCHP RELEASE
At this time, the DHCP client has released the IP
address DHCP Server
15