DHCPv4 - Dynamic Host Configuration Protocol for IPv4 ======================================================== .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow .. panels:: :column: col-lg-12 :card: shadow **What is DHCPv4?** DHCPv4 stands for Dynamic Host Configuration Protocol for IPv4. It is a network management protocol used to automatically assign IPv4 addresses and other configuration information (like subnet mask, default gateway, and DNS server) to devices on a network. .. panels:: :column: col-lg-12 :card: shadow **Why is DHCPv4 useful?** * Eliminates the need for manual IP configuration. * Reduces configuration errors caused by human input. * Efficiently manages and reuses a limited pool of IPv4 addresses. * Supports dynamic, automatic, and centralized IP address assignment. * Ideal for networks with frequent device changes (e.g., enterprise or public networks). .. panels:: :column: col-lg-12 :card: shadow **How it works (DHCPv4 process):** * **Discover** – The client broadcasts a DHCPDISCOVER message to locate a DHCP server. * **Offer** – The server replies with a DHCPOFFER message containing an IP address and configuration. * **Request** – The client replies with a DHCPREQUEST message to request the offered address. * **Acknowledge** – The server sends a DHCPACK to confirm the lease and configuration. (This is often referred to as the **DORA process**: Discover, Offer, Request, Acknowledge) .. panels:: :column: col-lg-12 :card: shadow **Where is DHCPv4 used?** * **Home Networks** – For automatic IP assignment via Wi-Fi routers. * **Enterprise Networks** – To manage large pools of IPs efficiently. * **Data Centers** – For dynamic provisioning of servers and virtual machines. * **Public Networks** – In hotels, airports, and cafes for guest access. .. panels:: :column: col-lg-12 :card: shadow **Which OSI Layer Does DHCPv4 Belong To?** * **DHCPv4 operates at the Application Layer (Layer 7)** of the OSI model. * It provides network configuration services (like IP address assignment) to applications and users. * While it uses **UDP** (Transport Layer – Layer 4) to transmit messages, the DHCP logic (like DISCOVER, OFFER, etc.) is defined at the Application Layer. * It interacts with system-level services to configure network parameters dynamically. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Topics in this section, * :ref:`Learnings in this section ` * :ref:`Terminology ` * :ref:`Version Info ` * :ref:`DHCPv4 Version&RFC Details ` * :ref:`DHCPv4 Basic Setup on Ubuntu using IPv4 ` * :ref:`DHCPv4 Protocol Packet Details ` * :ref:`DHCPv4 Usecases ` * :ref:`DHCPv4 Basic Features ` * :ref:`DHCPv4 Feature : Dynamic IP Assignment ` * :ref:`DHCPv4 Feature : Lease Management ` * :ref:`DHCPv4 Feature : Centralized Configuration ` * :ref:`DHCPv4 Feature : DHCP Options ` * :ref:`DHCPv4 Feature : Manual (Static) Assignment ` * :ref:`DHCPv4 Feature : Relay Agent Support ` * :ref:`DHCPv4 Feature : Authentication (Optional) ` * :ref:`DHCPv4 Feature : Failover Support ` * :ref:`DHCPv4 Feature : PXE Boot Support ` * :ref:`DHCPv4 Feature : Logging & Auditing ` * :ref:`Reference links ` .. _DHCPv4_step1: .. tab-set:: .. tab-item:: Learnings in this section * In this section, you are going to learn .. _DHCPv4_step2: .. tab-set:: .. tab-item:: Terminology * Terminology .. _DHCPv4_step3: .. tab-set:: .. tab-item:: Version Info * Version Info .. _DHCPv4_step5: .. tab-set:: .. tab-item:: DHCPv4 Version&RFC Details .. csv-table:: :file: ./DHCPv4/DHCPv4_Version_and_RFC_Details.csv :widths: 10,10,10,30 :header-rows: 1 .. _DHCPv4_step20: .. tab-set:: .. tab-item:: DHCPv4 Basic Setup on Ubuntu using IPv4 **Setup** .. _DHCPv4_step6: .. tab-set:: .. tab-item:: DHCPv4 Protocol Packet Details **DHCP Offer** .. csv-table:: :file: ./DHCPv4/DHCPv4_packetdetails1.csv :widths: 10,20,30,10 :header-rows: 1 **DHCP Offer** .. csv-table:: :file: ./DHCPv4/DHCPv4_packetdetails2.csv :widths: 10,20,30,10 :header-rows: 1 **DHCP Request** .. csv-table:: :file: ./DHCPv4/DHCPv4_packetdetails3.csv :widths: 10,20,30,10 :header-rows: 1 **DHCP Acknowledgment (ACK)** .. csv-table:: :file: ./DHCPv4/DHCPv4_packetdetails4.csv :widths: 10,20,30,10 :header-rows: 1 **DHCP Negative Acknowledgment (NAK)** .. csv-table:: :file: ./DHCPv4/DHCPv4_packetdetails5.csv :widths: 10,20,30,10 :header-rows: 1 **DHCP Decline** .. csv-table:: :file: ./DHCPv4/DHCPv4_packetdetails6.csv :widths: 10,20,30,10 :header-rows: 1 **DHCP Release** .. csv-table:: :file: ./DHCPv4/DHCPv4_packetdetails7.csv :widths: 10,20,30,10 :header-rows: 1 **DHCP Inform** .. csv-table:: :file: ./DHCPv4/DHCPv4_packetdetails8.csv :widths: 10,20,30,10 :header-rows: 1 .. _DHCPv4_step7: .. tab-set:: .. tab-item:: DHCPv4 Usecases .. csv-table:: :file: ./DHCPv4/DHCPv4_Use_Cases.csv :widths: 10,20,30 :header-rows: 1 .. _DHCPv4_step8: .. tab-set:: .. tab-item:: DHCPv4 Basic Features .. csv-table:: :file: ./DHCPv4/DHCPv4_Basic_Features.csv :widths: 10,10,30 :header-rows: 1 .. _DHCPv4_step9: .. tab-set:: .. tab-item:: DHCPv4 Feature : Dynamic IP Assignment **Dynamic IP Assignment - Testcases** .. csv-table:: :file: ./DHCPv4/DHCPv4_Feature1_Dynamic_IP_Assignment_Test_Cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _DHCPv4_step10: .. tab-set:: .. tab-item:: DHCPv4 Feature : Lease Management **Lease Management - Testcases** .. csv-table:: :file: ./DHCPv4/DHCPv4_Feature2_Lease_Management_Test_Cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _DHCPv4_step11: .. tab-set:: .. tab-item:: DHCPv4 Feature : Centralized Configuration **Centralized Configuration - Testcases** .. csv-table:: :file: ./DHCPv4/DHCPv4_Feature3_Centralized_Configuration_Test_Cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _DHCPv4_step12: .. tab-set:: .. tab-item:: DHCPv4 Feature : DHCP Options **DHCP Options - Testcases** .. csv-table:: :file: ./DHCPv4/DHCPv4_Feature4_DHCP_Options_Test_Cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _DHCPv4_step13: .. tab-set:: .. tab-item:: DHCPv4 Feature : Manual (Static) Assignment **Manual (Static) Assignment - Testcases** .. csv-table:: :file: ./DHCPv4/DHCPv4_Feature5_Manual_Static_Assignment_Test_Cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _DHCPv4_step14: .. tab-set:: .. tab-item:: DHCPv4 Feature : Relay Agent Support **Relay Agent Support - Testcases** .. csv-table:: :file: ./DHCPv4/DHCPv4_Feature6_Relay_Agent_Support_Test_Cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _DHCPv4_step15: .. tab-set:: .. tab-item:: DHCPv4 Feature : Authentication (Optional) **Authentication (Optional) - Testcases** .. csv-table:: :file: ./DHCPv4/DHCPv4_Feature7_Authentication_Optional_Test_Cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _DHCPv4_step16: .. tab-set:: .. tab-item:: DHCPv4 Feature : Failover Support **Failover Support - Testcases** .. csv-table:: :file: ./DHCPv4/DHCPv4_Feature8_Failover_Support_Test_Cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _DHCPv4_step17: .. tab-set:: .. tab-item:: DHCPv4 Feature : PXE Boot Support **PXE Boot Support - Testcases** .. csv-table:: :file: ./DHCPv4/DHCPv4_Feature9_PXE_Boot_Support_Test_Cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _DHCPv4_step18: .. tab-set:: .. tab-item:: DHCPv4 Feature : Logging & Auditing **Logging & Auditing - Testcases** .. csv-table:: :file: ./DHCPv4/DHCPv4_Feature10_Logging_and_Auditing_Test_Cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _DHCPv4_step19: .. tab-set:: .. tab-item:: Reference links * Reference links