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

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

Embed Size (px)

Citation preview

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

CIS 856: TCP/IP and Upper Layer ProtocolsKarthik Ravindra

Nov 11, 2008

Dynamic Host Configuration Protocol [DHCP]

-RFC 2131

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

Internet

Router

192.168.1.1Boot Server

192.168.1.2

DNS Server

192.168.1.3

FileServer

192.168.1.4

ee:ee:ee:ee:ee:01 ee:ee:ee:ee:ee:03 ee:ee:ee:ee:ee:04

Diskless Workstations

Where am I?

ee:ee:ee:ee:ee:02

What’s my IP

Who has my

boot file?

Where is my boot file?

Motivation

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

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.

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

BOOTP

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

Port 67/UDPPort 68/UDP

ee:ee:ee:ee:ee:02 | ff:ff:ff:ff:ff:ff255.255.255.255 | 0.0.0.067 | 68BOOTP PDU

BOOTREQUEST

ee:ee:ee:ee:ee:02 | ee:ee:ee:ee:ee:05 192.168.1.2 | 255.255.255.255 67| 68 BOOTP PDU

BOOTREPLY

BOOTP Client (A)

BOOTP UDP IP Ethernet

Is server name my

name?

Do I know the host with

server name?

I’ll discard this PDU

I’ll unicast this PDU to the host who has server

name after updating the gateway interface

address field

Is server name local?

Is client

IP address 0.0.0.0

?

Optional

Is client hardwar

e address in our DB?

I’ll create the BOOTREPLY PDU and send to the

client

YES

YES

YES

YES

NO

NO

NO

NO

YESBOOTP Server (B)

ee:ee:ee:ee:ee:02

ee:ee:ee:ee:ee:05

DDD S S S

S DDD SS

SD

SourceDestination

BOOTP Operation

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

Is server name my

name?

Do I know the host with

server name?

I’ll discard this PDU

I’ll unicast this PDU to the host who has server

name after updating the gateway interface

address field

Is server name local?

Is client

IP address 0.0.0.0

?

Optional

Is client hardwar

e address in our DB?

I’ll create the BOOTREPLY PDU and send to the

client

YES

YES

YES

YES

NO

NO

NO

NO

YES

NO

Identify the limitation ?

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

Router

192.168.1.1Boot Server

192.168.1.2

DNS Server

192.168.1.3

FileServer

192.168.1.4

I don’t know, I’ve never seen you here before.

New Roaming Client

What is my network configuration?

ee:ee:ee:ee:ee:01

ee:ee:ee:ee:ee:02

ee:ee:ee:ee:ee:03

ee:ee:ee:ee:ee:04

Internet

Identify the limitation ?

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

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.

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

DHCP Address Allocation

• Manual allocation

• Automatic allocation

• Dynamic allocation

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

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

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

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

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

DHCP Operation Phases

• 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: CIS 856: TCP/IP and Upper Layer Protocols Karthik Ravindra Nov 11, 2008 Dynamic Host Configuration Protocol [DHCP] - RFC 2131

DHCP OperationDHCP Client

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

DHCP Server

DHCPREQUEST

DHCPACK

• DCHP DISCOVER

At this time, the DHCP client can start using the IP address

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

DHCP Server

DHCPREQUEST

DHCPACK

• Renewing a Lease

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

DHCP OperationDHCP Client

00: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: CIS 856: TCP/IP and Upper Layer Protocols Karthik Ravindra Nov 11, 2008 Dynamic Host Configuration Protocol [DHCP] - RFC 2131

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 16: CIS 856: TCP/IP and Upper Layer Protocols Karthik Ravindra Nov 11, 2008 Dynamic Host Configuration Protocol [DHCP] - RFC 2131

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: CIS 856: TCP/IP and Upper Layer Protocols Karthik Ravindra Nov 11, 2008 Dynamic Host Configuration Protocol [DHCP] - RFC 2131

Client FSM (Simplified)

INIT

SELECTING

-/DHCPDISCOVE

R

DHCPOFFER/ Process offer

REQUESTING

Select offer/DHCPREQUEST

BOUND

DHCPACK/Set T1,T2

DHCPACK/Set T1,T2

DHCPACK/Set T1,T2

RENEWING

T1/ Unicast

DHCPREQUEST

REBINDING

T2/Broadcast DHCPREQUEST

DHCPNAK/ Stop using IP

addressDHCPNAK, Lease

expires/ Stop using IP address

DHCPACK (in use)/

DHCPDECLINE

DHCPNAK/ Discard

offer

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

Relay Agents

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

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.

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

DHCP Cons

• Potentially unauthorized clients

• Malicious client could exhaust address

• Malicious server (Rogue server)– Supply incorrect configuration parameters– Supply malicious configuration parameters

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

• BOOTP allows default router, subnet mask, DNS

• DHCP allows dynamic allocation

• DHCP is backward compatible with BOOTP

Summary

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

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

DHCP PDU Types

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

Figure 17-5 DHCP transition diagram

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

Exchanging messages

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

Exchanging messages