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

srv6: Introduce binding-sid end.b6.encaps used by TE policy. #15170

Draft
wants to merge 45 commits into
base: master
Choose a base branch
from

Conversation

dmytroshytyi-6WIND
Copy link
Contributor

These series of patches introduce new feature: user may configure TE policy srv6 binding SID End.B6.Encaps [0].

Specify the TE policy SRv6 Binding SID:

clicmd:: srv6-binding-sid X:X::X:X

Configuration example:

        configure
         segment-routing
         traffic-eng
          segment-list srv6-header
           index 1 ipv6-address fc00:0:4::
           index 2 ipv6-address fc00:0:5::
          exit
          policy color 1 endpoint fc00:0:6::
           srv6-binding-sid fc00:0:2::                    <<<                    SRv6 binding SID End.B6.Encaps          
           candidate-path preference 1 name srv6 explicit segment-list srv6-header
         exit
        exit
        !

[0] https://www.ietf.org/rfc/rfc8986.html#name-endb6encaps-endpoint-bound-

@dmytroshytyi-6WIND
Copy link
Contributor Author

ci:rerun

@dmytroshytyi-6WIND
Copy link
Contributor Author

ci:rerun

2 similar comments
@dmytroshytyi-6WIND
Copy link
Contributor Author

ci:rerun

@dmytroshytyi-6WIND
Copy link
Contributor Author

ci:rerun

@dmytroshytyi-6WIND
Copy link
Contributor Author

ci:rerun

@riw777 riw777 self-requested a review January 30, 2024 15:21
@ZAFARALI95
Copy link

ZAFARALI95 commented Feb 12, 2024

Hi Dmytro,
Thanks for making these changes and the PR.

I have some High-Level comments.

In the following CLI:
configure
segment-routing
traffic-eng
segment-list srv6-header
index 1 ipv6-address fc00:0:4::

The fc00:0:4:: is an SRv6 SID value and NOT an IPv6 address (by looking at your ISIS configuration).
Can you please make the following change?
s /index ipv6-address / index srv6 SID
The use of "srv6 SID" will align the CLI with the MPLS counterpart (mpls label ).

For "srv6-binding-sid fc00:0:2::" CLI, the cross-pounding MPLS counterpart is "binding-sid 1111:
You may like to consider "binding-sid srv6 ."

Did you test SRv6 uSID encapsulation of the SIDs in the sid-list?

Thanks

Copy link

@ZAFARALI95 ZAFARALI95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reposting to remove formatting issue above.

Hi Dmytro,

Thanks for making these changes and the PR.

I have some High-Level comments.

In the following CLI:
configure
segment-routing
traffic-eng
segment-list srv6-header
index 1 ipv6-address fc00:0:4::

The fc00:0:4:: is an SRv6 SID value and NOT an IPv6 address (by looking at your ISIS configuration).
Can you please make the following change?
s /index ipv6-address / index srv6 SID
The use of "srv6 SID" will align the CLI with the MPLS counterpart (mpls label ).

For "srv6-binding-sid fc00:0:2::" CLI, the cross-pounding MPLS counterpart is "binding-sid 1111:
You may like to consider "binding-sid srv6 ."

Did you test SRv6 uSID encapsulation of the SIDs in the sid-list?

Thanks

@dmytroshytyi-6WIND
Copy link
Contributor Author

Hello,
Thank you for interest in this PR.

The fc00:0:4:: is an SRv6 SID value and NOT an IPv6 address (by looking at your ISIS configuration). Can you please make the following change? s /index ipv6-address / index srv6 SID The use of "srv6 SID" will align the CLI with the MPLS counterpart (mpls label ).

Are you aware of this RFC8402 ?
The section 2 "Terminology" states the next:
"SRv6 SID: an IPv6 address..."

Best,
Dmytro.

api.vrf_id = VRF_DEFAULT;
api.type = ZEBRA_ROUTE_SRTE;
api.distance = 50;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the ZEBRA_SHARP_DISTANCE_DEFAULT define value.
if the value has to be changed, then this will be in zebra.h that it will be done.

@@ -80,7 +80,7 @@

DEFINE_MTYPE_STATIC(LIB, NH_SRV6, "Nexthop srv6");

static vlanid_t filter_vlan = 0;
static vlanid_t filter_vlan;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change is not needed.

@@ -1084,7 +1091,7 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id,
NULL);
}

static struct mcast_route_data *mroute = NULL;
static struct mcast_route_data *mroute;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change is not needed.

@@ -3797,7 +3862,7 @@ static int netlink_macfdb_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
* so perform an implicit delete of any local entry (if it exists).
*/
if (h->nlmsg_type == RTM_NEWNEIGH) {
/* Drop "permanent" entries. */
/* Drop "permanent" entries. */
if (!vni_mcast_grp && (ndm->ndm_state & NUD_PERMANENT)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change it not necessary

Copy link
Member

@pguibert6WIND pguibert6WIND left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comments

index 2 ipv6-address fc00:0:5:: \n \
exit \n \
policy color 1 endpoint fc00:0:6:: \n \
srv6-binding-sid fc00:0:2:: \n \
Copy link
Member

@pguibert6WIND pguibert6WIND Mar 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The binding-sid value should not be the same as the End SID value.
Value has however to be taken from the same locator prefix configured in zebra.
Why not using for instance fc00:0:2:100:: ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be sure we are talking about the same thing. You do not want to install the second route P "fc00:0:2::" that has higher priority (as of now, before changing the distance of p to 150)?

Please, explain why you don't want this change?

SRv6 TE(pathd, or "p") instructs the packets in the network to follow the specified path instead of following the shortest path calculated by the IGP (I).

``

C>* 2001:db8:1::/64 is directly connected, eth-sw1, 00:00:17
I>* fc00:0:1::/48 [115/10] via fe80::38ef:20ff:fe7b:77a9, eth-sw1, weight 1, 00:00:13
p>* fc00:0:2::/128 [150/0] is directly connected, eth-rt4-2, seg6local End.B6.Encap nh6 fc00:0:2::, seg6 fc00:0:4::,fc00:0:5::, weight 1, 00:00:10
I   fc00:0:2::/128 [115/0] is directly connected, sr0 inactive, seg6local End USP, weight 1, 00:00:19

dmytroshytyi-6WIND and others added 26 commits September 5, 2024 15:23
When SRv6 list of segments was changed, change SRv6 policy.

Signed-off-by: Dmytro Shytyi <[email protected]>
When SRv6 segment list size is bigger than 0, send segments
and other elements via zserv_send_message().

Also, an error happens when BGP receives a nexthop update from ZEBRA SRTE.

> Mar 11 08:19:40 north-vm bgpd[3842]: [KM298-5MMJ8] bgp_parse_nexthop_update[VRF default]: Failure to decode nexthop update

The ZEBRA SRTE code can not rely on the routing table. Use instead the
resolved nexthop information gathered by th SRv6 SRTE information.

Signed-off-by: Philippe Guibert <[email protected]>
Signed-off-by: Dmytro Shytyi <[email protected]>
Consider an srv6 policy active, when sr policy set is
received. The sr_policy_validate() function is however
called, the default state value is down, and immediately
sent to UP.

Signed-off-by: Philippe Guibert <[email protected]>
Signed-off-by: Dmytro Shytyi <[email protected]>
Add pathd srv6 segment list support.

Signed-off-by: Philippe Guibert <[email protected]>
Signed-off-by: Dmytro Shytyi <[email protected]>
SRv6 Policy is an ordered list of segments that represent a
source-routed policy. Packet flows are steered into an SRv6
Policy.

Signed-off-by: Dmytro Shytyi <dmytro@[email protected]>
Signed-off-by: Philippe Guibert <[email protected]>
When daemons allocate End.X SIDs they should also pass the interface
index.

Signed-off-by: Carmine Scarpitta <[email protected]>
When isisd allocates an End.X SID it should also pass the interface
index down to zebra.

Signed-off-by: Carmine Scarpitta <[email protected]>
Add a command to show SRv6 SIDs allocated.

Output examples:

```
router# show segment-routing srv6 sid

 SID                Behavior    Context                Daemon/Instance
 -----------------  ----------  ---------------------  -----------------
 fc00:0:1::         uN          -                      isis(0)
 fc00:0:1:fe00::    uDT6        VRF 'vrf10'            bgp(0)
 fc00:0:1:fe01::    uDT6        VRF 'vrf20'            bgp(0)
 fc00:0:1:e000::    uA          Interface 'eth-sw1'    isis(0)
 fc00:0:1:e001::    uA          Interface 'eth-sw1'    isis(0)
```

```
router# show segment-routing srv6 sid fc00:0:1:e000:: detail
 SID                Behavior    Context                Daemon/Instance
 -----------------  ----------  ---------------------  -----------------
 fc00:0:1:e000::    uA          Interface 'eth-sw1'    isis(0)

  Locator: loc1
  Allocation type: dynamic
```

```
router# show segment-routing srv6 sid json
[
  {
    "sid":"fc00:0:1::",
    "behavior":"uN",
    "context":"-",
    "daemons":"isis(0)"
  },
  {
    "sid":"fc00:0:1:fe00::",
    "behavior":"uDT6",
    "context":"VRF 'vrf10'",
    "daemons":"bgp(0)"
  },
  {
    "sid":"fc00:0:1:fe01::",
    "behavior":"uDT6",
    "context":"VRF 'vrf20'",
    "daemons":"bgp(0)"
  },
  {
    "sid":"fc00:0:1:e000::",
    "behavior":"uA",
    "context":"Interface 'eth-sw1'",
    "daemons":"isis(0)"
  },
  {
    "sid":"fc00:0:1:e001::",
    "behavior":"uA",
    "context":"Interface 'eth-sw1'",
    "daemons":"isis(0)"
  }
]
```

Signed-off-by: Carmine Scarpitta <[email protected]>
Some debug traces are visible by default whereas it should not:

> ... Registering nexthop(2001:db8::1/128) for candidate srte_ipv6 pref 10

Add a 'debug pathd zebra' command.
By default, traces are not visible.

Signed-off-by: Philippe Guibert <[email protected]>
Acked-by: Dmytro Shytyi <[email protected]>
The SID manager should be able to provide SID to SRTE policies.
An explicit SID value should be proposed by the pathd daemon to
ZEBRA, based on an usage context.

The usage context is defined by the srv6_sid_ctx structure, and
should help an operator to know the reason why a SID has been
allocated.

For SRTE policies, the usage is a binding SID IPv6 attached to
a SRTE policy. The sid context should be based on the color and
the nexthop of the policy. Propose to extend the srv6_sid_ctx
structure by adding the 'color' attribute, as the ipv6 nexthop
is already present.

Signed-off-by: Philippe Guibert <[email protected]>
Acked-by: Dmytro Shytyi <[email protected]>
Add srv6-binding-sid X:X::X:X to Traffic Engineering Policy.

End.B6.Encaps - Endpoint bound to an SRv6 Policy with
encapsulation SRv6 instantiation of a Binding SID.

Signed-off-by: Dmytro Shytyi <[email protected]>
Add SRv6 Binding SID to YANG model, pathd and zclient
headers. Provide CLI and NB handlers for SRv6 Binding
SID.

Signed-off-by: Dmytro Shytyi <[email protected]>
Signed-off-by: Philippe Guibert <[email protected]>
Encode the resolved nexthops number when zapi_sr_policy_encode
is called.
Fixes: 223d488 ("pathd, lib: add srv6 policy with resolved nexthop info")

Signed-off-by: Dmytro Shytyi <[email protected]>
Change symbol for ZEBRA_ROUTE_SRTE from "-" to "p".
It will be used by the further commits to display
installed SRv6 Binding SID.

Signed-off-by: Dmytro Shytyi <[email protected]>
Add "p - SR-TE" field to the list.

rt2# show ipv6 route
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIPng, O - OSPFv3, I - IS-IS, B - BGP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric, t - Table-Direct, p - SR-TE
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

Signed-off-by: Dmytro Shytyi <[email protected]>
We use ZAPI_ROUTE_ADD/DELETE, as SRv6 treatment
is based on the routes and not MPLS entries.
Set SRv6 binding SID in zebra sr policy from
srte_policy.

Signed-off-by: Dmytro Shytyi <[email protected]>
Add SRv6 SIDs and their number to the nexthop structure
for end.b6.encaps seg6local.

Extend zapi_nexthop_from_nexthop end.b6.encap support
and en_de_code srv6_bsid.

Signed-off-by: Dmytro Shytyi <[email protected]>
Introduce the End.B6.Encaps in the rt_netlink code.

Signed-off-by: Dmytro Shytyi <[email protected]>
Signed-off-by: Philippe Guibert <[email protected]>
The topotest for End.B6.Encaps binding sid is provided.

At rt4 out the effect of End.B6.Encaps:
1. decrement the counter of the current segment list
2. add the SRH [0]fc00:0:5::, [1]fc00:0:4::

Signed-off-by: Dmytro Shytyi <[email protected]>
The update of the srv6-binding-sid value of a policy triggers the
emission of a message to ZEBRA

configured:
> segment-routing
> traffic-eng
> policy color 1 endpoint 1::1
> srv6-binding-sid 1001::1
> [..]
> srv6-binding-sid 1001::40

output on logs:
> 2024/06/11 10:09:35 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_DELETE:0:40] comes from socket [34]

The previous BSID is attempted to be flushed, whereas it has never
been installed: the SR policy is not up and does not have any
candidate paths.

Fix this by using a BSID_IPV6_INSTALLED flag on srte policy to
tell whether the BSID is installed or not.

Signed-off-by: Philippe Guibert <[email protected]>
Acked-by: Dmytro Shytyi <[email protected]>
A policy can be defined with whatever binding ipv6 sid address,
whereas this value should be uniquely used by the SR-TE service,
and should own a defined srv6 locator.

Add the ability for The pathd daemon to request SRv6 SID values
to the zebra srv6 SID manager.

Compared with the previous behaviour, the user will have to
configure a locator, and the used binding sid should be in this
locator and be freed (not used by an other CP daemon). If not,
the binding SID will be configured but not usable.

Signed-off-by: Philippe Guibert <[email protected]>
Acked-by: Dmytro Shytyi <[email protected]>
Let pathd be aware of the list of locators. Upon the presence of
a locator, the policies are parsed to re-send srv6 sid requests
that previously failed. Upon the deletion of a locator, release
the sids that previously used it.

Signed-off-by: Philippe Guibert <[email protected]>
Acked-by: Dmytro Shytyi <[email protected]>
Introduce the command use-srv6-sid-manager within
srv6 te policy that allows to specify the srv6 bsid
outside of the srv6 locator.

Signed-off-by: Dmytro Shytyi <[email protected]>
Signed-off-by: Philippe Guibert <[email protected]>
Add the backend for SRTE 'use-srv6-sid-manager' command to tell the SRTE service
to use or not BSIDs allocated from the SRv6 SIDs pool of the zebra
locators.
- Handle the sync between pathd and zebra.
- Handle the parameter configuration change impact on SID allocation

Signed-off-by: Philippe Guibert <[email protected]>
Signed-off-by: Dmytro Shytyi <[email protected]>
Check the presense of srv6 bsid route (based/not based on srv6 locator)
when allocated with or without srv6-sid-manager.

Signed-off-by: Dmytro Shytyi <[email protected]>
SRTE 'use-srv6-sid-manager' command tells the SRTE
service to use or not BSIDs allocated from the SRv6
SIDs pool of the zebra locators.

Signed-off-by: Dmytro Shytyi <[email protected]>
Copy link

github-actions bot commented Sep 5, 2024

This pull request has conflicts, please resolve those before we can evaluate the pull request.

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

Successfully merging this pull request may close these issues.

4 participants