DHCP

Views:
 
     
 

Presentation Description

No description available.

Comments

Presentation Transcript

Slide 1:

Dynamic Host Configuration Protocol DHCP Presented By Muna Sikder Computer Science and Engineering, University of Dhaka.

DHCP:

‘Dynamic Host Configuration Protocol’ is a means for networked devices to get their TCP/IP networking settings from a central server. DHCP assigns IP addresses and other configuration parameters automatically . D HCP 2

Dynamic Assignment of IP addresses:

Dynamic Assignment of IP addresses Dynamic assignment of IP addresses is desirable for several reasons : IP addresses are assigned on-demand Avoid manual IP configuration Support mobility of laptops Three Protocols : RARP (until 1985, no longer used) BOOTP (1985-1993) DHCP (since 1993 ) Only DHCP is widely used today. 3

Motivation for DHCP:

Motivation for DHCP Configuration parameters for network hosts IP address Router’s IP address Subnet Mask IP address of a DNS server Those information is dependent on the individual configuration of the network. What about a diskless workstation or a computer with a disk that is booted for the first time? 4

Motivation for DHCP(cont..):

Before DHCP RARP BOOTP Problems of RARP Provides only the IP address RARP client and server must be on the same network because of it is a data link layer service. Problems of BOOTP Is a static configuration protocol Motivation for DHCP (cont..) 5

DHCP provides:

DHCP supports three models: Dynamic allocation Automatic or Reserved allocation Static allocation DHCP is backward compatible with BOOTP. Is a application layer protocol. Port for both protocol: client : UDP, 68 Server : UDP,67 DHCP provides 6

Simple network:

Simple network Hello Mr. Server, I need to connect to the Internet, could you be kind to hook me up with an IP address? Ok dude, I got some in my pool of address, I lend you it. Check it out? Your IP : 123.45.78.6 Thank you Mr. Server, I like your offer. I will use it. You’re welcome, here is your configuration but it’s only for 3 days. DHCP server discover DHCP server offer DHCP request DHCP acknowledge Router Internet DHCP Server UDP Port 68 UDP Port 68 UDP Port 68 UDP Port 67 DHCP Clients DHCP protocol is a mainly 4-step process: DHCP Server DHCP Clients Broadcast Unicast 7

DHCP Message Types:

DHCP Message Use DHCPDISCOVER Client broadcast to locate available servers DHCPOFFER Server to client response offering configuration parameters DHCPREQUEST Client broadcast requesting offered parameters DHCPDECLINE Client to server notification that IP address is in use DHCPACK Server to client response confirming a request DHCPNAK Server to client response denying a request DHCPRELEASE Client to server request to relinquish IP address DHCPINFORM Client to server request for configuration parameters DHCP Message Types 8

DHCP transition diagram:

DHCP transition diagram Initializing Rebinding Renewing Requesting Bound Selecting Boot DHCPDISCOVER DHCPREQUEST DHCPACK DHCPOFFER DHCPACK DHCPACK DHCPRELEASE DHCPREQUEST Lease time 50% expired Lease time 87.5% expired DHCPREQUEST Lease time expired DHCPNACK 9

DHCP transition diagram..:

Initializing Boot DHCP transition diagram.. 10

DHCP transition..:

DHCP Client DHCP Server 67 UDP 122.45.78.3 DHCPDISCOVER Source IP : 0.0.0.0 Source MAC : EA.0D.45.B4 Destination IP : 1.1.1.1 68 UDP DHCP transition.. 11 open

DHCP transition diagram..:

Initializing Boot DHCP transition diagram.. 12 Selecting DHCPDISCOVER

DHCP transition..:

DHCP Client DHCP Server 67 UDP 122.45.78.3 DHCPDISCOVER Source IP : 0.0.0.0 Source MAC : EA.0D.45.B4 Destination IP : 1.1.1.1 DHCPOFFER Source IP : 122.45.78.3 Destination IP : 1.1.1.1 Des MAC : EA.0D.45.B4 Client IP : 122.45.67.23 68 UDP DHCP transition.. 13

DHCP transition diagram..:

Initializing Boot DHCPDISCOVER Selecting DHCP transition diagram.. 14 DHCPOFFER

DHCP transition..:

DHCP Client DHCP Server 67 UDP 122.45.78.3 DHCPDISCOVER Source IP : 0.0.0.0 Source MAC : EA.0D.45.B4 Destination IP : 1.1.1.1 DHCPOFFER Source IP : 122.45.78.3 Destination IP : 1.1.1.1 Des MAC : EA.0D.45.B4 Client IP : 122.45.67.23 DHCPREQUEST Accept ,request to bind client physical address and its offered IP 68 UDP DHCP transition.. 15

DHCP transition diagram..:

Initializing Boot DHCPDISCOVER Requesting DHCPREQUEST Selecting DHCPOFFER DHCP transition diagram.. 16

Slide 17:

DHCP Client DHCP Server 67 UDP 122.45.78.3 DHCPDISCOVER DHCPOFEER DHCREQUEST DHCACK After receiving the ACK, client use offered IP. 68 UDP 17

Slide 18:

Requesting Initializing Boot DHCPDISCOVER DHCPREQUEST Bound DHCPACK Selecting DHCPOFFER DHCP transition diagram.. 18

Slide 19:

DHCP Client DHCP Server 67 UDP 122.45.78.3 DHCPDISCOVER DHCPOFEER DHCREQUEST DHCACK After receiving the ACK, client use offered IP. DHCPREQUEST After 50% of lease time expires DHCPREQUEST If the server does not respond, the request is repeated. If server responds with a NACK client must start all over again. i 68 UDP 19

DHCP transition diagram..:

Requesting Initializing Boot DHCPDISCOVER DHCPREQUEST Bound DHCPACK Selecting DHCPOFFER Renewing DHCPREQUEST Lease time 50% expired DHCPRELEASE DHCP transition diagram.. 20

DHCP transition..:

DHCP Client DHCP Server 67 UDP 122.45.78.3 DHCPDISCOVER DHCPOFEER DHCREQUEST DHCPACK DHCREQUEST DHCPACK 68 UDP 21 DHCP transition..

DHCP transition diagram..:

DHCP transition diagram.. Initializing Requesting Bound Selecting Boot DHCPDISCOVER DHCPREQUEST DHCPACK DHCPOFFER DHCPACK Renewing DHCPREQUEST Lease time 50% expired DHCPRELEASE 22 Lease cancelled/

DHCP transition..:

DHCP Client DHCP Server 67 UDP 122.45.78.3 DHCPDISCOVER DHCPOFEER DHCREQUEST DHCPACK DHCREQUEST DHCPACK DHCPREQUEST Before 87.5% of lease time expires 68 UDP DHCP transition.. 23

DHCP transition diagram..:

DHCP transition diagram.. Initializing Requesting Bound Selecting Boot DHCPDISCOVER DHCPREQUEST DHCPACK DHCPOFFER DHCPACK Renewing DHCPREQUEST Lease time 50% expired Rebinding Lease time 87.5% expired DHCPREQUEST DHCPRELEASE 24

DHCP transition..:

DHCP Client DHCP Server 67 UDP 122.45.78.3 DHCPDISCOVER DHCPOFEER DHCREQUEST DHCPACK DHCREQUEST DHCPACK DHCPREQUEST Before 87.5% of lease time expires DHCACK/ DHCPNACK 68 UDP 25 DHCP transition..

DHCP transition diagram..:

DHCP transition diagram.. Initializing Rebinding Requesting Selecting Boot DHCPDISCOVER DHCPREQUEST DHCPACK DHCPOFFER DHCPACK DHCPACK Renewing DHCPREQUEST Lease time 50% expired Lease time 87.5% expired DHCPREQUEST Bound Lease time expired/ DHCPNACK DHCPRELEASE 26

DHCP transition:

DHCP Client DHCP Server 67 UDP 122.45.78.3 DHCPDISCOVER DHCPOFEER DHCREQUEST DHCPACK DHCREQUEST DHCPACK DHCACK/ DHCPNACK DHCREQUEST DHCPRELEASE 68 UDP After 50% time expires After 87.50% time expires 27 DHCP transition

DHCP transition diagram:

DHCP transition diagram Initializing Rebinding Requesting Selecting Boot DHCPDISCOVER DHCPREQUEST DHCPACK DHCPOFFER DHCPACK DHCPACK Renewing DHCPREQUEST Lease time 50% expired Lease time 87.5% expired DHCPREQUEST Bound Lease time expired/ DHCPNACK DHCPRELEASE 28

Example with Relay Agent:

Example with Relay Agent Router Internet Relay agent Router 67 UDP Broadcast Source123.45.67.8 Destination : 1.1.1.1 Client IP : 123.45.68.7 DHCPOFFER 123.45.67.8 Broadcast Source : 0.0.0.0 Destination : 1.1.1.1 DHCPDISCOVER Unicas t Source : 123.45.67.8 Destination : 123.45.55. 3 Unicas t Source : 123.45.67.8 Destination : 123.45.55. 3 DHCP Server 123.45.55.3 Unicas t Source : 123.45.67.8 Destination : 123.45.55. 3 Client IP: 123.45.68.7 DHCPOFFER Unicas t Source : 123.45.53 Destination : 123.45.68 Client IP : 123.45.68.7 New DHCP Client 68 UDP 29

Another Example:

Another Example UDP Port 68 UDP Port 68 UDP Port 68 DHCP Clients Broadcast DHCPDISCOVER Broadcast DHCPDISCOVER Source : 0.0.0.0 Destination : 1.1.1.1 Source : 0.0.0.0 Destination : 1.1.1.1 Both packets are same. How does server distinguish which packet come from which client? Broadcast DHCPOFFER Source : 123.45.68.7 Destination : 1.1.1.1 Client IP : 123.45.55.8 DHCP Server UDP Port 67 123.45.68.7 For this problem server can offer same IP for both. Broadcast DHCPOFFER Source : 123.45.68.7 Destination : 1.1.1.1 Client IP : 123.45.55.8 To overcome this problem, client uses Transaction ID. Broadcast DHCPDISCOVER Broadcast DHCPDISCOVER Source : 0.0.0.0 Destination : 1.1.1.1 Transaction ID : E1CA52AD Source : 0.0.0.0 Destination : 1.1.1.1 Transaction ID : A3C5A2CB Broadcast DHCPOFFER Source : 123.45.68.7 Destination : 1.1.1.1 Client IP : 123.45.55.23 Transaction ID : E1CA52AD Broadcast DHCPOFFER Source : 123.45.68.7 Destination : 1.1.1.1 Client IP : 123.45.55.8 Transaction ID : A3C5A2CB 30

Another situation:

Another situation Internet DHCP Server UDP Port 67 DHCP Clients DHCP Server 123.45.55.3 Relay agent 123.45.67.8 67 UDP DHCPDISCOVER DHCPDISCOVER DHCPDISCOVER DHCPDISCOVER UDP Port 67 120.45.55.3 DHCPOFFER DHCPOFFER DHCPOFFER DHCPOFFER Client receives this offer and sends DHCPREQUEST packet. DHCPOFFER DHCREQUEST Discard New DHCP client DHCPOFFER DHCPOFFER ? Router 31

DHCP message format (cont.):

DHCP message format (cont.) Operation Code Hardware Type Hardware Length Hop Count Transaction ID Seconds Elapsed F Must Be Zero (MBZ) Client IP address Your IP address Server IP address Gateway IP address Client hardware address (16 bytes) Server host name (64 bytes) Boot file name (128 bytes) Options (up to 312 bytes) 32 Bits 32

DHCP message format:

DHCP message format Option code – defines the type of packet : request(1) or reply(2) Transaction ID - a random number that is used by the client to match incoming DHCP messages with pending requests. Gateway IP address – contains the IP address of the router filled by the server in reply message. Client IP address - used when client knows its IP address. Your IP address - the DHCP server will place the offered client IP address in this field, if the client IP address is 0.0.0.0. Server IP address - the DHCP server address, if it is known. Otherwise, it is used in DHCPOFFER and DHCPACK. Boot filename – contains a string consisting of the full pathname of the boot file. Client can use this path to retrieve other booting information. Options – it can carry either additional information or some specific vendor information. 33

Conclusion:

DHCP is a dynamic configure protocol with two database : one is similar to BOOTP and other is a pool of IP address available for temporary assignment. DHCP server issues a lease for an IP address to a client for a specific period of time. DHCP packet format is similar to that of BOOTP. DHCP should not require a server on each sub-net. Relay agent that is compatible with BOOTP can be used. NIP (Network Information Protocol) has the mechanism of dynamic allocation. When the NIP client requests an IP address, NIP server returns a set of IP address that is available in the network. NIP client selects one IP address from the network, and checks its availability with ARP. 34 C onclusion

Slide 35:

Thanks to all Router Internet DHCP Server UDP Port 68 UDP Port 68 UDP Port 68 UDP Port 67 DHCP Clients 35