Dynamic Host Configuration Protocol DHCP RFC 2131 CIS

  • Slides: 25
Download presentation
Dynamic Host Configuration Protocol [DHCP] -RFC 2131 CIS 856: TCP/IP and Upper Layer Protocols

Dynamic Host Configuration Protocol [DHCP] -RFC 2131 CIS 856: TCP/IP and Upper Layer Protocols Karthik Ravindra Nov 11, 2008

Motivation What’s my IP Where am I? DNS Server File Server 192. 168. 1.

Motivation What’s my IP Where am I? DNS Server File Server 192. 168. 1. 3 192. 168. 1. 4 ee: ee: ee: 01 ee: ee: ee: 02 Who has my boot file? Where is my boot file? ee: ee: ee: 03 ee: ee: ee: 04 Diskless Workstations Router 192. 168. 1. 1 Boot Server 192. 168. 1. 2 Internet

RARP • Provides IP Address for the diskless computer • However – RARP is

RARP • Provides IP Address for the diskless computer • However – RARP is a user process but works over link layer directly • RARP server and system must be on same network – Returns only IP address • Booting and configuration parameters not returned • Host needs ICMP to complete booting • Can’t relay RARP requests to a central server.

BOOTP

BOOTP

BOOTP Operation ee: ee: ee: 02 Port 68/UDP Is server name my name? ee:

BOOTP Operation ee: ee: ee: 02 Port 68/UDP Is server name my name? ee: ee: ee: 05 NO Optional Do I know the host with server name? YES BOOTP Client (A) I’ll discard this PDU NO YES BOOTP Server (B) BOOTREQUEST YES Is client IP address 0. 0? D YES BOOTP Is client hardware address in our DB? Port 67/UDP PDU D | 67 | 68 255 NO S S I’ll unicast this PDU to the host who has server name ee: ee: ee: 02 after updating the gateway 0. 0 interface address field S S D S | ff: ff: ff: ff D I’ll create the YES 192. 168. 1. 2 | 255 67| 68 ee: ee: ee: 02 | ee: ee: ee: 05 BOOTREPLY PDU and send to the client S Source D Destination D BOOTREPLY NO D S Is server name local? BOOTP UDP IP BOOTP PDU Ethernet

Identify the limitation ? Is server name my name? NO Optional YES Is server

Identify the limitation ? Is server name my name? NO Optional YES Is server name local? YES NO I’ll discard this PDU YES Is client IP address 0. 0? Is client hardware address in our DB? Do I know the host with server name? YES NO NO NO I’ll create the BOOTREPLY PDU and send to the client I’ll unicast this PDU to the host who has server name after updating the gateway interface address field

Identify the limitation ? ee: ee: ee: 01 ee: ee: ee: 03 ee: ee:

Identify the limitation ? ee: ee: ee: 01 ee: ee: ee: 03 ee: ee: ee: 02 DNS Server 192. 168. 1. 3 ee: ee: ee: 04 File Server 192. 168. 1. 4 Router New Roaming Client What is my network configuration? 192. 168. 1. 1 Boot Server 192. 168. 1. 2 Internet I don’t know, I’ve never seen you here before.

Purpose of DHCP – Automates the assignment of unique IP addresses, subnet masks, default

Purpose of DHCP – Automates the assignment of unique IP addresses, subnet masks, default gateways, and other IP parameters to individual computers and devices on the network. – Reduces the work necessary to administer a large IP (Internet Protocol) network. • DHCP lets a network administrator supervise and distribute IP addresses from a central point and automatically sends a new IP address when a computer is plugged into a different place in the network.

DHCP Address Allocation • Manual allocation • Automatic allocation • Dynamic allocation

DHCP Address Allocation • Manual allocation • Automatic allocation • Dynamic allocation

DHCP as compared to BOOTP • • Is an extension of BOOTP. Allows diskless

DHCP as compared to BOOTP • • Is an extension of BOOTP. Allows diskless clients configure automatically. Centralizes and manages the allocation of TCP/IP. Automatically assigns IP config settings Manually configured IP DHCP clients get IP config settings from DHCP server

Without DHCP Servers • Administrative overhead – Need to keep track of all IP

Without DHCP Servers • Administrative overhead – Need to keep track of all IP assignments – Need to manually enter IP settings • Bad or duplicate IP addresses – Mistakes will happen! • Moving between subnets – Need to manually change IP settings

DHCP Operation Phases • DCHP DISCOVER • DCHP OFFER

DHCP Operation Phases • DCHP DISCOVER • DCHP OFFER

DHCP Operation • DCHP DISCOVER At this time, the DHCP client can start using

DHCP Operation • DCHP DISCOVER At this time, the DHCP client can start using the IP address • Renewing a Lease

DHCP Operation • DCHP RELEASE At this time, the DHCP client has released the

DHCP Operation • DCHP RELEASE At this time, the DHCP client has released the IP address

Initial Message Flow Server A Client DHCPDISCOVER DHCPOFFER Server B DHCPDISCOVER DHCPOFFER Client attempts

Initial Message Flow Server A Client DHCPDISCOVER DHCPOFFER Server B DHCPDISCOVER DHCPOFFER Client attempts to discover available DHCP servers Servers reply with offers Client collects offers and decides which offer to accept DHCPREQUEST Configuration complete DHCPREQUEST DHCPACK Graceful shutdown DHCPRELEASE Client broadcasts request for one of the received offers Server acknowledges client’s use of IP address Client explicitly releases use of IP address

Renewal Message Flow Server A Client Server B T 1 elapses DHCPREQUEST Configuration complete

Renewal Message Flow Server A Client Server B T 1 elapses DHCPREQUEST Configuration complete DHCPACK Client unicasts request to continue using IP address Server acknowledges request and updates lease T 1 elapses DHCPREQUEST Client unicasts request to continue using IP address DHCPREQUEST Client broadcasts request to continue using IP address T 2 elapses DHCPREQUEST DHCPACK Configuration complete Server acknowledges request and updates lease

Client FSM (Simplified) DHCPNAK/ Stop using IP address INIT DHCPNAK, Lease expires/ Stop using

Client FSM (Simplified) DHCPNAK/ Stop using IP address INIT DHCPNAK, Lease expires/ Stop using IP address DHCPNAK/ Discard offer RENEWING T 2/Broadcast DHCPREQUEST REBINDING DHCPACK/Set T 1, T 2 DHCPACK (in use)/ DHCPDECLINE DHCPACK/Set T 1, T 2 REQUESTING -/DHCPDISCOVER Select offer/DHCPREQUEST SELECTING DHCPOFFER/ Process offer T 1/ Unicast DHCPREQUEST DHCPACK/Set T 1, T 2 BOUND

Relay Agents

Relay Agents

DHCP Pros • Reduces a great deal of manual configuration work. • Mobility of

DHCP Pros • Reduces a great deal of manual configuration work. • Mobility of devices between networks and to automatically obtain valid configuration parameters for the current network can be of great benefit. • Because IP addresses are only allocated when clients are actually active, it is possible to reduce the total number of addresses in use in an organization.

DHCP Cons • Potentially unauthorized clients • Malicious client could exhaust address • Malicious

DHCP Cons • Potentially unauthorized clients • Malicious client could exhaust address • Malicious server (Rogue server) – Supply incorrect configuration parameters – Supply malicious configuration parameters

Summary • BOOTP allows default router, subnet mask, DNS • DHCP allows dynamic allocation

Summary • BOOTP allows default router, subnet mask, DNS • DHCP allows dynamic allocation • DHCP is backward compatible with BOOTP

DHCP PDU Types DHCP PDU Use DHCPDISCOVER Client broadcast to find its local servers

DHCP PDU Types DHCP PDU Use DHCPDISCOVER Client broadcast to find its local servers DHCPOFFER Server response to client offering configuration parameters DHCPREQUEST Client broadcast requesting offered parameters DHCPDECLINE Client to server notification that IP address is in use DHCPACK Server response to client confirming a request DHCPNAK Server response to client denying a request DHCPRELEASE Client notice to server on release of address DHCPINFORM Client request to server for additional configuration parameters

Figure 17 -5 DHCP transition diagram

Figure 17 -5 DHCP transition diagram

Exchanging messages

Exchanging messages

Exchanging messages

Exchanging messages