public icon indicating copy to clipboard operation
public copied to clipboard

[OC-NI-PF Enhancement] Introduction of Match Type

Open rajatiet opened this issue 4 years ago • 2 comments

Hi OC-Team,

My name is Rajat Rastogi (Company name: Juniper Networks Inc).

While configuring policy via openconfig-network-instances on Juniper Routers, the following problem was faced. Please go through the problem statement.

Problem Statement

In the present openconfig-network-instances-policy-forwarding (OC-NI-PF) model, there is no way to specify a match-type of policy similar to OC-ACL. As you know that in OC-ACL a user can specify, acl-set type as ACL_L2, ACL_IPV4 etc. Due to these following problems are faced for a policy under network instances:

  • Based upon the type of matches L2, IPV4, IPV4 or MIXED, match-type of policy needs to be indirectly calculated.
  • CLI parsing becomes unnecessarily becomes complicated/twisted.
  • User cannot directly configure an action for a rule under a policy. The user must specify at least one match (either L2 or IPV4 or IPV6 or L4)

Proposed Solution

To handle the above issues, a match-type field needs to be introduced at the Policy level.

The match-type for a policy can be defined as below.

[edit] root@evovbrackla-RE0# set openconfig-network-instance:network-instances network-instance n1 policy-forwarding policies policy f1 config match-type ? Possible completions:   PF_MATCH_IPV4        This PF matches based on fields from ipv4 header   PF_MATCH_IPV6        This PF matches based on fields from ipv6 header   PF_MATCH_L2          This PF matches based upon fields of ethernet header   PF_MATCH_MIXED       Mixed-mode PF that specifies L2 and L3 protocol                        fields.  This mode type is not implemented by many                        routing/switching devices.   PF_MATCH_MPLS        An PF that matches on fields from the MPLS header. [edit] root@evovbrackla-RE0#

Please let me know your inputs.

Thanks and regards Rajat Rastogi

rajatiet avatar Oct 11 '21 10:10 rajatiet

Hi,

Thanks for the contribution.

Please can you (per the contribution guide) provide details of the implementation of this feature in other network operating systems?

Adding a type to the match type for the policy-forwarding seems reasonable to me, but I'd like to validate that this is something that is widely supported before proposing it as an upstream change.

thanks, r.

robshakir avatar Oct 19 '21 06:10 robshakir

Hi OC Team,

I checked on CISCO IOS (12.2) for route-map and found that under the same rule one can either ipv4, or ipv6, or ipv4 and ipv6, others as well. Below under route-map r1 and rule 1, one can configure ip and ipv6 matches.

CISCO BOX

er-cisco(config)#route-map r1 1 er-cisco(config-route-map)#match ? as-path Match BGP AS path list clns CLNS information community Match BGP community list extcommunity Match BGP/VPN extended community list interface Match first hop interface of route ip IP specific information ipv6 IPv6 specific information length Packet length local-preference Local preference for route mdt-group Match routes corresponding to MDT group metric Match metric of route mpls-label Match routes which have MPLS labels nlri BGP NLRI type policy-list Match IP policy list route-type Match route-type of route source-protocol Match source-protocol of route tag Match tag of route

er-cisco(config-route-map)#

The same is true for Arista EOS (4.26) as well.

ARISTA BOX

ci-arista-7280cr3(config)#route-map r1 permit 1 ci-arista-7280cr3(config-route-map-r1)#match ? aggregate-role Role in BGP contributor-aggregate relation as BGP AS number as-path BGP autonomous system path filter community Match BGP community list extcommunity Match BGP/VPN extended community list interface Interface invert-result Invert sub route map result ip Match IP specific information ipv6 Match IPv6 specific information isis IS-IS large-community Match BGP large community list local-preference BGP local preference metric Route metric metric-type Route metric type origin-as Originating autonomous system ospf OSPF route-type Route Type router-id Router ID source-protocol Source routing protocol tag Route tag

ci-arista-7280cr3(config-route-map-r1)#

So as requested kindly include match type for a policy under OC-NI-PF(openconfig-network-instance policy-forwarding).

Thanks and regards Rajat Rastogi

rajatiet avatar Dec 08 '21 09:12 rajatiet

This issue is stale because it has been open 180 days with no activity. If you wish to keep this issue active, please remove the stale label or add a comment, otherwise will be closed in 14 days.

github-actions[bot] avatar May 23 '24 02:05 github-actions[bot]