Copyright

Return to index

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

Here's a quick example and a simple description of the DHCP process, using routers configured to forward bootp requests.

<all masks are 255.255.255.0>

DHCP Server
192.168.100.2
|
Segment1
|
(192.168.100.1)
Router1
(192.168.200.1)
|
Segment2

Router1 (bootp forwarding enabled):

NIC1: 192.168.100.1
NIC2: 192.168.200.1

NT Server (DHCP and WINS server):

NIC: 192.168.100.2
DG: 192.168.100.1
WINS: 192.168.100.2, 192.168.100.2
DHCP Configuration:

Global Options:

Wins (#44): 192.168.100.2, 192.168.100.2
Node Type (#46): h-node (8)

Scope1: 192.168.100.1 - 192.168.100.254

Exclude: 192.168.100.1, 192.168.100.2
Scope Options:

Router (#03): 192.168.100.1

Scope2: 192.168.200.1 - 192.168.200.254

Exclude: 192.168.200.1
Scope Options:

Router (#03): 192.168.200.1

Client1 is attached to Segment1
Client2 is attached to Segment2

~~~~~~~~~~~~~~~~~~~~~~~~~
When client1 requests an IP (broadcasts a DHCPDISCOVER packet). The DHCP server picks up the packet and notes that the request was not forward through a router (the giaddr field is empty). So it looks up the subnet ID of the NIC on which it received the request (in this case, 192.168.100.0). If it has a scope defined for this subnet, it will offer an IP to the client. Assuming the client accepts the IP, it will also pass along the Global Options and the appropriate Scope Options.

~~~~~~~~~~~~~~~~~~~~~~~~~~
When client2 requests an IP. Router1 picks up the request and notes that it was not forwarded by another router (the giaddr field of the packet is empty). So it looks up the subnet of the NIC on which it received the request and attaches this information to the request (in this case, it sets the giaddr field of the packet to 192.168.200.1). It then forwards the packet direct to the configured DHCP server (defined in the DHCP/bootp relay agent's parameters).

When the DHCP server receives the packet, it notes that it was forwarded by a relay agent (the giaddr field is not empty). It uses the subnet information in the giaddr field to determine the appropriate scope. If it has a scope defined for that subnet and has an IP available in that scope, it will send a DHCPOFFER packet directly to Router1. Router1 will broadcast that packet on Segment2.

The same relay procedure is used for any other broadcast packets involved in the DHCP lease procedure.

~~~~~~~~~~~~~~~~~~~~~~~~~
Note. There is another procedure that can be used by DHCP/bootp relay agents, where the packets are broadcast on attached segments (instead of being sent directly to the DHCP server), but the one described above is more efficient and common (and the one used by MS DHCP relay agents).

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