DHCPv4 Relay Agent High Level Design#1938
Merged
yaqiangz merged 6 commits intosonic-net:masterfrom Aug 14, 2025
Merged
Conversation
Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>
Collaborator
|
/azp run |
|
No pipelines are associated with this pull request. |
Collaborator
|
/azp run |
|
No pipelines are associated with this pull request. |
Collaborator
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
Collaborator
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
Collaborator
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
yaqiangz
reviewed
Mar 17, 2025
Contributor
|
Hi @lolyu could you please help to check the dual tor part? |
369782f to
1dba737
Compare
Collaborator
|
/azp run |
|
No pipelines are associated with this pull request. |
|
Hi @yaqiangz , @saiarcot895 , @lguohan , could you please create the new repo mentioned in this HLD( https://github.com/sonic-net/sonic-dhcpv4-relay) to open code PR? |
This was referenced Apr 16, 2025
There was a problem hiding this comment.
Maybe detailing the type of OFFER packet(unicast) is more friendly
|
|
||
| - **DHCP Acknowledgment (ACK):** The DHCP server responds with a DHCP Ack message, setting the destination IP address to the relay agent's IP address (giaddr). Upon receiving this message, the DHCP relay agent updates the packet's fields similar to the Offer message and forwards it as a unicast message to the DHCP client, completing the DHCP transaction. | ||
|
|
||
| <div align="center"> <img src=images/DHCPv4_Relay_Basic_Flow.png width=600 /> </div> |
There was a problem hiding this comment.
offer packet from server to relay agent will also be unicast, typo?
|
|
||
| DHCPv4 relay process will run in the dhcp_relay container along with DHCPv6 processes and DhcpMon. A single instance of the process will handle DHCPv4 relay functionality of all the VLANs that are configured. This process will listen to Redis for all the necessary configuration updates and will not require restarting of the container. The design is split into 3 sub-modules and the following diagram provides an overview of how they interact with each other: | ||
|
|
||
| <div align="center"> <img src=images/DHCPv4_Relay_sequence_diagram.png width=700 /> </div> |
There was a problem hiding this comment.
This diagram needs to be updated with the latest changes(COUNTERS_DB etc.)?
9 tasks
8 tasks
Blueve
pushed a commit
to sonic-net/sonic-utilities
that referenced
this pull request
Nov 5, 2025
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks. With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938). What I did Added dependency checks in SONiC config CLI to prevent deletion of interfaces, VRFs, and VLANs that are in use by DHCPv4 relay configurations. Added/updated unit tests. How I did it Implemented a new function check_dhcpv4_relay_dependencies to check if an interface or VRF is referenced in the DHCPV4_RELAY table. Called this function before allowing deletion of portchannels, loopbacks, VRFs, and VLANs. Modified the VLAN deletion logic to block removal if the VLAN is present in the DHCPV4_RELAY table. Extended the test suite to verify that deletion is blocked when dependencies exist and allowed after cleanup. How to verify it Run the updated unit tests: they now include cases where deletion of interfaces, VRFs, or VLANs in use by DHCPv4 relay is attempted and should fail. Manually test by configuring DHCPv4 relay on an interface/VRF/VLAN, then attempt to delete it using the CLI; the command should fail with an appropriate error message. After removing the DHCPv4 relay configuration, deletion should succeed.
yxieca
pushed a commit
to sonic-net/sonic-buildimage
that referenced
this pull request
Nov 10, 2025
Why I did it Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks. With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938). Docker changes PR : #22486 How I did it Included new commands to support dhcpv4_relay in dockers/docker-dhcp-relay folder. Corresponding cli-plugin-tests are included. How to verify it Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938) Test it with real client/server with IPv4 or use the sonic-mgmt suite Co-authored-by: Prashant Srivastava <srivastavaprashant829@gmail.com>
gordon-nexthop
pushed a commit
to nexthop-ai/sonic-utilities
that referenced
this pull request
Nov 25, 2025
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks. With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938). What I did Added dependency checks in SONiC config CLI to prevent deletion of interfaces, VRFs, and VLANs that are in use by DHCPv4 relay configurations. Added/updated unit tests. How I did it Implemented a new function check_dhcpv4_relay_dependencies to check if an interface or VRF is referenced in the DHCPV4_RELAY table. Called this function before allowing deletion of portchannels, loopbacks, VRFs, and VLANs. Modified the VLAN deletion logic to block removal if the VLAN is present in the DHCPV4_RELAY table. Extended the test suite to verify that deletion is blocked when dependencies exist and allowed after cleanup. How to verify it Run the updated unit tests: they now include cases where deletion of interfaces, VRFs, or VLANs in use by DHCPv4 relay is attempted and should fail. Manually test by configuring DHCPv4 relay on an interface/VRF/VLAN, then attempt to delete it using the CLI; the command should fail with an appropriate error message. After removing the DHCPv4 relay configuration, deletion should succeed.
ashutosh-agrawal
pushed a commit
to AnantKishorSharma/sonic-buildimage
that referenced
this pull request
Nov 30, 2025
Why I did it Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks. With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938). Docker changes PR : sonic-net#22486 How I did it Included new commands to support dhcpv4_relay in dockers/docker-dhcp-relay folder. Corresponding cli-plugin-tests are included. How to verify it Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938) Test it with real client/server with IPv4 or use the sonic-mgmt suite Co-authored-by: Prashant Srivastava <srivastavaprashant829@gmail.com>
FengPan-Frank
pushed a commit
to FengPan-Frank/sonic-buildimage
that referenced
this pull request
Dec 4, 2025
Why I did it Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks. With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938). Docker changes PR : sonic-net#22486 How I did it Included new commands to support dhcpv4_relay in dockers/docker-dhcp-relay folder. Corresponding cli-plugin-tests are included. How to verify it Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938) Test it with real client/server with IPv4 or use the sonic-mgmt suite Co-authored-by: Prashant Srivastava <srivastavaprashant829@gmail.com> Signed-off-by: Feng Pan <fenpan@microsoft.com>
yxieca
pushed a commit
to sonic-net/sonic-buildimage
that referenced
this pull request
Dec 5, 2025
Why I did it Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks. With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938) Work item tracking Microsoft ADO (number only): How I did it Edit supervisord template to start sonic DHCPv4 relay instance when configured to do so in Config DB. Align cfg unit test to the new change. How to verify it Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938) Test it with real client/server with IPv4 or use the sonic-mgmt suite Signed-off-by: Ashutosh Agrawal <ashu@cisco.com> Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com> Co-authored-by: Ashutosh Agrawal <ashu@cisco.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com>
kewei-arista
pushed a commit
to kewei-arista/sonic-buildimage
that referenced
this pull request
Dec 8, 2025
Why I did it Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks. With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938) Work item tracking Microsoft ADO (number only): How I did it Edit supervisord template to start sonic DHCPv4 relay instance when configured to do so in Config DB. Align cfg unit test to the new change. How to verify it Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938) Test it with real client/server with IPv4 or use the sonic-mgmt suite Signed-off-by: Ashutosh Agrawal <ashu@cisco.com> Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com> Co-authored-by: Ashutosh Agrawal <ashu@cisco.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com>
hdwhdw
pushed a commit
to hdwhdw/sonic-buildimage
that referenced
this pull request
Dec 18, 2025
Why I did it Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks. With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938) Work item tracking Microsoft ADO (number only): How I did it Edit supervisord template to start sonic DHCPv4 relay instance when configured to do so in Config DB. Align cfg unit test to the new change. How to verify it Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938) Test it with real client/server with IPv4 or use the sonic-mgmt suite Signed-off-by: Ashutosh Agrawal <ashu@cisco.com> Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com> Co-authored-by: Ashutosh Agrawal <ashu@cisco.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com> Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
xwjiang-ms
pushed a commit
to xwjiang-ms/sonic-buildimage
that referenced
this pull request
Dec 22, 2025
Why I did it Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks. With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938). Docker changes PR : sonic-net#22486 How I did it Included new commands to support dhcpv4_relay in dockers/docker-dhcp-relay folder. Corresponding cli-plugin-tests are included. How to verify it Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938) Test it with real client/server with IPv4 or use the sonic-mgmt suite Co-authored-by: Prashant Srivastava <srivastavaprashant829@gmail.com> Signed-off-by: xiaweijiang <xiaweijiang@microsoft.com>
xwjiang-ms
pushed a commit
to xwjiang-ms/sonic-buildimage
that referenced
this pull request
Dec 22, 2025
Why I did it Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks. With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938) Work item tracking Microsoft ADO (number only): How I did it Edit supervisord template to start sonic DHCPv4 relay instance when configured to do so in Config DB. Align cfg unit test to the new change. How to verify it Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938) Test it with real client/server with IPv4 or use the sonic-mgmt suite Signed-off-by: Ashutosh Agrawal <ashu@cisco.com> Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com> Co-authored-by: Ashutosh Agrawal <ashu@cisco.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com> Signed-off-by: xiaweijiang <xiaweijiang@microsoft.com>
YairRaviv
pushed a commit
to YairRaviv/sonic-utilities
that referenced
this pull request
Jan 12, 2026
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks. With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938). What I did Added dependency checks in SONiC config CLI to prevent deletion of interfaces, VRFs, and VLANs that are in use by DHCPv4 relay configurations. Added/updated unit tests. How I did it Implemented a new function check_dhcpv4_relay_dependencies to check if an interface or VRF is referenced in the DHCPV4_RELAY table. Called this function before allowing deletion of portchannels, loopbacks, VRFs, and VLANs. Modified the VLAN deletion logic to block removal if the VLAN is present in the DHCPV4_RELAY table. Extended the test suite to verify that deletion is blocked when dependencies exist and allowed after cleanup. How to verify it Run the updated unit tests: they now include cases where deletion of interfaces, VRFs, or VLANs in use by DHCPv4 relay is attempted and should fail. Manually test by configuring DHCPv4 relay on an interface/VRF/VLAN, then attempt to delete it using the CLI; the command should fail with an appropriate error message. After removing the DHCPv4 relay configuration, deletion should succeed.
jasonbridges
pushed a commit
to jasonbridges/sonic-buildimage
that referenced
this pull request
Jan 22, 2026
Why I did it Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks. With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938) Work item tracking Microsoft ADO (number only): How I did it Edit supervisord template to start sonic DHCPv4 relay instance when configured to do so in Config DB. Align cfg unit test to the new change. How to verify it Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938) Test it with real client/server with IPv4 or use the sonic-mgmt suite Signed-off-by: Ashutosh Agrawal <ashu@cisco.com> Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com> Co-authored-by: Ashutosh Agrawal <ashu@cisco.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com>
ashutosh-agrawal
added a commit
to ashutosh-agrawal/sonic-buildimage
that referenced
this pull request
Feb 5, 2026
Why I did it Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks. With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938) Work item tracking Microsoft ADO (number only): How I did it Edit supervisord template to start sonic DHCPv4 relay instance when configured to do so in Config DB. Align cfg unit test to the new change. How to verify it Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938) Test it with real client/server with IPv4 or use the sonic-mgmt suite Signed-off-by: Ashutosh Agrawal <ashu@cisco.com> Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com> Co-authored-by: Ashutosh Agrawal <ashu@cisco.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com>
FengPan-Frank
pushed a commit
to FengPan-Frank/sonic-buildimage
that referenced
this pull request
Mar 6, 2026
Why I did it Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks. With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938) Work item tracking Microsoft ADO (number only): How I did it Edit supervisord template to start sonic DHCPv4 relay instance when configured to do so in Config DB. Align cfg unit test to the new change. How to verify it Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938) Test it with real client/server with IPv4 or use the sonic-mgmt suite Signed-off-by: Ashutosh Agrawal <ashu@cisco.com> Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com> Co-authored-by: Ashutosh Agrawal <ashu@cisco.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com> Signed-off-by: Feng Pan <fenpan@microsoft.com>
vmittal-msft
added a commit
to sonic-net/sonic-buildimage
that referenced
this pull request
Mar 23, 2026
* [dhcp_relay] sonic dhcp relay agent for IPv4 (#22486) Why I did it Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks. With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938) Work item tracking Microsoft ADO (number only): How I did it Edit supervisord template to start sonic DHCPv4 relay instance when configured to do so in Config DB. Align cfg unit test to the new change. How to verify it Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938) Test it with real client/server with IPv4 or use the sonic-mgmt suite Signed-off-by: Ashutosh Agrawal <ashu@cisco.com> Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com> Co-authored-by: Ashutosh Agrawal <ashu@cisco.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com> * Update sonic-dhcp-relay submodule to include boost dependency fixes Signed-off-by: Ashutosh Agrawal <ashu@cisco.com> --------- Signed-off-by: Ashutosh Agrawal <ashu@cisco.com> Co-authored-by: Anant <127479400+AnantKishorSharma@users.noreply.github.com> Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com> Co-authored-by: Vineet Mittal <46945843+vmittal-msft@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This document provides a high-level design for SONiC's new DHCPv4 relay agent, which addresses limitations of the existing ISC-DHCP implementation. The document outlines the architecture, new features and configuration of the new design, and also addresses the backward compatibility concerns related to transition from isc-dhcp.
Code PRs:
sonic-dhcp-relay
yang-model
sonic-buildimage
sonic-swss-common
Testplan HLD
sonic-mgmt test
CLIs