DHCP is the protocol that helps to assign clients' IP addresses to the LAN. The process of assigning DHCP consists of four steps--DHCPDiscover, DHCPOffer, DHCPRequest, and DHCP ACK.
DHCPDiscover is the first step where the client broadcasts in the LAN to find a DHCP server that can provide an IP for the client. Then the server will respond with a unicast DHCPOffer, where it offers a possible IP. Then, the client will broadcast the DHCPRequest with the IP to all networks, and finally the server will respond with a DHCP ACK or DHCP NAK. ACK represents a successful DHCP process, while NAK represents when the IP is not available:
The DHCP server stores the IP information to MAC bindings. If we ask for too many IPs from the DHCP server, other legitimate clients will not get an IP to connect. This is known as a DHCP starvation attack. In this recipe, we will be...