Dynamic Host Configuration Protocol (DHCP)

This protocol is used to assign IP addresses to hosts or workstations on the network. Usually a DHCP server on the network performs this function. Basically it “leases” out address for specific times to the various hosts. If a host does not use a given address for some period of time, that IP address can then be assigned to another machine by the DHCP server. When assignments are made or changed, the DHCP server must update the information in the DNS server.

As with BOOTP, DHCP uses the machine’s or NIC ethernet (MAC) or hardware address to determine IP address assignments. The DHCP protocol is built on BOOTP and replaces BOOTP. DHCP extends the vendor specific area in BOOTP to 312 bytes from 64. RFC 1541 defines DHCP.

DHCP RFCs

DHCP RFCs are 1533, 1534, 1541, and 1542. Sent from DHCP server:

·       IP address

·       Netmask

·       Default Gateway address

·       DNS server addresse(s)

·       NetBIOS Name server (NBNS) address(es).

·       Lease period in hours

·       IP address of DHCP server.

DHCP Lease Stages

1. Lease Request – The client sends a broadcast requesting an IP address

2. Lease Offer – The server sends the above information and marks the offered address as unavailable. The message sent is a DHCPOFFER broadcast message.

3. Lease Acceptance – The first offer received by the client is accepted. The acceptance is sent from the client as a broadcast (DHCPREQUEST message) including the IP address of the DNS server that sent the accepted offer.Other DHCP servers retract their offers and mark the offered address as available and the accepted address as unavailable.

4. Server lease acknowledgement – The server sends a DHCPACK or a DHCPNACK if an unavailable address was requested.

DHCP discover message – The initial broadcast sent by the client to obtain a DHCP lease. It contains the client MAC address and computer name. This is a broadcast using 255.255.255.255 as the destination address and 0.0.0.0 as the source address. The request is sent, then the client waits one second for an offer. The request is repeated at 9, 13, and 16 second intervals with additional 0 to 1000 milliseconds of randomness. The attempt is repeated every 5 minutes thereafter. The client uses port 67 and the server uses port 68.

DHCP Lease Renewal

After 50% of the lease time has passed, the client will attempt to renew the lease with the original DHCP server that it obtained the lease from using a DHCPREQUEST message. Any time the client boots and the lease is 50% or more passed,

the client will attempt to renew the lease. At 87.5% of the lease completion, the client will attempt to contact any DHCP server for a new lease. If the lease expires, the client will send a request as in the initial boot when the client had no IP address. If this fails, the client TCP/IP stack will cease functioning.

DHCP Scope and Subnets

One DHCP scope is required for each subnet.

DHCP Relay Agents

May be placed in two places:

  • Routers
  • Subnets that don’t have a DHCP server to forward DHCP requests.

Client Reservation

Client Reservation is used to be sure a computer gets the same IP address all the time. Therefore since DHCP IP address assignments use MAC addresses to control assignments, the following are required for client reservation:

  • MAC (hardware) address
  • IP address

Exclusion Range

Exclusion range is used to reserve a bank of IP addresses so computers with static IP addresses, such as servers may use the assigned addresses in this range. These addresses are not assigned by the DHCP server.

BOOTP

BOOTP (Boot Protocol) may be used to boot remote computers over a network. BOOTP messages are encapsulated inside UDP messages and therefore it’s requests and replies are forwarded by routers. BOOTP is defined by RFCs 951 and 1542. The drawing below illustrates the data encapsulation:

The diskless system reads its unique hardware address from its network interface card then sends a BOOTP request. The table below shows the BOOTP package format from most significant bit to least significant bit.

The BOOTP server uses port 67 and the BOOTP client uses port 68. The following is a brief explanation of what happens when a remote client boots:

1. BOOTP request. The client sends a BOOTP request from 0.0.0.0.68 to 255.255.255.255.67 with its ethernet address and number of second’s fields filled in.

2. BOOTP reply. The server responds with the client’s IP address, the server’s IP address (it’s own), and the IP address of a default gateway.

3. ARP request. The client issues an ARP to tell if the IP address it just received is being used. It uses 0.0.0.0 as it’s own address

4. ARP request. The client waits 0.5 seconds and repeats the same ARP request.

5. ARP request. The client waits another 0.5 seconds and repeats the ARP request with it’s own address as the senders address.

6. BOOTP request. The client waits 0.5 seconds and sends another BOOTP request with its own IP address in the IP header

7. BOOTP reply. The server sends the same BOOTP reply it sent the last time.

8. ARP request. The client outputs an ARP request for the server hardware address

9. ARP reply. The server replies with its own ethernet address.

10. TFTP read request. The client sends a TFTP read request asking for its specified boot file.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top