Skip to content

Commit

Permalink
Change packt img
Browse files Browse the repository at this point in the history
  • Loading branch information
yaqiangz committed Apr 13, 2023
1 parent ee5c3e8 commit 63a1ae6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/dhcp_server/images/dhcp_process_renew.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 9 additions & 16 deletions doc/dhcp_server/port_based_dhcp_server_high_level_design.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Port Based DHCP_SERVER in SONiC
# IPv4 Port Based DHCP_SERVER in SONiC
# High Level Design Document
**Rev 0.1**

Expand Down Expand Up @@ -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
<div align="center"> <img src=images/dhcp_process.png width = 520 /> </div>

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
<div align="center"> <img src=images/dhcp_process_renew.png width = 520 /> </div>

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**

<div align="center"> <img src=images/dhcp_process.png width = 520 /> </div>
<div align="center"> <img src=images/dhcp_process_release.png width = 520 /> </div>

# 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
Expand Down Expand Up @@ -394,8 +389,6 @@ Below sequence figure describes the work flow how dnsmasq updates lease table wh
<div align="center"> <img src=images/lease_update_flow_release.png width=400 /> </div>

### 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.
<div align="center"> <img src=images/packet_log_flow.png width=400 /> </div>

Expand Down

0 comments on commit 63a1ae6

Please sign in to comment.