From 4c6f9934e4d0cb824e0383e9435bd957ea54bcb0 Mon Sep 17 00:00:00 2001 From: Hiroki Shirokura Date: Sun, 23 Feb 2020 16:58:09 +0000 Subject: doc: add new section for srv6 configuration (step2) Signed-off-by: Hiroki Shirokura --- doc/user/zebra.rst | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) (limited to 'doc/user/zebra.rst') diff --git a/doc/user/zebra.rst b/doc/user/zebra.rst index 1539f9a9d..02999a700 100644 --- a/doc/user/zebra.rst +++ b/doc/user/zebra.rst @@ -620,6 +620,104 @@ presence of the entry. 21 Static 10.125.0.2 IPv4 Explicit Null +.. _zebra-srv6: + +Segment-Routing SRv6 +==================== + +Segment-Routing is source routing paradigm that allows +network operator to encode network intent into the packets. +SRv6 is an implementation of Segment-Routing +with application of IPv6 and segment-routing-header. + +All routing daemon can use the Segment-Routing base +framework implemented on zebra to use SRv6 routing mechanism. +In that case, user must configure initial srv6 setting on +FRR's cli or frr.conf or zebra.conf. This section shows how +to configure SRv6 on FRR. Of course SRv6 can be used as standalone, +and this section also helps that case. + +.. index:: show segment-routing srv6 locator [json] +.. clicmd:: show segment-routing srv6 locator [json] + + This command dump SRv6-locator configured on zebra. + SRv6-locator is used to route to the node before performing + the SRv6-function. and that works as aggregation of + SRv6-function's IDs. + Following console log shows two SRv6-locators LOC1 and LOC2. + All locators are identified by unique IPv6 prefix. + User can get that information as JSON string when ``json`` + key word at the end of cli is presented. + +:: + + router# sh segment-routing srv6 locator + Locator: + Name ID Prefix Status + -------------------- ------- ------------------------ ------- + hoge 1 1::/64 Up + fuga 2 2::/64 Up + +.. index:: segment-routing +.. clicmd:: segment-routing +.. index:: srv6 +.. clicmd:: srv6 +.. index:: locators +.. clicmd:: locators + + User can enter the SRv6 configuration node with ``segment-routing`` and + ``srv6`` commands in configure mode. If there is some SRv6-locator exist, + SRv6 feature is looked enabled and this affects running-config. + + User can enter the Locators node with ``locators`` command. + in srv6 configure mode. + After entering locators node, user can configure one or multi SRv6-locators. + +.. index:: locator NAME +.. clicmd:: locator NAME +.. index:: prefix X:X::X:X/M [function-bits-length 32] +.. clicmd:: prefix X:X::X:X/M [function-bits-length 32] + + Following example console log shows the typical configuration of + SRv6 data-plane. After a new SRv6 locator, named LOC1, is created, + LOC1's prefix is configured as ``2001:db8:a:a::/64``. + + If user or some routing daemon allocates new SID on this locator, + new SID will allocated in range of this prefix. + + For example, if some routing daemon creates new SID on locator + (``2001:db8:a:a::/64``), Then new SID will be + ``2001:db8:a:a:7::/80``, ``2001:db8:a:a:8::/80``, and so on. + + Each locator has default SID that is SRv6 local function "End". + Usually default SID is allocated as ``PREFIX:1::``. + (``PREFIX`` is locator's prefix) + For example, if user configure the locator's prefix as + `2001:db8:a:a::/64`, then default SID will be `2001:db8:a:a:1::`) + + The function bits range is 16bits by default. + If operator want to change function bits range, they can configure + with ``function-bits-length`` option. + +:: + + router# configure terminal + router(config)# segment-routinig + router(config-sr)# srv6 + router(config-srv6)# locators + router(config-srv6-locs)# locator LOC1 + router(config-srv6-loc)# prefix 2001:db8:a:a::/64 + + router(config-srv6-loc)# show run + ... + segment-routing + srv6 + locators + locator LOC1 + prefix 2001:db8:a:a::/64 + ! + ... + .. _multicast-rib-commands: Multicast RIB Commands -- cgit v1.2.3 From 6e9e2233270ea4176f6851472947f2c03329a662 Mon Sep 17 00:00:00 2001 From: Hiroki Shirokura Date: Wed, 30 Dec 2020 02:16:44 +0000 Subject: doc: fix srv6 section according to review Signed-off-by: Hiroki Shirokura --- doc/user/zebra.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/user/zebra.rst') diff --git a/doc/user/zebra.rst b/doc/user/zebra.rst index 02999a700..2522ec677 100644 --- a/doc/user/zebra.rst +++ b/doc/user/zebra.rst @@ -669,7 +669,7 @@ and this section also helps that case. ``srv6`` commands in configure mode. If there is some SRv6-locator exist, SRv6 feature is looked enabled and this affects running-config. - User can enter the Locators node with ``locators`` command. + User can enter the Locators node with ``locators`` command in srv6 configure mode. After entering locators node, user can configure one or multi SRv6-locators. @@ -693,7 +693,7 @@ and this section also helps that case. Usually default SID is allocated as ``PREFIX:1::``. (``PREFIX`` is locator's prefix) For example, if user configure the locator's prefix as - `2001:db8:a:a::/64`, then default SID will be `2001:db8:a:a:1::`) + ``2001:db8:a:a::/64``, then default SID will be ``2001:db8:a:a:1::``) The function bits range is 16bits by default. If operator want to change function bits range, they can configure -- cgit v1.2.3 From 4ccd40339c232aa87f180c9893b5b929ea8713d8 Mon Sep 17 00:00:00 2001 From: Hiroki Shirokura Date: Sat, 3 Apr 2021 17:33:06 +0000 Subject: doc: update srv6 cli guide Signed-off-by: Hiroki Shirokura --- doc/user/bgp.rst | 47 ++++++++++++++++++ doc/user/sharp.rst | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++++ doc/user/zebra.rst | 117 ++++++++++++++++++++++++++++---------------- 3 files changed, 261 insertions(+), 42 deletions(-) (limited to 'doc/user/zebra.rst') diff --git a/doc/user/bgp.rst b/doc/user/bgp.rst index dd042e258..0e01b8c3e 100644 --- a/doc/user/bgp.rst +++ b/doc/user/bgp.rst @@ -2597,6 +2597,19 @@ address-family: The CLI will disallow attempts to configure incompatible leaking modes. +.. _bgp-l3vpn-srv6: + +L3VPN SRv6 +---------- + +.. clicmd:: segment-routing srv6 + + Use SRv6 backend with BGP L3VPN, and go to its configuration node. + +.. clicmd:: locator NAME + + Specify the SRv6 locator to be used for SRv6 L3VPN. The Locator name must + be set in zebra, but user can set it in any order. .. _bgp-evpn: @@ -3528,6 +3541,40 @@ Displaying Update Group Information Display Information about update-group events in FRR. +Segment-Routing IPv6 +-------------------- + +.. clicmd:: show bgp segment-routing srv6 + + This command displays information about SRv6 L3VPN in bgpd. Specifically, + what kind of Locator is being used, and its Locator chunk information. + And the SID of the SRv6 Function that is actually managed on bgpd. + In the following example, bgpd is using a Locator named loc1, and two SRv6 + Functions are managed to perform VPNv6 VRF redirect for vrf10 and vrf20. + +:: + + router# show bgp segment-routing srv6 + locator_name: loc1 + locator_chunks: + - 2001:db8:1:1::/64 + functions: + - sid: 2001:db8:1:1::100 + locator: loc1 + - sid: 2001:db8:1:1::200 + locator: loc1 + bgps: + - name: default + vpn_policy[AFI_IP].tovpn_sid: none + vpn_policy[AFI_IP6].tovpn_sid: none + - name: vrf10 + vpn_policy[AFI_IP].tovpn_sid: none + vpn_policy[AFI_IP6].tovpn_sid: 2001:db8:1:1::100 + - name: vrf20 + vpn_policy[AFI_IP].tovpn_sid: none + vpn_policy[AFI_IP6].tovpn_sid: 2001:db8:1:1::200 + + .. _bgp-route-reflector: Route Reflector diff --git a/doc/user/sharp.rst b/doc/user/sharp.rst index 0542a593a..49aa6a08e 100644 --- a/doc/user/sharp.rst +++ b/doc/user/sharp.rst @@ -147,4 +147,143 @@ keyword. At present, no sharp commands will be preserved in the config. Show imported Traffic Engineering Data Base +.. clicmd:: sharp install seg6-routes [vrf NAME] nexthop-seg6 X:X::X:X encap X:X::X:X (1-1000000) + This command installs a route for SRv6 Transit behavior (on Linux it is + known as seg6 route). The count, destination, vrf, etc. have the same + meaning as in the ``sharp install routes`` command. With this command, + sharpd will request zebra to configure seg6 route via ZEBRA_ROUTE_ADD + ZAPI. As in the following example. + +:: + + router# sharp install seg6-routes 1::A nexthop-seg6 2001::2 encap A:: 1 + router# sharp install seg6-routes 1::B nexthop-seg6 2001::2 encap B:: 1 + + router# show ipv6 route + D>* 1::A/128 [150/0] via 2001::2, dum0, seg6 a::, weight 1, 00:00:01 + D>* 1::B/128 [150/0] via 2001::2, dum0, seg6 b::, weight 1, 00:00:01 + + bash# ip -6 route list + 1::A encap seg6 mode encap segs 1 [ a:: ] via 2001::2 dev dum0 proto 194 metric 20 pref medium + 1::B encap seg6 mode encap segs 1 [ b:: ] via 2001::2 dev dum0 proto 194 metric 20 pref medium + +.. clicmd:: sharp install seg6local-routes [vrf NAME] X:X::X:X nexthop-seg6local NAME ACTION ARGS.. (1-1000000) + + This command installs a route for SRv6 Endpoint behavior (on Linux it is + known as seg6local route). The count, destination, vrf, etc. have the same + meaning as in the ``sharp install routes`` command. With this command, + sharpd will request zebra to configure seg6local route via ZEBRA_ROUTE_ADD + ZAPI. As in the following example. + + There are many End Functions defined in SRv6, which have been standardized + in RFC 8986. The current implementation supports End, End.X, End.T, End.DX4, + and End.DT6, which can be configured as follows. + +:: + + router# sharp install seg6local-routes 1::1 nexthop-seg6local dum0 End 1 + router# sharp install seg6local-routes 1::2 nexthop-seg6local dum0 End_X 2001::1 1 + router# sharp install seg6local-routes 1::3 nexthop-seg6local dum0 End_T 10 1 + router# sharp install seg6local-routes 1::4 nexthop-seg6local dum0 End_DX4 10.0.0.1 1 + router# sharp install seg6local-routes 1::5 nexthop-seg6local dum0 End_DT6 10 1 + + router# show ipv6 route + D>* 1::1/128 [150/0] is directly connected, dum0, seg6local End USP, weight 1, 00:00:05 + D>* 1::2/128 [150/0] is directly connected, dum0, seg6local End.X nh6 2001::1, weight 1, 00:00:05 + D>* 1::3/128 [150/0] is directly connected, dum0, seg6local End.T table 10, weight 1, 00:00:05 + D>* 1::4/128 [150/0] is directly connected, dum0, seg6local End.DX4 nh4 10.0.0.1, weight 1, 00:00:05 + D>* 1::5/128 [150/0] is directly connected, dum0, seg6local End.DT6 table 10, weight 1, 00:00:05 + + bash# ip -6 route + 1::1 encap seg6local action End dev dum0 proto 194 metric 20 pref medium + 1::2 encap seg6local action End.X nh6 2001::1 dev dum0 proto 194 metric 20 pref medium + 1::3 encap seg6local action End.T table 10 dev dum0 proto 194 metric 20 pref medium + 1::4 encap seg6local action End.DX4 nh4 10.0.0.1 dev dum0 proto 194 metric 20 pref medium + 1::5 encap seg6local action End.DT6 table 10 dev dum0 proto 194 metric 20 pref medium + +.. clicmd:: show sharp segment-routing srv6 + + This command shows us what SRv6 locator chunk, sharp is holding as zclient. + An SRv6 locator is defined for each SRv6 router, and a single locator may + be shared by multiple protocols. + + In the FRRouting implementation, the Locator chunk get request is executed + by a routing protocol daemon such as sharpd or bgpd, And then Zebra + allocates a Locator Chunk, which is a subset of the Locator Prefix, and + notifies the requesting protocol daemon of this information. + + This command example shows how the locator chunk of sharpd itself is + allocated. + +:: + + router# show segment-routing srv6 locator + Locator: + Name ID 2 2001:db8:2:2::/64 Up + + router# show sharp segment-routing srv6 + Locator loc1 has 1 prefix chunks + 2001:db8:1:1::/64 + +.. clicmd:: sharp srv6-manager get-locator-chunk + + This command requests the SRv6 locator to allocate a locator chunk via ZAPI. + This chunk can be owned by the protocol daemon, and the chunk obtained by + sharpd will not be used by the SRv6 mechanism of another routing protocol. + + Since this request is made asynchronously, it can be issued before the SRv6 + locator is configured on the zebra side, and as soon as it is ready on the + zebra side, sharpd can check the allocated locator chunk via zapi. + +:: + + router# show segment-routing srv6 locator loc1 detail + Name: loc1 + Prefix: 2001:db8:1:1::/64 + Chunks: + - prefix: 2001:db8:1:1::/64, owner: system + + router# show sharp segment-routing srv6 + (nothing) + + router# sharp srv6-manager get-locator-chunk loc1 + + router# show segment-routing srv6 locator loc1 detail + Name: loc1 + Prefix: 2001:db8:1:1::/64 + Chunks: + - prefix: 2001:db8:1:1::/64, owner: sharp + + router# show sharp segment-routing srv6 + Locator loc1 has 1 prefix chunks + 2001:db8:1:1::/64 + +.. clicmd:: sharp srv6-manager release-locator-chunk + + This command releases a locator chunk that has already been allocated by + ZAPI. The freed chunk will have its owner returned to the system and will + be available to another protocol daemon. + +:: + + router# show segment-routing srv6 locator loc1 detail + Name: loc1 + Prefix: 2001:db8:1:1::/64 + Chunks: + - prefix: 2001:db8:1:1::/64, owner: sharp + + router# show sharp segment-routing srv6 + Locator loc1 has 1 prefix chunks + 2001:db8:1:1::/64 + + router# sharp srv6-manager release-locator-chunk loc1 + + router# show segment-routing srv6 locator loc1 detail + Name: loc1 + Prefix: 2001:db8:1:1::/64 + Chunks: + - prefix: 2001:db8:1:1::/64, owner: system + + router# show sharp segment-routing srv6 + (nothing) diff --git a/doc/user/zebra.rst b/doc/user/zebra.rst index 2522ec677..34e102883 100644 --- a/doc/user/zebra.rst +++ b/doc/user/zebra.rst @@ -622,7 +622,7 @@ presence of the entry. .. _zebra-srv6: -Segment-Routing SRv6 +Segment-Routing IPv6 ==================== Segment-Routing is source routing paradigm that allows @@ -640,14 +640,12 @@ and this section also helps that case. .. index:: show segment-routing srv6 locator [json] .. clicmd:: show segment-routing srv6 locator [json] - This command dump SRv6-locator configured on zebra. - SRv6-locator is used to route to the node before performing - the SRv6-function. and that works as aggregation of - SRv6-function's IDs. - Following console log shows two SRv6-locators LOC1 and LOC2. - All locators are identified by unique IPv6 prefix. - User can get that information as JSON string when ``json`` - key word at the end of cli is presented. + This command dump SRv6-locator configured on zebra. SRv6-locator is used + to route to the node before performing the SRv6-function. and that works as + aggregation of SRv6-function's IDs. Following console log shows two + SRv6-locators loc1 and loc2. All locators are identified by unique IPv6 + prefix. User can get that information as JSON string when ``json`` key word + at the end of cli is presented. :: @@ -655,49 +653,84 @@ and this section also helps that case. Locator: Name ID Prefix Status -------------------- ------- ------------------------ ------- - hoge 1 1::/64 Up - fuga 2 2::/64 Up + loc1 1 2001:db8:1:1::/64 Up + loc2 2 2001:db8:2:2::/64 Up + +.. index:: show segment-routing srv6 locator NAME detail [json] +.. clicmd:: show segment-routing srv6 locator NAME detail [json] + + As shown in the example, by specifying the name of the locator, you + can see the detailed information for each locator. Locator can be + represented by a single IPv6 prefix, but SRv6 is designed to share this + Locator among multiple Routing Protocols. For this purpose, zebra divides + the IPv6 prefix block that makes the Locator unique into multiple chunks, + and manages the ownership of each chunk. + + For example, loc1 has system as its owner. For example, loc1 is owned by + system, which means that it is not yet proprietary to any routing protocol. + For example, loc2 has sharp as its owner. This means that the shaprd for + function development holds the owner of the chunk of this locator, and no + other routing protocol will use this area. + +:: + + router# show segment-routing srv6 locator loc1 detail + Name: loc1 + Prefix: 2001:db8:1:1::/64 + Chunks: + - prefix: 2001:db8:1:1::/64, owner: system + + router# show segment-routing srv6 locator loc2 detail + Name: loc2 + Prefix: 2001:db8:2:2::/64 + Chunks: + - prefix: 2001:db8:2:2::/64, owner: sharp .. index:: segment-routing .. clicmd:: segment-routing + + Move from configure mode to segment-routing node. + .. index:: srv6 .. clicmd:: srv6 + + Move from segment-routing node to srv6 node. + .. index:: locators .. clicmd:: locators - User can enter the SRv6 configuration node with ``segment-routing`` and - ``srv6`` commands in configure mode. If there is some SRv6-locator exist, - SRv6 feature is looked enabled and this affects running-config. - - User can enter the Locators node with ``locators`` command - in srv6 configure mode. - After entering locators node, user can configure one or multi SRv6-locators. + Move from srv6 node to locator node. In this locator node, user can + configure detailed settings such as the actual srv6 locator. .. index:: locator NAME .. clicmd:: locator NAME -.. index:: prefix X:X::X:X/M [function-bits-length 32] -.. clicmd:: prefix X:X::X:X/M [function-bits-length 32] - Following example console log shows the typical configuration of - SRv6 data-plane. After a new SRv6 locator, named LOC1, is created, - LOC1's prefix is configured as ``2001:db8:a:a::/64``. + Create a new locator. If the name of an existing locator is specified, + move to specified locator's configuration node to change the settings it. - If user or some routing daemon allocates new SID on this locator, - new SID will allocated in range of this prefix. - - For example, if some routing daemon creates new SID on locator - (``2001:db8:a:a::/64``), Then new SID will be - ``2001:db8:a:a:7::/80``, ``2001:db8:a:a:8::/80``, and so on. - - Each locator has default SID that is SRv6 local function "End". - Usually default SID is allocated as ``PREFIX:1::``. - (``PREFIX`` is locator's prefix) - For example, if user configure the locator's prefix as - ``2001:db8:a:a::/64``, then default SID will be ``2001:db8:a:a:1::``) +.. index:: prefix X:X::X:X/M [function-bits-length 32] +.. clicmd:: prefix X:X::X:X/M [function-bits-length 32] - The function bits range is 16bits by default. - If operator want to change function bits range, they can configure - with ``function-bits-length`` option. + Set the ipv6 prefix block of the locator. SRv6 locator is defined by + RFC8986. The actual routing protocol specifies the locator and allocates a + SID to be used by each routing protocol. This SID is included in the locator + as an IPv6 prefix. + + Following example console log shows the typical configuration of SRv6 + data-plane. After a new SRv6 locator, named loc1, is created, loc1's prefix + is configured as ``2001:db8:1:1::/64``. If user or some routing daemon + allocates new SID on this locator, new SID will allocated in range of this + prefix. For example, if some routing daemon creates new SID on locator + (``2001:db8:1:1::/64``), Then new SID will be ``2001:db8:1:1:7::/80``, + ``2001:db8:1:1:8::/80``, and so on. Each locator has default SID that is + SRv6 local function "End". Usually default SID is allocated as + ``PREFIX:1::``. (``PREFIX`` is locator's prefix) For example, if user + configure the locator's prefix as ``2001:db8:1:1::/64``, then default SID + will be ``2001:db8:1:1:1::``) + + The function bits range is 16bits by default. If operator want to change + function bits range, they can configure with ``function-bits-length`` + option. :: @@ -705,16 +738,16 @@ and this section also helps that case. router(config)# segment-routinig router(config-sr)# srv6 router(config-srv6)# locators - router(config-srv6-locs)# locator LOC1 - router(config-srv6-loc)# prefix 2001:db8:a:a::/64 + router(config-srv6-locs)# locator loc1 + router(config-srv6-loc)# prefix 2001:db8:1:1::/64 router(config-srv6-loc)# show run ... segment-routing srv6 locators - locator LOC1 - prefix 2001:db8:a:a::/64 + locator loc1 + prefix 2001:db8:1:1::/64 ! ... -- cgit v1.2.3