22
DHCP Dynamic Host Configuration Protocol

Dhcp

Embed Size (px)

DESCRIPTION

About DHCP protocol

Citation preview

Page 1: Dhcp

DHCP

Dynamic Host Configuration Protocol

Page 2: Dhcp

Motivation for DHCP Configuration parameters for network

hosts IP address Router Address Subnet Mask

Before DHCP Manual assignment BOOTP

Page 3: Dhcp

DHCP Dynamic Host Configuration

Protocol (DHCP) From 1993 An extension of BOOTP, very similar to DHCP 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.

Page 4: Dhcp

DHCP Features Protocol for providing configuration

parameters to hosts over network Dynamic allocation of IP addresses Minimal human intervention

Page 5: Dhcp

Preliminaries

Router

Internet

DHCP Server

UDP Port 68

UDP Port 68

UDP Port 68

UDP Port 67

DHCP Clients

Sample Network

Page 6: Dhcp

Preliminaries

DHCP Server: UDP port 67DHCP Client: UDP port 68

Client-Server Exchange

Page 7: Dhcp

Preliminaries DHCP Message = DHCP Packet Client = DHCP Client Server = DHCP Server Broadcast and unicast used for Packets’s

in both directions “Broadcast”: link and IP addresses are

broadcast “Unicast”: link and IP addresses are unicast

Page 8: Dhcp

Initial Message FlowServer A Client Server B

Client attempts to discover available DHCP serversDHCPDISCOVE

RDHCPDISCOVE

R

Servers reply with offersDHCPOFFE

RDHCPOFFE

RClient collects offers and decides which offer to accept

Client broadcasts request for one of the received offersDHCPREQUES

TDHCPREQUES

T

Server acknowledges client’s use of IP addressDHCPAC

KConfiguration complete

Client explicitly releases use of IP addressDHCPRELEAS

E

Graceful shutdown

Page 9: Dhcp

DHCP Message Types

Value Message Type

1 DHCPDISCOVER

2 DHCPOFFER

3 DHCPREQUEST

4 DHCPACK

5 DHCPNAK

6 DHCPRELEASE

7 DHCPINFORM

Page 10: Dhcp

Message TypesDHCPDISCOVER: Broadcast by a client to find available DHCP servers.

DHCPOFFER: Response from a server to a DHCPDISCOVER and offering IP address and other parameters.

DHCPREQUEST: Message from a client to servers that does one of the following: Requests the parameters offered by one of the servers and declines all other offers. Verifies a previously allocated address after a system or network change (a reboot for example). Requests the extension of a lease on a particular address.

Page 11: Dhcp

Contd…..

DHCPACK: Acknowledgement from server to client with parameters,including IP address.

DHCPNACK: Negative acknowledgement from server to client, indicating that the client's lease has expired or that a requested IP address is incorrect.

DHCPRELEASE: Message from client to server canceling remainder of a lease and relinquishing network address.

DHCPINFORM: Message from a client that already has an IP address (manually configured for example), requesting further configuration parameters from the DHCP server.

Page 12: Dhcp

12

DHCP Operation

DCHP DISCOVER

DHCP Client00:a0:24:71:e4:44 DHCP Server

DHCPDISCOVERSent to 255.255.255.255

DHCP Server

DHCP Client00:a0:24:71:e4:44 DHCP Server

DHCP Server

DHCPOFFER

DHCPOFFER

DCHP OFFER

Page 13: Dhcp

13

DHCP Operation

DHCP Client00:a0:24:71:e4:44 DHCP Server

DHCP Server

DHCPREQUEST

DHCPACKDCHP REQUEST

At this time, the DHCP client can start to use the IP address

DHCP Client00:a0:24:71:e4:44 DHCP Server

DHCP Server

DHCPREQUEST

DHCPACKRenewing a Lease(sent when 50% of lease

has expired)If DHCP server sends DHCPNACK, then address is released.

Page 14: Dhcp

14

DHCP Operation

DHCP Client00:a0:24:71:e4:44 DHCP Server

DHCP Server

DHCPRELEASE

DCHP RELEASE

At this time, the DHCP client has released the IP address

Page 15: Dhcp

Lease Renewal Times (Client)

T1 < T2 < Lease time T1 default value = 1/2 of lease time T2 default value = 7/8 of lease time Communicated via DHCPOFFER, DHCPACK Client actions when times elapse

T1: client must renew address with the DHCP server

T2: client must renew address with any DHCP server

Lease time: client must stop using IP address

Page 16: Dhcp

Renewal Message FlowServer A Client Server B

Client unicasts request to continue using IP addressDHCPREQUES

TServer acknowledges request and updates leaseDHCPACK

Client broadcasts request to continue using IP addressDHCPREQUES

TDHCPREQUES

TServer acknowledges request and updates leaseDHCPAC

K

Configuration complete

T1 elapses

T1 elapses

Client unicasts request to continue using IP addressDHCPREQUES

TT2 elapses

Configuration complete

Page 17: Dhcp

Client FSM

Page 18: Dhcp
Page 19: Dhcp

Server Storage

Permanent storage Pool of available IP addresses Local configuration parameters Mapping between clients and leases

Page 20: Dhcp

Server Logic

Event Action Taken DHCPDISCOVER

If current lease for client exists, send DHCPOFFERElse, if IP address available, send DHCPOFFERElse, do nothing

DHCPREQUEST If IP address available, send DHCPACKElse, send DHCPNAK

DHCPRELEASE Mark IP address available, delete lease

DHCPINFORM Send DHCPACK with configuration parameters

Lease expiration

Mark IP address available, delete lease

Page 21: Dhcp

Advantages

It relieves the network administrator of a great deal of manual configuration work.

The ability for a device to be moved from network to network and to automatically obtain valid configuration parameters for the current network can be of great benefit to mobile users.

Because IP addresses are only allocated when clients are actually active, it is possible, by the use of reasonably short lease times and the fact that mobile clients do not need to be allocated more than one address, to reduce the total number of addresses in use in an organization.

Page 22: Dhcp

Disadvantages

Uses UDP, an unreliable and insecure protocol. DNS cannot be used for DHCP configured

hosts. Potentially unauthorized clients Malicious client could exhaust address

pool Malicious server (Rogue server)

Supply incorrect configuration parameters