diff --git a/doc/dhcp_server/images/dhcp_process_release.png b/doc/dhcp_server/images/dhcp_process_release.png new file mode 100644 index 0000000000..7976df6dcc Binary files /dev/null and b/doc/dhcp_server/images/dhcp_process_release.png differ diff --git a/doc/dhcp_server/images/dhcp_process_renew.png b/doc/dhcp_server/images/dhcp_process_renew.png new file mode 100644 index 0000000000..bff062a3e6 Binary files /dev/null and b/doc/dhcp_server/images/dhcp_process_renew.png differ diff --git a/doc/dhcp_server/port_based_dhcp_server_high_level_design.md b/doc/dhcp_server/port_based_dhcp_server_high_level_design.md index ad336ce2bc..43d83916d5 100644 --- a/doc/dhcp_server/port_based_dhcp_server_high_level_design.md +++ b/doc/dhcp_server/port_based_dhcp_server_high_level_design.md @@ -1,4 +1,4 @@ -# Port Based DHCP_SERVER in SONiC +# IPv4 Port Based DHCP_SERVER in SONiC # High Level Design Document **Rev 0.1** @@ -82,32 +82,27 @@ Configuration of DHCP server feature can be done via: * SONiC CLI # 2 Functionality -DHCP server listens to port 68 and waits for messages from client. DHCP server and DHCP client complete IP address assignment through four-step packet interaction: -1. Discover +DHCP server listens to port 68 and waits for messages from client. Below are three common scenarios: - DHCP client requesting DHCP IP for the first time does not know the IP address of DHCP server, and sends a DHCP DISCOVER packet in broadcast mode. +**1) Establish new lease** -2. Offer - - DHCP server performs matching after receiving the DHCP DISCOVER packet, selects an available IP address for allocation according to the configuration, and sends a DHCP OFFER packet. - -3. Request +
- After DHCP client receives the OFFER packet, it sends a DHCP REQUEST packet in the form of broadcast, which contains information such as the DHCP server identifier and client address selected by the client. +**2) Renew old lease** -4. Acknowledge +
- After receiving the REQUEST packet from the client, the DHCP server responds with a DHCP ACK, indicating that the IP address requested in the REQUEST packet has been allocated successfully. +**3) Release old lease** -
+
# 3 Design ## 3.1 Design Overview The design overview at a high level is as below. The details are explained in the following subsections. - Configuration tables for the DHCP server entries. +- State tables for the DHCP server counter and lease entries. - Design is centered around the dnsmasq insides dhcp_relay container. - Configuration file for dnsmasq is generated by related configuration tables. -- State tables for the DHCP server counter and lease entries. ## 3.2 DB Changes ### 3.2.1 Config DB @@ -394,8 +389,6 @@ Below sequence figure describes the work flow how dnsmasq updates lease table wh
### 3.6.4 Count Table Update Flow -This sequence figure describe the update work flow for updating packet counter table in STATE_DB. - Below sequence figure describes the work flow about server logging process while sending or receiving DHCP packets.