Skip to content

Conversation

ashutosh-agrawal
Copy link
Contributor

@ashutosh-agrawal ashutosh-agrawal commented Mar 1, 2025

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

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

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.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

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.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

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
Copy link
Contributor

Hi @lolyu could you please help to check the dual tor part?

@yaqiangz yaqiangz requested a review from lolyu March 17, 2025 12:28
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.

lolyu
lolyu previously approved these changes Apr 8, 2025
Copy link
Contributor

@lolyu lolyu left a comment

Choose a reason for hiding this comment

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

The dualtor part LGTM

@AnantKishorSharma
Copy link

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?

Choose a reason for hiding this comment

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

Maybe detailing the type of OFFER packet(unicast) is more friendly

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.

@ashutosh-agrawal
Copy link
Contributor Author

@prsunny @yaqiangz @selva-nexthop @jasper-hou-micas @zhangyanzhao I've addressed all the review comments on the HLD. Also, code PRs are open and I've added the link to code PRs above. Appreciate your help in quick approval of the HLD as this feature is included in the 202505 SONiC Planing table.

yaqiangz
yaqiangz previously approved these changes May 19, 2025
Copy link
Contributor

@yaqiangz yaqiangz left a comment

Choose a reason for hiding this comment

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

LGTM

@ashutosh-agrawal
Copy link
Contributor Author

ashutosh-agrawal commented May 22, 2025

@prsunny @zhangyanzhao This HLD has approvals from @yaqiangz from MSFT and @selva-nexthop for nexthop.ai. Also @lolyu has approved the dual-TOR specific section of the design. Appreciate your help in merging the HLD and assigning approvers for the code PRs.

Code PRs:
sonic-net/sonic-dhcp-relay#67
sonic-net/sonic-buildimage#22338
sonic-net/sonic-buildimage#22486
sonic-net/sonic-swss-common#1017

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.


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

Choose a reason for hiding this comment

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

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>
Copy link

@AnantKishorSharma AnantKishorSharma Jul 1, 2025

Choose a reason for hiding this comment

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

This diagram needs to be updated with the latest changes(COUNTERS_DB etc.)?

Copy link
Contributor

@yaqiangz yaqiangz left a comment

Choose a reason for hiding this comment

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

LGTM

@yaqiangz yaqiangz merged commit f415128 into sonic-net:master Aug 14, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants