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

Static route next network-instance option #1259

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

Conversation

rszarecki
Copy link
Contributor

Change Scope

This change introduces new option for static route, allowing further destination lookup in context of other network-instance.

module: openconfig-network-instance
  +--rw network-instances
     +--rw network-instance* [name]
        +--rw protocols
           +--rw protocol* [identifier name]
              +--rw static-routes
                 +--rw static* [prefix]
                    +--rw next-network-instance
                       +--rw config
                       |  +--rw next-network-instance?   -> ../../../../../../../config/name
                       +--rw state
                          +--rw next-network-instance?   -> ../../../../../../../state/name

This change is non-disruptive.

Platform Implementations

[edit]
routing-instances {
   vpna {
       instance-type vrf;
       routing-options {
           static {
               route 0.0.0.0/0 next-table inet.0;
           }
       }
router static
vrf vrf_A
address ipv4 unicast
172.168.40.0/24 loopback 1
172.168.50.0/24 vrf vrf_B 192.168.1.2

implementation output.

@rszarecki rszarecki requested a review from a team as a code owner February 23, 2025 20:21
@dplore
Copy link
Member

dplore commented Feb 25, 2025

/gcbrun

@OpenConfigBot
Copy link

No major YANG version changes in commit 7a75980

Copy link
Member

@dplore dplore left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.

It looks like this PR needs to be caught up to the latest commit in master? It's missing the changes from earlier commits in master.

Also this PR contains commits for the uRPF changes which is probably not intended.

@@ -298,11 +304,44 @@ module openconfig-local-routing {
uses local-static-state;
}

container next-network-instance {
Copy link
Member

Choose a reason for hiding this comment

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

Should follow the precedence from the afts model where a lookup is intended to be triggered in a different, destination network-instance. The leaf used there is next-hop-group-network-instance

/network-instances/network-instance/afts/ipv6-unicast/ipv6-entry/state/next-hop-group-network-instance

A similar pattern for static-routes could be:

/network-instances/network-instance/protocols/protocol/static-routes/static/config/next-hop-group-network-instance

Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this change analogous to #1219, i.e., resolution of next-hop in a different network-instance?

If so, Isn't it better & flexible to emulate the same model here for IP routes as well? i.e., Adding a next-hop-network-instance leaf under /network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/config, same leaf should be added in next-hop/state container as well.

Please correct me if I completely misunderstood the intent of this PR.

@dplore dplore self-assigned this Feb 28, 2025
@LimeHat
Copy link

LimeHat commented Mar 1, 2025

Implementation references contain links to two different features:

  • Juniper implementation simply suggests that a hierarchical lookup (in another network instance) is performed,
  • Cisco implementation suggests that a specific next-hop is resolved in another NI (and, in addition to that, the route is active only when that next-hop is in fact resolved)

@rszarecki
Copy link
Contributor Author

Good point @LimeHat .

I was thinking of juniper-like implementation. And I do have use case for it.
One would be internet access from vpn/vrf. Other would be some prod scenario, where subset of routes only are used for uRPF.
But indeed is not same as Arista and Cisco. Probably for this NI shall be option of next-hop not of prefixes.

What is your take?

@dplore
Copy link
Member

dplore commented Mar 5, 2025

So the destination NI leaf should probably be added to the nexthops as suggested above.

For example:
/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/config/next-network-instance

We also need some additional description to clarify the behavior.

next-network-instance:

The next-hop for this static route should be looked up in the specified network-instance. For example, if the current network instance is named 'Blue' and the route destination is '1.1.1.1'  and the next-hop next-network-instance is 'DEFAULT', then 
a. a lookup for '1.1.1.1' in the network-instance 'DEFAULT' should be performed 
b. any next-hop IP address that exists in the 'DEFAULT' network-instance should be returned.  
c. the packet should be forwarded to the next-hop from step b. in network-instance 'DEFAULT'

Is that a good description on what you're looking specify @rszarecki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Ready to discuss
Development

Successfully merging this pull request may close these issues.

5 participants