1 dhcp : dhcp : dynamic host configuration protocol :, original by: debie beemsigne, dominic joy,...

39
1 DHCP DHCP : : Dynamic Host Configuration Protocol Original by : : Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified by Prof. M. Modified by Prof. M. Veeraraghavan Veeraraghavan What is DHCP, and when & where is it used? What is DHCP, and when & where is it used? Components of DHCP Components of DHCP BOOTP and DHCP relation BOOTP and DHCP relation DHCP message format DHCP message format DHCP procedures DHCP procedures allocating new address allocating new address lease renewal lease renewal State machine State machine Questions & answers re. DHCP Questions & answers re. DHCP Benefits of DHCP Benefits of DHCP

Upload: meagan-hampton

Post on 24-Dec-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

11

DHCPDHCP: : Dynamic Host Configuration Protocol

Original by: : Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan,, EL604, Fall 2001;Modified by Prof. M. VeeraraghavanModified by Prof. M. Veeraraghavan

What is DHCP, and when & where is it used?What is DHCP, and when & where is it used? Components of DHCPComponents of DHCP BOOTP and DHCP relationBOOTP and DHCP relation DHCP message formatDHCP message format DHCP proceduresDHCP procedures

allocating new addressallocating new address lease renewallease renewal

State machineState machine Questions & answers re. DHCPQuestions & answers re. DHCP Benefits of DHCPBenefits of DHCP

Page 2: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

22

What is DHCP ?What is DHCP ?

Dynamic Host Configuration ProtocolDynamic Host Configuration Protocol Used for dynamic allocation of IP addressesUsed for dynamic allocation of IP addresses

used for hosts that run only client applicationsused for hosts that run only client applications Allows for host-specific configuration parameters Allows for host-specific configuration parameters

to be delivered from a DHCP server to a hostto be delivered from a DHCP server to a host DHCP can also be used to convey permanent DHCP can also be used to convey permanent

IP address assignments to hostsIP address assignments to hosts Server interfaces need permanent addresses Server interfaces need permanent addresses

because clients need to be able to reach them because clients need to be able to reach them Also, router interfaces should have permanent Also, router interfaces should have permanent

addresses for stability of routing dataaddresses for stability of routing data

Page 3: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

33

Where is DHCP used?Where is DHCP used? Since class B and class C address spaces have Since class B and class C address spaces have

been exhausted, service providers and enterprises been exhausted, service providers and enterprises use dynamically allocated IP addressesuse dynamically allocated IP addresses e.g., a cable modem service provider who has e.g., a cable modem service provider who has

many customersmany customers since not all customers are simultaneously on the since not all customers are simultaneously on the

Internet, a client host dynamically obtains an address Internet, a client host dynamically obtains an address for a short period of time and releases it for use by for a short period of time and releases it for use by some other clientsome other client

e.g., used on the Poly campus on our 802.11 e.g., used on the Poly campus on our 802.11 wireless network, where many students, faculty wireless network, where many students, faculty and staff members use their wireless cards for and staff members use their wireless cards for access to the Poly campus networkaccess to the Poly campus network

Page 4: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

44

Relevance of DHCP to Relevance of DHCP to wireless and mobile networkingwireless and mobile networking

If an end host only runs the “client” ends of If an end host only runs the “client” ends of applicationsapplications

e.g. a web browser, but not a web servere.g. a web browser, but not a web server e.g. Outlook to download email messages delivered to a e.g. Outlook to download email messages delivered to a

PC user’s incoming mail server, but not the mail server PC user’s incoming mail server, but not the mail server itselfitself

e.g. Windows PCs have ftp clients but not ftp serverse.g. Windows PCs have ftp clients but not ftp servers you ftp into utopia, but do you typically ftp into your PC?you ftp into utopia, but do you typically ftp into your PC?

Then, the end host can simply connect to the Then, the end host can simply connect to the network at any “point of attachment,” obtain a network at any “point of attachment,” obtain a network address and start receiving informationnetwork address and start receiving information

Page 5: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

55

Why is a dynamically obtained Why is a dynamically obtained address sufficient for such hosts?address sufficient for such hosts?

Because, such end hosts only make “outgoing calls”Because, such end hosts only make “outgoing calls” When such an end host initiates a call (TCP When such an end host initiates a call (TCP

connection), the called server receives an IP connection), the called server receives an IP packet from the calling host with the host’s new packet from the calling host with the host’s new temporary address and hence can, in turn, send temporary address and hence can, in turn, send the caller back requested datathe caller back requested data

These hosts do not receive “incoming calls,” These hosts do not receive “incoming calls,” i.e., no one calls themi.e., no one calls them Therefore, such end hosts do not need a Therefore, such end hosts do not need a

permanent address that potentially “callees” will permanent address that potentially “callees” will need to knowneed to know

Question: can we categorize a cellular Question: can we categorize a cellular telephone as such an “end point” telephone as such an “end point”

Page 6: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

66

Answer to questionAnswer to question in previous slide in previous slide

No, because a cell phone can be No, because a cell phone can be calledcalled

Therefore callees (calling parties) will Therefore callees (calling parties) will need to know the network address of need to know the network address of the cellular phonethe cellular phone

Page 7: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

77

Is DHCP needed only for Is DHCP needed only for wireless users or also wired? wireless users or also wired? DHCP can be used whether link to DHCP can be used whether link to

endpoint is “wired” or “wireless”endpoint is “wired” or “wireless” Even with an Ethernet NIC, a host can Even with an Ethernet NIC, a host can

use DHCP to dynamically obtain an IP use DHCP to dynamically obtain an IP addressaddress

e.g. cable modem user; Ethernet from e.g. cable modem user; Ethernet from host to cable modem; cable from host to cable modem; cable from modem to Internetmodem to Internet

Page 8: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

88

DHCP for mobile users?DHCP for mobile users?

DHCP is not designed to handle mobility DHCP is not designed to handle mobility by itselfby itself location management problem is to enable the location management problem is to enable the

delivery of calls to mobiles; but this means the delivery of calls to mobiles; but this means the callee needs the permanent address of the callee needs the permanent address of the called mobile; so location management called mobile; so location management problem does not arise for DHCP hostsproblem does not arise for DHCP hosts

handoff management requires a rerouting of handoff management requires a rerouting of packets when end host is in a connection; packets when end host is in a connection; “costly” to update far end of connection with a “costly” to update far end of connection with a new temporary address if DHCP is used to new temporary address if DHCP is used to change addresses when a user moveschange addresses when a user moves

Page 9: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

99

ComponentsComponents

DHCP client: a host using DHCP to DHCP client: a host using DHCP to obtain an IP address and other obtain an IP address and other configuration informationconfiguration information

DHCP server: a host that returns IP DHCP server: a host that returns IP addresses and other configuration addresses and other configuration informationinformation

BOOTP relay agents: host or router BOOTP relay agents: host or router that passes DHCP messages between that passes DHCP messages between DHCP clients and DHCP serversDHCP clients and DHCP servers

Page 10: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

1010

DHCP uses BOOTPDHCP uses BOOTP

Based on BOOTPBased on BOOTP Uses BOOTP format for messagesUses BOOTP format for messages Uses BOOTP relay agents to avoid having one Uses BOOTP relay agents to avoid having one

DHCP server per network segmentDHCP server per network segment BOOTP used to bootstrap hostsBOOTP used to bootstrap hosts

First operation, get Ethernet and IP address for First operation, get Ethernet and IP address for itself and the address of a server and bootfile itself and the address of a server and bootfile name (diskless client)name (diskless client)

Second operation, uses TFTP to download bootfile Second operation, uses TFTP to download bootfile BOOTP uses UDPBOOTP uses UDP

67 for the server port67 for the server port 68 for the client port68 for the client port

Page 11: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

1111

Differences betweenDifferences between BOOTP and DHCP BOOTP and DHCP

Two differencesTwo differences DHCP specifies a “lease time” for IP address DHCP specifies a “lease time” for IP address

usage allowing for allocation of the same usage allowing for allocation of the same address to another client upon lease expiryaddress to another client upon lease expiry

DHCP can acquire all IP-related configuration DHCP can acquire all IP-related configuration information, more than in BOOTPinformation, more than in BOOTP

BOOTP clients can talk to DHCP serversBOOTP clients can talk to DHCP servers

(backward compatibility) (backward compatibility) DHCP is an extension of BOOTPDHCP is an extension of BOOTP Message format similarMessage format similar

Page 12: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

1212

Format of a DHCP messageFormat of a DHCP message

op (1) htype (1) hlen (1) hops(1)xid (4)

secs (2) flags (2)ciaddr (4)yiaddr (4)siaddr (4)giaddr (4)chaddr (6)sname (64)file (128)

options ( variable)

Page 13: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

1313

Format of a DHCP message Format of a DHCP message cont.cont.

Op - message op code / message typeOp - message op code / message type 1 = BootRequest,1 = BootRequest, 2 = BootReply2 = BootReply

htype - hardware address typehtype - hardware address type hlen - hardware address length (i.e. ‘6’ for 10mbps Ethernet)hlen - hardware address length (i.e. ‘6’ for 10mbps Ethernet) hops - client sets to 0, optionally used by relay agents when hops - client sets to 0, optionally used by relay agents when

booting via a relay agentbooting via a relay agent xid - transaction ID, a random number chosen by the client, used xid - transaction ID, a random number chosen by the client, used

by the client and server to associate messages and responses by the client and server to associate messages and responses between a client and a serverbetween a client and a server

secs – filled in by the client, seconds elapsed since client began secs – filled in by the client, seconds elapsed since client began address acquisition or renewal processaddress acquisition or renewal process

flags – “broadcast flag” used if client cannot accept unicast IP flags – “broadcast flag” used if client cannot accept unicast IP packets before IP layer is configured (“chicken-and-egg” packets before IP layer is configured (“chicken-and-egg” problem)problem) destination IP address in IP header is a broadcast IP address instead destination IP address in IP header is a broadcast IP address instead

of yiaddress and destination MAC address is all ones; then set this of yiaddress and destination MAC address is all ones; then set this flag to “broadcast” mode. Server receiving this flag in Bootrequest flag to “broadcast” mode. Server receiving this flag in Bootrequest will know to send the Bootreply in broadcast modewill know to send the Bootreply in broadcast mode

BACK

Page 14: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

1414

Format of a DHCP message Format of a DHCP message cont.cont.

ciaddr – client IP address; only filled in if client is in ciaddr – client IP address; only filled in if client is in BOUND, RENEW or REBINDING state and can respond BOUND, RENEW or REBINDING state and can respond to ‘ARP’ requeststo ‘ARP’ requests

yiaddr – ‘your’ (client) IP address (set in DHCPOFFER)yiaddr – ‘your’ (client) IP address (set in DHCPOFFER) siaddr – IP address of next server to use in bootstrap; siaddr – IP address of next server to use in bootstrap;

returned in DHCPOFFER, DHCPACK by serverreturned in DHCPOFFER, DHCPACK by server giaddr – relay agent IP address, used in booting via a giaddr – relay agent IP address, used in booting via a

relay agentrelay agent chaddr – client hardware addresseschaddr – client hardware addresses sname – optional server host name, null terminated sname – optional server host name, null terminated

stringstring file – Boot file name, null terminated string; “generic” file – Boot file name, null terminated string; “generic”

name or null in DHCPDISCOVER, fully qualified name or null in DHCPDISCOVER, fully qualified directory-path name in DHCPOFFERdirectory-path name in DHCPOFFER

options – optional parameters field (see RFC 1533)options – optional parameters field (see RFC 1533)

BACK

Page 15: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

1515

DHCP optionsDHCP options DHCP Message Type DHCP Message Type

(must in all messages)(must in all messages) Requested IP AddressRequested IP Address Server identifierServer identifier IP Address Lease TimeIP Address Lease Time Renewal Time Value Renewal Time Value

(T1)(T1) Rebinding Time Value Rebinding Time Value

(T2)(T2) Client identifierClient identifier

DNS DNS (Domain Name Server) (Domain Name Server) optionoption specifies IP addresses of DNS specifies IP addresses of DNS

servers available to clientservers available to client Router optionRouter option

specifies IP addresses of specifies IP addresses of routers on the client’s subnetrouters on the client’s subnet

Max Datagram Max Datagram ReassemblyReassembly

Subnet MaskSubnet Mask Client HostnameClient Hostname

For all other options refer to RFC 2132For all other options refer to RFC 2132

Page 16: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

1616

Types of DHCP messagesTypes of DHCP messages

DHCPDISCOVERDHCPDISCOVER DHCPOFFERDHCPOFFER DHCPREQUESTDHCPREQUEST DHCPACKDHCPACK DHCPNAKDHCPNAK DHCPDECLINEDHCPDECLINE DHCPRELEASEDHCPRELEASE DHCPINFORM DHCPINFORM

Page 17: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

1717

How does DHCP work?How does DHCP work? When a client needs to start up TCP/IP operations, it When a client needs to start up TCP/IP operations, it

broadcasts a request for address information. The DHCP broadcasts a request for address information. The DHCP server receives the request, assigns a new address for a server receives the request, assigns a new address for a specific time period (called a lease period) and sends it to specific time period (called a lease period) and sends it to the client together with the other required configuration the client together with the other required configuration information. This information is acknowledged by the client, information. This information is acknowledged by the client, and used to set up its configuration. The DHCP server will and used to set up its configuration. The DHCP server will not reallocate the address during the lease period and will not reallocate the address during the lease period and will attempt to return the same address every time the client attempt to return the same address every time the client requests an address. The client may extend its lease with requests an address. The client may extend its lease with subsequent requests, and may send a message to the subsequent requests, and may send a message to the server before the lease expires telling it that it no longer server before the lease expires telling it that it no longer needs the address so it can be released and assigned to needs the address so it can be released and assigned to another client on the network. another client on the network.

Page 18: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

1818

DHCP proceduresDHCP procedures

Obtaining a new addressObtaining a new address Reusing a previously allocated Reusing a previously allocated

addressaddress

Page 19: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

1919

Allocating new addressAllocating new addressClient Server (selected)Server (not selected)

Collects repliesDHCP REQ. DHCP REQ.

DHCPACK

Initialization Complete

Graceful Shutdown

DHCPRELEASE

Discard lease

DHCPOFFERDHCPOFFER

DHCP DISC.DHCP DISC.

Client selectsconfiguration;in DCHP REQit accepts oneserver’s offer(server identifieroption)and implicitlyreject rest

Also broadcast

Sent on Ethernetbroadcast address

Page 20: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

2020

How the server selects ‘How the server selects ‘a new addressa new address

The client's current address as recorded in the client's The client's current address as recorded in the client's current binding, ELSEcurrent binding, ELSE

The client's previous address as recorded in the The client's previous address as recorded in the client's (now expired or released) binding, if that client's (now expired or released) binding, if that address is in the server's pool of available addresses address is in the server's pool of available addresses and not already allocated, ELSEand not already allocated, ELSE

The address requested in the 'Requested IP Address'The address requested in the 'Requested IP Address' option, if that address is valid and not already option, if that address is valid and not already allocated, ELSEallocated, ELSE

A new address allocated from the server's pool of A new address allocated from the server's pool of available addresses; the address is selected based on available addresses; the address is selected based on the subnet from which the message was received (if the subnet from which the message was received (if 'giaddr' is 0) or on the address of the relay agent that 'giaddr' is 0) or on the address of the relay agent that forwarded the message ('giaddr' is not 0).forwarded the message ('giaddr' is not 0).

Page 21: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

2121

Obtaining an IP addressObtaining an IP address

DHCPDISCOVER is broadcast because DHCPDISCOVER is broadcast because client does not know IP address of DHCP client does not know IP address of DHCP server; BOOTP relay agents may relay it to server; BOOTP relay agents may relay it to other DHCP serversother DHCP servers

One or more DHCP servers respond with One or more DHCP servers respond with DHCPOFFER, which carry yiaddr (Your IP DHCPOFFER, which carry yiaddr (Your IP address, i.e., client address) address, i.e., client address) recommended check: SHOULD instead of MUSTrecommended check: SHOULD instead of MUST

server uses ICMP echo request (ping) to check if server uses ICMP echo request (ping) to check if address is freeaddress is free

ping needed because often a user will leave without ping needed because often a user will leave without graceful release of addressgraceful release of address

Page 22: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

2222

Obtaining an IP address Obtaining an IP address contd. contd.

If the client receives no DHCP offer before If the client receives no DHCP offer before it times out, it retransmits DHCPDISCOVERit times out, it retransmits DHCPDISCOVER

Client may wait for multiple replies and Client may wait for multiple replies and then choose one offer. It broadcasts then choose one offer. It broadcasts DHCPREQUEST with ‘server identifier’ DHCPREQUEST with ‘server identifier’ option included identifying the server option included identifying the server whose offer it has accepted and whose offer it has accepted and ‘requested IP address’ option‘requested IP address’ option

Client SHOULD probe address with an ARP; Client SHOULD probe address with an ARP; if client detects that the address is already if client detects that the address is already in use, it issues DHCPDECLINEin use, it issues DHCPDECLINE

Page 23: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

2323

Obtaining an IP address Obtaining an IP address contd. contd.

Servers other than the one selected in the Servers other than the one selected in the DHCPREQUEST will release their offered DHCPREQUEST will release their offered addresses, while the selected server will addresses, while the selected server will note the bindingnote the binding

If selected server cannot meet the needs If selected server cannot meet the needs of the DHCPREQ. it sends a DHCPNAKof the DHCPREQ. it sends a DHCPNAK

If the client does not receive a DHCPACK If the client does not receive a DHCPACK or DHCPNAK before timeout it resends or DHCPNAK before timeout it resends DHCPREQDHCPREQ

Retransmission attempts use exponential Retransmission attempts use exponential backoff timesbackoff times

Page 24: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

2424

Reuse of addressReuse of address

Client ServerServer

DHCP REQ. DHCP REQ.

Locates Config. Locates Config.DHCPACK DHCPACK

Initialization Complete

(Subsequent DHCP Packets Ignored)

Servers with knowledge of the client's configuration parameters respond with a DHCPACK message to the client.

Page 25: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

2525

Reuse of IP addressReuse of IP address

DHCP REQUEST - client message to DHCP REQUEST - client message to servers servers requesting offered parameters from one requesting offered parameters from one

server and implicitly declining offers server and implicitly declining offers from all othersfrom all others

confirming correctness of previously confirming correctness of previously allocated address after, e.g., system allocated address after, e.g., system reboot,reboot,

extending the lease on a particular extending the lease on a particular network address. network address.

Page 26: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

2626

Reuse of IP address cont. Reuse of IP address cont.

DHCPACK - DHCPACK - Server to client with Server to client with configuration parameters, including configuration parameters, including committed network address.committed network address.

Page 27: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

2727

State machineState machine

INIT/REBOOT

INIT

REBOOTINGSELECTING

REQUESTING REBINDING

BOUND RENEWING

Send DHCPREQUESTDHCPNAKRestart Send DHCPDISCOVER

DH

CP

NA

K, Lease expired/H

alt N

etwork

DH

CP

NA

K/H

alt Netw

ork

T2 expires/Broadcast DHCPREQUEST

DHCPOFFER/Send DHCPREQUEST

DHCPOFFER/Discard

DHCPACK/Record lease, set timersT1, T2

DHCPACK/Record lease set timersT1,T2

T1 expires/Send DHCPREQUESTTo leasing server (unicast)

DHCPOFFER, DHCPACKDHCPNAK/Discard

DHCPACK/Record lease, set Timers T1,T2

DHCPNAK/ Discard

DHCPACK + not acceptSend DHCPDECLINE

DH

CP

AC

K/R

ecord lease, set timers

init with known network address Init with acquiring new network address

T1 is earlier than T2, which should expire before lease expires

Page 28: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

2828

TimersTimers

T1 is the time at which the client enters T1 is the time at which the client enters the RENEWING state and attempts to the RENEWING state and attempts to contact the server that originally issued contact the server that originally issued the client's network address. the client's network address.

T2 is the time at which the client enters T2 is the time at which the client enters the REBINDING state and attempts to the REBINDING state and attempts to contact any server.contact any server.

T1 MUST be earlier than T2 T1 MUST be earlier than T2 T2 MUST be earlier than the time at which T2 MUST be earlier than the time at which

the client's lease will expire.the client's lease will expire.

Page 29: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

2929

Use of giaddr and bootp Use of giaddr and bootp relaysrelays

By using BOOTP relay agents, we avoid having to place a DHCP By using BOOTP relay agents, we avoid having to place a DHCP server on every subnetserver on every subnet

giaddr (gateway address) is poorly namedgiaddr (gateway address) is poorly named it exists to facilitate relaying of BOOTP messages and is not a it exists to facilitate relaying of BOOTP messages and is not a

general or gateway IP router addressgeneral or gateway IP router address giaddr should be 0 in DHCPDiscover (says BOOTPRequest in RFC giaddr should be 0 in DHCPDiscover (says BOOTPRequest in RFC

1542)1542) BOOTP relay agent should not be confused with an IP router: BOOTP relay agent should not be confused with an IP router:

former terminates BOOTP messages, processes them and former terminates BOOTP messages, processes them and generates new ones; it does not simply forward packetsgenerates new ones; it does not simply forward packets

if giaddr is 0 when a BOOTP relay agent receives a message, it if giaddr is 0 when a BOOTP relay agent receives a message, it sets it to the IP address of the interface on which it was received sets it to the IP address of the interface on which it was received in the new message it relays to the next agentin the new message it relays to the next agent

if giaddr is non-zero, then it MUST not be modifiedif giaddr is non-zero, then it MUST not be modified allows the DHCP server to determine subnet of clientallows the DHCP server to determine subnet of client

RFC 1542 explains this procedure wellRFC 1542 explains this procedure well

Page 30: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

3030

Questions on DHCPQuestions on DHCP

What happens if there is no DHCP server What happens if there is no DHCP server on a network and an IP host connects to it on a network and an IP host connects to it with the “Obtain IP address automatically” with the “Obtain IP address automatically” option selected?option selected?

Who makes and sells DHCP servers? Are Who makes and sells DHCP servers? Are these standalone entities or are they add-these standalone entities or are they add-ons to IP routers?ons to IP routers?

Use a sniffer, capture DHCP messages and Use a sniffer, capture DHCP messages and explain procedure and parameters.explain procedure and parameters.

Page 31: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

3131

What happens if there is no DHCP server on a network and an What happens if there is no DHCP server on a network and an IP host connects to it with the “Obtain IP address IP host connects to it with the “Obtain IP address

automatically” option selected?automatically” option selected?

Page 32: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

3232

What happens if there is no DHCP server on a network and an What happens if there is no DHCP server on a network and an IP host connects to it with the “Obtain IP address IP host connects to it with the “Obtain IP address

automatically” option selected?automatically” option selected?

In static addressing, the following fields: Gateway, DNS Configuration and IP Address would have to be manually set for a host to have connectivity into the network.

If there is no DHCP server, and no BOOTP relay agent, then no IP address will be assigned and hence host cannot communicate;In this case “Static Addressing” needs to be used

Page 33: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

3333

Who makes and sells DHCP servers? Are these Who makes and sells DHCP servers? Are these standalone entities or are they add-ons to IP standalone entities or are they add-ons to IP

routers?routers?

Commercial DHCP serversCommercial DHCP servers Microsoft: DHCP server included in Windows NT Microsoft: DHCP server included in Windows NT

Server 3.51, 4.0, Windows 2000Server 3.51, 4.0, Windows 2000 SunSoft: Solstice SolarNet PC-Admin 1.5 SunSoft: Solstice SolarNet PC-Admin 1.5

includes a DHCP/BOOTP server includes a DHCP/BOOTP server Cisco IOS DHCP Server (IOS is used in routers)Cisco IOS DHCP Server (IOS is used in routers)

Page 34: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

3434

Use sniffer and obtain a trace Use sniffer and obtain a trace of a DHCP sessionof a DHCP session

Current IP configuration(before release)

Page 35: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

3535

IP configuration after release IP configuration after release

Page 36: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

3636

Tcpdump output for a renew Tcpdump output for a renew

17:26:32.135029 0:b0:c2:f3:15:80 0:50:4:fd:10:85 0800 482: 128.238.112.1.67 > 128.238.112.144.68: xid:0x596f374e 17:26:32.135029 0:b0:c2:f3:15:80 0:50:4:fd:10:85 0800 482: 128.238.112.1.67 > 128.238.112.144.68: xid:0x596f374e Y:128.238.112.144 S:128.238.29.25 G:128.238.112.1 [|bootp]Y:128.238.112.144 S:128.238.29.25 G:128.238.112.1 [|bootp]

4500 01d4 b330 0000 ff11 247a 80ee 70014500 01d4 b330 0000 ff11 247a 80ee 7001 80ee 7090 0043 0044 01c0 3bb7 0201 060080ee 7090 0043 0044 01c0 3bb7 0201 0600 596f 374e 0000 0000 0000 0000 80ee 7090596f 374e 0000 0000 0000 0000 80ee 7090 80ee 1d19 80ee 7001 0050 04fd 1085 000080ee 1d19 80ee 7001 0050 04fd 1085 0000 0000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 0000 00000000 17:26:32.135144 0:50:4:fd:10:85 ff:ff:ff:ff:ff:ff 0800 342: 0.0.0.0.68 > 255.255.255.255.67: xid:0x596f374e [|bootp]17:26:32.135144 0:50:4:fd:10:85 ff:ff:ff:ff:ff:ff 0800 342: 0.0.0.0.68 > 255.255.255.255.67: xid:0x596f374e [|bootp] 4500 0148 4401 0000 8011 f5a4 0000 00004500 0148 4401 0000 8011 f5a4 0000 0000 ffff ffff 0044 0043 0134 a8ac 0101 0600ffff ffff 0044 0043 0134 a8ac 0101 0600 596f 374e 0000 0000 0000 0000 0000 0000596f 374e 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0050 04fd 1085 00000000 0000 0000 0000 0050 04fd 1085 0000 0000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 0000 00000000 17:26:32.142934 0:b0:c2:f3:15:80 0:50:4:fd:10:85 0800 487: 128.238.112.1.67 > 128.238.112.144.68: xid:0x596f374e 17:26:32.142934 0:b0:c2:f3:15:80 0:50:4:fd:10:85 0800 487: 128.238.112.1.67 > 128.238.112.144.68: xid:0x596f374e

Y:128.238.112.144 G:128.238.112.1 [|bootp]Y:128.238.112.144 G:128.238.112.1 [|bootp] 4500 01d9 b332 0000 ff11 2473 80ee 70014500 01d9 b332 0000 ff11 2473 80ee 7001 80ee 7090 0043 0044 01c5 cb6b 0201 060080ee 7090 0043 0044 01c5 cb6b 0201 0600 596f 374e 0000 0000 0000 0000 80ee 7090596f 374e 0000 0000 0000 0000 80ee 7090 0000 0000 80ee 7001 0050 04fd 1085 00000000 0000 80ee 7001 0050 04fd 1085 0000 0000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 0000 00000000 17:26:32.143044 0:50:4:fd:10:85 ff:ff:ff:ff:ff:ff 0800 346: 0.0.0.0.68 > 255.255.255.255.67: xid:0x596f374e [|bootp]17:26:32.143044 0:50:4:fd:10:85 ff:ff:ff:ff:ff:ff 0800 346: 0.0.0.0.68 > 255.255.255.255.67: xid:0x596f374e [|bootp] 4500 014c 4501 0000 8011 f4a0 0000 00004500 014c 4501 0000 8011 f4a0 0000 0000 ffff ffff 0044 0043 0138 ddee 0101 0600ffff ffff 0044 0043 0138 ddee 0101 0600 596f 374e 0000 0000 0000 0000 0000 0000596f 374e 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0050 04fd 1085 00000000 0000 0000 0000 0050 04fd 1085 0000 0000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 0000 00000000

Identify parametersand explain values

Page 37: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

3737

IP configuration after the renewIP configuration after the renew

Page 38: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

3838

Benefits of using DHCP for Benefits of using DHCP for dynamic address allocationdynamic address allocation

Address reuseAddress reuse A service provider/enterprise with 1000 addresses can support a A service provider/enterprise with 1000 addresses can support a

much larger number of subscribers/hosts with time multiplexing much larger number of subscribers/hosts with time multiplexing of addresses (one host uses an address, and releases it when of addresses (one host uses an address, and releases it when done; another host is allocated the same address)done; another host is allocated the same address)

Removes error-prone manual host configuration process Removes error-prone manual host configuration process to set IP addresses, DNS server addresses, gateways, to set IP addresses, DNS server addresses, gateways, etc.etc.

Configuration information can be administered from a Configuration information can be administered from a single point. single point.

Major network resource changes (e.g. a router changing Major network resource changes (e.g. a router changing an interface address) requires an update of only the an interface address) requires an update of only the DHCP server, rather than every system. DHCP server, rather than every system.

Caveat: cannot allocate temporary addresses to Caveat: cannot allocate temporary addresses to servers/routersservers/routers

Page 39: 1 DHCP : DHCP : Dynamic Host Configuration Protocol :, Original by: Debie Beemsigne, Dominic Joy, Max Pereira, Ravidev Mohan, EL604, Fall 2001; Modified

3939

ReferencesReferences

RFC 2131: DHCP RFC 2132: DHCP options RFC 951: Bootstrap protocol (BOOTP) RFC 1542: BOOTP relay agents Steven M. Glass, “Use of DHCP in Mobile IP,” 2000,

http://www.ietf.org/proceedings/00jul/SLIDES/mobileip-dhcpinmip/index.htm

Charles Perkins, “Mobile IP”, Addison Wesley, 1998