Copyright

Return to index

*************************************

The following is a limited general description of the steps that take place, when a new DHCP client (one that hasn't already been issued an IP from this server) attempts to obtain an IP. I am ignoring reservations and several other variations.

==============================================

When a DHCP client boots, it issues a DHCPDiscover. This is a broadcast to locate any DHCP servers with IPs available for the client's segment. Because DHCPDiscover is a broadcast, it will (in most cases) not cross routers. So, if your DHCP server isn't on the same segment as the client, the packet must be forwarded to the DHCP server by either a DHCP relay agent or a router with bootp/DHCP forwarding enabled.

When the DHCP server receives a DHCPDiscover, it checks to see, whether the discover was forwarded (by a DHCP relay or router) or received directly from a client on the local segment.

    1. If the discover was forwarded, then the forwarding agent will have added the IP of the NIC on which it received the DHCPDiscover broadcast to the packet (in the giaddr field) before forwarding it to the DHCP server. The DHCP server will use this IP to determine the appropriate scope.
    2. If the discover was received directly from a local client (the giaddr field is blank), then primary IP of the NIC on which the request was received will be used to determine the appropriate scope.

The DHCP server checks its scopes to see, if any are defined for the same subnet as the IP on which the initial DHCPDiscover broadcast was received (byt the DHCP server or the DHCP relay agent). If it finds a matching scope, it checks for available IPs in that scope. If it has any available, it will send a DHCPOffer (containing the offered IP) back to the client.

The DHCP client collects all DHCPOffer replies (every DHCP server with an IP to offer will have replied) and selects one (almost always the first one received). The client sends out a DHCPRequest, requesting the selected I from the selected DHCP server. The DHCP server replies with a DHCPAck, indicating that the client now owns that IP (at least for the duration of the lease).

================================================

Rules for MS DHCP servers and clients:

  1. A given DHCP server can have only one scope defined for each subnet.
  2. If you have multiple DHCP servers, you can split subnets between servers to provide redundancy, but you cannot overlap subnet. For example, if the subnet is 192.168.100.0 (255.255.255.0), one server might have 192.168.100.1 - 180 and the other might have 192.168.100.181 - 254.
  3. If a DHCP server is logically multihomed (i.e. has more than one IP assigned to a NIC), it will only use the subnet of the first IP in the list on the multihomed adapter to determine the target subnet.
  4. On current MS DHCP servers, you can use a combination of logical multihoming and superscopes to provide IPs from multiple subnets to clients on a single segment.
  5. If a DHCP server has multiple NICs configured for different subnets attached to the same physical segment (this means that the server will receive multiple DHCPDiscovers for clients on this segment - one for each NIC) the DHCP server will issue a DHCPOffer for each applicable subnet. The client will simply pick one.
  6. There are only 2 ways to exert control over which client receives an given IP or an IP from a given subnet:
    1. Define a Reservation for the client.
    2. Use a router to segment the LAN and place the client on the segment that is configured only for the target subnet.

*************************************