Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to SRv6 programming model and related objects/attributes #1231

Merged
merged 10 commits into from
Jun 24, 2021
Prev Previous commit
Next Next commit
Added new behaviors to support uSID instruction
Signed-off-by: Ashutosh Agrawal <ashutosh.agrawal@intel.com>
  • Loading branch information
ashutosh-agrawal committed Jun 8, 2021
commit 02e58d95ad966ca9efc24eb9e0c0fa10b21de2a4
57 changes: 29 additions & 28 deletions doc/SAI-IPv6-Segment-Routing-Update.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ SAI IPv6 Segment Routing Update

## Overview ##

Segment Routing with IPv6(SRv6) support was added in SAI 1.2 about 4 years ago. Since then SAI
pipeline model for tunnels and MPLS fowarding has evolved and there have been several
modifications to SRv6 RFCs. This proposal will bring SRv6 APIs and attributes in-line with the
latest RFCs and SAI MPLS/tunnel pipeline model.
Segment Routing with IPv6(SRv6) support was added in SAI 1.2 about 4 years ago. Since then SAI
pipeline model for tunnels and MPLS fowarding has evolved and there have been several
modifications to SRv6 RFCs. This proposal will bring SRv6 APIs and attributes in-line with the
latest RFCs and SAI MPLS/tunnel pipeline model.

Note that SRv6 features and use cases continue to evolve and this proposal is focused on functions
Note that SRv6 features and use cases continue to evolve and this proposal is focused on functions
and behaviors described in the SRv6 Network Programming RFC [
Segment Routing over IPv6 (SRv6) Network Programming]. We will submit additional
Segment Routing over IPv6 (SRv6) Network Programming]. We will submit additional
PRs in future to add support for other functions and use cases. Also, this PR doesn't explicitly address
the functionality related to Traffic Class, Hop-Limit, ECN marking and load-balancing hash calculation.
It's assumed that existing attributes for other IPv6 tunnels will apply to the SRv6 as well.
Expand All @@ -19,14 +19,14 @@ Following list of changes are being proposed:
## Behavioral Model Changes ##

### Endpoint Behavior ###
In the earlier proposal, In order to program the hardware for an Endpoint SID, first a route entry is created for the local SID and then a nexthop entry
is created to specify the endpoint behavior and parameters. This will require either the application or the operating system responsible for making the SAI
API calls to create two additional objects for every LocalSID entry - a route object and a nexthop object. This model is different from the programming model
used for IP tunnels and MPLS. For IP and MPLS tunnel terminations, a separate tunnel_term or Insegment object is created without a need to decompose the tunnel
termination entry into multiple SAI objects.
In the earlier proposal, In order to program the hardware for an Endpoint SID, first a route entry is created for the local SID and then a nexthop entry
is created to specify the endpoint behavior and parameters. This will require either the application or the operating system responsible for making the SAI
API calls to create two additional objects for every LocalSID entry - a route object and a nexthop object. This model is different from the programming model
used for IP tunnels and MPLS. For IP and MPLS tunnel terminations, a separate tunnel_term or Insegment object is created without a need to decompose the tunnel
termination entry into multiple SAI objects.
This proposal will follow the programming model of MPLS segment routing and IP tunnel termination by adding a LocalSID object for SRv6 similar to InSegment
for MPLS.

![SRv6 Endpoint Behavioral Model](figures/SRv6_Endpoint_behavioral_model.png "Figure 1: Endpoint Behavior ")
ashutosh-agrawal marked this conversation as resolved.
Show resolved Hide resolved
__Figure 1: Endpoint Behavior.__

Expand Down Expand Up @@ -125,11 +125,11 @@ typedef enum _sai_next_hop_attr_t

1. Added attribute to enable/disable SRv6 on a RIF.
ashutosh-agrawal marked this conversation as resolved.
Show resolved Hide resolved

```
```
typedef enum _sai_router_interface_attr_t
{
...

/**
* @brief Admin SRV6 state
*
Expand All @@ -147,8 +147,8 @@ typedef enum _sai_router_interface_attr_t

### saisegmentroute.h ###

1. Added new enums for SR Headend functionality with reduced SRH. These new behaviors reduce the length of
SRH by excluding the first segment in the pushed IPv6 header. First segment is placed in only the DA of
1. Added new enums for SR Headend functionality with reduced SRH. These new behaviors reduce the length of
SRH by excluding the first segment in the pushed IPv6 header. First segment is placed in only the DA of
the outer IPv6 header.

```
Expand All @@ -166,7 +166,7 @@ typedef enum _sai_router_interface_attr_t


} sai_segmentroute_sidlist_type_t;
```
```

2. Added enum sai_local_sid_entry_endpoint_type_t to provide the initial list of endpoint behaviors.

Expand Down Expand Up @@ -221,7 +221,7 @@ typedef enum _sai_local_sid_entry_endpoint_behavior_t
} sai_local_sid_entry_endpoint_behavior_t;

```
3. Added enum sai_local_sid_entry_endpoint_flavor_t to list all the combinations of endpoint flavors
3. Added enum sai_local_sid_entry_endpoint_flavor_t to list all the combinations of endpoint flavors
as defined in RFC-8986

```
Expand Down Expand Up @@ -432,7 +432,7 @@ typedef struct _sai_local_sid_entry_t
## Examples ##
- SR Headend
Example configuration for H.Encaps.Red behavior
ashutosh-agrawal marked this conversation as resolved.
Show resolved Hide resolved

1. Create a SID list object with 3 segments

sidlist_entry_attrs[0].id = SAI_SEGMENTROUTE_SIDLIST_ATTR_TYPE
Expand All @@ -442,8 +442,8 @@ typedef struct _sai_local_sid_entry_t
CONVERT_STR_TO_IPV6(sidlist_entry_attrs[1].value.objlist.list[0], "2001:db8:85a3::8a2e:370:7334");
CONVERT_STR_TO_IPV6(sidlist_entry_attrs[1].value.objlist.list[1], "2001:db8:85a3::8a2e:370:2345");
CONVERT_STR_TO_IPV6(sidlist_entry_attrs[1].value.objlist.list[2], "2001:db8:85a3::8a2e:370:3456");
saistatus = sai_v6sr_api->create_segmentroute_sidlist(&sidlist_id, switch_id, 2, sidlist_entry_attrs);
saistatus = sai_v6sr_api->create_segmentroute_sidlist(&sidlist_id, switch_id, 2, sidlist_entry_attrs);

2. Create a tunnel object with source IP used for tunnel encapsulation

tunnel_entry_attrs[0].id = SAI_TUNNEL_ATTR_TYPE
Expand All @@ -463,30 +463,30 @@ typedef struct _sai_local_sid_entry_t
nexthop_entry_attrs[2].id = SAI_NEXT_HOP_ATTR_SEGMENTROUTE_SIDLIST_ID
nexthop_entry_attrs[2].value.oid = sidlist_id
saistatus = sai_v6sr_api->create_nexthop(&nexthop_id, switch_id, 3, nexthop_entry_attrs)

4. Create a route entry which points to the srv6 nexthop

route_entry.switch_id = 0
route_entry.vr_id = vr_id_1 // created elsewhere
route_entry.destination.addr_family = SAI_IP_ADDR_FAMILY_IPV4
route_entry.destination.addr.ip4 = "198.51.100.0"
route_entry.destination.addr.mask = "255.255.255.0"
route_entry.destination.addr.mask = "255.255.255.0"

route_entry_attrs[0].id = SAI_ROUTE_ENTRY_ATTR_NEXT_HOP_ID;
route_entry_attrs[0].value.oid = nexthop_id;
route_entry_attrs[0].value.oid = nexthop_id;
saisstatus = saiv6sr_api->create_route(&route_entry, 1, route_entry_attrs)


- SR Endpoint/Transit

Example configuration for End.DT46 behavior

local_sid_entry.switch_id = 0
local_sid_entry.vr_id = vr_id_1 // underlay VRF
local_sid_entry.locator_len = 64
local_sid_entry.function_len = 8
CONVERT_STR_TO_IPV6(local_sid_entry.sid, "2001:db8:0:1::1000:0:0:0");

local_sid_attr[0].id = SAI_LOCAL_SID_ENTRY_ATTR_ENDPOINT_TYPE
local_sid_attr[0].value = SAI_LOCAL_SID_ENTRY_ENDPOINT_TYPE_DT46
local_sid_attr[1].id = SAI_LOCAL_SID_ENTRY_ATTR_VRF
Expand All @@ -499,4 +499,5 @@ typedef struct _sai_local_sid_entry_t
2. [Segment Routing over IPv6 (SRv6) Network Programming](https://tools.ietf.org/html/rfc8986)
3. [Segment Routing Policy Architecture](https://tools.ietf.org/html/draft-ietf-spring-segment-routing-policy-11)
4. [Segment Routing Architecture](https://datatracker.ietf.org/doc/html/rfc8402)
5. [SRv6 NET-PGM extension: Insertion](https://datatracker.ietf.org/doc/html/draft-filsfils-spring-srv6-net-pgm-insertion-04)
5. [SRv6 NET-PGM extension: Insertion](https://datatracker.ietf.org/doc/html/draft-filsfils-spring-srv6-net-pgm-insertion-04)
6. [Network Programming extension: SRv6 uSID instruction](https://datatracker.ietf.org/doc/html/draft-filsfils-spring-net-pgm-extension-srv6-usid-10)
8 changes: 7 additions & 1 deletion inc/saisegmentroute.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ typedef enum _sai_local_sid_entry_endpoint_behavior_t
/** End.B6.Insert function with a reduced SRH */
SAI_LOCAL_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_INSERT_RED,

/** End.uN function for shift-and-lookup behavior */
SAI_LOCAL_SID_ENTRY_ENDPOINT_BEHAVIOR_UN,

/** End.uN function for shift-and-xconnect behavior */
SAI_LOCAL_SID_ENTRY_ENDPOINT_BEHAVIOR_UA,

/** Custom range base value */
SAI_LOCAL_SID_ENTRY_ENDPOINT_BEHAVIOR_CUSTOM_RANGE_START = 0x10000000,

Expand Down Expand Up @@ -289,7 +295,7 @@ typedef enum _sai_local_sid_entry_attr_t
* @objects SAI_OBJECT_TYPE_NEXT_HOP, SAI_OBJECT_TYPE_NEXT_HOP_GROUP, SAI_OBJECT_TYPE_ROUTER_INTERFACE
* @allownull true
* @default SAI_NULL_OBJECT_ID
* @validonly SAI_LOCAL_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR == SAI_LOCAL_SID_ENTRY_ENDPOINT_BEHAVIOR_X or SAI_LOCAL_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR == SAI_LOCAL_SID_ENTRY_ENDPOINT_BEHAVIOR_DX4 or SAI_LOCAL_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR == SAI_LOCAL_SID_ENTRY_ENDPOINT_BEHAVIOR_DX6 or SAI_LOCAL_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR == SAI_LOCAL_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_ENCAPS or SAI_LOCAL_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR == SAI_LOCAL_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_ENCAPS_RED or SAI_LOCAL_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR == SAI_LOCAL_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_INSERT or SAI_LOCAL_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR == SAI_LOCAL_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_INSERT_RED
* @validonly SAI_LOCAL_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR == SAI_LOCAL_SID_ENTRY_ENDPOINT_BEHAVIOR_X or SAI_LOCAL_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR == SAI_LOCAL_SID_ENTRY_ENDPOINT_BEHAVIOR_DX4 or SAI_LOCAL_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR == SAI_LOCAL_SID_ENTRY_ENDPOINT_BEHAVIOR_DX6 or SAI_LOCAL_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR == SAI_LOCAL_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_ENCAPS or SAI_LOCAL_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR == SAI_LOCAL_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_ENCAPS_RED or SAI_LOCAL_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR == SAI_LOCAL_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_INSERT or SAI_LOCAL_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR == SAI_LOCAL_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_INSERT_RED or SAI_LOCAL_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR == SAI_LOCAL_SID_ENTRY_ENDPOINT_BEHAVIOR_UA
*/
SAI_LOCAL_SID_ENTRY_ATTR_NEXT_HOP_ID,

Expand Down
3 changes: 3 additions & 0 deletions meta/aspell.en.pws
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,6 @@ Wildcard
www
Encaps
Args
xconnect
uA
uN