Sie sind auf Seite 1von 18

PART XXII

BOOTSTRAP AND AUTOCONFIGURATION


(DHCP)

Internetworking With TCP/IP vol 1 -- Part 22

2005

System Startup
d To keep protocol software general

IP stack designed with many parameters

Values lled 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

2005

Bootstrapping
d BOOTstrap Protocol (BOOTP)

Early alternative to RARP

Provided more than just an IP address

Obtained conguration parameters from a server

Used UDP

d Dynamic Host Conguration Protocol (DHCP)

Replaces and extends BOOTP

Provides dynamic address assignment

Internetworking With TCP/IP vol 1 -- Part 22

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

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 machines 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

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

2005

Two-Step Bootstrap
d DHCP provides information, not data
d Client receives

Name of le 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

2005

Dynamic Address Assignment


d Needed by ISPs

Client obtains an IP address and uses temporarily

When client nishes, address is available for another


client

d Also used on many corporate networks

Internetworking With TCP/IP vol 1 -- Part 22

2005

DHCP Address Assignment


d Backward compatible with BOOTP
d Can assign addresses in three ways

Manual (manager species 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

2005

DHCP Support For Autoconguration

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 species length of lease
d At end of lease, client must renew lease or stop using
address

d Actions controlled by nite 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

DHCPNACK

DHCPNACK

SELECT

or
Lease Expires

Lease Reaches
87.5% Expiration /

DHCPOFFER

Select Offer /

REBIND

DHCPREQUEST

RENEW

DHCPREQUEST
DHCPACK
DHCPACK

REQUEST

Lease Reaches
50% Expiration /

DHCPREQUEST

DHCPACK
BOUND

Internetworking With TCP/IP vol 1 -- Part 22

13

Cancel Lease / DHCPRELEASE


2005

DHCP Message Format


0

16

OP

HTYPE

24
HLEN

31
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

8
CODE (53)

TYPE FIELD
1
2
3
4
5
6
7
8

Internetworking With TCP/IP vol 1 -- Part 22

16
LENGTH (1)

23
TYPE (1 - 7)

Corresponding DHCP Message Type


DHCPDISCOVER
DHCPOFFER
DHCPREQUEST
DHCPDECLINE
DHCPACK
DHCPNACK
DHCPRELEASE
DHCPINFORM

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 species length of time

Host must renew lease or stop using address when lease


expires

Actions controlled by nite state machine

Internetworking With TCP/IP vol 1 -- Part 22

17

2005

Questions?

Das könnte Ihnen auch gefallen