From e71e2554f04de6f7b386b8bcdcdd9f60c8f52c85 Mon Sep 17 00:00:00 2001 From: dplore Date: Mon, 19 Aug 2024 09:58:04 -0700 Subject: [PATCH 01/15] move policer from te-18.1 to new test --- .../otg_tests/ingress_police_nhg/README.md | 184 ++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 feature/qos/otg_tests/ingress_police_nhg/README.md diff --git a/feature/qos/otg_tests/ingress_police_nhg/README.md b/feature/qos/otg_tests/ingress_police_nhg/README.md new file mode 100644 index 00000000000..a5da3bd0765 --- /dev/null +++ b/feature/qos/otg_tests/ingress_police_nhg/README.md @@ -0,0 +1,184 @@ +# TE-18.3 QoS scheduler with 1 rate 2 color policer, classifying on next-hop group + +## Summary + +Use the gRIBI applied ip entries from TE-18.1 gRIBI. Configure an ingress scheduler +to police traffic using a 1 rate, 2 color policer. Configure a classifier to match +traffic on a next-hop-group. Apply the configuration to a VLAN on an aggregate +interface. Send traffic to validate the policer. + +## Topology + +* [`featureprofiles/topologies/atedut_2.testbed`](https://github.com/openconfig/featureprofiles/blob/main/topologies/atedut_2.testbed) + +## Test setup + +Use TE-18.1 test environment setup. + +## Procedure + +### TE-18.3.1 Generate and push configuration + +* Generate config for 2 scheduler polices with an input rate limit. +* Generate config for 2 classifiers which match on next-hop-group. +* Generate config for 2 input policies which map the scheduler and classifers + together. +* Generate config to apply classifer and scheduler to DUT subinterface with vlan. +* Use gnmi.Replace to push the config to the DUT. + +```yaml +--- +openconfig-qos: + scheduler-policies: + - scheduler-policy: "limit_2Gb" + config: + name: "limit_2Gb" + schedulers: + - scheduler: 0 + config: + type: ONE_RATE_TWO_COLOR + sequence: 0 + one-rate-two-color: + config: + cir: 2000000000 # 2Gbit/sec + bc: 100000 # 100 kilobytes + queuing-behavior: POLICE + exceed-action: + config: + drop: TRUE + + - scheduler-policy: "limit_1Gb" + config: + name: "limit_1Gb" + schedulers: + - scheduler: 0 + config: + type: ONE_RATE_TWO_COLOR + sequence: 0 + one-rate-two-color: + config: + cir: 1000000000 # 1Gbit/sec + bc: 100000 # 100 kilobytes + queuing-behavior: POLICE + exceed-action: + config: + drop: TRUE + classifers: + - classifer: “dest_A” + config: + name: “dest_A” + terms: + - term: # repeated for address in destination A + config: + id: "match_1_dest_A" + conditions: + next-hop-group: + config: + name: "nhg_A" # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id + - classifer: “dest_B” + config: + name: “dest_B” + terms: + - term: + config: + id: "match_1_dest_B" + conditions: + next-hop-group: + config: + name: "nhg_B" # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id + + input-policies: # new OC subtree input-policies (/qos/input-policies) + - input-policy: "limit_group_A_2Gb" + config: + name: "limit_group_A_2Gb" + classifer: "dest_A" + scheduler-policy: "limit_2Gb" + - input-policy: "limit_dest_group_B_1Gb" + config: + name: "limit_dest_group_B_1Gb" + classifer: "dest_B" + scheduler-policy: "limit_1Gb" + + interfaces: # this is repeated per subinterface (vlan) + - interface: "PortChannel1" + interface-ref: + config: + subinterface: 100 + input: + config: + policies: [ # new OC leaf-list (/qos/interfaces/interface/input/config/policies) + limit_dest_group_A_2Gb + ] + interfaces: # this is repeated per subinterface (vlan) + - interface: "PortChannel1" + interface-ref: + config: + subinterface: 200 + input: + config: + policies: [ # new OC leaf-list (/qos/interfaces/interface/input/config/policies) + limit_dest_group_B_1Gb + ] + +``` + +### TE-18.3.1 Test traffic + +* Send traffic + * Send traffic from ATE port 1 to DUT for dest_A and is conforming to cir. + * Send traffic from ATE port 1 to DUT for to dest_B and is conforming to + cir. + * Validate packets are received by ATE port 2. + * Validate qos interface scheduler counters + * Validate afts next hop counters + * Validate outer packet ipv6 flow label assignment + * When the outer packet is IPv6, the flow-label should be inspected on the ATE. + * If the inner packet is IPv4, the outer IPv6 flow label should be computed based on the IPv4 5 tuple src,dst address and ports, plus protocol + * If the inner packet is IPv6, the inner flow label should be copied to the outer packet. + * Increase traffic on flow to dest_B to 2Gbps + * Validate that flow dest_B experiences ~50% packet loss (+/- 1%) + +#### OpenConfig Path and RPC Coverage + +```yaml +paths: + # qos scheduler config + /qos/scheduler-policies/scheduler-policy/config/name: + /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/config/type: + /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/one-rate-two-color/config/cir: + /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/one-rate-two-color/config/bc: + /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/one-rate-two-color/config/queuing-behavior: + /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/one-rate-two-color/exceed-action/config/drop: + + # qos classifier config + /qos/classifiers/classifier/config/name: + /qos/classifiers/classifier/terms/term/config/id: + #/qos/classifiers/classifier/terms/term/conditions/next-hop-group/config/name: # TODO: new OC leaf to be added + + # qos input-policies config - TODO: a new OC subtree (/qos/input-policies) + # /qos/input-policies/input-policy/config/name: + # /qos/input-policies/input-policy/config/classifier: + # /qos/input-policies/input-policy/config/scheduler-policy: + + # qos interface config + #/qos/interfaces/interface/subinterface/input/config/policies: # TODO: new OC leaf-list (/qos/interfaces/interface/input/config/policies) + + # qos interface scheduler counters + /qos/interfaces/interface/input/scheduler-policy/schedulers/scheduler/state/conforming-pkts: + /qos/interfaces/interface/input/scheduler-policy/schedulers/scheduler/state/conforming-octets: + /qos/interfaces/interface/input/scheduler-policy/schedulers/scheduler/state/exceeding-pkts: + /qos/interfaces/interface/input/scheduler-policy/schedulers/scheduler/state/exceeding-octets: + +rpcs: + gnmi: + gNMI.Set: + union_replace: true + replace: true + gNMI.Subscribe: + on_change: true +``` + +## Required DUT platform + +* FFF + From 2aa6e7ff86d173355e08e5e1786cf2bf1ae40496 Mon Sep 17 00:00:00 2001 From: dplore Date: Mon, 19 Aug 2024 10:01:26 -0700 Subject: [PATCH 02/15] test registry --- feature/qos/otg_tests/ingress_police_nhg/README.md | 2 +- testregistry.textproto | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/feature/qos/otg_tests/ingress_police_nhg/README.md b/feature/qos/otg_tests/ingress_police_nhg/README.md index a5da3bd0765..b88aff4c3f4 100644 --- a/feature/qos/otg_tests/ingress_police_nhg/README.md +++ b/feature/qos/otg_tests/ingress_police_nhg/README.md @@ -1,4 +1,4 @@ -# TE-18.3 QoS scheduler with 1 rate 2 color policer, classifying on next-hop group +# TE-18.2 QoS scheduler with 1 rate 2 color policer, classifying on next-hop group ## Summary diff --git a/testregistry.textproto b/testregistry.textproto index f6201525b5b..08711f0cfc4 100644 --- a/testregistry.textproto +++ b/testregistry.textproto @@ -945,6 +945,10 @@ test: { id: "TE-17.1" readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/experimental/gribi/otg_tests/vrf_policy_driven_te/README.md" } +test: { + id: "TE-18.2" + readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/qos/otg_tests/ingress_police_nhg/README.md" +} test: { id: "TE-2.1" description: "gRIBI IPv4 Entry" From 9289479a6e6951c14dfcae19fe30343d91ee4f30 Mon Sep 17 00:00:00 2001 From: dplore Date: Wed, 21 Aug 2024 12:47:26 -0700 Subject: [PATCH 03/15] revise to define policer-policies and attach to interface --- .../otg_tests/ingress_police_nhg/README.md | 86 +++++++++---------- 1 file changed, 42 insertions(+), 44 deletions(-) diff --git a/feature/qos/otg_tests/ingress_police_nhg/README.md b/feature/qos/otg_tests/ingress_police_nhg/README.md index b88aff4c3f4..4c788538068 100644 --- a/feature/qos/otg_tests/ingress_police_nhg/README.md +++ b/feature/qos/otg_tests/ingress_police_nhg/README.md @@ -29,12 +29,12 @@ Use TE-18.1 test environment setup. ```yaml --- openconfig-qos: - scheduler-policies: - - scheduler-policy: "limit_2Gb" + policer-policies: + - policer-policy: "limit_2Gb" config: name: "limit_2Gb" - schedulers: - - scheduler: 0 + policers: + - policer: 0 config: type: ONE_RATE_TWO_COLOR sequence: 0 @@ -47,11 +47,11 @@ openconfig-qos: config: drop: TRUE - - scheduler-policy: "limit_1Gb" + - policer-policy: "limit_1Gb" config: name: "limit_1Gb" - schedulers: - - scheduler: 0 + policers: + - policer: 0 config: type: ONE_RATE_TWO_COLOR sequence: 0 @@ -75,6 +75,9 @@ openconfig-qos: next-hop-group: config: name: "nhg_A" # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id + actions: + config: + policer-policy: "limit_group_A_2Gb" # new OC path needed - classifer: “dest_B” config: name: “dest_B” @@ -86,40 +89,35 @@ openconfig-qos: next-hop-group: config: name: "nhg_B" # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id - - input-policies: # new OC subtree input-policies (/qos/input-policies) - - input-policy: "limit_group_A_2Gb" - config: - name: "limit_group_A_2Gb" - classifer: "dest_A" - scheduler-policy: "limit_2Gb" - - input-policy: "limit_dest_group_B_1Gb" - config: - name: "limit_dest_group_B_1Gb" - classifer: "dest_B" - scheduler-policy: "limit_1Gb" + actions: + config: + policer-policy: "limit_group_B_1Gb" # new OC path needed interfaces: # this is repeated per subinterface (vlan) - - interface: "PortChannel1" - interface-ref: + - interface: "PortChannel1.100" config: - subinterface: 100 - input: - config: - policies: [ # new OC leaf-list (/qos/interfaces/interface/input/config/policies) - limit_dest_group_A_2Gb - ] - interfaces: # this is repeated per subinterface (vlan) - - interface: "PortChannel1" - interface-ref: + interface-id: "PortChannel1.100" + input: + classifers: + - classifier: + config: + name: "dest_A" + type: "IPV4" + policer-policy: # New OC subtree /qos/interfaces/interface/policer-policy + config: + name: "limit_2G" + - interface: "PortChannel1.200" config: - subinterface: 200 - input: - config: - policies: [ # new OC leaf-list (/qos/interfaces/interface/input/config/policies) - limit_dest_group_B_1Gb - ] - + interface-id: "PortChannel1.200" + input: + classifers: + - classifier: + config: + name: "dest_B" + type: "IPV4" + policer-policy: # New OC subtree /qos/interfaces/interface/policer-policy + config: + name: "limit_1G" ``` ### TE-18.3.1 Test traffic @@ -155,13 +153,13 @@ paths: /qos/classifiers/classifier/terms/term/config/id: #/qos/classifiers/classifier/terms/term/conditions/next-hop-group/config/name: # TODO: new OC leaf to be added - # qos input-policies config - TODO: a new OC subtree (/qos/input-policies) - # /qos/input-policies/input-policy/config/name: - # /qos/input-policies/input-policy/config/classifier: - # /qos/input-policies/input-policy/config/scheduler-policy: - - # qos interface config - #/qos/interfaces/interface/subinterface/input/config/policies: # TODO: new OC leaf-list (/qos/interfaces/interface/input/config/policies) + # qos policer config - TODO: a new OC subtree (/qos/policer-policies, essentially copying/moving policer action from schedulers) + # /qos/policer-policies/policer-policy/config/name: + # /qos/policer-policies/policer-policy/config/policers/policer/config/sequence: + # /qos/policer-policies/policer-policy/config/policers/policer/one-rate-two-color/config/cir: + # /qos/policer-policies/policer-policy/config/policers/policer/one-rate-two-color/config/bc: + # /qos/policer-policies/policer-policy/config/policers/policer/one-rate-two-color/config/cir: + # /qos/policer-policies/policer-policy/config/policers/policer/one-rate-two-color/exceed-action/config/drop: # qos interface scheduler counters /qos/interfaces/interface/input/scheduler-policy/schedulers/scheduler/state/conforming-pkts: From d1a45a03686500bdd348d878faefda1bf7797755 Mon Sep 17 00:00:00 2001 From: dplore Date: Thu, 19 Sep 2024 15:44:18 -0700 Subject: [PATCH 04/15] add gribi proto with next-hop-group-ip field --- .../otg_tests/ingress_police_nhg/README.md | 124 +++++++++++++++++- 1 file changed, 122 insertions(+), 2 deletions(-) diff --git a/feature/qos/otg_tests/ingress_police_nhg/README.md b/feature/qos/otg_tests/ingress_police_nhg/README.md index 4c788538068..99686b5ea22 100644 --- a/feature/qos/otg_tests/ingress_police_nhg/README.md +++ b/feature/qos/otg_tests/ingress_police_nhg/README.md @@ -17,7 +17,7 @@ Use TE-18.1 test environment setup. ## Procedure -### TE-18.3.1 Generate and push configuration +### TE-18.2.1 Generate and push configuration * Generate config for 2 scheduler polices with an input rate limit. * Generate config for 2 classifiers which match on next-hop-group. @@ -120,7 +120,127 @@ openconfig-qos: name: "limit_1G" ``` -### TE-18.3.1 Test traffic +### TE-18.2.2 push gRIBI aft encap rules with next-hop-group-id + +Create a gRIBI client and send this proto message to the DUT to create AFT +entries. Note the next-hop-groups here include a `next_hop_group_id` field +which matches the +`/qos/classifiers/classifier/condition/next-hop-group/config/name` leaf. + +* [TODO: OC AFT Encap PR in progress](https://github.com/openconfig/public/pull/1153) +* [TODO: gRIBI v1 protobuf defintions](https://github.com/openconfig/gribi/blob/master/v1/proto/README.md) + +```proto +network_instances: { + network_instance: { + afts { + # + # entries used for "group_A" + ipv6_unicast { + ipv6_entry { + prefix: "inner_ipv6_dst_A" # this is an IPv6 entry for the origin/inner packet + next_hop_group: 100 + } + } + ipv4_unicast { + ipv4_entry { + prefix: "ipv4_inner_dst_A" # this is an IPv4 entry for the origin/inner packet + next_hop_group: 100 + } + } + next_hop_groups { + next_hop_group { + id: 100 + next_hop_group_id: "nhg_A" # new OC path /network-instances/network-instance/afts/next-hop-groups/next-hop-group/state/next-hop-group-id + next_hops { # reference to a next-hop + next_hop: { + index: 100 + } + } + } + } + next_hops { + next_hop { + index: 100 + network_instance: "group_A" + encap-headers { + encap-header { + index: 1 + pushed_mpls_label_stack: [100,] + } + } + encap-headers { + encap-header { + index: 2 + src_ip: "outer_ipv6_src" + dst_ip: "outer_ipv6_dst_A" + dst_udp_port: "outer_dst_udp_port" + ip_ttl: "outer_ip-ttl" + dscp: "outer_dscp" + } + } + } + } + # + # entries used for "group_B" + ipv6_unicast { + ipv6_entry { + prefix: "inner_ipv6_dst_B" + next_hop_group: 200 + } + } + ipv4_unicast { + ipv4_entry { + prefix: "ipv4_inner_dst_B" + next_hop_group: 200 + } + } + next_hop_groups { + next_hop_group { + id: 200 + next_hop_group_id: "nhg_B" # new OC path /network-instances/network-instance/afts/next-hop-groups/next-hop-group/state/next-hop-group-id + next_hops { # reference to a next-hop + next_hop: { + index: 200 + } + } + } + } + next_hops { + next_hop { + index: 200 + network_instance: "group_B" + encap-headers { + encap-header { + index: 1 + type : OPENCONFIG_AFT_TYPES:MPLS + mpls { + pushed_mpls_label_stack: [200,] + } + } + } + encap-headers { + encap-header { + index: 2 + type: OPENCONFIG_AFT_TYPES:UDP + udp { + src_ip: "outer_ipv6_src" + dst_ip: "outer_ipv6_dst_B" + dst_udp_port: "outer_dst_udp_port" + ip_ttl: "outer_ip-ttl" + dscp: "outer_dscp" + } + } + } + } + } + } + } +} +``` + + +### TE-18.2.3 Test traffic * Send traffic * Send traffic from ATE port 1 to DUT for dest_A and is conforming to cir. From c9d327462e8ae65df53fff48bc733489a360f772 Mon Sep 17 00:00:00 2001 From: dplore Date: Thu, 19 Sep 2024 17:14:02 -0700 Subject: [PATCH 05/15] revise to use existing OC schema with dummy input queue --- .../otg_tests/ingress_police_nhg/README.md | 161 ++++++++++++------ 1 file changed, 111 insertions(+), 50 deletions(-) diff --git a/feature/qos/otg_tests/ingress_police_nhg/README.md b/feature/qos/otg_tests/ingress_police_nhg/README.md index 99686b5ea22..fd95b1600cb 100644 --- a/feature/qos/otg_tests/ingress_police_nhg/README.md +++ b/feature/qos/otg_tests/ingress_police_nhg/README.md @@ -19,79 +19,135 @@ Use TE-18.1 test environment setup. ### TE-18.2.1 Generate and push configuration -* Generate config for 2 scheduler polices with an input rate limit. * Generate config for 2 classifiers which match on next-hop-group. -* Generate config for 2 input policies which map the scheduler and classifers - together. +* Generate config for 2 forwarding-groups mapped to "dummy" input queues + * Note that the DUT is not required to have an input queue, the dummy queue + satisfies the OC schema which requires defining nodes mapping + classfier->fwd_group->queue->scheduler +* Generate config for 2 schedulder-policies to police traffic * Generate config to apply classifer and scheduler to DUT subinterface with vlan. * Use gnmi.Replace to push the config to the DUT. ```yaml --- openconfig-qos: - policer-policies: - - policer-policy: "limit_2Gb" - config: - name: "limit_2Gb" - policers: - - policer: 0 - config: - type: ONE_RATE_TWO_COLOR - sequence: 0 - one-rate-two-color: - config: - cir: 2000000000 # 2Gbit/sec - bc: 100000 # 100 kilobytes - queuing-behavior: POLICE - exceed-action: - config: - drop: TRUE - - - policer-policy: "limit_1Gb" - config: - name: "limit_1Gb" - policers: - - policer: 0 - config: - type: ONE_RATE_TWO_COLOR - sequence: 0 - one-rate-two-color: - config: - cir: 1000000000 # 1Gbit/sec - bc: 100000 # 100 kilobytes - queuing-behavior: POLICE - exceed-action: - config: - drop: TRUE classifers: - classifer: “dest_A” config: name: “dest_A” terms: - - term: # repeated for address in destination A + - term: config: - id: "match_1_dest_A" + id: "match_1_dest_A1" conditions: next-hop-group: config: - name: "nhg_A" # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id + name: "nhg_A1" # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id actions: config: - policer-policy: "limit_group_A_2Gb" # new OC path needed + target-group: "input_dest_A" + - term: + config: + id: "match_1_dest_A2" + conditions: + next-hop-group: + config: + name: "nhg_A2" # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id + actions: + config: + target-group: "input_dest_A" + - classifer: “dest_B” config: name: “dest_B” terms: - term: config: - id: "match_1_dest_B" + id: "match_1_dest_B1" + conditions: + next-hop-group: + config: + name: "nhg_B1" # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id + actions: + config: + target-group: "input_dest_B" + - term: + config: + id: "match_1_dest_B2" conditions: next-hop-group: config: - name: "nhg_B" # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id + name: "nhg_B2" # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id actions: config: - policer-policy: "limit_group_B_1Gb" # new OC path needed + target-group: "input_dest_B" + + + forwarding-groups: + - forwarding-group: "input_dest_A" + config: + name: "input packets" + output-queue: dummy_input_queue_A + - forwarding-group: "input_dest_B" + config: + name: "input packets" + output-queue: dummy_input_queue_B + + queues: + - queue: + config: + name: "dummy_input_queue_A" + - queue: + config: + name: "dummy_input_queue_B" + + scheduler-policies: + - scheduler-policy: + config: + name: "limit_1Gb" + schedulers: + - scheduler: + config: + sequence: 1 + type: ONE_RATE_TWO_COLOR + inputs: + - input: "my input policer 1Gb" + config: + id: "my input policer 1Gb" + # instead of QUEUE, how about a new enum, FWD_GROUP (current options are QUEUE, IN_PROFILE, OUT_PROFILE) + queue: dummy_input_queue_A + one-rate-two-color: + config: + cir: 1000000000 # 1Gbit/sec + bc: 100000 # 100 kilobytes + queuing-behavior: POLICE + exceed-action: + config: + drop: TRUE + + - scheduler-policy: + config: + name: "limit_2Gb" + schedulers: + - scheduler: + config: + sequence: 1 + type: ONE_RATE_TWO_COLOR + inputs: + - input: "my input policer 2Gb" + config: + id: "my input policer 2Gb" + # instead of QUEUE, how about a new enum, FWD_GROUP (current options are QUEUE, IN_PROFILE, OUT_PROFILE) + input-type: QUEUE + queue: dummy_input_queue_B + one-rate-two-color: + config: + cir: 2000000000 # 2Gbit/sec + bc: 100000 # 100 kilobytes + queuing-behavior: POLICE + exceed-action: + config: + drop: TRUE interfaces: # this is repeated per subinterface (vlan) - interface: "PortChannel1.100" @@ -103,9 +159,9 @@ openconfig-qos: config: name: "dest_A" type: "IPV4" - policer-policy: # New OC subtree /qos/interfaces/interface/policer-policy - config: - name: "limit_2G" + scheduler-policy: + state: + name: limit_group_A_1Gb - interface: "PortChannel1.200" config: interface-id: "PortChannel1.200" @@ -115,9 +171,14 @@ openconfig-qos: config: name: "dest_B" type: "IPV4" - policer-policy: # New OC subtree /qos/interfaces/interface/policer-policy - config: - name: "limit_1G" + scheduler-policy: + state: + name: limit_group_B_2Gb + + scheduler-policy: + state: + name: limit_group_A_1Gb + ``` ### TE-18.2.2 push gRIBI aft encap rules with next-hop-group-id From b4b9f6b0961268849da12aa1c40beeb62f94e6b2 Mon Sep 17 00:00:00 2001 From: dplore Date: Fri, 27 Sep 2024 18:55:17 -0700 Subject: [PATCH 06/15] revise proto format --- .../otg_tests/ingress_police_nhg/README.md | 173 +++++++----------- 1 file changed, 64 insertions(+), 109 deletions(-) diff --git a/feature/qos/otg_tests/ingress_police_nhg/README.md b/feature/qos/otg_tests/ingress_police_nhg/README.md index fd95b1600cb..3fce5d16ecf 100644 --- a/feature/qos/otg_tests/ingress_police_nhg/README.md +++ b/feature/qos/otg_tests/ingress_police_nhg/README.md @@ -2,7 +2,7 @@ ## Summary -Use the gRIBI applied ip entries from TE-18.1 gRIBI. Configure an ingress scheduler +Use the gRIBI applied IP entries from TE-18.1 gRIBI. Configure an ingress scheduler to police traffic using a 1 rate, 2 color policer. Configure a classifier to match traffic on a next-hop-group. Apply the configuration to a VLAN on an aggregate interface. Send traffic to validate the policer. @@ -23,9 +23,9 @@ Use TE-18.1 test environment setup. * Generate config for 2 forwarding-groups mapped to "dummy" input queues * Note that the DUT is not required to have an input queue, the dummy queue satisfies the OC schema which requires defining nodes mapping - classfier->fwd_group->queue->scheduler -* Generate config for 2 schedulder-policies to police traffic -* Generate config to apply classifer and scheduler to DUT subinterface with vlan. + classfier->forwarding-group->queue->scheduler +* Generate config for 2 scheduler-policies to police traffic +* Generate config to apply classifer and scheduler to DUT subinterface. (TODO: include interface config details with 802.1Q tags) * Use gnmi.Replace to push the config to the DUT. ```yaml @@ -42,7 +42,7 @@ openconfig-qos: conditions: next-hop-group: config: - name: "nhg_A1" # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id + name: "nhg_A1" # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id (what about MBB / gribi is not transactional, a delete might fail and and add might succeed) actions: config: target-group: "input_dest_A" @@ -82,15 +82,15 @@ openconfig-qos: config: target-group: "input_dest_B" - + # TODO: Add link to OC qos overview documentation, pending: https://github.com/openconfig/public/pull/1190/files?short_path=11f0b86#diff-11f0b8695aa64acdd535b0d47141c0a373e01f63099a423a21f61a542eda0052 forwarding-groups: - forwarding-group: "input_dest_A" config: - name: "input packets" + name: "input_dest_A" output-queue: dummy_input_queue_A - forwarding-group: "input_dest_B" config: - name: "input packets" + name: "input_dest_B" output-queue: dummy_input_queue_B queues: @@ -114,6 +114,7 @@ openconfig-qos: - input: "my input policer 1Gb" config: id: "my input policer 1Gb" + input-type: QUEUE # instead of QUEUE, how about a new enum, FWD_GROUP (current options are QUEUE, IN_PROFILE, OUT_PROFILE) queue: dummy_input_queue_A one-rate-two-color: @@ -181,7 +182,7 @@ openconfig-qos: ``` -### TE-18.2.2 push gRIBI aft encap rules with next-hop-group-id +### TE-18.2.2 push gRIBI AFT encapsulation rules with next-hop-group-id Create a gRIBI client and send this proto message to the DUT to create AFT entries. Note the next-hop-groups here include a `next_hop_group_id` field @@ -192,114 +193,68 @@ which matches the * [TODO: gRIBI v1 protobuf defintions](https://github.com/openconfig/gribi/blob/master/v1/proto/README.md) ```proto -network_instances: { - network_instance: { - afts { - # - # entries used for "group_A" - ipv6_unicast { - ipv6_entry { - prefix: "inner_ipv6_dst_A" # this is an IPv6 entry for the origin/inner packet - next_hop_group: 100 - } - } - ipv4_unicast { - ipv4_entry { - prefix: "ipv4_inner_dst_A" # this is an IPv4 entry for the origin/inner packet - next_hop_group: 100 - } - } - next_hop_groups { - next_hop_group { - id: 100 - next_hop_group_id: "nhg_A" # new OC path /network-instances/network-instance/afts/next-hop-groups/next-hop-group/state/next-hop-group-id - next_hops { # reference to a next-hop - next_hop: { - index: 100 - } - } - } - } - next_hops { - next_hop { - index: 100 - network_instance: "group_A" - encap-headers { - encap-header { - index: 1 - pushed_mpls_label_stack: [100,] - } - } - encap-headers { - encap-header { - index: 2 - src_ip: "outer_ipv6_src" - dst_ip: "outer_ipv6_dst_A" - dst_udp_port: "outer_dst_udp_port" - ip_ttl: "outer_ip-ttl" - dscp: "outer_dscp" - } - } - } - } - # - # entries used for "group_B" - ipv6_unicast { - ipv6_entry { - prefix: "inner_ipv6_dst_B" - next_hop_group: 200 - } +# +# aft entries used for network instance "NI_A" +IPv6Entry {2001:DB8:2::2/128 (NI_A)} -> NHG#100 (DEFAULT VRF) +IPv4Entry {203.0.113.2/32 (NI_A)} -> NHG#100 (DEFAULT VRF) -> { + {NH#101, DEFAULT VRF} +} + +# this nexthop specifies a MPLS in UDP encapsulation +NH#101 -> { + encap-headers { + encap-header { + index: 1 + mpls { + pushed_mpls_label_stack: [101,] } - ipv4_unicast { - ipv4_entry { - prefix: "ipv4_inner_dst_B" - next_hop_group: 200 - } + } + encap-header { + index: 2 + udp { + src_ip: "outer_ipv6_src" + dst_ip: "outer_ipv6_dst_A" + dst_udp_port: "outer_dst_udp_port" + ip_ttl: "outer_ip-ttl" + dscp: "outer_dscp" } - next_hop_groups { - next_hop_group { - id: 200 - next_hop_group_id: "nhg_B" # new OC path /network-instances/network-instance/afts/next-hop-groups/next-hop-group/state/next-hop-group-id - next_hops { # reference to a next-hop - next_hop: { - index: 200 - } - } - } + } + } + next_hop_group_id: "nhg_A" # new OC path /network-instances/network-instance/afts/next-hop-groups/next-hop-group/state/ + network_instance: "DEFAULT" +} + +# +# entries used for network-instance "NI_B" +IPv6Entry {2001:DB8:2::2/128 (NI_B)} -> NHG#200 (DEFAULT VRF) +IPv4Entry {203.0.113.2/32 (NI_B)} -> NHG#200 (DEFAULT VRF) -> { + {NH#201, DEFAULT VRF} +} + +NH#201 -> { + encap-headers { + encap-header { + index: 1 + mpls { + pushed_mpls_label_stack: [201,] } - next_hops { - next_hop { - index: 200 - network_instance: "group_B" - encap-headers { - encap-header { - index: 1 - type : OPENCONFIG_AFT_TYPES:MPLS - mpls { - pushed_mpls_label_stack: [200,] - } - } - } - encap-headers { - encap-header { - index: 2 - type: OPENCONFIG_AFT_TYPES:UDP - udp { - src_ip: "outer_ipv6_src" - dst_ip: "outer_ipv6_dst_B" - dst_udp_port: "outer_dst_udp_port" - ip_ttl: "outer_ip-ttl" - dscp: "outer_dscp" - } - } - } - } + } + encap-header { + index: 2 + udp { + src_ip: "outer_ipv6_src" + dst_ip: "outer_ipv6_dst_B" + dst_udp_port: "outer_dst_udp_port" + ip_ttl: "outer_ip-ttl" + dscp: "outer_dscp" } } } + next_hop_group_id: "nhg_B" # new OC path /network-instances/network-instance/afts/next-hop-groups/next-hop-group/state/ + network_instance: "DEFAULT" } -``` +``` ### TE-18.2.3 Test traffic From 2fbc82f313e9fd00a84117375517a8d9b535fc49 Mon Sep 17 00:00:00 2001 From: dplore Date: Fri, 27 Sep 2024 19:08:05 -0700 Subject: [PATCH 07/15] revise oc paths list for qos config --- .../otg_tests/ingress_police_nhg/README.md | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/feature/qos/otg_tests/ingress_police_nhg/README.md b/feature/qos/otg_tests/ingress_police_nhg/README.md index 3fce5d16ecf..6f6dd580ae0 100644 --- a/feature/qos/otg_tests/ingress_police_nhg/README.md +++ b/feature/qos/otg_tests/ingress_police_nhg/README.md @@ -160,9 +160,9 @@ openconfig-qos: config: name: "dest_A" type: "IPV4" - scheduler-policy: - state: - name: limit_group_A_1Gb + scheduler-policy: + config: + name: limit_group_A_1Gb - interface: "PortChannel1.200" config: interface-id: "PortChannel1.200" @@ -173,13 +173,8 @@ openconfig-qos: name: "dest_B" type: "IPV4" scheduler-policy: - state: + config: name: limit_group_B_2Gb - - scheduler-policy: - state: - name: limit_group_A_1Gb - ``` ### TE-18.2.2 push gRIBI AFT encapsulation rules with next-hop-group-id @@ -259,18 +254,17 @@ NH#201 -> { ### TE-18.2.3 Test traffic * Send traffic - * Send traffic from ATE port 1 to DUT for dest_A and is conforming to cir. - * Send traffic from ATE port 1 to DUT for to dest_B and is conforming to - cir. + * Send flow A traffic from ATE port 1 to DUT for dest_A at 0.7Gbps (note cir is 1Gbps). + * Send flow B traffic from ATE port 1 to DUT for to dest_B at 1.5Gbps (note cir is 2Gbps). * Validate packets are received by ATE port 2. - * Validate qos interface scheduler counters - * Validate afts next hop counters + * Validate DUT qos interface scheduler counters count packets as conforming-pkts and conforming-octets + * Validate at OTG that 0 packets are lost on flow A and flow B * Validate outer packet ipv6 flow label assignment * When the outer packet is IPv6, the flow-label should be inspected on the ATE. * If the inner packet is IPv4, the outer IPv6 flow label should be computed based on the IPv4 5 tuple src,dst address and ports, plus protocol * If the inner packet is IPv6, the inner flow label should be copied to the outer packet. - * Increase traffic on flow to dest_B to 2Gbps - * Validate that flow dest_B experiences ~50% packet loss (+/- 1%) + * Increase traffic on flow to dest_A to 2Gbps + * Validate that flow dest_A experiences ~50% packet loss (+/- 1%) #### OpenConfig Path and RPC Coverage @@ -289,13 +283,18 @@ paths: /qos/classifiers/classifier/terms/term/config/id: #/qos/classifiers/classifier/terms/term/conditions/next-hop-group/config/name: # TODO: new OC leaf to be added - # qos policer config - TODO: a new OC subtree (/qos/policer-policies, essentially copying/moving policer action from schedulers) - # /qos/policer-policies/policer-policy/config/name: - # /qos/policer-policies/policer-policy/config/policers/policer/config/sequence: - # /qos/policer-policies/policer-policy/config/policers/policer/one-rate-two-color/config/cir: - # /qos/policer-policies/policer-policy/config/policers/policer/one-rate-two-color/config/bc: - # /qos/policer-policies/policer-policy/config/policers/policer/one-rate-two-color/config/cir: - # /qos/policer-policies/policer-policy/config/policers/policer/one-rate-two-color/exceed-action/config/drop: + # qos forwarding-groups config + /qos/forwarding-groups/forwarding-group/config/name: + /qos/forwarding-groups/forwarding-group/config/output-queue: + + # qos queue config + /qos/queues/queue/config/name: + + # qos interfaces config + /qos/interfaces/interface/config/interface-id: + /qos/interfaces/interface/input/classifiers/classifier/config/name: + /qos/interfaces/interface/input/classifiers/classifier/config/type: + /qos/interfaces/interface/input/scheduler-policy/config/name: # qos interface scheduler counters /qos/interfaces/interface/input/scheduler-policy/schedulers/scheduler/state/conforming-pkts: From 0e6f06190077204c8748376920cfa3d2a40a3cc9 Mon Sep 17 00:00:00 2001 From: dplore Date: Fri, 27 Sep 2024 19:26:33 -0700 Subject: [PATCH 08/15] revise flow label verification --- .../qos/otg_tests/ingress_police_nhg/README.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/feature/qos/otg_tests/ingress_police_nhg/README.md b/feature/qos/otg_tests/ingress_police_nhg/README.md index 6f6dd580ae0..aa0cad5d9e3 100644 --- a/feature/qos/otg_tests/ingress_police_nhg/README.md +++ b/feature/qos/otg_tests/ingress_police_nhg/README.md @@ -251,7 +251,7 @@ NH#201 -> { ``` -### TE-18.2.3 Test traffic +### TE-18.2.3 Test flow policing * Send traffic * Send flow A traffic from ATE port 1 to DUT for dest_A at 0.7Gbps (note cir is 1Gbps). @@ -259,12 +259,20 @@ NH#201 -> { * Validate packets are received by ATE port 2. * Validate DUT qos interface scheduler counters count packets as conforming-pkts and conforming-octets * Validate at OTG that 0 packets are lost on flow A and flow B - * Validate outer packet ipv6 flow label assignment - * When the outer packet is IPv6, the flow-label should be inspected on the ATE. - * If the inner packet is IPv4, the outer IPv6 flow label should be computed based on the IPv4 5 tuple src,dst address and ports, plus protocol - * If the inner packet is IPv6, the inner flow label should be copied to the outer packet. * Increase traffic on flow to dest_A to 2Gbps * Validate that flow dest_A experiences ~50% packet loss (+/- 1%) + * Stop traffic + +### TE-18.2.3 IPv6 flow label validiation + + * Send 100 packets for flow A and flow B. (Use an OTG fixed packet count flow) + * When the outer packet is IPv6, the flow-label should be inspected on the ATE. + * If the inner packet is IPv4, the outer IPv6 flow label should be computed based on the IPv4 5 tuple src,dst address and ports, plus protocol. + * If the inner packet is IPv6, the inner flow label should be copied to the outer packet. + * To validate the flow label, use the ATE to verify that the packets for + * flow A all have the same flow label + * flow B have the same flow label + * flow A and B labels do not match #### OpenConfig Path and RPC Coverage From 99b30e815c1b651f0797a62b1ea4fcca0d203561 Mon Sep 17 00:00:00 2001 From: dplore Date: Fri, 27 Sep 2024 19:56:35 -0700 Subject: [PATCH 09/15] fix yaml syntax --- .../otg_tests/ingress_police_nhg/README.md | 50 +++++++++---------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/feature/qos/otg_tests/ingress_police_nhg/README.md b/feature/qos/otg_tests/ingress_police_nhg/README.md index aa0cad5d9e3..099097f6082 100644 --- a/feature/qos/otg_tests/ingress_police_nhg/README.md +++ b/feature/qos/otg_tests/ingress_police_nhg/README.md @@ -82,7 +82,7 @@ openconfig-qos: config: target-group: "input_dest_B" - # TODO: Add link to OC qos overview documentation, pending: https://github.com/openconfig/public/pull/1190/files?short_path=11f0b86#diff-11f0b8695aa64acdd535b0d47141c0a373e01f63099a423a21f61a542eda0052 + # TODO: link to OC qos ingress policer documentation, pending: https://github.com/openconfig/public/pull/1190/files?short_path=11f0b86#diff-11f0b8695aa64acdd535b0d47141c0a373e01f63099a423a21f61a542eda0052 forwarding-groups: - forwarding-group: "input_dest_A" config: @@ -115,7 +115,6 @@ openconfig-qos: config: id: "my input policer 1Gb" input-type: QUEUE - # instead of QUEUE, how about a new enum, FWD_GROUP (current options are QUEUE, IN_PROFILE, OUT_PROFILE) queue: dummy_input_queue_A one-rate-two-color: config: @@ -138,7 +137,6 @@ openconfig-qos: - input: "my input policer 2Gb" config: id: "my input policer 2Gb" - # instead of QUEUE, how about a new enum, FWD_GROUP (current options are QUEUE, IN_PROFILE, OUT_PROFILE) input-type: QUEUE queue: dummy_input_queue_B one-rate-two-color: @@ -149,32 +147,32 @@ openconfig-qos: exceed-action: config: drop: TRUE - interfaces: # this is repeated per subinterface (vlan) - - interface: "PortChannel1.100" - config: - interface-id: "PortChannel1.100" - input: - classifers: - - classifier: - config: - name: "dest_A" - type: "IPV4" - scheduler-policy: + - interface: + config: + interface-id: "PortChannel1.100" + input: + classifiers: + - classifier: config: - name: limit_group_A_1Gb - - interface: "PortChannel1.200" - config: - interface-id: "PortChannel1.200" - input: - classifers: - - classifier: - config: - name: "dest_B" - type: "IPV4" - scheduler-policy: + name: "dest_A" + type: "IPV4" + scheduler-policy: + config: + name: "limit_group_A_1Gb" + - interface: + config: + interface-id: "PortChannel1.200" + input: + classifiers: + - classifier: config: - name: limit_group_B_2Gb + name: "dest_B" + type: "IPV4" + scheduler-policy: + config: + name: "limit_group_B_1Gb" + ``` ### TE-18.2.2 push gRIBI AFT encapsulation rules with next-hop-group-id From f5508c27da7c10a743d6414d37ff75e34acfba8a Mon Sep 17 00:00:00 2001 From: dplore Date: Thu, 3 Oct 2024 14:03:09 -0700 Subject: [PATCH 10/15] Change test id to DP-2.2 --- feature/qos/otg_tests/ingress_police_nhg/README.md | 7 ++++--- testregistry.textproto | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/feature/qos/otg_tests/ingress_police_nhg/README.md b/feature/qos/otg_tests/ingress_police_nhg/README.md index 099097f6082..2a53d34b6cb 100644 --- a/feature/qos/otg_tests/ingress_police_nhg/README.md +++ b/feature/qos/otg_tests/ingress_police_nhg/README.md @@ -1,4 +1,4 @@ -# TE-18.2 QoS scheduler with 1 rate 2 color policer, classifying on next-hop group +# DP-2.2 QoS scheduler with 1 rate 2 color policer, classifying on next-hop group ## Summary @@ -13,11 +13,11 @@ interface. Send traffic to validate the policer. ## Test setup -Use TE-18.1 test environment setup. +Use DP-2.1 test environment setup. ## Procedure -### TE-18.2.1 Generate and push configuration +### DP-2.2.1 Generate and push configuration * Generate config for 2 classifiers which match on next-hop-group. * Generate config for 2 forwarding-groups mapped to "dummy" input queues @@ -43,6 +43,7 @@ openconfig-qos: next-hop-group: config: name: "nhg_A1" # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id (what about MBB / gribi is not transactional, a delete might fail and and add might succeed) + name: "nhg_A1" # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id (what about MBB / gribi is not transactional, a delete might fail and and add might succeed) actions: config: target-group: "input_dest_A" diff --git a/testregistry.textproto b/testregistry.textproto index 19fee3d7940..da0df7d86dd 100644 --- a/testregistry.textproto +++ b/testregistry.textproto @@ -269,6 +269,10 @@ test: { readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/qos/ate_tests/wrr_traffic_test/README.md" exec: " " } +test: { + id: "DP-2.2" + readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/qos/otg_tests/ingress_police_nhg/README.md" +} test: { id: "FP-1.1" description: "Power admin DOWN/UP Test" @@ -1001,10 +1005,6 @@ test { description: "MPLS in UDP Encapsulation with QoS scheduler" readme: "" } -test: { - id: "TE-18.2" - readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/qos/otg_tests/ingress_police_nhg/README.md" -} test: { id: "TE-2.1" description: "gRIBI IPv4 Entry" From 86ad2491e3c7d49c7ca055ce77abab685ab99e01 Mon Sep 17 00:00:00 2001 From: dplore Date: Thu, 3 Oct 2024 14:06:45 -0700 Subject: [PATCH 11/15] Change test id to DP-2.2 --- feature/qos/otg_tests/ingress_police_nhg/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/feature/qos/otg_tests/ingress_police_nhg/README.md b/feature/qos/otg_tests/ingress_police_nhg/README.md index 2a53d34b6cb..da6fce5df0d 100644 --- a/feature/qos/otg_tests/ingress_police_nhg/README.md +++ b/feature/qos/otg_tests/ingress_police_nhg/README.md @@ -2,7 +2,7 @@ ## Summary -Use the gRIBI applied IP entries from TE-18.1 gRIBI. Configure an ingress scheduler +Use the gRIBI applied IP entries from DP-2.1 gRIBI. Configure an ingress scheduler to police traffic using a 1 rate, 2 color policer. Configure a classifier to match traffic on a next-hop-group. Apply the configuration to a VLAN on an aggregate interface. Send traffic to validate the policer. @@ -176,7 +176,7 @@ openconfig-qos: ``` -### TE-18.2.2 push gRIBI AFT encapsulation rules with next-hop-group-id +### DP-2.2.2 push gRIBI AFT encapsulation rules with next-hop-group-id Create a gRIBI client and send this proto message to the DUT to create AFT entries. Note the next-hop-groups here include a `next_hop_group_id` field @@ -250,7 +250,7 @@ NH#201 -> { ``` -### TE-18.2.3 Test flow policing +### DP-2.2.3 Test flow policing * Send traffic * Send flow A traffic from ATE port 1 to DUT for dest_A at 0.7Gbps (note cir is 1Gbps). @@ -262,7 +262,7 @@ NH#201 -> { * Validate that flow dest_A experiences ~50% packet loss (+/- 1%) * Stop traffic -### TE-18.2.3 IPv6 flow label validiation +### DP-2.2.3 IPv6 flow label validiation * Send 100 packets for flow A and flow B. (Use an OTG fixed packet count flow) * When the outer packet is IPv6, the flow-label should be inspected on the ATE. From c414fb9b7714c8d0c4a20b0153ae2b02717cbef1 Mon Sep 17 00:00:00 2001 From: dplore Date: Thu, 3 Oct 2024 14:09:02 -0700 Subject: [PATCH 12/15] remove cut-paste error --- feature/qos/otg_tests/ingress_police_nhg/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/feature/qos/otg_tests/ingress_police_nhg/README.md b/feature/qos/otg_tests/ingress_police_nhg/README.md index da6fce5df0d..2ccb5fb34d8 100644 --- a/feature/qos/otg_tests/ingress_police_nhg/README.md +++ b/feature/qos/otg_tests/ingress_police_nhg/README.md @@ -43,7 +43,6 @@ openconfig-qos: next-hop-group: config: name: "nhg_A1" # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id (what about MBB / gribi is not transactional, a delete might fail and and add might succeed) - name: "nhg_A1" # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id (what about MBB / gribi is not transactional, a delete might fail and and add might succeed) actions: config: target-group: "input_dest_A" From 04df4675c3d135eca583e803599d660d1f7e482b Mon Sep 17 00:00:00 2001 From: dplore Date: Thu, 3 Oct 2024 16:47:59 -0700 Subject: [PATCH 13/15] tweak proto field for udpv6 --- feature/qos/otg_tests/ingress_police_nhg/README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/feature/qos/otg_tests/ingress_police_nhg/README.md b/feature/qos/otg_tests/ingress_police_nhg/README.md index 2ccb5fb34d8..58b824fe134 100644 --- a/feature/qos/otg_tests/ingress_police_nhg/README.md +++ b/feature/qos/otg_tests/ingress_police_nhg/README.md @@ -17,7 +17,7 @@ Use DP-2.1 test environment setup. ## Procedure -### DP-2.2.1 Generate and push configuration +### DP-2.2.1 Generate and push policer configuration * Generate config for 2 classifiers which match on next-hop-group. * Generate config for 2 forwarding-groups mapped to "dummy" input queues @@ -204,7 +204,7 @@ NH#101 -> { } encap-header { index: 2 - udp { + udpv6 { src_ip: "outer_ipv6_src" dst_ip: "outer_ipv6_dst_A" dst_udp_port: "outer_dst_udp_port" @@ -234,7 +234,7 @@ NH#201 -> { } encap-header { index: 2 - udp { + udpv6 { src_ip: "outer_ipv6_src" dst_ip: "outer_ipv6_dst_B" dst_udp_port: "outer_dst_udp_port" @@ -246,7 +246,6 @@ NH#201 -> { next_hop_group_id: "nhg_B" # new OC path /network-instances/network-instance/afts/next-hop-groups/next-hop-group/state/ network_instance: "DEFAULT" } - ``` ### DP-2.2.3 Test flow policing @@ -320,4 +319,3 @@ rpcs: ## Required DUT platform * FFF - From 767d610c97c91f400072da3751d1a9ffcac71ecb Mon Sep 17 00:00:00 2001 From: dplore Date: Thu, 3 Oct 2024 16:50:14 -0700 Subject: [PATCH 14/15] convert yaml to json --- .../otg_tests/ingress_police_nhg/README.md | 405 +++++++++++------- 1 file changed, 260 insertions(+), 145 deletions(-) diff --git a/feature/qos/otg_tests/ingress_police_nhg/README.md b/feature/qos/otg_tests/ingress_police_nhg/README.md index 58b824fe134..6e772620d72 100644 --- a/feature/qos/otg_tests/ingress_police_nhg/README.md +++ b/feature/qos/otg_tests/ingress_police_nhg/README.md @@ -28,151 +28,266 @@ Use DP-2.1 test environment setup. * Generate config to apply classifer and scheduler to DUT subinterface. (TODO: include interface config details with 802.1Q tags) * Use gnmi.Replace to push the config to the DUT. -```yaml ---- -openconfig-qos: - classifers: - - classifer: “dest_A” - config: - name: “dest_A” - terms: - - term: - config: - id: "match_1_dest_A1" - conditions: - next-hop-group: - config: - name: "nhg_A1" # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id (what about MBB / gribi is not transactional, a delete might fail and and add might succeed) - actions: - config: - target-group: "input_dest_A" - - term: - config: - id: "match_1_dest_A2" - conditions: - next-hop-group: - config: - name: "nhg_A2" # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id - actions: - config: - target-group: "input_dest_A" - - - classifer: “dest_B” - config: - name: “dest_B” - terms: - - term: - config: - id: "match_1_dest_B1" - conditions: - next-hop-group: - config: - name: "nhg_B1" # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id - actions: - config: - target-group: "input_dest_B" - - term: - config: - id: "match_1_dest_B2" - conditions: - next-hop-group: - config: - name: "nhg_B2" # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id - actions: - config: - target-group: "input_dest_B" - - # TODO: link to OC qos ingress policer documentation, pending: https://github.com/openconfig/public/pull/1190/files?short_path=11f0b86#diff-11f0b8695aa64acdd535b0d47141c0a373e01f63099a423a21f61a542eda0052 - forwarding-groups: - - forwarding-group: "input_dest_A" - config: - name: "input_dest_A" - output-queue: dummy_input_queue_A - - forwarding-group: "input_dest_B" - config: - name: "input_dest_B" - output-queue: dummy_input_queue_B - - queues: - - queue: - config: - name: "dummy_input_queue_A" - - queue: - config: - name: "dummy_input_queue_B" - - scheduler-policies: - - scheduler-policy: - config: - name: "limit_1Gb" - schedulers: - - scheduler: - config: - sequence: 1 - type: ONE_RATE_TWO_COLOR - inputs: - - input: "my input policer 1Gb" - config: - id: "my input policer 1Gb" - input-type: QUEUE - queue: dummy_input_queue_A - one-rate-two-color: - config: - cir: 1000000000 # 1Gbit/sec - bc: 100000 # 100 kilobytes - queuing-behavior: POLICE - exceed-action: - config: - drop: TRUE - - - scheduler-policy: - config: - name: "limit_2Gb" - schedulers: - - scheduler: - config: - sequence: 1 - type: ONE_RATE_TWO_COLOR - inputs: - - input: "my input policer 2Gb" - config: - id: "my input policer 2Gb" - input-type: QUEUE - queue: dummy_input_queue_B - one-rate-two-color: - config: - cir: 2000000000 # 2Gbit/sec - bc: 100000 # 100 kilobytes - queuing-behavior: POLICE - exceed-action: - config: - drop: TRUE - interfaces: # this is repeated per subinterface (vlan) - - interface: - config: - interface-id: "PortChannel1.100" - input: - classifiers: - - classifier: - config: - name: "dest_A" - type: "IPV4" - scheduler-policy: - config: - name: "limit_group_A_1Gb" - - interface: - config: - interface-id: "PortChannel1.200" - input: - classifiers: - - classifier: - config: - name: "dest_B" - type: "IPV4" - scheduler-policy: - config: - name: "limit_group_B_1Gb" - +```json +{ + # + # A classifer is created to match packets belonging to certain + # next-hop-groups and map them either forwarding-group input_dest_A or + # input_dest_B + "openconfig-qos": { + "classifers": [ + { + "classifer": "“dest_A”", + "config": { + "name": "“dest_A”" + }, + "terms": [ + { + "term": null, + "config": { + "id": "match_1_dest_A1" + }, + "conditions": { + "next-hop-group": { + "config": { + # new OC path needed, string related to /afts/next-hop-groups/next-hop-group/state/next-hop-group-id + "name": "nhg_A1" + } + } + }, + "actions": { + "config": { + "target-group": "input_dest_A" + } + } + }, + { + "term": null, + "config": { + "id": "match_1_dest_A2" + }, + "conditions": { + "next-hop-group": { + "config": { + "name": "nhg_A2" + } + } + }, + "actions": { + "config": { + "target-group": "input_dest_A" + } + } + } + ] + }, + { + "classifer": "“dest_B”", + "config": { + "name": "“dest_B”" + }, + "terms": [ + { + "term": null, + "config": { + "id": "match_1_dest_B1" + }, + "conditions": { + "next-hop-group": { + "config": { + "name": "nhg_B1" + } + } + }, + "actions": { + "config": { + "target-group": "input_dest_B" + } + } + }, + { + "term": null, + "config": { + "id": "match_1_dest_B2" + }, + "conditions": { + "next-hop-group": { + "config": { + "name": "nhg_B2" + } + } + }, + "actions": { + "config": { + "target-group": "input_dest_B" + } + } + } + ] + } + ], + # + # Forwarding groups are created named input_dest_A and input_dest_B. + # These are mapped to 'fake' queues + "forwarding-groups": [ + { + "forwarding-group": "input_dest_A", + "config": { + "name": "input_dest_A", + "output-queue": "dummy_input_queue_A" + } + }, + { + "forwarding-group": "input_dest_B", + "config": { + "name": "input_dest_B", + "output-queue": "dummy_input_queue_B" + } + } + ], + "queues": [ + { + "queue": null, + "config": { + "name": "dummy_input_queue_A" + } + }, + { + "queue": null, + "config": { + "name": "dummy_input_queue_B" + } + } + ], + # + # Two scheduler policies are created, limit_1Gb and limit_2Gb + # and are associated with the dummy queue they are servicing. + "scheduler-policies": [ + { + "scheduler-policy": null, + "config": { + "name": "limit_1Gb" + }, + "schedulers": [ + { + "scheduler": null, + "config": { + "sequence": 1, + "type": "ONE_RATE_TWO_COLOR" + }, + "inputs": [ + { + "input": "my input policer 1Gb", + "config": { + "id": "my input policer 1Gb", + "input-type": "QUEUE", + "queue": "dummy_input_queue_A" + } + } + ], + "one-rate-two-color": { + "config": { + "cir": 1000000000, + "bc": 100000, + "queuing-behavior": "POLICE" + }, + "exceed-action": { + "config": { + "drop": true + } + } + } + } + ] + }, + { + "scheduler-policy": null, + "config": { + "name": "limit_2Gb" + }, + "schedulers": [ + { + "scheduler": null, + "config": { + "sequence": 1, + "type": "ONE_RATE_TWO_COLOR" + }, + "inputs": [ + { + "input": "my input policer 2Gb", + "config": { + "id": "my input policer 2Gb", + "input-type": "QUEUE", + "queue": "dummy_input_queue_B" + } + } + ], + "one-rate-two-color": { + "config": { + "cir": 2000000000, + "bc": 100000, + "queuing-behavior": "POLICE" + }, + "exceed-action": { + "config": { + "drop": true + } + } + } + } + ] + } + ], + # + # Interfaces input are mapped to the desired classifier and scheduler. + "interfaces": [ + { + "interface": null, + "config": { + "interface-id": "PortChannel1.100" + }, + "input": { + "classifiers": [ + { + "classifier": null, + "config": { + "name": "dest_A", + "type": "IPV4" + } + } + ], + "scheduler-policy": { + "config": { + "name": "limit_group_A_1Gb" + } + } + } + }, + { + "interface": null, + "config": { + "interface-id": "PortChannel1.200" + }, + "input": { + "classifiers": [ + { + "classifier": null, + "config": { + "name": "dest_B", + "type": "IPV4" + } + } + ], + "scheduler-policy": { + "config": { + "name": "limit_group_B_1Gb" + } + } + } + } + ] + } +} ``` ### DP-2.2.2 push gRIBI AFT encapsulation rules with next-hop-group-id From b599a67e4221314513b119eb24c9b9f2c43f8b07 Mon Sep 17 00:00:00 2001 From: dplore Date: Thu, 3 Oct 2024 16:51:56 -0700 Subject: [PATCH 15/15] update TODO items --- feature/qos/otg_tests/ingress_police_nhg/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/feature/qos/otg_tests/ingress_police_nhg/README.md b/feature/qos/otg_tests/ingress_police_nhg/README.md index 6e772620d72..0b983ca0e0b 100644 --- a/feature/qos/otg_tests/ingress_police_nhg/README.md +++ b/feature/qos/otg_tests/ingress_police_nhg/README.md @@ -25,7 +25,7 @@ Use DP-2.1 test environment setup. satisfies the OC schema which requires defining nodes mapping classfier->forwarding-group->queue->scheduler * Generate config for 2 scheduler-policies to police traffic -* Generate config to apply classifer and scheduler to DUT subinterface. (TODO: include interface config details with 802.1Q tags) +* Generate config to apply classifer and scheduler to DUT subinterface. * Use gnmi.Replace to push the config to the DUT. ```json @@ -298,7 +298,7 @@ which matches the `/qos/classifiers/classifier/condition/next-hop-group/config/name` leaf. * [TODO: OC AFT Encap PR in progress](https://github.com/openconfig/public/pull/1153) -* [TODO: gRIBI v1 protobuf defintions](https://github.com/openconfig/gribi/blob/master/v1/proto/README.md) +* [TODO: updated gRIBI v1 protobuf defintions](https://github.com/openconfig/gribi/blob/master/v1/proto/README.md) ```proto #