Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 18 Host Configuration : DHCP

Similar presentations


Presentation on theme: "Chapter 18 Host Configuration : DHCP"— Presentation transcript:

1 Chapter 18 Host Configuration : DHCP

2 18.1 Introduction The information that is held in each computer attached to a TCP/IP internet Its IP address Its subnet mask The IP address of a router The IP address of a name server The above information is usually stored in a configuration file and accessed by the computer during the bootstrap process In the case of a diskless computer, the operating system and networking S/W can be stored in ROM. But the above information cannot be stored in ROM

3 Previous Protocol RARP ( Reverse Address Resolution Protocol)
Provide the IP address for a booted computer Map a physical address to an IP address But deprecated today for two reasons RARP used the broadcast service of the data link layer So RARP server must be present in each network RARP can provide only the IP address of the computer Today, a computer requires IP address, subnet mask, IP address of router, IP address of name server.

4 Previous Protocol (cont’)
BOOTP ( Bootstrap Protocol) Prerunner of DHCP Client/Server protocol designed BOOTP server can be anywhere in the Internet BOOTP can provide all pieces of information But BOOTP is a static configuration protocol BOOTP can not support dynamic configuration

5 DHCP Dynamic Host Configuration Protocol
DHCP is a client/server protocol designed to provide the four pieces of information for a diskless computer or a computer that is booted for the first time. Successor to BOOTP and is backward compatible with it Meaning that a host running the BOOTP client can request a static configuration to a DHCP server DHCP provides temporary IP addresses for a limited period of time

6 18.2 DHCP Operation A client broadcasts a DHCPDISCOVER message using destination port 67 Servers respond with a DHCPOFFER message including an IP address Offering the duration of the lease - default : one hour The server that sends a DHCPOFFER locks the offered IP address so that it is not available to any other clients If the client receives no DHCPOFER message, it will try four more times, each with a SPAN of two seconds. If there is no reply to any of these DHCPDISCOVERs, the client sleeps for five minutes before trying again The client chooses one of the offers and sends a DHCPREQUEST message to the selected sever

7 DHCP Operation (cont’)
The server responds with a DHCPACK message and creates the binding between the client physical address and its IP address Before 50 percent of the lease period is reached, the client sends another DHCPREQUEST and asks for renewal If the server responds with a DHCPACK, the client has a new lease agreement and can reset its timer. If the server responds with a DHCPNACK, the client must immediately stop using the IP address and find another server (step 1) If the sever does not respond, the client sends another DHCPREQUEST when the lease time reaches 87.5 percent. If the client terminates the lease prematurely, the client sends a DHCPRELEASE message to the server.

8 DHCP Operation (cont’)
Client and server on the same network The DHCP server issues an active open command on UDP port number 67 and waits for a client A booted client issues an active open command on port number 68. The server responds with either a broadcast or a unicast message using UDP source port number 67 and destination port 68

9 DHCP Operation (cont’)
Client and server on the same network

10 DHCP Operation (cont’)
Client and server on two different networks DHCP request is broadcast because the client does not know the IP address of server Broadcast IP datagram cannot pass through any router To solve above problem, one of the hosts can be used as a relay, called relay agent. Relay agent knows the unicast address of a DHCP server Listen for broadcast message on port 67

11 DHCP Operation (cont’)
Client and server on two different networks

12 DHCP Operation (cont’)
Use of UDP ports

13 DHCP Operation (cont’)
Error Control DHCP uses UDP, which does not provide error control Therefore, DHCP must provide error control. DHCP requires that UDP uses the checksum. Using of the checksum in UDP is optional The DHCP client uses timers and a retransmission policy if it does not receive the DHCP reply to a request. DHCP forces the client to use a random number to set its timers

14 DHCP Operation (cont’)
Packet Format To make DHCP backward compatible with BOOTP, it is only added a one-bit flag to the packet. Extra options have been added to the option field Flag : Let client specify a forced broadcast reply from the server Option : several options are added Ex) the value 53 for the tag subfield is used to define the type of interaction between the client and server MAX : 312 bytes

15 DHCP Operation (cont’)
Packet Format

16 DHCP Operation (cont’)
Flag format and optional format

17 DHCP Operation (cont’)
Options for DHCP

18 18.3 Configuration The DHCP has been devised to provide static and dynamic address allocation DHCP has two DBs One for statically binding between physical address and IP address The other one with a pool of available IP addresses When a DHCP client requests a temporary IP addresses, the DHCP sever assigns an IP address from a pool for a negotiable period of time When a DHCP client sends a request to a DHCP server At first, checking its static database If not , selecting an IP address from the available pool Leasing The DHCP server issues a lease for a specific period of time When the lease expires, the client must either stop using the IP address or renew the lease

19 Configuration (cont’)
Optional with tag 53

20 Configuration (cont’)
DHCP client transition diagram

21 Configuration (cont’)
DHCP client transition diagram INIT state First sate of client The client broadcasts a DHCPDISCOVER message Selecting state After sending DHCPDISCOVER message, the client goes to the selecting state. Server respond with DHCPOFFER message including IP address Requesting state After receiving DHCPOFFER message, the client goes to the requesting state. The client sends a DHCPREQUEST message to the server The client remains in the requesting state until it receives a DHCPACK message from the server

22 Configuration (cont’)
Bound state After receiving DHCPACK message, the client goes to the bound state In this state, the client can use IP address until the lease expires When 50 percent of the lease period is reached, the client sends another DHCPREQUEST to ask for renewal and goes to renewing state Renewing state If the client receive a DHCPACK, it resets its timer and goes back to the bound state If a DHCPACK is not received, and 87.5 percent of the lease time expires, the client goes to the rebinding state Rebinding state If the client receive a DHCPNACK or the lease expires, it goes back to the initializing state If the client receives a DHCPACK, it goes to the bound state and resets the timers

23 Configuration (cont’)
Exchanging message

24 Summary Every computer attached to a TCP/IP internet must know its IP address, the IP address of a router, the IP address of an name server, and its subnet mask. Dynamic Host Configuration Protocol (DHCP) is a client-server application that deliver vital network information to either diskless computers or computers at first boot One DHCP packet format is used for both the client request and the server reply. The DHCP server waits passively for a client request. A server reply can be broadcast or unicast. A DHCP request or reply is encapsulated in a UDP user datagram. When the DHCP client and server are on different networks, a relay agent is used to send local DHCP request from a client to remote servers When DHCP acts as static configuration protocol, it uses a table that maps IP addresses to physical addresses. When DHCP acts as a dynamic configuration protocol, it leases IP addresses to the requesting clients. DHCP client is designed as a state machine that uses six main states and three timers to allow a host to lease an IP address for a specified period time.


Download ppt "Chapter 18 Host Configuration : DHCP"

Similar presentations


Ads by Google