Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HLD for IPv4 port based DHCP server in SONiC #1282

Merged
merged 23 commits into from
Oct 12, 2023

Conversation

yaqiangz
Copy link
Contributor

@yaqiangz yaqiangz commented Mar 14, 2023

This document describes the design details of ipv4 port based DHCP server in SONiC.

Description Repo PR title State
Add yang model sonic-buildimage [yang][dhcp_server] Add dhcp_server_ipv4 yang model GitHub issue/pull request detail
Add dhcp_server container sonic-buildimage [dhcp_server] Add dhcp_server container GitHub issue/pull request detail
Add support for dhcp_server in minigraph parser
No need any more
sonic-buildimage [minigraph] Add support for ipv4 dhcp_server in minigraph parser GitHub issue/pull request detail
Add dhcpservd sonic-buildimage [dhcp_server] Add dhcpservd to dhcp_server container GitHub issue/pull request detail
Update DHCPv4 relay start parameter when dhcp_server feature enabled sonic-buildimage sonic-net/sonic-buildimage#16947 GitHub issue/pull request detail
Support to customize unassigned DHCP options and add db monitor sonic-buildimage sonic-net/sonic-buildimage#17051 GitHub issue/pull request detail
Add dhcprelayd for dhcp_server feature sonc-buildimage sonic-net/sonic-buildimage#16947 GitHub issue/pull request detail
Use dhcprelayd to manage critical processes sonic-buildimag sonic-net/sonic-buildimage#17236 GitHub issue/pull request detail
Publish test plan sonic-mgmt sonic-net/sonic-mgmt#11348 GitHub issue/pull request detail
Add config add CLI sonic-buildimage sonic-net/sonic-buildimage#17489 GitHub issue/pull request detail
Add config del CLI sonic-buildimage sonic-net/sonic-buildimage#17603 GitHub issue/pull request detail
Add config enable CLI sonic-buildimage sonic-net/sonic-buildimage#17605 GitHub issue/pull request detail
Add config update CLI sonic-buildimage sonic-net/sonic-buildimage#17736 GitHub issue/pull request detail
Add config range add/del/update CLI sonic-buildimage sonic-net/sonic-buildimage#17741 GitHub issue/pull request detail
Add config option add/del CLI sonic-buildimage sonic-net/sonic-buildimage#18013 GitHub issue/pull request detail
Add config ip bind/unbind CLI sonic-buildimage sonic-net/sonic-buildimage#17811 GitHub issue/pull request detail
Add config option bind/unbind CLI sonic-buildimage sonic-net/sonic-buildimage#18013 GitHub issue/pull request detail
Add show info CLI sonic-buildimage sonic-net/sonic-buildimage#17468 GitHub issue/pull request detail
Add show range CLI sonic-buildimage sonic-net/sonic-buildimage#17262 GitHub issue/pull request detail
Add show lease CLI sonic-buildimage sonic-net/sonic-buildimage#17125 GitHub issue/pull request detail
Add show port CLI sonic-buildimage sonic-net/sonic-buildimage#17491 GitHub issue/pull request detail
Add show option CLI sonic-buildimage sonic-net/sonic-buildimage#17469 GitHub issue/pull request detail

@yaqiangz yaqiangz force-pushed the master_dhcp_server_hld branch 2 times, most recently from 82ec39e to c2e4c6b Compare April 13, 2023 08:12
@yaqiangz yaqiangz force-pushed the master_dhcp_server_hld branch 3 times, most recently from 065541e to d5d7e5b Compare May 26, 2023 08:29
@yaqiangz yaqiangz force-pushed the master_dhcp_server_hld branch 4 times, most recently from 0450c90 to 8558ed3 Compare June 15, 2023 07:08
@yaqiangz yaqiangz force-pushed the master_dhcp_server_hld branch 3 times, most recently from 42a7344 to 697e2a5 Compare September 26, 2023 12:02
@zhangyanzhao
Copy link
Collaborator


1. Relatively more secure and stable, if other no-configured interface requests IP, it will not be assigned.
2. Assigning IP based on port can quickly complete a self-made network without external information input.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a out of scope section as well to call out specific cases like "MCLAG" or any other , thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added Design considerations section

- [Design](#design)
- [Design Overview](#design-overview)
- [Container](#container)
- [DHCP Server Daemon](#dhcp-server-daemon)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this HLD replacing the original dhcp relay container functionality? or will dhcp server and relay functionality coexists? if it co exists do you see any conflicts with dhcp server and dhcp relay functions?

Copy link
Contributor Author

@yaqiangz yaqiangz Oct 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This HLD wouldn't replace the original dhcp relay container functionality. In the scenario of disabling dhcp_server feature, functionality of dhcp_relay is exactly the same as before. Currently only support enabling dhcp_server per switch, means functionality of dhcp_relay cannot work with functionality dhcp_server. We will add restrictions in CLI to prevent users from configuring dhcp_relay when dhcp_server feature is enabled. Maybe add support in future releases for enabling dhcp_server feature per vlan, means enable dhcp_server in one vlan and enable dhcp_relay in other vlan.

# About this Manual

This document describes the design details of **ipv4 port based DHCP server** feature.
Dynamic Host Configuration Protocol (DHCP) server is used to centrally manage and configure IP addresses of clients dynamically. When server receives requests from DHCP-enabled clients, it would offer information to client about IP address, subnet mask, gateway etc.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you could mention the exact use-case for this feature, would be helpful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added, pls refer to pic in Design considerations section

@yaqiangz yaqiangz force-pushed the master_dhcp_server_hld branch 2 times, most recently from 0cb1d89 to 8c88e58 Compare October 10, 2023 10:43
Copy link
Collaborator

@ridahanif96 ridahanif96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add me as reviewer of this HLD code PRs as well. thanks!

@zhangyanzhao zhangyanzhao merged commit 6037ad7 into sonic-net:master Oct 12, 2023
1 check passed
yxieca pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Oct 20, 2023
Why I did it
Part implementation of dhcp_server. HLD: sonic-net/SONiC#1282.
Add dhcpservd to dhcp_server container.

How I did it
Add installing required pkg (psutil) in Dockerfile.
Add copying required file to container in Dockerfile (kea-dhcp related and dhcpservd related)
Add critical_process and supervisor config.
Add support for generating kea config (only in dhcpservd.py) and updating lease table (in dhcpservd.py and lease_update.sh)

How to verify it
Build image with setting INCLUDE_DHCP_SERVER to y and enabled dhcp_server feature after installed image, container start as expected.
Enter container and found that all processes defined in supervisor configuration running as expected.
Kill processes defined in critical_processes, container exist.
yxieca pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Nov 2, 2023
Add support in dhcp_relay container for dhcp_server_ipv4 feature. HLD: sonic-net/SONiC#1282
yxieca pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Nov 16, 2023
…vd (#17051)

Why I did it
Add config_db monitor and customize options for dhcpservd. HLD: sonic-net/SONiC#1282

Work item tracking
Microsoft ADO (number only): 25600859
How I did it
Add support to customize unassigned DHCP options. Current support type: binary, boolean, ipv4-address, string, uint8, uint16, uint32
Add db config change monitor for dhcpservd
How to verify it
Unit tests in sonic-dhcp-server all passed
@zhangyanzhao
Copy link
Collaborator

@yaqiangz what are the plan for the missed code PRs? Thanks.

@yaqiangz
Copy link
Contributor Author

yaqiangz commented Feb 5, 2024

@yaqiangz what are the plan for the missed code PRs? Thanks.

@zhangyanzhao Updated PR description. Test plan will be merged next month, and I think other PRs can be merged this week.

@zhangyanzhao
Copy link
Collaborator

all code PRs are merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: DeferredForNextRelease
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants