From today's perspective, it is impossible to imagine a modern network infrastructure without the Dynamic Host Configuration Protocol.
If DHCP is activated, it enables automated IP assignment in a network. Especially in larger networks, such as company networks but also in common home networks, such as IP releases via the Fritzbox's DHCP service, the standard for assigning IP to end devices is now automatically configured and set.
This means that manual IP assignment no longer needs to be carried out. The protocol not only takes care of assigning an IP to a device, but also automatically supplies the most important network parameters (more later). This protocol works at Layer 7 (Application Layer) of the OSI model.
The Dynamic Configuration Host Protocol works on the client-server principle. When a client is integrated into a network, it normally requests an IP configuration from an associated DHCP server. The already configured server has a so-called pool (range) of IP addresses that it can assign.
In order for the client to have an IP address, it must communicate with the DHCP server. However, this is initially not possible directly. This is because the client does not have a valid IP address, subnet mask or even gateway through which the client can reach the server. The only thing the client can show is its MAC address.
The following explains the individual steps of how the client establishes a connection to the DHCP and receives an IP configuration from the server. This procedure is also known as the “DORA” principle.
So that the client can reach the associated DHCP server, the client sends a UDP packet with a broadcast request (on layer 2 and layer 3) and the source address 0.0.0.0. (see Figure 1) In short, broadcast means that the packet is sent to all accessible devices within a network and the device being searched for responds. The remaining devices simply discard the packet.
If the DHCP server is not located in the same subnet as the requesting client, the request must originate from the client via a DHCP relay agent processed because broadcast requests are not routed beyond a subnet. The relay agent is usually implemented on a router or switch with a routing function and sends the client's request in the Uni-Cast to the requested DHCP server.
The server responds with an offer. It suggests a free IP address to the client and sends this back to the client together with other important network parameters (see later) using a MAC unicast (assuming the server is in the same subnet as the requesting client).
If the DHCP server is in a different subnet than the requesting client, the server sends its information back to the DHCP relay agent in unicast, which then sends it to the desired client in MAC unicast. (see Figure 2).
In order to check whether the proposed IP address that was provided by the server is valid or whether another client has been assigned this IP address in the meantime, the requesting client uses an ARP request to check whether the existing IP address is still valid. If this is the case, the client sends a request back to the server and asks for the configuration.
Depending on the configuration, the following network parameters can be included:
All this data in the configuration is called “LEASE”. This LEASE is only valid for a certain period of time. This means that the client is only provided with the configuration for a certain period of time.
After approximately 50% of the lease duration, the client sends another request in Uni-Cast to the DHCP server (see Figure 2) and asks for a lease renewal. If the lease is still valid, the DHCP server sends confirmation of the renewal of the lease using an acknowledge. The lease will therefore be valid again.
The allocation of addresses can be tracked in three different ways:
The IP addresses are permanently assigned based on the MAC addresses. The address is assigned for an unlimited period of time. An example of an application would be a printer that should always be accessible at the same address.
The DHCP server has a range (pool) of IP addresses. Once the address from this range has been assigned to a client, it belongs to that client indefinitely, because here too the IP address is bound to the MAC address. This mapping is not lost even if the client is powered off because the mapping is stored in the DHCP server's cache.
If the requesting client does not receive a DHCP configuration because the service is not available or has even failed, the client uses a so-called APIPA address. (Automatic Private IP Addressing). This enables the client to continue working locally. However, it usually does not establish a valid connection to the network. (unless other clients also have an APIPA address). The client tries to obtain a valid address every 10 minutes. APIPA is also used for troubleshooting.
The area where APIPA is located is: 169.254.XX /16. (Class B)
We use cookies, and Google reCAPTCHA, which loads Google Fonts and communicates with Google servers. By continuing to use our website, you agree to the use of cookies and our privacy policy.