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

[Yang] Add Yang Model and tests for VNET_ROUTE_TUNNEL table - v2 #21939

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

miatttao
Copy link

@miatttao miatttao commented Mar 5, 2025

Why I did it

Added YANG model and tests for VNET_ROUTE_TUNNEL table to provide schema validation and testing capabilities for VNET route tunnel configurations.

Work item tracking
  • Microsoft ADO (number only):

How I did it

  • Edit the existing sonic-vnet.yang model to define the VNET_ROUTE_TUNNEL table schema
  • Added comprehensive test cases covering both valid and invalid configurations
  • Implemented validation for:
    • Mandatory endpoint field
    • MAC address format
    • VXLAN ID range
    • Name format (vnet_name:prefix)

How to verify it

  1. Review the YANG model against the config_db schema
  2. cd src/sonic-yang-models && python3 setup.py test
Test Cases Validated

image

Yang Model Validated (assertionError can be ignored)

image
image

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md/VNET_ROUTE_TUNNEL

@miatttao miatttao requested a review from qiluo-msft as a code owner March 5, 2025 18:22
Copy link

linux-foundation-easycla bot commented Mar 5, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@miatttao
Copy link
Author

miatttao commented Mar 7, 2025

03/06: Merged the latest changes from master to rerun the auto-cancelled pipeline.

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@miatttao miatttao requested a review from anish-n March 7, 2025 22:10
@miatttao
Copy link
Author

miatttao commented Mar 7, 2025

03/07 a0be257 passed all pipeline checks.
Changed ip_address type

type yang:mac-address;
}

leaf vxlanid {
Copy link
Contributor

Choose a reason for hiding this comment

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

could you change this to vni. Upon checking sonic-swss I see that this should be called vni:
https://github.com/sonic-net/sonic-swss/blob/master/orchagent/vnetorch.cpp#L2733

@prsunny should we update the HLD https://github.com/sonic-net/SONiC/blob/gh-pages/doc/vxlan/Vxlan_hld.md to say that the tunnel route field is vni vs vxlandid?
image

Copy link
Author

Choose a reason for hiding this comment

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

Hi Anish, for a specific vnet_route_tunnel, can the vni in VNET_ROUTE_TABLE overwrite the base vni in VNET_TABLE? Or do they have to be the same? See below for reference. Thanks!

image
image

Copy link
Contributor

Choose a reason for hiding this comment

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

The vni in VNET_ROUTE_TUNNEL_TABLE overrides the base vni in VNET_TABLE for any traffic destined to the IP of prefix in VNET_ROUTE_TUNNEL_TABLE. It is also an optional field, so if none is provided the default VNET_TABLE vni is used for the traffic.

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.

3 participants