Transcript Chapter 15

Chapter 15
DHCP
Dynamic Host Configuration
Protocol
• An Application Layer Protocol
• A client server protocol that automatically
provides an IP host with its IP address and
other items such as the subnet mask and
default gateway
• All necessary TCP/IP configuration
information for the host is obtained from a
DHCP server
When to Use DHCP
• DHCP can help when you are running out of IP
addresses.
• In a Class C IP network, there are only 254
addresses to assign to hosts. What to do if you get
more hosts than this?
• Use DHCP to assign hosts an IP address for a
short period of time.
• This works if you never have more than 254
simultaneous users.
History of DHCP
• Originally called BootP protocol
• Designed to give IP addresses to diskless
workstations
• Today DHCP is built onto BootP protocol
How DHCP Works
• When TCP/IP starts up on a DHCP-enabled host,
the host sends out a special message to the DHCP
server requesting an IP address and a subnet mask
• The DHCP server checks its internal database to
find an available IP address
• The DHCP offers the IP address to the client for a
specified period of time, called a lease
The Pros of DHCP
•
•
•
•
It’s inexpensive
Human error factors are eliminated
Configuration problems are minimized
New or moved hosts can be plugged into a
network segment immediately without any
configuration or setup
The Cons of DHCP
• If DHCP server is down, then no clients will
be operational
• Certain applications require the use of a
specific IP address.
DHCP in Action
•
•
•
•
•
•
Stage One: IP Lease Request
Stage Two: IP Lease Offer
Stage Three: IP Lease Selection
Stage Four: IP Lease Acknowledgement
DHCP Lease Renewal
DHCP Lease Release
IP Lease Request
• Begins when a host is started that has TCP/IP configures
with DHCP
• Client does not have an IP address initially
• It uses 0.0.0.0
• The client sends out a DHCP discover message
• The message contains the hardware address of the client
• The client waits one second for an offer
• If no DHCP server responds, then the request is repeated
at 9, 13, and 16 second intervals
• If no response still, then a broadcast message is sent every
five minutes
IP Lease Offer
• Information is sent back to the client
• The offer consists of an IP address, subnet mask,
lease period (in hours), and the IP address of the
proposing DHCP server
• The offer is sent to the hardware address of the
client
• The pending IP address is reserved temporarily
IP Lease Selection
• The client machine selects the first IP addressing
offer it receives
• Client replies by broadcasting an acceptance
message
• The message includes the IP address of the DHCP
server whose offer was accepted
• All other DHCP servers revoke their offer
IP Lease Acknowledgement
• The accepted DHCP server assigns the IP address to the
client
• The DHCP server then sends an acknowledgement back to
the client
• This acknowledgement is called DHCPACK
• Occasionalyy a negative acknowledgement (DHCPNACK)
is sent back
• This may happen if the client is trying to lease its old IP
address that has already been assigned elsewhere
DHCP Lease Renewal
• IP addresses are leased for a period of time
• The leasing client will send a DHCPREQUEST to the DHCP server
when its lease period has elapsed by 50%
• The DHCP server may send a acknowledge message to the client,
updating the configuration and resetting the least time
• If the server can’t renew the lease, the client will receive an eviction
notice
• The rejected client responds by sending out an additional lease renewal
attempt when 87.5% of its lease time is expired
• Any available DHCP server can respond and renew the lease
• If the client receives a DHCPNACK, the client must stop using the IP
address immediately and start the leasing process from the beginning
DHCP Lease Release
• The client can elect to cancel the lease by using the IPCONFIG
/RELEASE utility
• DHCP leases are not automatically released at system shutdown
DHCP Client Reservation
• Certain machines such as servers must always have the same IP
address
• To fulfill this need, a special arrangement called a client reservation
must be made with the DHCP server
DHCP Relay
• Used in networks with older routers that don’t support DHCP
• The DHCP Relay Agent forwards an IP lease request from a client on
the same subnet directly to the computer running the DHCP service
• The DHCP server then returns an IP address directly to the requesting
client