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

Bootstrap and Autoconfiguration (DHCP) Chapter 22

  • View
    223

  • Download
    1

Embed Size (px)

Text of Bootstrap and Autoconfiguration (DHCP) Chapter 22

  • Slide 1
  • Bootstrap and Autoconfiguration (DHCP) Chapter 22
  • Slide 2
  • Look at client-server for bootstrapping Computer must know IP address before sending or receiving datagrams Computer must know IP address before sending or receiving datagrams Needs router address, subnet mask, address of name server Needs router address, subnet mask, address of name server Look at protocol to allow host to determine information automatically at startup Look at protocol to allow host to determine information automatically at startup Client & server communicate using UDP Client & server communicate using UDP RememberUDP relies on IP to transfer messages How use UDP to find IP address? Will look at special IP addresses mentioned in Chap 3 Will look at special IP addresses mentioned in Chap 3
  • Slide 3
  • History of Bootstrapping Chap 5 mentioned RARP Protocol to permit computer to get IP address Protocol to permit computer to get IP address More general BOOTP replaced RARP BOOTstrap Protocol BOOTstrap Protocol DHCP developed as successor to BOOTP Dynamic Host Configuration Protocol Dynamic Host Configuration Protocol Most features of DCHP also apply to BOOTP Most features of DCHP also apply to BOOTP For simplicity, only talk about DHCP For simplicity, only talk about DHCP
  • Slide 4
  • DHCP uses UDP and IP Can be implemented with an application program Can be implemented with an application program Operates in client-server paradigm Operates in client-server paradigm Requires a single packet exchange Requires a single packet exchange IP address Router address Name server address Option: field for vendor-specific info
  • Slide 5
  • Using IP to Determine an IP Address DHCP uses UDP to carry messages UDP messages encapsulated in IP datagrams UDP messages encapsulated in IP datagrams Recall in Chap 3 several special-case IP addrs Recall in Chap 3 several special-case IP addrs Specifically, all 1s specifies limited broadcast IP SW can do even before knowing its local IP addr An application program can use the limited broadcast IP address to force IP to broadcast a datagram on the local network before IP has discovered the IP address of the local network or the machines IP address An application program can use the limited broadcast IP address to force IP to broadcast a datagram on the local network before IP has discovered the IP address of the local network or the machines IP address
  • Slide 6
  • Example Client A wants to use DHCP; B is server Client A wants to use DHCP; B is server (B is on same physical net) A uses limited broadcast for its initial DHCP request B probably cannot send a directed reply back B sends reply datagram to network interface SW B sends reply datagram to network interface SW Interface SW needs to map next hop IP addr to HW addr Interface SW needs to map next hop IP addr to HW addr Would use ARP, but Would use ARP, but A does not know its address to answer the ARP request B has two choices Broadcast the reply Broadcast the reply Manually add entry to its ARP cache Manually add entry to its ARP cache System may not allow application program to do
  • Slide 7
  • DHCP Retransmission Policy UDP uses IP for delivery We know it is an unreliable service We know it is an unreliable service DHCP puts responsibility for reliability on client DHCP also: DHCP also: Requires that UDP use checksums IP does not have checksum for the data IP does not have checksum for the data Requires that the do not fragment bit be set To accommodate clients with little memory To accommodate clients with little memory Allows multiple replies (accepts & processes the 1 st )
  • Slide 8
  • Timeout & retransmission used for reliability Client sends request; starts timer Client sends request; starts timer If no reply before expires, must retransmit If no reply before expires, must retransmit DHCP server(s) can get overrun with requests DHCP server(s) can get overrun with requests After power failure & all machines booting Machines use different retransmission timeout DHCP specification recommends random delay DHCP 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 retransmissions After reach 60 seconds, not double but still use randomization
  • Slide 9
  • DHCP Message Format Figure 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 fields Client & server used loosely Clients sends request Server sends reply DHCP can be used even if client already knows its IP address To get other info
  • Slide 10
  • Need for Dynamic Configuration Early bootstrap protocols designed for static environment Manager created configuration file Manager created configuration file File changed infrequently File changed infrequently Then: wireless networking & portable computers Static parameter assignment requires extensive involvement of managers Static parameter assignment requires extensive involvement of managers Enter parameters for each host & store in server config file Assign each host an IP address Configure server so it understands host ID to IP addr mapping
  • Slide 11
  • DHCP designed for automated address assignment Gets all configuration information in one message Gets all configuration information in one message Allows dynamic address allocation to computers Allows dynamic address allocation to computers Manager configures DHCP server with set of IP addresses New computer connects & requests addr, server picks one
  • Slide 12
  • DHCP allows three types of assignments DHCP allows three types of assignments Manual configuration Manager configures specific address for specific computer Manager configures specific address for specific computer Automatic configuration Server allowed to assign permanent address Server allowed to assign permanent address Dynamic configuration Server loans an address for a limited time Server loans an address for a limited time Assignment based on clients identifier and the network to which it has connected Assignment based on clients identifier and the network to which it has connected Server can allocate to different computers in different ways
  • Slide 13
  • DHCP Lease Concept Dynamic address assignment is temporary DHCP server leases an address to a client DHCP server leases an address to a client Server specifies the lease period at allocation Server specifies the lease period at allocation During the lease, server cannot lease that address to any other client At 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 host DHCP does not specify a fixed constant Client requests a certain period; server informs client of the period it grants
  • Slide 14
  • Multiple Addresses & Relays DHCP provides info about one interface Multi-homed host has multiple interfaces Multi-homed host has multiple interfaces Each interface handled independently Each interface handled independently Relay agent Lets computer contact server on nonlocal net Lets computer contact server on nonlocal net Complicates multi-homed host configuration Complicates multi-homed host configuration Get multiple requests from same computer Assume multi-homed client can identify each interface uniquely so server can tell requests apart Assume multi-homed client can identify each interface uniquely so server can tell requests apart
  • Slide 15
  • Address Acquisition States State diagram has six states At boot, client enters INITIALIZE state At boot, client enters INITIALIZE state Broadcasts DHCPDISCOVER message Moves to SELECT state Moves to SELECT state Gets zero or more DHCPOFFER responses Each contains configuration info & IP address Client must choose one of the offers (first to arrive) Sends DHCPREQUEST message to negotiate
  • Slide 16
  • Enters REQUEST state Enters REQUEST state Server acks request and starts lease with DHCPACK Client enters BOUND state upon receipt of ack Client enters BOUND state upon receipt of ack Proceeds to use the address This is the normal state of operation To terminate a lease early, send DHCPRELEASE Cannot send any more datagrams using the address Cannot send any more datagrams using the address Leaves BOUND state; must enter INITIALIZE to use IP Leaves BOUND state; must enter INITIALIZE to use IP Client has three timers in this state First: 50% of the lease time; must attempt to renew lease First: 50% of the lease time; must attempt to renew lease Moves to RENEW state Server can send DHCPACK or DHCPNACK
  • Slide 17
  • Second: 87.5% Second: 87.5% If no response, server is either down or unreachable When second timer expires, move to REBIND state Broadcasts DHCPREQUEST to any server on net If get positive response, move back to BOUND If get negative response, move back to INITIALIZE Third: full lease period Third: full lease period If get no response in REBIND state, move back to INITIALIZE when this timer expires
  • Slide 18
  • Figure 22.3
  • Slide 19
  • DHCP and Domain Names Not all procedures for attaching permanent host to internet are automated DHCP protocol does not specify interaction with the domain name system (DNS) DHCP protocol does not specify interaction with the domain name system (DNS) However, some implementations do interact with DNS However, some implementations do interact with DNS
  • Slide 20
  • Summary DHCP allows a computer to obtain information at startup Router address, DNS server address, IP address Router address, DNS server address, IP address Permits automatic and dynamic allocation of IP addresses Dynamic allocation is necessary in environments where computers attach and detach quickly Dynamic allocation is necessary in environments where computers attach and detach quickly
  • Slide 21
  • Computer becomes client to use DHCP Broadcasts request to DHCP servers Broadcasts request to DHCP servers Selects one of the offers it receives Selects one of the offers it receives Exchanges messages to obtain lease on IP address Exchanges messages to obtain lease on IP address Relay agent can forward DHCP requests Allows site to have one DHCP server for multiple subnets Allows site to have one DHCP server for multiple subnets Starts three timers Starts three timers When first expires, must attempt to renew its lease If second expires before renewal is done, attempts to rebind from any server If third expires before renewal, client stops using IP address and returns to initial state to get new address