Bootstrap and Autoconfiguration (DHCP) : Internetworking With TCP/IP Vol 1 - Part 22 2005

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

PART XXII

BOOTSTRAP AND AUTOCONFIGURATION


(DHCP)

Internetworking With TCP/IP vol 1 -- Part 22 1 2005


System Startup

d To keep protocol software general


– IP stack designed with many parameters
– Values filled in when system starts
d Two possible sources of information
– Local storage device (e.g., disk)
– Server on the network

Internetworking With TCP/IP vol 1 -- Part 22 2 2005


Bootstrapping

d BOOTstrap Protocol (BOOTP)


– Early alternative to RARP
– Provided more than just an IP address
– Obtained configuration parameters from a server
– Used UDP
d Dynamic Host Configuration Protocol (DHCP)
– Replaces and extends BOOTP
– Provides dynamic address assignment

Internetworking With TCP/IP vol 1 -- Part 22 3 2005


Apparent Contradiction

d DHCP used to obtain parameters for an IP stack


d DHCP uses IP and UDP to obtain the parameters
d Stack must be initialized before being initialized

Internetworking With TCP/IP vol 1 -- Part 22 4 2005


Solving The Apparent Contradiction

d DHCP runs as application


d Only needs basic facilities
d In particular:

An application program can use the limited broadcast IP


address to force IP to broadcast a datagram on the local
network before IP has discovered the IP address of the local
network or the machine’s IP address.

d Note: server cannot use ARP when replying to client


because client does not know its own IP address

Internetworking With TCP/IP vol 1 -- Part 22 5 2005


DHCP Retransmission

d Client handles retransmission


d Initial timeout selected at random
d Timeout for successive retransmissions doubled

Internetworking With TCP/IP vol 1 -- Part 22 6 2005


Two-Step Bootstrap

d DHCP provides information, not data


d Client receives
– Name of file that contains boot image
– Address of server
d Client must use another means to obtain the image to run
(typically TFTP)

Internetworking With TCP/IP vol 1 -- Part 22 7 2005


Dynamic Address Assignment

d Needed by ISPs
– Client obtains an IP address and uses temporarily
– When client finishes, address is available for another
client
d Also used on many corporate networks

Internetworking With TCP/IP vol 1 -- Part 22 8 2005


DHCP Address Assignment

d Backward compatible with BOOTP


d Can assign addresses in three ways
– Manual (manager specifies binding as in BOOTP)
– Automatic (address assigned by server, and machine
retains same address)
– Dynamic (address assigned by server, but machine may
obtain new address for successive request)
d Manager chooses type of assignment for each address

Internetworking With TCP/IP vol 1 -- Part 22 9 2005


DHCP Support For Autoconfiguration

Because it allows a host to obtain all the parameters needed for


communication without manual intervention, DHCP permits
autoconfiguration. Autoconfiguration is, of course, subject to
administrative constraints.

Internetworking With TCP/IP vol 1 -- Part 22 10 2005


Dynamic Address Assignment

d Client is granted a lease on an address


d Server specifies length of lease
d At end of lease, client must renew lease or stop using
address
d Actions controlled by finite state machine

Internetworking With TCP/IP vol 1 -- Part 22 11 2005


Server Contact

To use DHCP, a host becomes a client by broadcasting a


message to all servers on the local network. The host then
collects offers from servers, selects one of the offers, and
verifies acceptance with the server.

Internetworking With TCP/IP vol 1 -- Part 22 12 2005


DHCP Finite State Machine

Host Boots INITIALIZE

/ DHCPDISCOVER

SELECT DHCPNACK DHCPNACK


or
Lease Expires

Lease Reaches
DHCPOFFER 87.5% Expiration /
DHCPREQUEST
REBIND RENEW
Select Offer /
DHCPREQUEST

DHCPACK

REQUEST DHCPACK

Lease Reaches
50% Expiration /
DHCPACK DHCPREQUEST

BOUND
Cancel Lease / DHCPRELEASE

Internetworking With TCP/IP vol 1 -- Part 22 13 2005


DHCP Message Format
0 8 16 24 31

OP HTYPE HLEN HOPS

TRANSACTION ID

SECONDS FLAGS

CLIENT IP ADDRESS

YOUR IP ADDRESS

SERVER IP ADDRESS

ROUTER IP ADDRESS

CLIENT HARDWARE ADDRESS (16 OCTETS)


.
.
.

SERVER HOST NAME (64 OCTETS)


.
.
.

BOOT FILE NAME (128 OCTETS)


.
.
.

OPTIONS (VARIABLE)
.
.
.

Internetworking With TCP/IP vol 1 -- Part 22 14 2005


Message Type Field

0 8 16 23

CODE (53) LENGTH (1) TYPE (1 - 7)

2TYPE FIELD Corresponding DHCP Message Type


2222222222222222222222222222222222222222222222222
1 DHCPDISCOVER
2 DHCPOFFER
3 DHCPREQUEST
4 DHCPDECLINE
5 DHCPACK
6 DHCPNACK
7 DHCPRELEASE
8 DHCPINFORM

Internetworking With TCP/IP vol 1 -- Part 22 15 2005


Questions For Discussion

d Explain the relationship between DHCP and DNS


d What basic facility is needed? Why?

Internetworking With TCP/IP vol 1 -- Part 22 16 2005


Summary

d Two protocols available for bootstrapping


– BOOTP (static binding of IP address to computer)
– DHCP (extension of BOOTP that adds dynamic binding
of IP addresses)
d DHCP
– Server grants lease for an address
– Lease specifies length of time
– Host must renew lease or stop using address when lease
expires
– Actions controlled by finite state machine

Internetworking With TCP/IP vol 1 -- Part 22 17 2005


Questions?

You might also like