42
1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

Embed Size (px)

Citation preview

Page 1: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

11

DHCPDHCP Dynamic Host Configuration Protocol

Polytechnic UniversityPolytechnic University

Debie Beemsigne

Dominic Joy

Max Pereira

Ravidev Mohan

Edited by Malathi Veeraraghavan

Page 2: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

22

OutlineOutline

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 3: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

33

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

only possible for hosts that exclusively run client applicationsonly possible for hosts that exclusively run client applications Allows for host-specific configuration parameters to Allows for host-specific configuration parameters to

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

address assignments to hostsaddress 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 be permanent Also, router interfaces should be permanent

addresses for stability of routing dataaddresses for stability of routing data

Page 4: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

44

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 been exhausted, service providers and enterprises use dynamically allocated IP enterprises use dynamically allocated IP addressesaddresses e.g., a cable modem service provider who has many e.g., a cable modem service provider who has many

customerscustomers since not all customers are simultaneously on the Internet, a since not all customers are simultaneously on the Internet, a

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

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

Page 5: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

55

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 PC e.g. Outlook to download email messages delivered to a PC

user’s incoming mail server, but not the mail server itselfuser’s incoming mail server, but not the mail server itself 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 network Then, the end host can simply connect to the network at any “point of attachment,” obtain a network address at any “point of attachment,” obtain a network address and start receiving informationand start receiving information

Page 6: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

66

Why is a dynamically obtained address Why is a dynamically obtained address sufficient for such hosts?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 packet connection), the called server receives an IP packet from the calling host with the host’s new temporary from the calling host with the host’s new temporary address and hence can, in turn, send the caller back address and hence can, in turn, send the caller back requested datarequested data

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

address that potentially “callees” will need to knowaddress that potentially “callees” will need to know Question: can we categorize a cellular telephone Question: can we categorize a cellular telephone

as such an “end point” as such an “end point”

Page 7: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

77

Answer to questionAnswer to question in previous slide in previous slide

No, because a cell phone can be calledNo, because a cell phone can be called Therefore callees (calling parties) will need Therefore callees (calling parties) will need

to know the network address of the cellular to know the network address of the cellular phonephone

Page 8: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

88

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 use Even with an Ethernet NIC, a host can use

DHCP to dynamically obtain an IP addressDHCP to dynamically obtain an IP address e.g. cable modem user; Ethernet from host to e.g. cable modem user; Ethernet from host to

cable modem; cable from modem to Internetcable modem; cable from modem to Internet

Page 9: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

99

DHCP for mobile users?DHCP for mobile users?

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

delivery of calls to mobiles; end hosts that can delivery of calls to mobiles; end hosts that can dynamically obtain addresses are never “called;” so dynamically obtain addresses are never “called;” so location management problem does not arise for location management problem does not arise for DHCP hostsDHCP hosts

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

Page 10: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

1010

ComponentsComponents

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

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 that BOOTP relay agents: host or router that passes DHCP messages between DHCP passes DHCP messages between DHCP clients and DHCP serversclients and DHCP servers

Page 11: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

1111

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 DHCP Uses BOOTP relay agents to avoid having one DHCP

server per network segmentserver per network segment BOOTP used to bootstrap hostsBOOTP used to bootstrap hosts

First operation, get address and bootfile selection First operation, get address and bootfile selection (diskless client)(diskless client)

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

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

Page 12: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

1212

Differences betweenDifferences between BOOTP and DHCP BOOTP and DHCP

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

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

DHCP can acquire all IP-related configuration DHCP can acquire all IP-related configuration information, not just an addressinformation, not just an address

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 13: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

1313

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 (16)sname (64)file (128)

options ( variable)

Page 14: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

1414

Format of a DHCP message cont.Format of a DHCP message 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 booting via a hops - client sets to 0, optionally used by relay agents when booting via a

relay agentrelay agent xid - transaction ID, a random number chosen by the client, used by the xid - transaction ID, a random number chosen by the client, used by the

client and server to associate messages and responses between a client client and server to associate messages and responses between a client and a serverand a server

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

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

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

BACK

Page 15: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

1515

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

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

yiaddr – ‘your’ (client) IP addressyiaddr – ‘your’ (client) IP address 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 relay giaddr – relay agent IP address, used in booting via a relay

agentagent chaddr – client hardware addresseschaddr – client hardware addresses sname – optional server host name, null terminated stringsname – optional server host name, null terminated string file – Boot file name, null terminated string; “generic” name file – Boot file name, null terminated string; “generic” name

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

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

BACK

Page 16: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

1616

DHCP optionsDHCP options

Client IP AddressClient IP Address Subnet MaskSubnet Mask Client HostnameClient Hostname DHCP Lease TimeDHCP Lease Time DHCP Message TypeDHCP Message Type Renewal Time ValueRenewal Time Value Rebinding Time ValueRebinding Time Value

Max Datagram Max Datagram ReassemblyReassembly

Interface MTUInterface MTU Broadcast AddressBroadcast Address MobileIP Home AgentMobileIP Home Agent DNS DNS (Domain Name Server)(Domain Name Server)

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

Page 17: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

1717

Types of DHCP messagesTypes of DHCP messages

DHCPDISCOVERDHCPDISCOVER DHCPOFFERDHCPOFFER DHCPREQUESTDHCPREQUEST DHCPACKDHCPACK DHCPNAKDHCPNAK DHCPDECLINEDHCPDECLINE DHCPRELEASEDHCPRELEASE DHCPINFORM DHCPINFORM

Page 18: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

1818

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 specific time period (called a lease period) and sends it to the client together with the other required to the client together with the other required configuration information. This information is configuration information. This information is acknowledged by the client, and used to set up its acknowledged by the client, and used to set up its configuration. The DHCP server will not reallocate the configuration. The DHCP server will not reallocate the address during the lease period and will attempt to return address during the lease period and will attempt to return the same address every time the client requests an the same address every time the client requests an address. The client may extend its lease with 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 19: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

1919

DHCP proceduresDHCP procedures

Allocating/obtaining new addressesAllocating/obtaining new addresses Lease renewal/reuse of addressLease renewal/reuse of address

Page 20: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

2020

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 offerand implicitlyreject rest

Page 21: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

2121

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' when not 0).forwarded the message ('giaddr' when not 0).

Page 22: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

2222

Obtaining an IP addressObtaining an IP address

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

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) after checking that address, i.e., client address) after checking that the address is free using ICMP echo request the address is free using ICMP echo request (ping)(ping) 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 23: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

2323

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

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

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

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

Page 24: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

2424

Obtaining an IP address contd. Obtaining an IP address 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 note addresses, while the selected server will note the bindingthe binding

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

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

Retransmission attempts use exponential Retransmission attempts use exponential backoff times;backoff times;

Page 25: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

2525

Lease renewalLease renewal

DHCP REQUEST DHCP REQUEST

Locates Configuration Locates Configuration

Client ServerServer

Begin Initialization

Initialization complete

DHCPACK DHCPACK

(Subsequent DHCPACKS ignored)

Tim

e

Page 26: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

2626

Reuse of addressReuse of address

Client Server (selected)Server (selected)

DHCP REQ. DHCP REQ.

Locates Config. Locates Config.DHCPACK DHCPACK

Initialization Complete

(Subsequent DHCP Packets Ignored)

Page 27: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

2727

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 from all server and implicitly declining offers from all othersothers

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

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

Page 28: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

2828

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 29: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

2929

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

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 30: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

3030

Questions on DHCPQuestions on DHCP

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

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 routers?standalone entities or are they add-ons to IP routers?

Perform a tcpdump and explain DHCP message Perform a tcpdump and explain DHCP message parameters.parameters.

Can DHCP support mobility across 802.11 LANs (on Can DHCP support mobility across 802.11 LANs (on different subnets)?different subnets)?

Comment on the speed of DHCP.Comment on the speed of DHCP.

Page 31: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

3131

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

selected?selected?

Page 32: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

3232

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

selected?selected?

In static addressing, the following fields: Gateway, WINS Configuration, 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 Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

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 routers?standalone entities or are they add-ons to IP 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 includes a SunSoft: Solstice SolarNet PC-Admin 1.5 includes a

DHCP/BOOTP server 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 Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

3434

Use tcpdump and obtain a trace Use tcpdump 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 Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

3535

Use tcpdump and obtain a traceUse tcpdump and obtain a traceof a DHCP sessionof a DHCP session

Tcpdump Output (Release)Tcpdump Output (Release)C:\WINDOWS\DESKTOP\WINDUMP.EXE: listening on EL3C574C:\WINDOWS\DESKTOP\WINDUMP.EXE: listening on EL3C574

17:18:20.069309 0:50:4:fd:10:85 0:b0:c2:f3:15:80 0800 342: 17:18:20.069309 0:50:4:fd:10:85 0:b0:c2:f3:15:80 0800 342: 128.238.112.144.68 >128.238.112.144.68 >

128.238.29.25.67: xid:0xc29c14f flags:0x8000 C:128.238.112.144 [|bootp]128.238.29.25.67: xid:0xc29c14f flags:0x8000 C:128.238.112.144 [|bootp]

4500 0148 3801 0000 8011 721e 80ee 70904500 0148 3801 0000 8011 721e 80ee 7090

80ee 1d19 0044 0043 0134 f6e1 0101 060080ee 1d19 0044 0043 0134 f6e1 0101 0600

0c29 c14f 0000 8000 80ee 7090 0000 00000c29 c14f 0000 8000 80ee 7090 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

IP header

Source Port Number#68

Op fieldhtype field

hlen

hops

xid field

flagsciaddr field

adapter addressDestination

Port Number#67

Page 36: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

3636

IP configuration after release IP configuration after release

Page 37: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

3737

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 Y:128.238.112.144 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]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 Y:128.238.112.144 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]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

Page 38: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

3838

IP configuration after the renewIP configuration after the renew

Page 39: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

3939

TCP DHCP Release and RenewTCP DHCP Release and Renew

C:\WINDOWS\COMMAND\WINDUMP.EXE: listening on EL3C574C:\WINDOWS\COMMAND\WINDUMP.EXE: listening on EL3C574 14:33:57.285551 128.238.110.84.68 > 128.238.29.25.67: xid:0x2c12fc0c flags:0x8014:33:57.285551 128.238.110.84.68 > 128.238.29.25.67: xid:0x2c12fc0c flags:0x80 00 C:128.238.110.84 [|bootp]00 C:128.238.110.84 [|bootp] 14:33:59.923127 128.238.110.1.67 > 128.238.110.84.68: xid:0x77514b14 Y:128.238.14:33:59.923127 128.238.110.1.67 > 128.238.110.84.68: xid:0x77514b14 Y:128.238. 110.84 S:128.238.29.25 G:128.238.110.1 [|bootp]110.84 S:128.238.29.25 G:128.238.110.1 [|bootp] 14:33:59.929897 128.238.110.1.67 > 128.238.110.84.68: xid:0x77514b14 Y:128.238.14:33:59.929897 128.238.110.1.67 > 128.238.110.84.68: xid:0x77514b14 Y:128.238. 110.84 G:128.238.110.1 [|bootp]110.84 G:128.238.110.1 [|bootp] 14:33:59.930499 arp who-has 128.238.110.84 tell 128.238.110.8414:33:59.930499 arp who-has 128.238.110.84 tell 128.238.110.84 14:34:00.769168 128.238.110.84 > 224.0.0.2: icmp: router solicitation14:34:00.769168 128.238.110.84 > 224.0.0.2: icmp: router solicitation 14:34:01.714654 128.238.29.23.137 > 128.238.110.84.137:14:34:01.714654 128.238.29.23.137 > 128.238.110.84.137: >>> NBT UDP PACKET(137): REGISTRATION; POSITIVE; RESPONSE; UNICAST>>> NBT UDP PACKET(137): REGISTRATION; POSITIVE; RESPONSE; UNICAST 14:34:01.714775 128.238.110.84.137 > 128.238.29.23.137:14:34:01.714775 128.238.110.84.137 > 128.238.29.23.137: >>> NBT UDP PACKET(137): REGISTRATION; REQUEST; UNICAST>>> NBT UDP PACKET(137): REGISTRATION; REQUEST; UNICAST 14:34:01.714790 128.238.110.84.137 > 128.238.29.23.137:14:34:01.714790 128.238.110.84.137 > 128.238.29.23.137: >>> NBT UDP PACKET(137): REGISTRATION; REQUEST; UNICAST>>> NBT UDP PACKET(137): REGISTRATION; REQUEST; UNICAST 14:34:01.714799 128.238.110.84.137 > 128.238.29.23.137:14:34:01.714799 128.238.110.84.137 > 128.238.29.23.137: >>> NBT UDP PACKET(137): REGISTRATION; REQUEST; UNICAST>>> NBT UDP PACKET(137): REGISTRATION; REQUEST; UNICAST 14:34:01.715000 128.238.29.23.137 > 128.238.110.84.137:14:34:01.715000 128.238.29.23.137 > 128.238.110.84.137: >>> NBT UDP PACKET(137): REGISTRATION; POSITIVE; RESPONSE; UNICAST>>> NBT UDP PACKET(137): REGISTRATION; POSITIVE; RESPONSE; UNICAST 14:34:01.715429 128.238.29.23.137 > 128.238.110.84.137:14:34:01.715429 128.238.29.23.137 > 128.238.110.84.137: >>> NBT UDP PACKET(137): REGISTRATION; POSITIVE; RESPONSE; UNICAST>>> NBT UDP PACKET(137): REGISTRATION; POSITIVE; RESPONSE; UNICAST 14:34:03.774056 128.238.110.84 > 224.0.0.2: icmp: router solicitation14:34:03.774056 128.238.110.84 > 224.0.0.2: icmp: router solicitation 14:34:06.773913 128.238.110.84 > 224.0.0.2: icmp: router solicitation14:34:06.773913 128.238.110.84 > 224.0.0.2: icmp: router solicitation

Release

Renew

Page 40: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

4040

Comment on the Comment on the speed of DHCPspeed of DHCP

If DHCP servers have to ping all hosts to check if an If DHCP servers have to ping all hosts to check if an address is truly free, this will take timeaddress is truly free, this will take time

Depends on location of BOOTP relay agents and DHCP Depends on location of BOOTP relay agents and DHCP serversservers

Why is this ping necessary? Why is this ping necessary? Because a host does not issue a renewal but is still online past Because a host does not issue a renewal but is still online past

its lease time; if client coded to issue a renewal, why would this its lease time; if client coded to issue a renewal, why would this happen?happen?

Will a server ping for an address whose lease is still not up if all Will a server ping for an address whose lease is still not up if all addresses are taken with the “hope” that a host left without addresses are taken with the “hope” that a host left without gracefully releasing address?gracefully releasing address?

Is a conflict of address space possible between different DHCP Is a conflict of address space possible between different DHCP servers if multiple are present on one subnet? There is no servers if multiple are present on one subnet? There is no server-to-server protocol yetserver-to-server protocol yet

Page 41: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

4141

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 of much larger number of subscribers/hosts with time multiplexing of addresses (one host uses an address, and releases it when done; addresses (one host uses an address, and releases it when done; another host is allocated the same address)another host is allocated the same address)

Removes error-prone manual host configuration process to Removes error-prone manual host configuration process to set IP addresses, DNS server addresses, gateways, etc.set IP addresses, DNS server addresses, gateways, 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 an Major network resource changes (e.g. a router changing an interface address) requires an update of only the DHCP interface address) requires an update of only the DHCP server, rather than every system. server, rather than every system.

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

Page 42: 1 DHCP DHCP Dynamic Host Configuration Protocol Polytechnic University Debie Beemsigne Dominic Joy Max Pereira Ravidev Mohan Edited by Malathi Veeraraghavan

4242

ReferencesReferences

RFC 2131: DHCP RFC 2132: DHCP options RFC 951: Bootstrap protocol (BOOTP) 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 Other RFCs: 1533, 1541, 1542, 2132