written 8.4 years ago by |
The Dynamic Host Configuration Protocol (DHCP) is a client/server protocol designed to provide the four pieces of information for a diskless computer or a computer that is booted for the first time.
DHCP operation:
The DHCP client and server can either be on the same network or on different networks.
Same Network :
Although the practice is not very common, the administrator may put the client and the server on the same network as shown in Figure1.
Fig1: Client and server on the same network
In this case, the operation can be described as follows:
i. The DHCP server issues a passive open command on UDP port number 67 and waits for a client.
ii. A booted client issues an active open command on port number 68. The message is encapsulated in a UDP user datagram, using the destination port number 67 and the source port number 68. The UDP user datagram, in turn, is encapsulated in an IP datagram.
iii. The client uses all 0sas the source address and all 1s as the destination address.
iv. The server responds with either a broadcast or a unicast message using UDP source port number 67 and destination port number 68. The response can be unicast because the server knows the IP address of the client.
v. It also knows the physical address of the client, which means it does not need the services of ARP for logical to physical address mapping.
Different Networks :
- As in other application-layer processes, a client can be in one network and the server in another, separated by several other networks. Figure2 shows the situation.
- The DHCP request is broadcast because the client does not know the IP address of the server.
- A broadcast IP datagram cannot pass through any router. A router receiving such a packet discards it. Recall that an IP address of all 1s is a limited broadcast address.
- To solve the problem, there is a need for an intermediary. One of the hosts (or a router that can be configured to operate at the application layer) can be used as a relay. The host in this case is called a relay agent.
- The relay agent knows the unicast address of a DHCP server and listens for broadcast messages on port 67.
- When it receives this type of packet, it encapsulates the message in a unicast datagram and sends the request to the DHCP server. The packet, carrying a unicast destination address, is routed by any router and reaches the DHCP server.
- The DHCP server knows the message comes from a relay agent because one of the fields in the request message defines the IP address ofthe relay agent. The relay agent, after receiving the reply, sends it to the DHCP client.