21
Bootstrap and Bootstrap and Autoconfiguration Autoconfiguration (DHCP) (DHCP) Chapter 22 Chapter 22

Bootstrap and Autoconfiguration (DHCP)

  • Upload
    nassor

  • View
    62

  • Download
    0

Embed Size (px)

DESCRIPTION

Bootstrap and Autoconfiguration (DHCP). Chapter 22. Look at client-server for bootstrapping Computer must know IP address before sending or receiving datagrams Needs router address, subnet mask, address of name server - PowerPoint PPT Presentation

Citation preview

Page 1: Bootstrap and Autoconfiguration (DHCP)

Bootstrap and Bootstrap and Autoconfiguration Autoconfiguration

(DHCP)(DHCP)

Chapter 22Chapter 22

Page 2: Bootstrap and Autoconfiguration (DHCP)

Look at client-server for bootstrappingLook at client-server for bootstrapping Computer must know IP address before Computer must know IP address before

sending or receiving datagramssending or receiving datagrams Needs router address, subnet mask, address of Needs router address, subnet mask, address of

name servername server Look at protocol to allow host to determine Look at protocol to allow host to determine

information automatically at startup information automatically at startup Client & server communicate using UDPClient & server communicate using UDP

Remember…UDP relies on IP to transfer messagesRemember…UDP relies on IP to transfer messages

How use UDP to find IP address?How use UDP to find IP address? Will look at special IP addresses mentioned in Chap 3Will look at special IP addresses mentioned in Chap 3

Page 3: Bootstrap and Autoconfiguration (DHCP)

History of BootstrappingHistory of Bootstrapping

Chap 5 mentioned RARPChap 5 mentioned RARP Protocol to permit computer to get IP addressProtocol to permit computer to get IP address

More general BOOTP replaced RARPMore general BOOTP replaced RARP BOOTstrap ProtocolBOOTstrap Protocol

DHCP developed as successor to BOOTPDHCP developed as successor to BOOTP Dynamic Host Configuration ProtocolDynamic Host Configuration Protocol Most features of DCHP also apply to BOOTPMost features of DCHP also apply to BOOTP For simplicity, only talk about DHCPFor simplicity, only talk about DHCP

Page 4: Bootstrap and Autoconfiguration (DHCP)

DHCP uses UDP and IPDHCP uses UDP and IP Can be implemented with an application programCan be implemented with an application program Operates in client-server paradigmOperates in client-server paradigm Requires a single packet exchangeRequires a single packet exchange

IP addressIP address

Router addressRouter address

Name server addressName server address

Option: field for vendor-specific infoOption: field for vendor-specific info

Page 5: Bootstrap and Autoconfiguration (DHCP)

Using IP to Determine an IP Using IP to Determine an IP AddressAddress

DHCP uses UDP to carry messagesDHCP uses UDP to carry messages UDP messages encapsulated in IP datagramsUDP messages encapsulated in IP datagrams Recall in Chap 3 several special-case IP addrsRecall in Chap 3 several special-case IP addrs

Specifically, all 1’s specifies limited broadcastSpecifically, all 1’s specifies limited broadcast

IP SW can do even before knowing its local IP addrIP SW can do even before knowing its local IP addr ““An application program can use the limited broadcast IP An application program can use the limited broadcast IP

address to force IP to broadcast a datagram on the local address to force IP to broadcast a datagram on the local network before IP has discovered the IP address of the network before IP has discovered the IP address of the local network or the machine’s IP addresslocal network or the machine’s IP address””

Page 6: Bootstrap and Autoconfiguration (DHCP)

ExampleExample Client Client AA wants to use DHCP; wants to use DHCP; BB is server is server

((BB is on same physical net) is on same physical net)

AA uses limited broadcast for its initial DHCP request uses limited broadcast for its initial DHCP request

BB probably probably cannotcannot send a directed reply back send a directed reply back BB sends reply datagram to network interface SW sends reply datagram to network interface SW Interface SW needs to map next hop IP addr to HW addrInterface SW needs to map next hop IP addr to HW addr Would use ARP, butWould use ARP, but

AA does not know its address to answer the ARP request does not know its address to answer the ARP request

BB has two choices has two choices Broadcast the replyBroadcast the reply Manually add entry to its ARP cacheManually add entry to its ARP cache

System may not allow application program to doSystem may not allow application program to do

Page 7: Bootstrap and Autoconfiguration (DHCP)

DHCP Retransmission PolicyDHCP Retransmission Policy

UDP uses IP for deliveryUDP uses IP for delivery We know it is an unreliable serviceWe know it is an unreliable service

DHCP puts responsibility for reliability on clientDHCP puts responsibility for reliability on client DHCP also:DHCP also:

Requires that UDP use checksumsRequires that UDP use checksums IP does not have checksum for the dataIP does not have checksum for the data

Requires that the Requires that the do not fragmentdo not fragment bit be set bit be set To accommodate clients with little memoryTo accommodate clients with little memory

Allows multiple replies (accepts & processes the 1Allows multiple replies (accepts & processes the 1stst))

Page 8: Bootstrap and Autoconfiguration (DHCP)

Timeout & retransmission used for reliabilityTimeout & retransmission used for reliability Client sends request; starts timerClient sends request; starts timer If no reply before expires, must retransmitIf no reply before expires, must retransmit DHCP server(s) can get overrun with requestsDHCP server(s) can get overrun with requests

After power failure & all machines bootingAfter power failure & all machines booting

Machines use different retransmission timeoutMachines use different retransmission timeout DHCP specification recommends random delayDHCP specification recommends random delay In addition, start with random timeout value (0-4 seconds)In addition, start with random timeout value (0-4 seconds)

Double the time after each retransmissionsDouble the time after each retransmissions

After reach 60 seconds, not double but still use After reach 60 seconds, not double but still use randomizationrandomization

Page 9: Bootstrap and Autoconfiguration (DHCP)

DHCP Message FormatDHCP Message Format

Figure 22.1Figure 22.1 The format of a DHCP message. To keep implementations small enough to fit in ROM, fields except for options have fixed length

Fixed length Fixed length fieldsfieldsClientClient & & serverserver used looselyused loosely

Clients sends Clients sends requestrequest

Server sends Server sends replyreply

DHCP can be DHCP can be used even if used even if client already client already knows its IP knows its IP addressaddress

To get other infoTo get other info

Page 10: Bootstrap and Autoconfiguration (DHCP)

Need for Dynamic ConfigurationNeed for Dynamic Configuration

Early bootstrap protocols designed for static Early bootstrap protocols designed for static environmentenvironment Manager created configuration fileManager created configuration file File changed infrequentlyFile changed infrequently

Then: wireless networking & portable computersThen: wireless networking & portable computers Static parameter assignment requires extensive Static parameter assignment requires extensive

involvement of managersinvolvement of managersEnter parameters for each host & store in server config fileEnter parameters for each host & store in server config file

Assign each host an IP addressAssign each host an IP address

Configure server so it understands host ID to IP addr mappingConfigure server so it understands host ID to IP addr mapping

Page 11: Bootstrap and Autoconfiguration (DHCP)

DHCP designed for automated address DHCP designed for automated address assignmentassignment Gets all configuration information in one messageGets all configuration information in one message Allows dynamic address allocation to computersAllows dynamic address allocation to computers

Manager configures DHCP server with set of IP Manager configures DHCP server with set of IP addressesaddresses

New computer connects & requests addr, server picks New computer connects & requests addr, server picks oneone

Page 12: Bootstrap and Autoconfiguration (DHCP)

DHCP allows three types of assignmentsDHCP allows three types of assignmentsManual configurationManual configuration

Manager configures specific address for specific computerManager configures specific address for specific computer

Automatic configurationAutomatic configuration Server allowed to assign permanent addressServer allowed to assign permanent address

Dynamic configurationDynamic configuration Server “loans” an address for a limited timeServer “loans” an address for a limited time

Assignment based on client’s identifier and Assignment based on client’s identifier and the network to which it has connectedthe network to which it has connected

Server can allocate to different computers in different Server can allocate to different computers in different waysways

Page 13: Bootstrap and Autoconfiguration (DHCP)

DHCP Lease ConceptDHCP Lease Concept

Dynamic address assignment is temporaryDynamic address assignment is temporary DHCP server DHCP server leasesleases an address to a client an address to a client Server specifies the lease period at allocationServer specifies the lease period at allocation

During the lease, server cannot lease that address to During the lease, server cannot lease that address to any other clientany other clientAt end of lease, client must renew or stop using addrAt end of lease, client must renew or stop using addr

How long should the lease be?How long should the lease be?Depends on network and needs of hostDepends on network and needs of hostDHCP does not specify a fixed constantDHCP does not specify a fixed constantClient requests a certain period; server informs client of Client requests a certain period; server informs client of the period it grantsthe period it grants

Page 14: Bootstrap and Autoconfiguration (DHCP)

Multiple Addresses & RelaysMultiple Addresses & Relays

DHCP provides info about one interfaceDHCP provides info about one interface Multi-homed host has multiple interfacesMulti-homed host has multiple interfaces Each interface handled independentlyEach interface handled independently

Relay agentRelay agent Lets computer contact server on nonlocal netLets computer contact server on nonlocal net Complicates multi-homed host configurationComplicates multi-homed host configuration

Get multiple requests from same computerGet multiple requests from same computer Assume multi-homed client can identify each Assume multi-homed client can identify each

interface uniquely so server can tell requests interface uniquely so server can tell requests apartapart

Page 15: Bootstrap and Autoconfiguration (DHCP)

Address Acquisition StatesAddress Acquisition States

State diagram has six statesState diagram has six states At boot, client enters At boot, client enters INITIALIZEINITIALIZE state state

Broadcasts DHCPDISCOVER messageBroadcasts DHCPDISCOVER message Moves to Moves to SELECTSELECT state state

Gets zero or more DHCPOFFER responsesGets zero or more DHCPOFFER responses

Each contains configuration info & IP addressEach contains configuration info & IP address

Client must choose one of the offers (first to arrive)Client must choose one of the offers (first to arrive)

Sends DHCPREQUEST message to negotiateSends DHCPREQUEST message to negotiate

Page 16: Bootstrap and Autoconfiguration (DHCP)

Enters Enters REQUESTREQUEST state stateServer acks request and starts lease with DHCPACKServer acks request and starts lease with DHCPACK

Client enters Client enters BOUNDBOUND state upon receipt of ack state upon receipt of ackProceeds to use the addressProceeds to use the address

This is the normal state of operationThis is the normal state of operation

To terminate a lease early, send DHCPRELEASETo terminate a lease early, send DHCPRELEASE Cannot send any more datagrams using the addressCannot send any more datagrams using the address Leaves BOUND state; must enter INITIALIZE to use IPLeaves BOUND state; must enter INITIALIZE to use IP

Client has three timers in this stateClient has three timers in this state FirstFirst: : 50%50% of the lease time; must attempt to renew lease of the lease time; must attempt to renew lease

Moves to Moves to RENEWRENEW state state

Server can send DHCPACK or DHCPNACKServer can send DHCPACK or DHCPNACK

Page 17: Bootstrap and Autoconfiguration (DHCP)

Second: 87.5%Second: 87.5%

If no response, server is either down or unreachableIf no response, server is either down or unreachable

When second timer expires, move to When second timer expires, move to REBINDREBIND state state

Broadcasts DHCPREQUEST to any server on netBroadcasts DHCPREQUEST to any server on net

If get positive response, move back to BOUNDIf get positive response, move back to BOUND

If get negative response, move back to INITIALIZEIf get negative response, move back to INITIALIZE Third: full lease periodThird: full lease period

If get no response in REBIND state, move back to If get no response in REBIND state, move back to INITIALIZE when this timer expiresINITIALIZE when this timer expires

Page 18: Bootstrap and Autoconfiguration (DHCP)

Figure 22.3Figure 22.3

Page 19: Bootstrap and Autoconfiguration (DHCP)

DHCP and Domain NamesDHCP and Domain Names

Not all procedures for attaching Not all procedures for attaching permanent host to internet are automatedpermanent host to internet are automated DHCP protocol does not specify interaction with DHCP protocol does not specify interaction with

the domain name system (DNS)the domain name system (DNS) However, some implementations do interact with However, some implementations do interact with

DNSDNS

Page 20: Bootstrap and Autoconfiguration (DHCP)

SummarySummary

DHCP allows a computer to obtain DHCP allows a computer to obtain information at startupinformation at startup Router address, DNS server address, IP addressRouter address, DNS server address, IP address

Permits automatic and dynamic allocation Permits automatic and dynamic allocation of IP addressesof IP addresses Dynamic allocation is necessary in environments Dynamic allocation is necessary in environments

where computers attach and detach quicklywhere computers attach and detach quickly

Page 21: Bootstrap and Autoconfiguration (DHCP)

Computer becomes client to use DHCPComputer becomes client to use DHCP Broadcasts request to DHCP serversBroadcasts request to DHCP servers Selects one of the offers it receivesSelects one of the offers it receives Exchanges messages to obtain lease on IP Exchanges messages to obtain lease on IP

addressaddressRelay agent can forward DHCP requestsRelay agent can forward DHCP requests

Allows site to have one DHCP server for multiple subnetsAllows site to have one DHCP server for multiple subnets

Starts three timersStarts three timersWhen first expires, must attempt to renew its leaseWhen first expires, must attempt to renew its leaseIf second expires before renewal is done, attempts to If second expires before renewal is done, attempts to rebind from any serverrebind from any serverIf third expires before renewal, client stops using IP If third expires before renewal, client stops using IP address and returns to initial state to get new addressaddress and returns to initial state to get new address