From 81e4ec467feb57647b11bbbbbd70007af9d7e099 Mon Sep 17 00:00:00 2001 From: vishnureddybadveli <112267356+vishnureddybadveli@users.noreply.github.com> Date: Wed, 1 Jan 2025 09:31:36 -0800 Subject: [PATCH 01/18] Moved decap sub test cases from TE-18.1 README to a seperate directory --- feature/gribi/otg_tests/mpls_in_udp/README.md | 80 +------------------ testregistry.textproto | 6 ++ 2 files changed, 8 insertions(+), 78 deletions(-) diff --git a/feature/gribi/otg_tests/mpls_in_udp/README.md b/feature/gribi/otg_tests/mpls_in_udp/README.md index b2f8fc44704..68874f772b9 100644 --- a/feature/gribi/otg_tests/mpls_in_udp/README.md +++ b/feature/gribi/otg_tests/mpls_in_udp/README.md @@ -1,12 +1,8 @@ -# TE-18.1 gRIBI MPLS in UDP Encapsulation and Decapsulation +# TE-18.1 gRIBI MPLS in UDP Encapsulation Create AFT entries using gRIBI to match on next hop group in a network-instance and encapsulate the matching packets in MPLS in UDP. -Create a policy routing configuration using gNMI to decapsulate MPLS -in UDP packets which are sent to a loopback address and apply to -the DUT. - The MPLS in UDP encapsulation is expected to follow [rfc7510](https://datatracker.ietf.org/doc/html/rfc7510#section-3), but relaxing the requirement for a well-known destination UDP port. gRIBI is @@ -186,72 +182,6 @@ encapsulate in GRE. * Generate traffic from ATE port 1 to ATE port 2 * Validate ATE port 2 receives GRE traffic with correct inner and outer IPs -### TE-18.1.3 - MPLS in GRE decapsulation set by gNMI - -Canonical OpenConfig for policy forwarding, matching IP prefix with action -decapsulate in GRE. # TODO: Move to dedicated README - -```yaml -openconfig-network-instance: - network-instances: - - network-instance: "DEFAULT" - afts: - policy-forwarding: - policies: - policy: "default decap rule" - config: - policy-id: "default decap rule" - type: PBR_POLICY - rules: - rule: 1 - config: - sequence-id: 1 - ipv6: - config: - destination-address: "decap_loopback_ipv6" - action: - decapsulate-mpls-in-gre: TRUE # TODO: add to OC model/PR in progress -``` - -* Push the gNMI the policy forwarding configuration -* Push the configuration to DUT using gnmi.Set with REPLACE option -* Configure ATE port 1 with traffic flow which matches the decap loopback IP address -* Generate traffic from ATE port 1 -* Validate ATE port 2 receives packets with correct VLAN and the inner inner_decap_ipv6 - -### TE-18.1.4 - MPLS in UDP decapsulation set by gNMI - -Canonical OpenConfig for policy forwarding, matching IP prefix with action -decapsulate MPLS in UDP. # TODO: Move to dedicated README - -```yaml -openconfig-network-instance: - network-instances: - - network-instance: "DEFAULT" - afts: - policy-forwarding: - policies: - policy: "default decap rule" - config: - policy-id: "default decap rule" - type: PBR_POLICY - rules: - rule: 1 - config: - sequence-id: 1 - ipv6: - config: - destination-address: "decap_loopback_ipv6" - action: - decapsulate-mpls-in-udp: TRUE -``` - -* Push the gNMI the policy forwarding configuration -* Push the configuration to DUT using gnmi.Set with REPLACE option -* Configure ATE port 1 with traffic flow - * Flow should have a packet encap format : outer_decap_udp_ipv6 <- MPLS label <- inner_decap_ipv6 -* Generate traffic from ATE port 1 -* Validate ATE port 2 receives the innermost IPv4 traffic with correct VLAN and inner_decap_ipv6 ## OpenConfig Path and RPC Coverage @@ -294,12 +224,6 @@ paths: #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/gre/config/ip-ttl: #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/gre/config/source-ip: - # Paths added for TE-18.1.3 - MPLS in GRE decapsulation set by gNMI - /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/ipv6/config/destination-address: - # TODO: /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/config/decapsulate-mpls-in-gre: - - # Paths added for TE-18.1.4 - MPLS in UDP decapsulation set by gNMI - /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/config/decapsulate-mpls-in-udp: rpcs: gnmi: @@ -317,4 +241,4 @@ rpcs: ## Required DUT platform -* FFF +* FFF \ No newline at end of file diff --git a/testregistry.textproto b/testregistry.textproto index a70dfc099b8..4365f27224f 100644 --- a/testregistry.textproto +++ b/testregistry.textproto @@ -434,6 +434,12 @@ test: { readme: "" exec: " " } +test: { + id: "PF-1.7" + description: "MPLS Decapsulation" + readme: "" + exec: " " +} test: { id: "PLT-1.1" description: "Interface breakout Test" From 68a2bc8672f64c17a3d4989b9e07d81aba2a61a4 Mon Sep 17 00:00:00 2001 From: vishnureddybadveli <112267356+vishnureddybadveli@users.noreply.github.com> Date: Wed, 1 Jan 2025 09:36:55 -0800 Subject: [PATCH 02/18] Create README.md --- feature/gribi/otg_tests/mpls_decap/README.md | 244 +++++++++++++++++++ 1 file changed, 244 insertions(+) create mode 100644 feature/gribi/otg_tests/mpls_decap/README.md diff --git a/feature/gribi/otg_tests/mpls_decap/README.md b/feature/gribi/otg_tests/mpls_decap/README.md new file mode 100644 index 00000000000..68874f772b9 --- /dev/null +++ b/feature/gribi/otg_tests/mpls_decap/README.md @@ -0,0 +1,244 @@ +# TE-18.1 gRIBI MPLS in UDP Encapsulation + +Create AFT entries using gRIBI to match on next hop group in a +network-instance and encapsulate the matching packets in MPLS in UDP. + +The MPLS in UDP encapsulation is expected to follow +[rfc7510](https://datatracker.ietf.org/doc/html/rfc7510#section-3), +but relaxing the requirement for a well-known destination UDP port. gRIBI is +expected to be able to set the destination UDP port. + +## Topology + +* [`featureprofiles/topologies/atedut_2.testbed`](https://github.com/openconfig/featureprofiles/blob/main/topologies/atedut_2.testbed) + +## Test setup + +TODO: Complete test environment setup steps + +inner_ipv6_dst_A = "2001:aa:bb::1/128" +inner_ipv6_dst_B = "2001:aa:bb::2/128" +inner_ipv6_default = "::/0" + +ipv4_inner_dst_A = "10.5.1.1/32" +ipv4_inner_dst_B = "10.5.1.2/32" +ipv4_inner_default = "0.0.0.0/0" + +outer_ipv6_src = "2001:f:a:1::0" +outer_ipv6_dst_A = "2001:f:c:e::1" +outer_ipv6_dst_B = "2001:f:c:e::2" +outer_ipv6_dst_def = "2001:1:1:1::0" +outer_dst_udp_port = "6635" +outer_dscp = "26" +outer_ip-ttl = "64" + +## Procedure + +### TE-18.1.1 Match and Encapsulate using gRIBI aft modify + +#### gRIBI RPC content + +The gRIBI client should send this proto message to the DUT to create AFT +entries. + +```proto +# +# 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,] + } + } + encap_header { + index: 2 + udp_v6 { + 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_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,] + } + } + encap_header { + index: 2 + udp_v6 { + 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" + # network_instance: "DEFAULT" TODO: requires new OC path /network-instances/network-instance/afts/next-hop-groups/next-hop-group/state/network-instance +} +``` + +* Send traffic from ATE port 1 to DUT port 1 +* Using OTG, validate ATE port 2 receives MPLS-IN-UDP packets + * Validate destination IPs are outer_ipv6_dst_A and outer_ipv6_dst_B + * Validate MPLS label is set + +### TE-18.1.2 Validate prefix match rule for MPLS in GRE encap using default route + +Canonical OpenConfig for policy forwarding, matching IP prefix with action +encapsulate in GRE. + +```json +{ + "openconfig-network-instance": { + "network-instances": [ + { + "afts": { + "policy-forwarding": { + "policies": [ + { + "config": { + "policy-id": "default encap rule", + "type": "PBR_POLICY" + }, + "policy": "default encap rule", + "rules": [ + { + "action": { + "encapsulate-headers": [ + { + "encapsulate-header": null, + "gre": { + "config": { + "destination-ip": "outer_ipv6_dst_def", + "dscp": "outer_dscp", + "id": "default_dst_1", + "ip-ttl": "outer_ip-ttl", + "source-ip": "outer_ipv6_src" + } + }, + "mpls": { + "mpls-label-stack": [ + 100 + ] + } + } + ], + "config": { + "network-instance": "DEFAULT" + } + }, + "config": { + "sequence-id": 1, + }, + "ipv6": { + "config": { + "destination-address": "inner_ipv6_default" + } + }, + "rule": 1 + } + ] + } + ] + } + }, + "network-instance": "group_A" + } + ] + } +} +``` + +* Generate the policy forwarding configuration +* Push the configuration to DUT using gnmi.Set with REPLACE option +* Configure ATE port 1 with traffic flow which does not match any AFT next hop route +* Generate traffic from ATE port 1 to ATE port 2 +* Validate ATE port 2 receives GRE traffic with correct inner and outer IPs + + +## OpenConfig Path and RPC Coverage + +```yaml +paths: + +# afts state paths set via gRIBI + # TODO: need new OC for user defined next-hop-group/state/id, needed for policy-forwarding rules pointing to a NHG + # /network-instances/network-instance/afts/next-hop-groups/next-hop-group/state/next-hop-group-id: + + # TODO: new OC path for aft NHG pointing to a different network-instance + # /network-instances/network-instance/afts/next-hop-groups/next-hop-group/state/network-instance: + + # Paths added for TE-18.1.1 Match and Encapsulate using gRIBI aft modify + /network-instances/network-instance/afts/next-hop-groups/next-hop-group/state/id: + /network-instances/network-instance/afts/next-hop-groups/next-hop-group/next-hops/next-hop/state/index: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/state/index: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/state/type: + + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/mpls/state/mpls-label-stack: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v4/state/src-ip: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v4/state/dst-ip: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v4/state/dst-udp-port: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v4/state/ip-ttl: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v4/state/dscp: + + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v6/state/src-ip: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v6/state/dst-ip: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v6/state/dst-udp-port: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v6/state/ip-ttl: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v6/state/dscp: + + # Paths added for TE-18.1.2 Validate prefix match rule for MPLS in GRE encap using default route + /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/config/network-instance: + /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/config/sequence-id: + #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/mpls/config/mpls-label-stack: + #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/gre/config/destination-ip: + #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/gre/config/dscp: + #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/gre/config/id: + #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/gre/config/ip-ttl: + #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/gre/config/source-ip: + + +rpcs: + gnmi: + gNMI.Set: + union_replace: true + replace: true + gNMI.Subscribe: + on_change: true + gribi: + gRIBI.Modify: + afts:next-hops:next-hop:encap-headers:encap-header:udp_v6: + afts:next-hops:next-hop:encap-headers:encap-header:mpls: + gRIBI.Flush: +``` + +## Required DUT platform + +* FFF \ No newline at end of file From b98d9c24ec9c84a6f356106ad33f07f18cead3fb Mon Sep 17 00:00:00 2001 From: vishnureddybadveli <112267356+vishnureddybadveli@users.noreply.github.com> Date: Wed, 1 Jan 2025 09:31:36 -0800 Subject: [PATCH 03/18] Moved decap sub test cases from TE-18.1 README to a seperate directory --- feature/gribi/otg_tests/mpls_in_udp/README.md | 80 +------------------ testregistry.textproto | 6 ++ 2 files changed, 8 insertions(+), 78 deletions(-) diff --git a/feature/gribi/otg_tests/mpls_in_udp/README.md b/feature/gribi/otg_tests/mpls_in_udp/README.md index b2f8fc44704..68874f772b9 100644 --- a/feature/gribi/otg_tests/mpls_in_udp/README.md +++ b/feature/gribi/otg_tests/mpls_in_udp/README.md @@ -1,12 +1,8 @@ -# TE-18.1 gRIBI MPLS in UDP Encapsulation and Decapsulation +# TE-18.1 gRIBI MPLS in UDP Encapsulation Create AFT entries using gRIBI to match on next hop group in a network-instance and encapsulate the matching packets in MPLS in UDP. -Create a policy routing configuration using gNMI to decapsulate MPLS -in UDP packets which are sent to a loopback address and apply to -the DUT. - The MPLS in UDP encapsulation is expected to follow [rfc7510](https://datatracker.ietf.org/doc/html/rfc7510#section-3), but relaxing the requirement for a well-known destination UDP port. gRIBI is @@ -186,72 +182,6 @@ encapsulate in GRE. * Generate traffic from ATE port 1 to ATE port 2 * Validate ATE port 2 receives GRE traffic with correct inner and outer IPs -### TE-18.1.3 - MPLS in GRE decapsulation set by gNMI - -Canonical OpenConfig for policy forwarding, matching IP prefix with action -decapsulate in GRE. # TODO: Move to dedicated README - -```yaml -openconfig-network-instance: - network-instances: - - network-instance: "DEFAULT" - afts: - policy-forwarding: - policies: - policy: "default decap rule" - config: - policy-id: "default decap rule" - type: PBR_POLICY - rules: - rule: 1 - config: - sequence-id: 1 - ipv6: - config: - destination-address: "decap_loopback_ipv6" - action: - decapsulate-mpls-in-gre: TRUE # TODO: add to OC model/PR in progress -``` - -* Push the gNMI the policy forwarding configuration -* Push the configuration to DUT using gnmi.Set with REPLACE option -* Configure ATE port 1 with traffic flow which matches the decap loopback IP address -* Generate traffic from ATE port 1 -* Validate ATE port 2 receives packets with correct VLAN and the inner inner_decap_ipv6 - -### TE-18.1.4 - MPLS in UDP decapsulation set by gNMI - -Canonical OpenConfig for policy forwarding, matching IP prefix with action -decapsulate MPLS in UDP. # TODO: Move to dedicated README - -```yaml -openconfig-network-instance: - network-instances: - - network-instance: "DEFAULT" - afts: - policy-forwarding: - policies: - policy: "default decap rule" - config: - policy-id: "default decap rule" - type: PBR_POLICY - rules: - rule: 1 - config: - sequence-id: 1 - ipv6: - config: - destination-address: "decap_loopback_ipv6" - action: - decapsulate-mpls-in-udp: TRUE -``` - -* Push the gNMI the policy forwarding configuration -* Push the configuration to DUT using gnmi.Set with REPLACE option -* Configure ATE port 1 with traffic flow - * Flow should have a packet encap format : outer_decap_udp_ipv6 <- MPLS label <- inner_decap_ipv6 -* Generate traffic from ATE port 1 -* Validate ATE port 2 receives the innermost IPv4 traffic with correct VLAN and inner_decap_ipv6 ## OpenConfig Path and RPC Coverage @@ -294,12 +224,6 @@ paths: #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/gre/config/ip-ttl: #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/gre/config/source-ip: - # Paths added for TE-18.1.3 - MPLS in GRE decapsulation set by gNMI - /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/ipv6/config/destination-address: - # TODO: /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/config/decapsulate-mpls-in-gre: - - # Paths added for TE-18.1.4 - MPLS in UDP decapsulation set by gNMI - /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/config/decapsulate-mpls-in-udp: rpcs: gnmi: @@ -317,4 +241,4 @@ rpcs: ## Required DUT platform -* FFF +* FFF \ No newline at end of file diff --git a/testregistry.textproto b/testregistry.textproto index 16eac380e5e..599ca71be97 100644 --- a/testregistry.textproto +++ b/testregistry.textproto @@ -434,6 +434,12 @@ test: { readme: "" exec: " " } +test: { + id: "PF-1.7" + description: "MPLS Decapsulation" + readme: "" + exec: " " +} test: { id: "PLT-1.1" description: "Interface breakout Test" From fadc293346563dd0bb12fdbe1bb1b3141b591527 Mon Sep 17 00:00:00 2001 From: vishnureddybadveli <112267356+vishnureddybadveli@users.noreply.github.com> Date: Wed, 1 Jan 2025 09:36:55 -0800 Subject: [PATCH 04/18] Create README.md --- feature/gribi/otg_tests/mpls_decap/README.md | 244 +++++++++++++++++++ 1 file changed, 244 insertions(+) create mode 100644 feature/gribi/otg_tests/mpls_decap/README.md diff --git a/feature/gribi/otg_tests/mpls_decap/README.md b/feature/gribi/otg_tests/mpls_decap/README.md new file mode 100644 index 00000000000..68874f772b9 --- /dev/null +++ b/feature/gribi/otg_tests/mpls_decap/README.md @@ -0,0 +1,244 @@ +# TE-18.1 gRIBI MPLS in UDP Encapsulation + +Create AFT entries using gRIBI to match on next hop group in a +network-instance and encapsulate the matching packets in MPLS in UDP. + +The MPLS in UDP encapsulation is expected to follow +[rfc7510](https://datatracker.ietf.org/doc/html/rfc7510#section-3), +but relaxing the requirement for a well-known destination UDP port. gRIBI is +expected to be able to set the destination UDP port. + +## Topology + +* [`featureprofiles/topologies/atedut_2.testbed`](https://github.com/openconfig/featureprofiles/blob/main/topologies/atedut_2.testbed) + +## Test setup + +TODO: Complete test environment setup steps + +inner_ipv6_dst_A = "2001:aa:bb::1/128" +inner_ipv6_dst_B = "2001:aa:bb::2/128" +inner_ipv6_default = "::/0" + +ipv4_inner_dst_A = "10.5.1.1/32" +ipv4_inner_dst_B = "10.5.1.2/32" +ipv4_inner_default = "0.0.0.0/0" + +outer_ipv6_src = "2001:f:a:1::0" +outer_ipv6_dst_A = "2001:f:c:e::1" +outer_ipv6_dst_B = "2001:f:c:e::2" +outer_ipv6_dst_def = "2001:1:1:1::0" +outer_dst_udp_port = "6635" +outer_dscp = "26" +outer_ip-ttl = "64" + +## Procedure + +### TE-18.1.1 Match and Encapsulate using gRIBI aft modify + +#### gRIBI RPC content + +The gRIBI client should send this proto message to the DUT to create AFT +entries. + +```proto +# +# 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,] + } + } + encap_header { + index: 2 + udp_v6 { + 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_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,] + } + } + encap_header { + index: 2 + udp_v6 { + 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" + # network_instance: "DEFAULT" TODO: requires new OC path /network-instances/network-instance/afts/next-hop-groups/next-hop-group/state/network-instance +} +``` + +* Send traffic from ATE port 1 to DUT port 1 +* Using OTG, validate ATE port 2 receives MPLS-IN-UDP packets + * Validate destination IPs are outer_ipv6_dst_A and outer_ipv6_dst_B + * Validate MPLS label is set + +### TE-18.1.2 Validate prefix match rule for MPLS in GRE encap using default route + +Canonical OpenConfig for policy forwarding, matching IP prefix with action +encapsulate in GRE. + +```json +{ + "openconfig-network-instance": { + "network-instances": [ + { + "afts": { + "policy-forwarding": { + "policies": [ + { + "config": { + "policy-id": "default encap rule", + "type": "PBR_POLICY" + }, + "policy": "default encap rule", + "rules": [ + { + "action": { + "encapsulate-headers": [ + { + "encapsulate-header": null, + "gre": { + "config": { + "destination-ip": "outer_ipv6_dst_def", + "dscp": "outer_dscp", + "id": "default_dst_1", + "ip-ttl": "outer_ip-ttl", + "source-ip": "outer_ipv6_src" + } + }, + "mpls": { + "mpls-label-stack": [ + 100 + ] + } + } + ], + "config": { + "network-instance": "DEFAULT" + } + }, + "config": { + "sequence-id": 1, + }, + "ipv6": { + "config": { + "destination-address": "inner_ipv6_default" + } + }, + "rule": 1 + } + ] + } + ] + } + }, + "network-instance": "group_A" + } + ] + } +} +``` + +* Generate the policy forwarding configuration +* Push the configuration to DUT using gnmi.Set with REPLACE option +* Configure ATE port 1 with traffic flow which does not match any AFT next hop route +* Generate traffic from ATE port 1 to ATE port 2 +* Validate ATE port 2 receives GRE traffic with correct inner and outer IPs + + +## OpenConfig Path and RPC Coverage + +```yaml +paths: + +# afts state paths set via gRIBI + # TODO: need new OC for user defined next-hop-group/state/id, needed for policy-forwarding rules pointing to a NHG + # /network-instances/network-instance/afts/next-hop-groups/next-hop-group/state/next-hop-group-id: + + # TODO: new OC path for aft NHG pointing to a different network-instance + # /network-instances/network-instance/afts/next-hop-groups/next-hop-group/state/network-instance: + + # Paths added for TE-18.1.1 Match and Encapsulate using gRIBI aft modify + /network-instances/network-instance/afts/next-hop-groups/next-hop-group/state/id: + /network-instances/network-instance/afts/next-hop-groups/next-hop-group/next-hops/next-hop/state/index: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/state/index: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/state/type: + + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/mpls/state/mpls-label-stack: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v4/state/src-ip: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v4/state/dst-ip: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v4/state/dst-udp-port: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v4/state/ip-ttl: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v4/state/dscp: + + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v6/state/src-ip: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v6/state/dst-ip: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v6/state/dst-udp-port: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v6/state/ip-ttl: + /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v6/state/dscp: + + # Paths added for TE-18.1.2 Validate prefix match rule for MPLS in GRE encap using default route + /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/config/network-instance: + /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/config/sequence-id: + #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/mpls/config/mpls-label-stack: + #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/gre/config/destination-ip: + #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/gre/config/dscp: + #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/gre/config/id: + #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/gre/config/ip-ttl: + #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/gre/config/source-ip: + + +rpcs: + gnmi: + gNMI.Set: + union_replace: true + replace: true + gNMI.Subscribe: + on_change: true + gribi: + gRIBI.Modify: + afts:next-hops:next-hop:encap-headers:encap-header:udp_v6: + afts:next-hops:next-hop:encap-headers:encap-header:mpls: + gRIBI.Flush: +``` + +## Required DUT platform + +* FFF \ No newline at end of file From 07ea35e981870d8240a22f6dea516ff12caae447 Mon Sep 17 00:00:00 2001 From: vishnureddybadveli <112267356+vishnureddybadveli@users.noreply.github.com> Date: Wed, 1 Jan 2025 09:39:11 -0800 Subject: [PATCH 05/18] Created README for decap sub test cases in new directory --- feature/gribi/otg_tests/mpls_decap/README.md | 263 +++++-------------- 1 file changed, 64 insertions(+), 199 deletions(-) diff --git a/feature/gribi/otg_tests/mpls_decap/README.md b/feature/gribi/otg_tests/mpls_decap/README.md index 68874f772b9..3aae81418eb 100644 --- a/feature/gribi/otg_tests/mpls_decap/README.md +++ b/feature/gribi/otg_tests/mpls_decap/README.md @@ -1,12 +1,8 @@ -# TE-18.1 gRIBI MPLS in UDP Encapsulation +# PF-1.7 MPLS Decapsulation -Create AFT entries using gRIBI to match on next hop group in a -network-instance and encapsulate the matching packets in MPLS in UDP. - -The MPLS in UDP encapsulation is expected to follow -[rfc7510](https://datatracker.ietf.org/doc/html/rfc7510#section-3), -but relaxing the requirement for a well-known destination UDP port. gRIBI is -expected to be able to set the destination UDP port. +Create a policy-forwarding configuration using gNMI to decapsulate MPLS +in GRE and UDP packets which are sent to a loopback address and apply to +the DUT. ## Topology @@ -34,211 +30,80 @@ outer_ip-ttl = "64" ## Procedure -### TE-18.1.1 Match and Encapsulate using gRIBI aft modify - -#### gRIBI RPC content - -The gRIBI client should send this proto message to the DUT to create AFT -entries. - -```proto -# -# 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,] - } - } - encap_header { - index: 2 - udp_v6 { - 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_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,] - } - } - encap_header { - index: 2 - udp_v6 { - 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" - # network_instance: "DEFAULT" TODO: requires new OC path /network-instances/network-instance/afts/next-hop-groups/next-hop-group/state/network-instance -} -``` +### TE-18.1.3 - MPLS in GRE decapsulation set by gNMI -* Send traffic from ATE port 1 to DUT port 1 -* Using OTG, validate ATE port 2 receives MPLS-IN-UDP packets - * Validate destination IPs are outer_ipv6_dst_A and outer_ipv6_dst_B - * Validate MPLS label is set +Canonical OpenConfig for policy forwarding, matching IP prefix with action +decapsulate in GRE. # TODO: Move to dedicated README -### TE-18.1.2 Validate prefix match rule for MPLS in GRE encap using default route +```yaml +openconfig-network-instance: + network-instances: + - network-instance: "DEFAULT" + afts: + policy-forwarding: + policies: + policy: "default decap rule" + config: + policy-id: "default decap rule" + type: PBR_POLICY + rules: + rule: 1 + config: + sequence-id: 1 + ipv6: + config: + destination-address: "decap_loopback_ipv6" + action: + decapsulate-mpls-in-gre: TRUE # TODO: add to OC model/PR in progress +``` +### TE-18.1.4 - MPLS in UDP decapsulation set by gNMI Canonical OpenConfig for policy forwarding, matching IP prefix with action -encapsulate in GRE. - -```json -{ - "openconfig-network-instance": { - "network-instances": [ - { - "afts": { - "policy-forwarding": { - "policies": [ - { - "config": { - "policy-id": "default encap rule", - "type": "PBR_POLICY" - }, - "policy": "default encap rule", - "rules": [ - { - "action": { - "encapsulate-headers": [ - { - "encapsulate-header": null, - "gre": { - "config": { - "destination-ip": "outer_ipv6_dst_def", - "dscp": "outer_dscp", - "id": "default_dst_1", - "ip-ttl": "outer_ip-ttl", - "source-ip": "outer_ipv6_src" - } - }, - "mpls": { - "mpls-label-stack": [ - 100 - ] - } - } - ], - "config": { - "network-instance": "DEFAULT" - } - }, - "config": { - "sequence-id": 1, - }, - "ipv6": { - "config": { - "destination-address": "inner_ipv6_default" - } - }, - "rule": 1 - } - ] - } - ] - } - }, - "network-instance": "group_A" - } - ] - } -} +decapsulate MPLS in UDP. # TODO: Move to dedicated README + +```yaml +openconfig-network-instance: + network-instances: + - network-instance: "DEFAULT" + afts: + policy-forwarding: + policies: + policy: "default decap rule" + config: + policy-id: "default decap rule" + type: PBR_POLICY + rules: + rule: 1 + config: + sequence-id: 1 + ipv6: + config: + destination-address: "decap_loopback_ipv6" + action: + decapsulate-mpls-in-udp: TRUE ``` -* Generate the policy forwarding configuration +* Push the gNMI the policy forwarding configuration * Push the configuration to DUT using gnmi.Set with REPLACE option -* Configure ATE port 1 with traffic flow which does not match any AFT next hop route -* Generate traffic from ATE port 1 to ATE port 2 -* Validate ATE port 2 receives GRE traffic with correct inner and outer IPs - +* Configure ATE port 1 with traffic flow + * Flow should have a packet encap format : outer_decap_udp_ipv6 <- MPLS label <- inner_decap_ipv6 +* Generate traffic from ATE port 1 +* Validate ATE port 2 receives the innermost IPv4 traffic with correct VLAN and inner_decap_ipv6 ## OpenConfig Path and RPC Coverage ```yaml paths: -# afts state paths set via gRIBI - # TODO: need new OC for user defined next-hop-group/state/id, needed for policy-forwarding rules pointing to a NHG - # /network-instances/network-instance/afts/next-hop-groups/next-hop-group/state/next-hop-group-id: - - # TODO: new OC path for aft NHG pointing to a different network-instance - # /network-instances/network-instance/afts/next-hop-groups/next-hop-group/state/network-instance: - - # Paths added for TE-18.1.1 Match and Encapsulate using gRIBI aft modify - /network-instances/network-instance/afts/next-hop-groups/next-hop-group/state/id: - /network-instances/network-instance/afts/next-hop-groups/next-hop-group/next-hops/next-hop/state/index: - /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/state/index: - /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/state/type: - - /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/mpls/state/mpls-label-stack: - /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v4/state/src-ip: - /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v4/state/dst-ip: - /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v4/state/dst-udp-port: - /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v4/state/ip-ttl: - /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v4/state/dscp: - - /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v6/state/src-ip: - /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v6/state/dst-ip: - /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v6/state/dst-udp-port: - /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v6/state/ip-ttl: - /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/encap-header/udp-v6/state/dscp: - - # Paths added for TE-18.1.2 Validate prefix match rule for MPLS in GRE encap using default route - /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/config/network-instance: - /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/config/sequence-id: - #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/mpls/config/mpls-label-stack: - #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/gre/config/destination-ip: - #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/gre/config/dscp: - #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/gre/config/id: - #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/gre/config/ip-ttl: - #/network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/encap-headers/encap-header/gre/config/source-ip: - - -rpcs: - gnmi: - gNMI.Set: - union_replace: true - replace: true - gNMI.Subscribe: - on_change: true - gribi: - gRIBI.Modify: - afts:next-hops:next-hop:encap-headers:encap-header:udp_v6: - afts:next-hops:next-hop:encap-headers:encap-header:mpls: - gRIBI.Flush: + # Paths added for TE-18.1.3 - MPLS in GRE decapsulation set by gNMI + /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/ipv6/config/destination-address: + # TODO: /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/config/decapsulate-mpls-in-gre: + + # Paths added for TE-18.1.4 - MPLS in UDP decapsulation set by gNMI + /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/config/decapsulate-mpls-in-udp: + ``` ## Required DUT platform -* FFF \ No newline at end of file +* FFF From 18de9d3281eedcd919ca4946e7fa1090cab05622 Mon Sep 17 00:00:00 2001 From: vishnureddybadveli <112267356+vishnureddybadveli@users.noreply.github.com> Date: Mon, 6 Jan 2025 13:10:44 -0800 Subject: [PATCH 06/18] Update README.md --- feature/gribi/otg_tests/mpls_decap/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/feature/gribi/otg_tests/mpls_decap/README.md b/feature/gribi/otg_tests/mpls_decap/README.md index 3aae81418eb..81945c51a31 100644 --- a/feature/gribi/otg_tests/mpls_decap/README.md +++ b/feature/gribi/otg_tests/mpls_decap/README.md @@ -102,6 +102,15 @@ paths: # Paths added for TE-18.1.4 - MPLS in UDP decapsulation set by gNMI /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/config/decapsulate-mpls-in-udp: + +rpcs: + gnmi: + gNMI.Set: + union_replace: true + replace: true + gNMI.Subscribe: + on_change: true + ``` ## Required DUT platform From acc6421cc12d6fbd64bf65df94d80e003dbd47dd Mon Sep 17 00:00:00 2001 From: vishnureddybadveli <112267356+vishnureddybadveli@users.noreply.github.com> Date: Wed, 8 Jan 2025 18:20:41 -0800 Subject: [PATCH 07/18] Update feature/gribi/otg_tests/mpls_decap/README.md Co-authored-by: Darren Loher --- feature/gribi/otg_tests/mpls_decap/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/gribi/otg_tests/mpls_decap/README.md b/feature/gribi/otg_tests/mpls_decap/README.md index 81945c51a31..c6652dd19ea 100644 --- a/feature/gribi/otg_tests/mpls_decap/README.md +++ b/feature/gribi/otg_tests/mpls_decap/README.md @@ -1,4 +1,4 @@ -# PF-1.7 MPLS Decapsulation +# PF-1.7 Decapsulate MPLS in GRE and UDP Create a policy-forwarding configuration using gNMI to decapsulate MPLS in GRE and UDP packets which are sent to a loopback address and apply to From c1166d42062083204a80ac6ac4ef4c5fabeb887d Mon Sep 17 00:00:00 2001 From: vishnureddybadveli <112267356+vishnureddybadveli@users.noreply.github.com> Date: Wed, 8 Jan 2025 18:20:54 -0800 Subject: [PATCH 08/18] Update feature/gribi/otg_tests/mpls_decap/README.md Co-authored-by: Darren Loher --- feature/gribi/otg_tests/mpls_decap/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/gribi/otg_tests/mpls_decap/README.md b/feature/gribi/otg_tests/mpls_decap/README.md index c6652dd19ea..b11f221fe89 100644 --- a/feature/gribi/otg_tests/mpls_decap/README.md +++ b/feature/gribi/otg_tests/mpls_decap/README.md @@ -30,7 +30,7 @@ outer_ip-ttl = "64" ## Procedure -### TE-18.1.3 - MPLS in GRE decapsulation set by gNMI +### PF-1.7.1 - MPLS in GRE decapsulation set by gNMI Canonical OpenConfig for policy forwarding, matching IP prefix with action decapsulate in GRE. # TODO: Move to dedicated README From 636abf6a645e7e35f8e174d470d8c39adea67c24 Mon Sep 17 00:00:00 2001 From: vishnureddybadveli <112267356+vishnureddybadveli@users.noreply.github.com> Date: Wed, 8 Jan 2025 18:23:08 -0800 Subject: [PATCH 09/18] Update feature/gribi/otg_tests/mpls_decap/README.md Co-authored-by: Darren Loher --- feature/gribi/otg_tests/mpls_decap/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/gribi/otg_tests/mpls_decap/README.md b/feature/gribi/otg_tests/mpls_decap/README.md index b11f221fe89..093c98a352a 100644 --- a/feature/gribi/otg_tests/mpls_decap/README.md +++ b/feature/gribi/otg_tests/mpls_decap/README.md @@ -56,7 +56,7 @@ openconfig-network-instance: action: decapsulate-mpls-in-gre: TRUE # TODO: add to OC model/PR in progress ``` -### TE-18.1.4 - MPLS in UDP decapsulation set by gNMI +### PF-1.7.2 - MPLS in UDP decapsulation set by gNMI Canonical OpenConfig for policy forwarding, matching IP prefix with action decapsulate MPLS in UDP. # TODO: Move to dedicated README From 647d8cfc4f12c6c0ee90870bc13d3c85e782cd31 Mon Sep 17 00:00:00 2001 From: vishnureddybadveli <112267356+vishnureddybadveli@users.noreply.github.com> Date: Wed, 8 Jan 2025 18:53:48 -0800 Subject: [PATCH 10/18] Update README.md Addressing review comments. --- feature/gribi/otg_tests/mpls_decap/README.md | 134 ++++++++++++------- 1 file changed, 87 insertions(+), 47 deletions(-) diff --git a/feature/gribi/otg_tests/mpls_decap/README.md b/feature/gribi/otg_tests/mpls_decap/README.md index 093c98a352a..287cda80111 100644 --- a/feature/gribi/otg_tests/mpls_decap/README.md +++ b/feature/gribi/otg_tests/mpls_decap/README.md @@ -33,56 +33,96 @@ outer_ip-ttl = "64" ### PF-1.7.1 - MPLS in GRE decapsulation set by gNMI Canonical OpenConfig for policy forwarding, matching IP prefix with action -decapsulate in GRE. # TODO: Move to dedicated README - -```yaml -openconfig-network-instance: - network-instances: - - network-instance: "DEFAULT" - afts: - policy-forwarding: - policies: - policy: "default decap rule" - config: - policy-id: "default decap rule" - type: PBR_POLICY - rules: - rule: 1 - config: - sequence-id: 1 - ipv6: - config: - destination-address: "decap_loopback_ipv6" - action: - decapsulate-mpls-in-gre: TRUE # TODO: add to OC model/PR in progress +decapsulate in GRE. + +```json +{ + "openconfig-network-instance": { + "network-instances": [ + { + "afts": { + "policy-forwarding": { + "policies": [ + { + "config": { + "policy-id": "default decap rule", + "type": "PBR_POLICY" + }, + "policy": "default decap rule", + "rules": [ + { + "config": { + "sequence-id": 1, + }, + "ipv6": { + "config": { + "destination-address": "decap_loopback_ipv6" + } + }, + "action": { + "decapsulate-mpls-in-gre": TRUE + } + } + ] + } + ] + } + } + } + ] + } +} ``` +* Push the gNMI the policy forwarding configuration +* Push the configuration to DUT using gnmi.Set with REPLACE option +* Configure ATE port 1 with traffic flow + * Flow should have a packet encap format : outer_decap_gre_ipv6 <- MPLS label <- inner_decap_ipv6 +* Generate traffic from ATE port 1 +* Validate ATE port 2 receives the innermost IPv4 traffic with correct VLAN and inner_decap_ipv6 + ### PF-1.7.2 - MPLS in UDP decapsulation set by gNMI Canonical OpenConfig for policy forwarding, matching IP prefix with action -decapsulate MPLS in UDP. # TODO: Move to dedicated README - -```yaml -openconfig-network-instance: - network-instances: - - network-instance: "DEFAULT" - afts: - policy-forwarding: - policies: - policy: "default decap rule" - config: - policy-id: "default decap rule" - type: PBR_POLICY - rules: - rule: 1 - config: - sequence-id: 1 - ipv6: - config: - destination-address: "decap_loopback_ipv6" - action: - decapsulate-mpls-in-udp: TRUE +decapsulate MPLS in UDP. + +```json +{ + "openconfig-network-instance": { + "network-instances": [ + { + "afts": { + "policy-forwarding": { + "policies": [ + { + "config": { + "policy-id": "default decap rule", + "type": "PBR_POLICY" + }, + "policy": "default decap rule", + "rules": [ + { + "config": { + "sequence-id": 1, + }, + "ipv6": { + "config": { + "destination-address": "decap_loopback_ipv6" + } + }, + "action": { + "decapsulate-mpls-in-udp": TRUE + } + } + ] + } + ] + } + } + } + ] + } +} ``` - * Push the gNMI the policy forwarding configuration * Push the configuration to DUT using gnmi.Set with REPLACE option * Configure ATE port 1 with traffic flow @@ -95,11 +135,11 @@ openconfig-network-instance: ```yaml paths: - # Paths added for TE-18.1.3 - MPLS in GRE decapsulation set by gNMI + # Paths added for PF-1.7.1 - MPLS in GRE decapsulation set by gNMI /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/ipv6/config/destination-address: # TODO: /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/config/decapsulate-mpls-in-gre: - # Paths added for TE-18.1.4 - MPLS in UDP decapsulation set by gNMI + # Paths added for PF-1.7.2 - MPLS in UDP decapsulation set by gNMI /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/config/decapsulate-mpls-in-udp: From 3da03c3dcad802cb91bb22598800f40f258bc261 Mon Sep 17 00:00:00 2001 From: vishnureddybadveli <112267356+vishnureddybadveli@users.noreply.github.com> Date: Wed, 8 Jan 2025 18:54:20 -0800 Subject: [PATCH 11/18] Update testregistry.textproto Co-authored-by: Darren Loher --- testregistry.textproto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testregistry.textproto b/testregistry.textproto index 599ca71be97..6b7bd140165 100644 --- a/testregistry.textproto +++ b/testregistry.textproto @@ -436,7 +436,7 @@ test: { } test: { id: "PF-1.7" - description: "MPLS Decapsulation" + description: "Decapsulate MPLS in GRE and UDP" readme: "" exec: " " } From db78b3f2d19aa043a1a2bdc1c2de551086ef03f5 Mon Sep 17 00:00:00 2001 From: vishnureddybadveli <112267356+vishnureddybadveli@users.noreply.github.com> Date: Wed, 8 Jan 2025 19:03:37 -0800 Subject: [PATCH 12/18] Create README.md Created a new directory for decap test cases --- .../policy_forwarding/otg_tests/mpls_gre_udp_decap_test/README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 feature/policy_forwarding/otg_tests/mpls_gre_udp_decap_test/README.md diff --git a/feature/policy_forwarding/otg_tests/mpls_gre_udp_decap_test/README.md b/feature/policy_forwarding/otg_tests/mpls_gre_udp_decap_test/README.md new file mode 100644 index 00000000000..e69de29bb2d From 3807df6e73c56f9d6a18a118167812e243134385 Mon Sep 17 00:00:00 2001 From: vishnureddybadveli <112267356+vishnureddybadveli@users.noreply.github.com> Date: Wed, 8 Jan 2025 19:23:43 -0800 Subject: [PATCH 13/18] Update README.md --- .../mpls_gre_udp_decap_test/README.md | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) diff --git a/feature/policy_forwarding/otg_tests/mpls_gre_udp_decap_test/README.md b/feature/policy_forwarding/otg_tests/mpls_gre_udp_decap_test/README.md index e69de29bb2d..ad8b8233fe3 100644 --- a/feature/policy_forwarding/otg_tests/mpls_gre_udp_decap_test/README.md +++ b/feature/policy_forwarding/otg_tests/mpls_gre_udp_decap_test/README.md @@ -0,0 +1,158 @@ +# PF-1.7 Decapsulate MPLS in GRE and UDP + +Create a policy-forwarding configuration using gNMI to decapsulate MPLS +in GRE and UDP packets which are sent to a loopback address and apply to +the DUT. + +## Topology + +* [`featureprofiles/topologies/atedut_2.testbed`](https://github.com/openconfig/featureprofiles/blob/main/topologies/atedut_2.testbed) + +## Test setup + +TODO: Complete test environment setup steps + +inner_ipv6_dst_A = "2001:aa:bb::1/128" +inner_ipv6_dst_B = "2001:aa:bb::2/128" +inner_ipv6_default = "::/0" + +ipv4_inner_dst_A = "10.5.1.1/32" +ipv4_inner_dst_B = "10.5.1.2/32" +ipv4_inner_default = "0.0.0.0/0" + +outer_ipv6_src = "2001:f:a:1::0" +outer_ipv6_dst_A = "2001:f:c:e::1" +outer_ipv6_dst_B = "2001:f:c:e::2" +outer_ipv6_dst_def = "2001:1:1:1::0" +outer_dst_udp_port = "6635" +outer_dscp = "26" +outer_ip-ttl = "64" + +## Procedure + +### PF-1.7.1 - MPLS in GRE decapsulation set by gNMI + +Canonical OpenConfig for policy forwarding, matching IP prefix with action +decapsulate in GRE. + +```json +{ + "openconfig-network-instance": { + "network-instances": [ + { + "afts": { + "policy-forwarding": { + "policies": [ + { + "config": { + "policy-id": "default decap rule", + "type": "PBR_POLICY" + }, + "policy": "default decap rule", + "rules": [ + { + "config": { + "sequence-id": 1, + }, + "ipv6": { + "config": { + "destination-address": "decap_loopback_ipv6" + } + }, + "action": { + "decapsulate-mpls-in-gre": TRUE + } + } + ] + } + ] + } + } + } + ] + } +} +``` +* Push the gNMI the policy forwarding configuration +* Push the configuration to DUT using gnmi.Set with REPLACE option +* Configure ATE port 1 with traffic flow + * Flow should have a packet encap format : outer_decap_gre_ipv6 <- MPLS label <- inner_decap_ipv6 +* Generate traffic from ATE port 1 +* Validate ATE port 2 receives the innermost IPv4 traffic with correct VLAN and inner_decap_ipv6 + +### PF-1.7.2 - MPLS in UDP decapsulation set by gNMI + +Canonical OpenConfig for policy forwarding, matching IP prefix with action +decapsulate MPLS in UDP. + +```json +{ + "openconfig-network-instance": { + "network-instances": [ + { + "afts": { + "policy-forwarding": { + "policies": [ + { + "config": { + "policy-id": "default decap rule", + "type": "PBR_POLICY" + }, + "policy": "default decap rule", + "rules": [ + { + "config": { + "sequence-id": 1, + }, + "ipv6": { + "config": { + "destination-address": "decap_loopback_ipv6" + } + }, + "action": { + "decapsulate-mpls-in-udp": TRUE + } + } + ] + } + ] + } + } + } + ] + } +} +``` +* Push the gNMI the policy forwarding configuration +* Push the configuration to DUT using gnmi.Set with REPLACE option +* Configure ATE port 1 with traffic flow + * Flow should have a packet encap format : outer_decap_udp_ipv6 <- MPLS label <- inner_decap_ipv6 +* Generate traffic from ATE port 1 +* Validate ATE port 2 receives the innermost IPv4 traffic with correct VLAN and inner_decap_ipv6 + +## OpenConfig Path and RPC Coverage + +```yaml +paths: + + # Paths added for PF-1.7.1 - MPLS in GRE decapsulation set by gNMI + /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/ipv6/config/destination-address: + # TODO: /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/config/decapsulate-mpls-in-gre: + + # Paths added for PF-1.7.2 - MPLS in UDP decapsulation set by gNMI + /network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/config/decapsulate-mpls-in-udp: + + +rpcs: + gnmi: + gNMI.Set: + union_replace: true + replace: true + gNMI.Subscribe: + on_change: true + +``` + +## Required DUT platform + +* FFF From 18dd2c25b00e302b6668277fb480a9e4e0d5ed84 Mon Sep 17 00:00:00 2001 From: vishnureddybadveli <112267356+vishnureddybadveli@users.noreply.github.com> Date: Wed, 8 Jan 2025 19:25:26 -0800 Subject: [PATCH 14/18] Delete feature/gribi/otg_tests/mpls_decap directory --- feature/gribi/otg_tests/mpls_decap/README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 feature/gribi/otg_tests/mpls_decap/README.md diff --git a/feature/gribi/otg_tests/mpls_decap/README.md b/feature/gribi/otg_tests/mpls_decap/README.md deleted file mode 100644 index e69de29bb2d..00000000000 From 0602b4dbdb92381b0fc6413effe7f124d7633232 Mon Sep 17 00:00:00 2001 From: vishnureddybadveli <112267356+vishnureddybadveli@users.noreply.github.com> Date: Wed, 8 Jan 2025 19:28:48 -0800 Subject: [PATCH 15/18] Update testregistry.textproto --- testregistry.textproto | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/testregistry.textproto b/testregistry.textproto index 16eac380e5e..82945e26120 100644 --- a/testregistry.textproto +++ b/testregistry.textproto @@ -434,6 +434,12 @@ test: { readme: "" exec: " " } +test: { + id: "PF-1.7" + description: "Decapsulate MPLS in GRE and UDP" + readme: "" + exec: " " +} test: { id: "PLT-1.1" description: "Interface breakout Test" @@ -1829,4 +1835,4 @@ test: { description: "AFT Streaming" readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/aft/aft_base/otg_tests/aft_prefixcounters/README.md" exec: " " -} \ No newline at end of file +} From c2f739fb3951d8ee9aefefce82cd2b769eb45486 Mon Sep 17 00:00:00 2001 From: vishnureddybadveli <112267356+vishnureddybadveli@users.noreply.github.com> Date: Mon, 13 Jan 2025 08:10:36 -0800 Subject: [PATCH 16/18] Update testregistry.textproto Adding URL for README for decap sub test cases. --- testregistry.textproto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testregistry.textproto b/testregistry.textproto index 82945e26120..b88643a141a 100644 --- a/testregistry.textproto +++ b/testregistry.textproto @@ -437,7 +437,7 @@ test: { test: { id: "PF-1.7" description: "Decapsulate MPLS in GRE and UDP" - readme: "" + readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/policy_forwarding/otg_tests/mpls_gre_udp_decap_test/README.md" exec: " " } test: { From 9d09856641463113e1da4ac6e7fbf7b6e20ca5d1 Mon Sep 17 00:00:00 2001 From: vishnureddybadveli <112267356+vishnureddybadveli@users.noreply.github.com> Date: Mon, 13 Jan 2025 08:14:58 -0800 Subject: [PATCH 17/18] Update README.md Updated 18.1 description mentioning applicability for MPLS in UDP with outer header as IPv6. --- feature/gribi/otg_tests/mpls_in_udp/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/feature/gribi/otg_tests/mpls_in_udp/README.md b/feature/gribi/otg_tests/mpls_in_udp/README.md index 68874f772b9..75be987625c 100644 --- a/feature/gribi/otg_tests/mpls_in_udp/README.md +++ b/feature/gribi/otg_tests/mpls_in_udp/README.md @@ -1,7 +1,7 @@ # TE-18.1 gRIBI MPLS in UDP Encapsulation Create AFT entries using gRIBI to match on next hop group in a -network-instance and encapsulate the matching packets in MPLS in UDP. +network-instance and encapsulate the matching packets in MPLS in UDP with outer header as IPv6 Header. The MPLS in UDP encapsulation is expected to follow [rfc7510](https://datatracker.ietf.org/doc/html/rfc7510#section-3), @@ -241,4 +241,4 @@ rpcs: ## Required DUT platform -* FFF \ No newline at end of file +* FFF From a497b74c6d2e8bf0e399e350a5b241a59f51437f Mon Sep 17 00:00:00 2001 From: vishnureddybadveli <112267356+vishnureddybadveli@users.noreply.github.com> Date: Mon, 13 Jan 2025 08:20:44 -0800 Subject: [PATCH 18/18] Update PF-1.7.1, PF-1.7.2 test cases Updated matching with a generic ip address --- .../otg_tests/mpls_gre_udp_decap_test/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/feature/policy_forwarding/otg_tests/mpls_gre_udp_decap_test/README.md b/feature/policy_forwarding/otg_tests/mpls_gre_udp_decap_test/README.md index ad8b8233fe3..ebc79da1ce2 100644 --- a/feature/policy_forwarding/otg_tests/mpls_gre_udp_decap_test/README.md +++ b/feature/policy_forwarding/otg_tests/mpls_gre_udp_decap_test/README.md @@ -1,7 +1,7 @@ # PF-1.7 Decapsulate MPLS in GRE and UDP Create a policy-forwarding configuration using gNMI to decapsulate MPLS -in GRE and UDP packets which are sent to a loopback address and apply to +in GRE and UDP packets which are sent to a IP from a decap pool or loopback address and apply to the DUT. ## Topology @@ -56,7 +56,7 @@ decapsulate in GRE. }, "ipv6": { "config": { - "destination-address": "decap_loopback_ipv6" + "destination-address": "decap_ipv6" } }, "action": { @@ -106,7 +106,7 @@ decapsulate MPLS in UDP. }, "ipv6": { "config": { - "destination-address": "decap_loopback_ipv6" + "destination-address": "decap_ipv6" } }, "action": {