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

Two alternative ways to express source protocol condition in routing policy may requires vendor-awarness on controller side.. #931

Open
rszarecki opened this issue Jul 27, 2023 · 4 comments

Comments

@rszarecki
Copy link
Contributor

rszarecki commented Jul 27, 2023


  1. and

  2. are essentially redundant. Hence one implementation can select to support only 1. while other only 2. As result controller that generate routing policy configuration would need to denerate 2 variants and distribute according to network device capability. This contradict OpenConfig fundamental goal.

The 2. provides higer level of granularity, hence IMHO 1. (install-protocol-eq) shaould be deprecated.

One can argue that 2. reqires explicit specification of protocol's process/agent/instance identifier. This concern can be addressed by defining default value of "DEFAULT" (similiarly to [network-instance/protocols/protocol]

).

In case when multiple process/agent/instance of given protocol (e.g. ISIS) are enabled in single network-instance (what is rare deployment use case) AND intent is to match on this protocol in policy w/o discrimination by process/aget/instance (what make case even more rare), the 2. would requires explicit list of all this instances - each in sepate statement.


Note: The "name" and "identifier" are used inconsistently between

grouping protocol-instance-policy-config {
and

@rszarecki
Copy link
Contributor Author

rszarecki commented Jul 28, 2023

EXAMPLE:

Let assume deployment where we have single network-instance "DEFAULT" running one BGP instance "BGP" and one ISIS instance "isis".

/network-instances/network-instance[name=default]/protocols/protocol[identifier=BGP][name=BGP]:
{
...
}
/network-instances/network-instance[name=default]/protocols/protocol[identifier=ISIS][name=isis]:
{
...
}

Let asume further that all isis routes are "best and active" and all isis routes need to be advertised to some of BGP peers (PeerGrp0) and not advertosed to other BGP peers (PeerGrp1). Hence redistribution of all isis routes to BGP Local-RIB is enabled via /network-instances/network-instance[name=default]/table-connections
Since all isis routes are in Local-RIB they must be filtered out in export route-policy on sessions where they should NOT be advertised. This requires export policy to express consitions checking if route source is isis protocols.

using metod [1] (install-protocol-eq)

/routing-policy/policy-definitions/policy-definition[name="PeerGrp1_out"]/statements/statement[name="Reject_isis"]/conditions/config/
install-protocol-eq: ISIS
/routing-policy/policy-definitions/policy-definition[name="PeerGrp1_out"]/statements/statement[name="Reject_isis"]/actions/config/
policy-result: REJECT_ROUTE

Or using metod [2] (match-protocol-instance)

/routing-policy/policy-definitions/policy-definition[name="PeerGrp1_out"]/statements/statement[name="Reject_isis"]/conditions/match-protocol-instance/config/
protocol-identifier: isis
routing-policy/policy-definitions/policy-definition[name="PeerGrp1_out"]/statements/statement[name="Reject_isis"]/conditions/match-protocol-instance/config/
protocol-name: ISIS
/routing-policy/policy-definitions/policy-definition[name="PeerGrp1_out"]/statements/statement[name="Reject_isis"]/actions/config/
policy-result: REJECT_ROUTE

Now lets extend out example by considering that ADDITIONALY second ISIS instance is running in same network-instance - "isis2". And ther eis another subset of BGP peers (PeerGrp2) that should recive ISIS routes form instance "isis2" but not form insatnce "isis". This may not be satisfied using metod [1]. Hence here are possible implementations:

using mix of metod [1] (install-protocol-eq) and [2] (match-protocol-instance)

/routing-policy/policy-definitions/policy-definition[name="PeerGrp1_out"]/statements/statement[name="Reject_isis"]/conditions/config/
install-protocol-eq: ISIS
/routing-policy/policy-definitions/policy-definition[name="PeerGrp1_out"]/statements/statement[name="Reject_isis"]/actions/config/
policy-result: REJECT_ROUTE

/routing-policy/policy-definitions/policy-definition[name="PeerGrp2_out"]/statements/statement[name="Reject_isis"]/conditions/match-protocol-instance/config/
protocol-identifier: isis
routing-policy/policy-definitions/policy-definition[name="PeerGrp2_out"]/statements/statement[name="Reject_isis"]/conditions/match-protocol-instance/config/
protocol-name: ISIS
/routing-policy/policy-definitions/policy-definition[name="PeerGrp2_out"]/statements/statement[name="Reject_isis"]/actions/config/
policy-result: REJECT_ROUTE

Or using metod [2] (match-protocol-instance)

/routing-policy/policy-definitions/policy-definition[name="PeerGrp1_out"]/statements/statement[name="Reject_isis"]/conditions/match-protocol-instance/config/
protocol-identifier: isis
routing-policy/policy-definitions/policy-definition[name="PeerGrp1_out"]/statements/statement[name="Reject_isis"]/conditions/match-protocol-instance/config/
protocol-name: ISIS
/routing-policy/policy-definitions/policy-definition[name="PeerGrp1_out"]/statements/statement[name="Reject_isis"]/actions/config/
policy-result: REJECT_ROUTE
definition[name="PeerGrp1_out"]/statements/statement[name="Reject_isis2"]/conditions/match-protocol-instance/config/
protocol-identifier: isis2
routing-policy/policy-definitions/policy-definition[name="PeerGrp1_out"]/statements/statement[name="Reject_isis2"]/conditions/match-protocol-instance/config/
protocol-name: ISIS
/routing-policy/policy-definitions/policy-definition[name="PeerGrp1_out"]/statements/statement[name="Reject_isis2"]/actions/config/
policy-result: REJECT_ROUTE

/routing-policy/policy-definitions/policy-definition[name="PeerGrp2_out"]/statements/statement[name="Reject_isis"]/conditions/match-protocol-instance/config/
protocol-identifier: isis
routing-policy/policy-definitions/policy-definition[name="PeerGrp2_out"]/statements/statement[name="Reject_isis"]/conditions/match-protocol-instance/config/
protocol-name: ISIS
/routing-policy/policy-definitions/policy-definition[name="PeerGrp2_out"]/statements/statement[name="Reject_isis"]/actions/config/
policy-result: REJECT_ROUTE

If we asume all implementations always suppot both - [1] (install-protocol-eq) and [2] (match-protocol-instance) - then it is up to controller to decide. But this assumption is risky, and some implementations may skip one of methods - e.g. because given implementation do not support multiple instances of same protocol (so skip [2]) or because it does (so skip[1] as redundant).
Therefore deprecating [1] enforces unification.

@dplore
Copy link
Member

dplore commented Mar 19, 2024

Added to community meeting agenda on April 4, 2024

@dplore
Copy link
Member

dplore commented Apr 4, 2024

Jeff Haas has comments from OC community meeting that we need to consider the case where one wants to match on the source routing table. I think to try to make this clear, we need some example policy which one thinks install-protocol-eq is required and evaluate if that could be implemented with only the match-protocol-instance option.

@rszarecki
Copy link
Contributor Author

rszarecki commented Apr 4, 2024 via email

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

No branches or pull requests

2 participants