Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SRv6 in SONiC

ebiken
August 24, 2023

SRv6 in SONiC

> SRv6研究会#18 @新潟・柏崎

SONiC SRv6 サポート状況や現在提案されている課題や拡張機能などを整理。

DEMOとして以下2つの設定・パケット・ログなどを紹介しています。
- APPL_DB エントリを直接操作(End.DT46, H.Encaps.Red)
- FRRouting連携(uSID: uN, uDT46)

ebiken

August 24, 2023
Tweet

More Decks by ebiken

Other Decks in Technology

Transcript

  1. SRv6 in SONiC SRv6研究会#18 2023/08/24 SRv6 in SONiC | SRv6研究会#18

    @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24
  2. • Overview ~ SONiC Architecture • Status of SRv6 in

    SONiC/FRR • SONiC SRv6 サポート状況 • SRv6 FRR/SONiC Integration Status • Alibaba: SRv6 VPN 課題&拡張提案 • SONiC Routing WG ~ Discussions Summary • Implementation of SRv6 in SONiC • APPL_DB schema (H.Encaps.Red, End.DT46, End.uN, End.uDT46) • APPL_DB => ASIC_DB 処理フロー(End.DT46, H.Encaps.Red) • Demo: SRv6 in SONiC (End.DT46, H.Encaps.Red) • Demo: SRv6 in SONiC/FRR (uSID: uN, uDT46) Table of Contents SRv6 in SONiC | SRv6研究会#18 @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24
  3. List of HLD/PR/Issues released to SRv6 FRR/SONiC SRv6 in SONiC

    | SRv6研究会#18 @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 SONiC HLD • [2] SONiC: Segment Routing over IPv6 (SRv6) HLD https://github.com/sonic-net/SONiC/blob/master/doc/srv6/srv6_hld.md • [7] SONiC HLD: SONiC uSID https://github.com/sonic-net/SONiC/blob/master/doc/srv6/SRv6_uSID.md • [] SRv6 VPN HLD (Alibaba): https://github.com/sonic-net/SONiC/blob/master/doc/srv6/srv6_vpn.md SONiC PR • [3] Srv6 hld #795 https://github.com/sonic-net/SONiC/pull/795 • [8] SRv6 uSID design for srv6orch #1034 https://github.com/sonic-net/SONiC/pull/1034 • [] [orchagent, SRv6]: create seglist support to set sid list type #2406 https://github.com/sonic-net/sonic-swss/pull/2406 SONiC Release notes • [] SONiC_202111_Release_Notes.md • [] SONiC_202211_Release_Notes.md SAI • [1] SAI: SAI IPv6 Segment Routing Proposal for SAI 1.2.0 https://github.com/opencomputeproject/SAI/blob/master/doc/SAI-Proposal- IPv6_Segment_Routing-1.md • [4] SAI: SAI IPv6 Segment Routing Update (SAI 1.9.1) https://github.com/opencomputeproject/SAI/blob/master/doc/SAI-IPv6-Segment-Routing-Update.md • [5] SAI v1.91: PR: Updates to SRv6 programming model and related objects/attributes #1231 https://github.com/opencomputeproject/SAI/pull/1231 • [6] SAI v1.91: PR: Added uSID related attributes which were accidentally deleted in last c… #1261 https://github.com/opencomputeproject/SAI/pull/1261 • [10] SAI v1.12: SRv6 VPN enhancements #1744 https://github.com/opencomputeproject/SAI/pull/1744 Others • [] SONiC issues: Upgrade to FRR 8.5.1 #1381 https://github.com/sonic-net/SONiC/issues/1381 • [] SONiC PR: [frr]FRR 8.5.1 integration changes #15965 https://github.com/sonic-net/sonic-buildimage/pull/15965 FRR SRv6 • [9] FRR PR: bgpd, zebra: Add support for SRv6 uSID Behaviors #12219 https://github.com/FRRouting/frr/pull/12219 • isisd: Add support for SRv6 uSID (RFC 9352) #13724 • bgpd: Add support for BGP vrf route copying #13582 • zebra: Add the missing Source Addr param for SRv6 Encapsulation #12261 • zebra: Extend the FPM module to push the missing SRv6 information #12301 FRRouting FPM protobuf extension (Alibaba) • zebra: Adding a new dataplane using protobuf #14173 • Dplane test server #14219
  4. Overview ~ SONiC Architecture SRv6 in SONiC | SRv6研究会#18 @

    新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24
  5. SONiC Architecture SRv6 in SONiC | SRv6研究会#18 @ 新潟・柏崎 |

    Kentaro Ebsiawa | 2023/08/24 https://github.com/sonic-net/SONiC/wiki/Architecture
  6. SONiC Architecture (SRv6 related modules) SRv6 in SONiC | SRv6研究会#18

    @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 SONiC core modules FRRouting zebra FPM module fpm | dplane_fpm_nl bgpd isisd fpmsyncd APP_DB netlink over fpm ASIC_DB swss orchagent syncd Switch ASIC SAI driver (per ASIC) • SONiC の基本構造 • APP_DB にエントリを作成 • swss/orchagent が ASIC_DB 形式に変換 • syncd が ASIC_DB のエントリをSAI API を用いて ASIC に設定 • APP_DB にエントリを作成するのは様々な方法がある • 直接APP_DBを操作(コントローラやエージェントなど) • fpmsyncd (FRR) (Cisco/Alibaba実装あるが、マージされていない) • CLIが設定した CONFIG_DB から(SRv6は未対応)
  7. Status of SRv6 in SONiC/FRR SRv6 in SONiC | SRv6研究会#18

    @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24
  8. SONiC SRv6 サポート状況(2023/08/18) SRv6 in SONiC | SRv6研究会#18 @ 新潟・柏崎

    | Kentaro Ebsiawa | 2023/08/24 ※ SRv6 Behaviors は SAI x SONiC x ASIC の組合せで決まるため、機材選択の際は Platform (ASIC) 毎のサポート状況も要確認 ※ SAI 1.9.1 で現在の SRv6 Object Model へのリファクタリング[5] 、SAI 1.12 でSRv6 L3VPN拡張[10]を実施。 ※ uSID in FRR は FRR 8.5 にマージされている(https://frrouting.org/release/8.5/) ※ SONiC.202311 で FRR 8.5.1 へのアップグレードが計画されている SONiC version SAI version FRR version SRv6 Behaviors 説明 HLD, PR SONiC.201803 SAI 1.2.0 n/a • Cavium XPliant チームが開発 • おそらく XPliant でしか動作しない • SAI Object 含め 202111 で変更された [1] SONiC.202111 SAI 1.9.1 FRR 7.5.1 End End.DT46 H.Encaps.Red • Platform: Tofino (確認済み), SiliconOne • 現在のデザイン(SAI Object, APPL_DB, ASIC_DB) [2] [3] [4] [5] [6] SONiC.202211 SAI 1.11.1 FRR 8.2.2 uN, uA uDX, uDT • Platform: Tofino (確認済み), SiliconOne • (FRRouting での uSID サポートが同時に進められて いたが、FRR v8.2.2 には含まれていない) [7] [8] [9] [10] SONiC.202305 SAI 1.12 FRR 8.2.2 - • FRRouting との統合(fpmsyncd拡張)や SRv6 L3VPN が計画されていたがマージされていない SONiC.202311 TBD FRR 8.5.1 ?? • Path Tracing や、uSIDの機能拡張(IS-IS)が予定さ れている • uSIDに関しては、SONiC側の変更が必要かは不明 SONiC.202211 でデータプレーン(FRR無し)の多くの機能がサポートされた コントロールプレーン(FRR)の統合は SONiC.202305 で予定されていたがマージされていない (デモは有り)
  9. SONiC でサポートされている behavior SRv6 in SONiC | SRv6研究会#18 @ 新潟・柏崎

    | Kentaro Ebsiawa | 2023/08/24 • High Level Design ドキュメントでサポートしていると記載されている(≠ 動作確認済み)behavior • ASICそのものや ASIC ベンダの syncd が対応している必要がある事に注意 • SONiC.202211 で uSID サポートされた際に End.uDX もサポートされたと記述があるが、テスト(test/srv6.py)に含 まれておらず動作しない可能性あり(逆に、End.uDX が動作するなら End.DX も動作する可能性がある) • SONiC.201111 • End • End.DT46/4/6 (※1) • H.Encaps.Red • SONiC.202211 • uN (PSP and USD flavor) • uA (PSP and USD flavor) • uDT46/4/6, uDX4/6(※2) SRv6 Behavior sai_my_sid_entry_endpoint_behavior_t SONiC. 202111 SONiC. 202211 end SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_E YES YES end.dt6 SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT6 YES YES end.dt4 SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT4 YES YES end.dt46 SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT46 YES YES end.udx6 SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DX6 YES end.udx4 SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DX4 YES end.udt6 SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT6 YES end.udt4 SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT4 YES end.udt46 SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT46 YES end.un SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UN YES end.ua SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UA YES SONiC.202111: https://github.com/sonic-net/SONiC/blob/master/doc/srv6/srv6_hld.md SONiC.202211: https://github.com/sonic-net/SONiC/blob/master/doc/srv6/SRv6_uSID.md ※1 HLDには End.DT46 のみ記載だが、おそらく動作する ※2 uDT, uDX は SONiC のレイヤでは End.DT4/End.DT6, End.DX4/End.DX6 と同じ 実装(動作の違いはデータプレーンでのパケット処理方法)
  10. orchagent で定義されている end point behavior (確認方法) SRv6 in SONiC |

    SRv6研究会#18 @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 https://github.com/sonic-net/sonic-swss/blob/master/orchagent/srv6orch.cpp const map<string, sai_my_sid_entry_endpoint_behavior_t> end_behavior_map = { {"end", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_E}, {"end.x", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_X}, {"end.t", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_T}, {"end.dx6", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DX6}, {"end.dx4", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DX4}, {"end.dt4", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT4}, {"end.dt6", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT6}, {"end.dt46", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT46}, {"end.b6.encaps", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_ENCAPS}, {"end.b6.encaps.red", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_ENCAPS_RED}, {"end.b6.insert", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_INSERT}, {"end.b6.insert.red", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_INSERT_RED}, {"udx6", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DX6}, {"udx4", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DX4}, {"udt6", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT6}, {"udt4", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT4}, {"udt46", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT46}, {"un", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UN}, {"ua", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UA} }; bool Srv6Orch::sidEntryEndpointBehavior( string action, sai_my_sid_entry_endpoint_behavior_t &end_behavior, sai_my_sid_entry_endpoint_behavior_flavor_t &end_flavor) { if (action == "end") { end_behavior = SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_E; end_flavor = SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_FLAVOR_PSP_AND_USD; } else if (action == "end.x") { end_behavior = SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_X; end_flavor = SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_FLAVOR_PSP_AND_USD; } ...snip... else { SWSS_LOG_ERROR("Invalid endpoing behavior function"); return false; } return true; } SONiC.202211 SONiC.202111 SONiC.202111 では bool Srv6Orch::sidEntryEndpointBehavior でサポートしているかチェック SONiC.202211 からは uSID 追加時に const map として定義しており、見やすくなった end.dx と end.udx 、end.dt と end.udt は同じ type (処理ロジックが同じ)
  11. orchagent で定義されている end point behavior SRv6 in SONiC | SRv6研究会#18

    @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 SRv6 Behavior sai_my_sid_entry_endpoint_behavior_t 202111 202211 end SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_E YES YES end.x SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_X YES YES end.t SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_T YES YES end.dx6 SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DX6 YES YES end.dx4 SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DX4 YES YES end.dt6 SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT6 YES YES end.dt4 SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT4 YES YES end.dt46 SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT46 YES YES end.b6.encaps SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_ENCAPS YES YES end.b6.encaps.red SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_ENCAPS_RED YES YES end.b6.insert SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_INSERT YES YES end.b6.insert.red SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_INSERT_RED YES YES end.udx6 SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DX6 YES end.udx4 SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DX4 YES end.udt6 SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT6 YES end.udt4 SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT4 YES end.udt46 SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT46 YES end.un SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UN YES end.ua SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UA YES 注:定義されているだけで、実装有無は未確認
  12. • 202305 release: SRv6 VPN SID and fpmsyncd extension was

    proposed for 202305 • HLD PR is already merged: https://github.com/sonic-net/SONiC/pull/1252 • Feature PRs in the HLD is still under review <= fpmsyncd SRv6対応がマージされていない • [202305][SRv6]: SRv6 VPN SID #2765 • SRv6 L3VPN only solution, without the need to use SID List • SAI 1.12 opencomputeproject/SAI #1744 • [fpmsyncd] Add support for SRv6 #2515 • fpmsyncd extension for FRR and SONiC integration via dplane_fpm_nl module • SONiC workaround: add cli(frr) design doc for srv6_vpn #1343 • 202311 release: 3 features are planned for 202311 • Tracked in GitHub: SONiC 202311 Release Projects page • SRv6 Performance Measurement · Issue #1395 · sonic-net/SONiC (github.com) • SRv6 uSID enhancement for IS-IS · Issue #1369 · sonic-net/SONiC (github.com) • SRv6 Path Tracing · Issue #1368 · sonic-net/SONiC (github.com) (draft-filsfils-spring-path-tracing) • FRRouting FPM protobuf extension for SRv6 policy communication • This is being discussed in the SONIC Routing WG meeting • Few PRs already opened to FRR: FRRouting/frr/pull/14173 | FRRouting/frr/pull/14219 • (Alibaba has funded several interns on the FRR/SONiC work) SRv6 FRR/SONiC Integration Status SRv6 in SONiC | SRv6研究会#18 @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24
  13. • https://github.com/sonic-net/SONiC/blob/master/doc/srv6/srv6_vpn.md • Current SONiC's Design Limitations and workarounds •

    We don't have an efficient infrastructure to communicate between FRR related processes and SONiC related processes due to current SONiC design limitation. This area needs to be redesigned in the future. Alibaba's business can't wait for the community agreed solution to be ready, therefore we put in the following workaround for an overall solution in the cloud environment. These workarounds would NOT be commited in 202305 release. We will raise PRs and provide diff for referencing purposes only. • SRv6 policy download (SRV6_POLICY_TABLE on APPL_DB) • For a simple workaround, FRR pathd would add, update and delete SRv6 policy related information by writing to APP_DB directly. • MY_SID enhancement (SRV6_MY_SID_TABLE) • For a simple workaround, Zebra would add, update and delete SRV6_MY_SID by writing to APP_DB directly. • Notify BFD state changes events to FRR bfdd • For notifying bfdd in FRR, we introduce a new bfdsyncd process in our code base which would set up a TCP socket connection between FRR's bfdd process and SWSS's bfd syncd process. This new process monitors state db for hardware offloaded bfd sessions' state change events and relay these state change events to FRR's bfdd. Alibaba usage of SRv6/SONiC SRv6 in SONiC | SRv6研究会#18 @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24
  14. • ROUTE_TABLE フィールド追加 • vpn_sid = vpn_sid (PR有り) • Optional

    field to add vpn_sid to learnt BGP routes • [SRv6]: SRv6 VPN SID #2793 • policy = policy (PR無し) • Optional field to add a list of policy names, separated by ',' • SRv6 Policy サポート(次スライド) • VPN Routes Scale Enhancements • orchagent の改善により 2M route でメモリ消費量を 3.5GB -> 1.4GB に削減 Alibaba: SRv6 VPN 課題&拡張提案 SRv6 in SONiC | SRv6研究会#18 @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24
  15. Alibaba: SRv6 VPN 課題&拡張提案 Alibaba proposal: SRv6 policy SRv6 in

    SONiC | SRv6研究会#18 @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 > SRV6_POLICY_TABLE (APP_DB) key = SRV6_POLICY_TABLE|policy_name ; segment = SRv6_SID_LIST.key, ; List of segment names, separated by ',' weight = weight_list ; List of weights, separated by ',' > ROUTE_TABLE (APP_DB) key = ROUTE_TABLE:VRF_NAME:prefix ; nexthop = prefix, ; IP addresses separated ',' intf = ifindex? PORT_TABLE.key ; zero or more separated by ',' vni_label = VRF.vni ; zero or more separated by ',' router_mac = mac_address ; zero or more remote router MAC address separated by ',' blackhole = BIT ; Set to 1 if this route is a blackhole (or null0) segment = SRV6_SID_LIST.key ; Optional field. List of segment names, separated by ',' seg_src = address ; Optional field. Source addrs for sid encap vpn_sid = vpn_sid ; Optional field to add vpn_sid to learnt BGP routes policy = policy ; Optional field to add a list of policy names, separated by ',' Alibaba 独自実装は FRR pathd から直接 APP_DB へエントリ追加 FPM に新しく protobuf で通信できるモジュールを追加する提案(次スライド) orchagent の拡張も必要
  16. SONiC FRRouting Alibaba: SRv6 VPN 課題&拡張提案 (This is being discussed

    in the SONIC Routing WG meeting) • zebra: Adding a new dataplane using protobuf #14173 • https://github.com/FRRouting/frr/pull/14173 • dplane_fpm_pb • protobuf version of FPM dplane_fpm_nl module • built using zebra’s data plane framework (as same as dplane_fpm_nl) • one can add a new data structure to fpm/fpm.proto • FRRouting Docs » FPM FPM protobuf extension for SRv6 policy (Alibaba) SRv6 in SONiC | SRv6研究会#18 @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 zebra FPM module dplane_fpm_nl dplane_fpm_pb bgpd isisd fpmsyncd APP_DB netlink protobuf
  17. SONiC Routing WG ~ Discussions Summary (2023/08/18) SRv6 in SONiC

    | SRv6研究会#18 @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 https://lists.sonicfoundation.dev/g/sonic-wg-routing/ Chair: Eddie @ Alibaba Weekly Meeting: Every Friday 9:30 AM JST (10:30 after Nov)
  18. Implementation of SRv6 in SONiC SRv6 in SONiC | SRv6研究会#18

    @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24
  19. SONiC Architecture (SRv6 related modules) SRv6 in SONiC | SRv6研究会#18

    @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 SONiC core modules FRRouting zebra FPM module fpm | dplane_fpm_nl bgpd isisd fpmsyncd APP_DB netlink ASIC_DB swss orchagent syncd Switch ASIC SAI driver (per ASIC) • SONiC の基本構造 • APP_DB にエントリを作成 • swss/orchagent が ASIC_DB 形式に変換 • syncd が ASIC_DB のエントリをSAI API を用いて ASIC に設定 • APP_DB にエントリを作成するのは様々な方法がある • 直接APP_DBを操作(コントローラやエージェントなど) • fpmsyncd (FRR) (Cisco/Alibaba実装あるが、マージされていない) • CLIが設定した CONFIG_DB から(SRv6は未対応) 再掲
  20. Controller Controller App, CLI, Python Script, etc. BGP Container (FRR)

    SRv6 on SONiC デザイン(SONiC.202111) SRv6 in SONiC | SRv6研究会#18 @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 CONFIG_DB APPL_DB ASIC_DB Orchagent Srv6Orch RouteOrch fpmsyncd kernel FRR SRV6_SID_LIST sidlist_name: path SRV6_MY_SID_TABLE address (loc/func/arg): len, action, param SRV6_POLICY policy_name: segment list SRV6_STEER vrf|prefix: policy, src SRV6_MY_SID_TABLE block_len:node_len:func_len:arg_len:ipv6address, action, param ROUTE_TABLE VRF_NAME:prefix: segment (list), seg_src SAI_OBJECT_TYPE_MY_SID_ENTRY SAI_OBJECT_TYPE_SRV6_SIDLIST SAI_OBJECT_TYPE_TUNNEL SAI_OBJECT_TYPE_NEXTHOP SAI_OBJECT_TYPE_ROUTE_ENTRY syncd ASIC Vendor SAI 経由で ASICにエントリ投入 SRV6_SID_LIST_TABLE sidlist_name: path !! 最初のデザイン ⇒ この通りには実装されていない!! (e.g. CONFIG_DB, FRR連携は未実装)
  21. APPL_DB schema SRv6 in SONiC | SRv6研究会#18 @ 新潟・柏崎 |

    Kentaro Ebsiawa | 2023/08/24 > holds local SID to behavior mapping > Stores SRV6 MY_SID table entries and associated actions key = SRV6_MY_SID_TABLE:block_len:node_len:func_len:arg_len:ipv6address ; field = value action = behavior ; behaviors defined for local SID vrf = VRF_TABLE.key ; VRF name for END.DT46, can be empty adj = address, ; List of adjacencies for END.X, can be empty segment = SRv6_SID_LIST.key, ; List of segment names for END.B6.ENCAP, source = address, ; List of src addrs for encap for END.B6.ENCAP APPL_DB のスキーマは sonic-swss: doc/swss-schema.md に記載されている https://github.com/sonic-net/sonic-swss/blob/master/doc/swss-schema.md#srv6_sid_list_table しかし、SRV6_SID_LIST_TABLE SRV6_MY_SID_TABLE に関しては誤っているため、動作確認できたHDL記載の以下スキーマを参照 > Issue https://github.com/sonic-net/sonic-swss/issues/2555 > Stores IPV6 prefixes for a SRV6 segment name key = SRV6_SID_LIST_TABLE:segment_name ; field = value path = STRING, ; List of SIDs. Comma-separated list of IPV6 prefixes for a SRV6 segment type = STRING ; SRV6 segment list type like "insert", "encaps.red"; default type will be "encaps.red" > Stores a list of routes key = ROUTE_TABLE:VRF_NAME:prefix ; ; field = value nexthop = *prefix, ;IP addresses separated “,” ifname = ifindex? PORT_TABLE.key mpls_nh = STRING ; Comma-separated list of MPLS NH info. blackhole = BIT ; Set to 1 if this route is a blackhole weight = weight_list ; List of weights. nexthop_group = string ; index within the NEXTHOP_GROUP_TABLE, segment = string ; SRV6 segment name seg_src = string ; ipv6 address for SRV6 tunnel source vpn_sid = string ; ipv6 address for SRV6 VPN sid ドキュメントにより schema 定義は不整合あり schema 定義に頼らず、Source Code やテスト結果を確認する
  22. APPL_DB example (H.Encaps.Red, End.DT46) SRv6 in SONiC | SRv6研究会#18 @

    新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 > SRV6_MY_SID_TABLE "SRV6_MY_SID_TABLE:32:32:16:0:2001:db8:ffff:1:14::": { "action": "end.dt46", "vrf": "Vrf_srv6" } > SRV6_SID_LIST_TABLE "SRV6_SID_LIST_TABLE:seg3": { "path": "2001:db8::100,2001:db8::103", "type": "encaps.red" } > ROUTE_TABLE "ROUTE_TABLE:Vrf_srv6:10.3.0.0/24": { "segment": "seg3", "seg_src": "2001:db8:ffff::3" }
  23. APPL_DB example (End.uN, End.uDT46) SRv6 in SONiC | SRv6研究会#18 @

    新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 > SRV6_MY_SID_TABLE SRV6_MY_SID_TABLE:32:16:16:0:fc00:0:1:6500:: {'action': 'udt46', 'vrf': 'Vrf1'} SRV6_MY_SID_TABLE:32:16:16:0:fc00:0:1:6600:: {'action': 'udt46', 'vrf': 'Vrf2'} SRV6_MY_SID_TABLE:32:16:16:0:fc00:0:1:: {'action': 'un'} > SRV6_SID_LIST_TABLE SRV6_SID_LIST_TABLE:fc00:0:2:6500:: {'path': 'fc00:0:2:6500::'} SRV6_SID_LIST_TABLE:fc00:0:2:6600:: {'path': 'fc00:0:2:6600::'} > ROUTE_TABLE ROUTE_TABLE:Vrf1:2001:0:101:2::/64 {'segment': 'fc00:0:2:6500::', 'seg_src': 'fc00:0:1::1'} ROUTE_TABLE:Vrf1:10.101.2.0/24 {'segment': 'fc00:0:2:6500::', 'seg_src': 'fc00:0:1::1'} ROUTE_TABLE:Vrf2:2001:0:102:2::/64 {'segment': 'fc00:0:2:6600::', 'seg_src': 'fc00:0:1::1'} ROUTE_TABLE:Vrf2:10.102.2.0/24 {'segment': 'fc00:0:2:6600::', 'seg_src': 'fc00:0:1::1'}
  24. APPL_DB => ASIC_DB 処理フロー(End.DT46, H.Encaps.Red) SRv6 in SONiC | SRv6研究会#18

    @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 APPL_DB ASIC_DB RouteOrch (orchagent) SIDLIST の作成 Srv6Orch (orchagent) TUNNEL, NH/NHG の作成(*) SRv6 NH/NHG ハンドル(oid) Route Entry を作成 SRv6 Route の場合、Srv6Orch に TUNNEL, SRV6 NH/NHG 作成を依頼 "ROUTE_TABLE:Vrf_srv6:10.3.0.0/24": { "segment": "seg3", "seg_src": "2001:db8:ffff::3" } "SRV6_MY_SID_TABLE:32:32:16:0:2001:db8:ffff:1:14::": { "action": "end.dt46", "vrf": "Vrf_srv6" } End.DT46 H.Encaps.Red "SRV6_SID_LIST_TABLE:seg3": { "path": "2001:db8::100,2001:db8::103", "type": "encaps.red" } SAI_OBJECT_TYPE_MY_SID_ENTRY MY_SID Entry の作成 SAI_OBJECT_TYPE_SRV6_SIDLIST SAI_OBJECT_TYPE_TUNNEL SAI_OBJECT_TYPE_ROUTE_ENTRY SAI_OBJECT_TYPE_NEXT_HOP (*)存在していない場合のみ
  25. Demo: SRv6 in SONiC End.DT46 H.Encaps.Red SRv6 in SONiC |

    SRv6研究会#18 @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24
  26. • H.Encaps.Red • オリジナルパケットにを SRv6 に変換(Encapsulation) • Red = Reduced

    で、SID List 最初の SID を SRv6 ヘッダに含めない • End.DT46 • SRv6 からオリジナルパケットに変換(Decapsulation) • オリジナルパケットの宛先IPアドレスで、指定されたTableをLookup • Zenn: SRv6 on SONiC を設定してみる (End.DT46, H.Encaps.Red) • https://zenn.dev/ebiken_sdn/articles/2887c04cf977a9 シナリオ (H.Encaps.Red, End.DT46) SRv6 in SONiC | SRv6研究会#18 @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24
  27. Topology and Configuration SRv6 in SONiC | SRv6研究会#18 @ 新潟・柏崎

    | Kentaro Ebsiawa | 2023/08/24 SONiC (Wedge100BF32) vrf: <default> vrf: Vrf_srv6 Ethernet0 10.0.0.1/24 2001:db8::1/64 Ethernet4 10.0.4.1/24 2001:db8:4:1/64 Server ens1f0 10.0.0.100/24 2011:db8::100/64 ens1f1@sonic04 10.0.4.100/24 2001:db8:4:100/64 H.Encaps.Red (APPL_DB) vrf: Vrf_srv6 { "SRV6_SID_LIST_TABLE:seg3": { "path": "2001:db8::100,2001:db8::103" }, }, { "ROUTE_TABLE:Vrf_srv6:10.3.0.0/24": { "segment": "seg3", "seg_src": "2001:db8:ffff::3" }, } End.DT46 (APPL_DB) vrf: <default> { "SRV6_MY_SID_TABLE:32:32:16:0:2001:db8:ffff:1:14::": { "action": "end.dt46", "vrf": "Vrf_srv6" }, } Basic Config "INTERFACE": { "Ethernet0": {}, "Ethernet0|10.0.0.1/24": {}, "Ethernet0|2001:db8::1/64": {}, "Ethernet4": { "vrf_name": "Vrf_srv6" }, "Ethernet4|10.0.4.1/24": {}, "Ethernet4|2001:db8:4::1/64": {} }, "VRF": { "Vrf_srv6": {} }
  28. Apply SRv6 Config SRv6 in SONiC | SRv6研究会#18 @ 新潟・柏崎

    | Kentaro Ebsiawa | 2023/08/24 H.Encaps.Red : encaps-red-3.json [ { "SRV6_SID_LIST_TABLE:seg3": { "path": "2001:db8::100,2001:db8::103" }, "OP": "SET" }, { "ROUTE_TABLE:Vrf_srv6:10.3.0.0/24": { "segment": "seg3", "seg_src": "2001:db8:ffff::3" }, "OP": "SET" } ] End.DT46 : end-dt46.json [ { "SRV6_MY_SID_TABLE:32:32:16:0:2001:db8:ffff:1:14::": { "action": "end.dt46", "vrf": "Vrf_srv6" }, "OP": "SET" } ] Insert Entries to APPL_DB > Enter swss container admin@sonic:~$ docker exec -it swss bash > Create files (Copy&Paste JSON on right) root@sonic:/# vi encaps-red-3.json root@sonic:/# vi end-dt46.json > Insert Entries using command: swssconfig root@sonic:/# swssconfig end-dt46.json root@sonic:/# swssconfig encaps-red-3.json
  29. swss logs SRv6 in SONiC | SRv6研究会#18 @ 新潟・柏崎 |

    Kentaro Ebsiawa | 2023/08/24 End.DT46 root@sonic:/# swssconfig end-dt46.json admin@sonic:~$ tail -f /var/log/swss/sairedis.rec 2022-12- 04.02:28:23.070782|c|SAI_OBJECT_TYPE_MY_SID_ENTRY:{"args_len":"0","function_len":"16"," locator_block_len":"32","locator_node_len":"32","sid":"2001:db8:ffff:1:14::","switch_id ":"oid:0x21000000000000","vr_id":"oid:0x300000000004a"}|SAI_MY_SID_ENTRY_ATTR_VRF=oid:0 x3000000000390|SAI_MY_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR=SAI_MY_SID_ENTRY_ENDPOINT_BEHAVI OR_DT46|SAI_MY_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR_FLAVOR=SAI_MY_SID_ENTRY_ENDPOINT_BEHAVI OR_FLAVOR_PSP_AND_USD admin@sonic:~$ tail -f /var/log/swss/swss.rec 2022-12- 04.02:28:23.070248|SRV6_MY_SID_TABLE:32:32:16:0:2001:db8:ffff:1:14::|SET|action:end.dt4 6|vrf:Vrf_srv6 H.Encaps.Red root@sonic:/# swssconfig encaps-red-3.json admin@sonic:~$ tail -f /var/log/swss/sairedis.rec 2022-12- 04.02:28:36.325914|c|SAI_OBJECT_TYPE_SRV6_SIDLIST:oid:0x3d0000000003a5|SAI_SRV6_SIDLIST _ATTR_SEGMENT_LIST=2:2001:db8::100,2001:db8::103|SAI_SRV6_SIDLIST_ATTR_TYPE=SAI_SRV6_SI DLIST_TYPE_ENCAPS_RED 2022-12- 04.02:28:36.328422|c|SAI_OBJECT_TYPE_TUNNEL:oid:0x2a0000000003a6|SAI_TUNNEL_ATTR_TYPE=S AI_TUNNEL_TYPE_SRV6|SAI_TUNNEL_ATTR_UNDERLAY_INTERFACE=oid:0x600000000004b|SAI_TUNNEL_A TTR_ENCAP_SRC_IP=2001:db8:ffff::3 2022-12- 04.02:28:36.331526|c|SAI_OBJECT_TYPE_NEXT_HOP:oid:0x40000000003a7|SAI_NEXT_HOP_ATTR_TYP E=SAI_NEXT_HOP_TYPE_SRV6_SIDLIST|SAI_NEXT_HOP_ATTR_SRV6_SIDLIST_ID=oid:0x3d0000000003a5 |SAI_NEXT_HOP_ATTR_TUNNEL_ID=oid:0x2a0000000003a6 2022-12- 04.02:28:36.335623|C|SAI_OBJECT_TYPE_ROUTE_ENTRY||{"dest":"10.3.0.0/24","switch_id":"oi d:0x21000000000000","vr":"oid:0x3000000000390"}|SAI_ROUTE_ENTRY_ATTR_NEXT_HOP_ID=oid:0x 40000000003a7 admin@sonic:~$ tail -f /var/log/swss/swss.rec 2022-12- 04.02:28:36.325306|SRV6_SID_LIST_TABLE:seg3|SET|path:2001:db8::100,2001:db8::103 2022-12- 04.02:28:36.328071|ROUTE_TABLE:Vrf_srv6:10.3.0.0/24|SET|seg_src:2001:db8:ffff::3|segmen t:seg3
  30. Packet Flow (H.Encaps.Red) SRv6 in SONiC | SRv6研究会#18 @ 新潟・柏崎

    | Kentaro Ebsiawa | 2023/08/24 SONiC (Wedge100BF32) vrf: <default> vrf: Vrf_srv6 Ethernet0 10.0.0.1/24 2001:db8::1/64 Ethernet4 10.0.4.1/24 2001:db8:4:1/64 Server ens1f0 10.0.0.100/24 2001:db8::100/64 ens1f1@sonic04 10.0.4.100/24 2001:db8:4:100/64 (1) Send IPv4 Packet from ens1f1@sonic04 ether: src: "0c:42:a1:46:64:a3" (ens1f1) dst: "00:90:fb:65:d6:fe" (SONiC) ip: src: "10.0.4.100" (ens1f1) dst: "10.3.0.1" (address matching SRv6 ROUTE) ttl: 32 udp: (2)(3) Encap, Lookup vrf:<default>, Send to ens1f0 ether: src: "00:90:fb:65:d6:fe" (SONiC) dst: "0c:42:a1:46:64:a2" (ens1f0) ipv6: src: "2001:db8:ffff::3" (seg_src) dst: "2001:db8::100" hlim: 31 srh: #IPv6ExtHdrSegmentRouting segleft: 1 addresses: - "2001:db8::103" (Next Segment) inner_packet: ip: src: "10.0.4.100" (ens1f1) dst: "10.3.0.1" (address matching SRv6 ROUTE) ttl: 31 udp: (1) (2) (3) $ sudo ./sendpacket.py pkt_hencaps_03.yaml
  31. Packet Dump of H.Encaps.Red SRv6 in SONiC | SRv6研究会#18 @

    新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 (1) Send IPv4 Packet from ens1f1@sonic04 (2)(3) Encap, Lookup vrf:<default>, Send to ens1f0 Both Hoplimit in encaped packet and TTL in inner packet is inner_ipv4.ttl -1
  32. Packet Flow (End.DT46) SRv6 in SONiC | SRv6研究会#18 @ 新潟・柏崎

    | Kentaro Ebsiawa | 2023/08/24 SONiC (Wedge100BF32) vrf: <default> vrf: Vrf_srv6 Ethernet0 10.0.0.1/24 2001:db8::1/64 Ethernet4 10.0.4.1/24 2001:db8:4:1/64 Server ens1f0 10.0.0.100/24 2001:db8::100/64 ens1f1@sonic04 10.0.4.100/24 2001:db8:4:100/64 (1) Send SRv6 Packet from ens1f0 to End.DT46 SID ether: src: "0c:42:a1:46:64:a2" (ens1f0) dst: "00:90:fb:65:d6:fe" (SONiC) ipv6: src: "2001:db8::100" (ens1f0) dst: "2001:db8:ffff:1:14::" (End.DT46 SID) hlim: 24 srh: #IPv6ExtHdrSegmentRouting segleft: 0 addresses: - "2001:db8:ffff:1:14::" inner_packet: ip: src: "10.0.0.100" dst: "10.0.4.100“ ttl: 32 udp: (2)(3) Decap, Lookup Vrf_srv6, Send to ens1f1 ether: src: "02:90:fb:65:d6:fe" (SONiC) dst: "0c:42:a1:46:64:a3" (ens1f1) ip: src: "10.0.0.100" dst: "10.0.4.100" ttl: 31 udp: (1) (2) (3) $ sudo ./sendpacket.py pkt_dt46_01.yaml
  33. Packet Dump of End.DT46 SRv6 in SONiC | SRv6研究会#18 @

    新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 (1) Send SRv6 Packet from ens1f0 to End.DT46 SID (2)(3) Decap, Lookup Vrf_srv6, Send to ens1f1 Time To Live in decaped packet is inner_ipv4.ttl -1 (not outer_ipv6.hoplimit)
  34. Demo: SRv6 in SONiC/FRR (uSID) SRv6 in SONiC | SRv6研究会#18

    @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24
  35. "Building an SRv6 uSID Data Center Fabric with SONiC" (Cisco

    Blog) SRv6 in SONiC | SRv6研究会#18 @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 https://www.segment-routing.net/blogs/srv6-usid-on-sonic/ • patched sonic-vs image with SAI, SONiC, FRR SRv6 integration • uSID with uN, uA, uDT46 etc. • Senarios: L3VPN, Service Insertion "Demo: SRv6 uSID in SONiC with Cisco Silicon One" also available on YouTube https://www.youtube.com/watch?v=o4DroPlnY-s
  36. SRv6 uSID L3VPN in SONiC/FRR SRv6 in SONiC | SRv6研究会#18

    @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 sonic01 (AS65001) E4 (Vrf1) E8 (Vrf2) E0 s01 vnet1 vnet2 s02 vnet4 vnet5 sonic02 (AS65002) E4 (Vrf1) E8 (Vrf2) E0 sonic03 (AS65003) E0 E4 • Small demo using sonic-vs image with Cisco patch: • https://www.segment-routing.net/blogs/srv6-usid-on-sonic/ • Note: this is using fpm, not dplane_fpm_nl module • Details including config files are available on GitHub: • https://github.com/ebiken/sonic-book/tree/main/examples/srv6-usid/ 10.0.0.1/32 fc00:0:1::1/128 10.101.1.100/24 10.101.1.1/24 10.101.2.100/24 10.101.2.1/24 ipv6_use_link_local_only ipv6_use_link_local_only 10.0.0.3/32 fc00:0:3::1/128 10.0.0.2/32 fc00:0:2::1/128 Underlay
  37. config: Host (remove site) SRv6 in SONiC | SRv6研究会#18 @

    新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 ip netns add s01 ip link set vnet1 netns s01 ip netns exec s01 ip link set dev lo up ip netns exec s01 ethtool --offload vnet1 rx off tx off ip netns exec s01 ip addr add 10.101.1.100/24 dev vnet1 ip netns exec s01 ip link set dev vnet1 up ip netns exec s01 ip route add default via 10.101.1.1 ip netns add s02 ip link set vnet4 netns s02 ip netns exec s02 ip link set dev lo up ip netns exec s02 ethtool --offload vnet4 rx off tx off ip netns exec s02 ip addr add 10.101.2.100/24 dev vnet4 ip netns exec s02 ip link set dev vnet4 up ip netns exec s02 ip route add default via 10.101.2.1 sonic01 (AS65001) E4 (Vrf1) E8 (Vrf2) E0 s01 vnet1 vnet2 s02 vnet4 vnet5 sonic02 (AS65002) E4 (Vrf1) E8 (Vrf2) E0 sonic03 (AS65003) E0 E4 10.0.0.1/32 fc00:0:1::1/128 10.101.1.100/24 10.101.1.1/24 10.101.2.100/24 10.101.2.1/24 ipv6_use_link_local_only ipv6_use_link_local_only 10.0.0.3/32 fc00:0:3::1/128 10.0.0.2/32 fc00:0:2::1/128
  38. config: sonic0x (non FRR) SRv6 in SONiC | SRv6研究会#18 @

    新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 > sonic03 "LOOPBACK_INTERFACE": { "Loopback0|10.0.0.3/32": {}, "Loopback0|fc00:0:3::1/128": {} }, "INTERFACE": { "Ethernet0": { "ipv6_use_link_local_only": "enable" }, "Ethernet4": { "ipv6_use_link_local_only": "enable" } }, config_db.json available under sonic0x/ https://github.com/ebiken/sonic-book/tree/main/examples/srv6-usid/ > sonic01 "LOOPBACK_INTERFACE": { "Loopback0|10.0.0.1/32": {}, "Loopback0|fc00:0:1::1/128": {} }, "INTERFACE": { "Ethernet0": { "ipv6_use_link_local_only": "enable" }, "Ethernet4": { "vrf_name": "Vrf1" }, "Ethernet4|10.101.1.1/24": {}, "Ethernet4|2001:0:101:1::1/64": {}, "Ethernet8": { "vrf_name": "Vrf2" }, "Ethernet8|10.102.1.1/24": {}, "Ethernet8|2001:0:102:1::1/64": {} }, "VRF": { "Vrf1": {}, "Vrf2": {} }, > sonic02 "LOOPBACK_INTERFACE": { "Loopback0|10.0.0.2/32": {}, "Loopback0|fc00:0:2::1/128": {} }, "INTERFACE": { "Ethernet0": { "ipv6_use_link_local_only": "enable" }, "Ethernet4": { "vrf_name": "Vrf1" }, "Ethernet4|10.101.2.1/24": {}, "Ethernet4|2001:0:101:2::1/64": {}, "Ethernet8": { "vrf_name": "Vrf2" }, "Ethernet8|10.102.2.1/24": {}, "Ethernet8|2001:0:102:2::1/64": {} }, "VRF": { "Vrf1": {}, "Vrf2": {} },
  39. config: FRRouting (sonic01, sonic02) SRv6 in SONiC | SRv6研究会#18 @

    新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 ipv6 route fc00:0:1::/48 Loopback0 ! router bgp 65001 bgp router-id 10.0.0.1 bgp log-neighbor-changes no bgp ebgp-requires-policy no bgp default ipv4-unicast bgp bestpath as-path multipath-relax neighbor Ethernet0 interface remote-as 65003 ! segment-routing srv6 locator MAIN exit ! address-family ipv4 vpn neighbor Ethernet0 activate neighbor Ethernet0 route-map BGP-IPV6 in exit-address-family ! address-family ipv6 unicast network fc00:0:1::/48 network fc00:0:1::1/128 neighbor Ethernet0 activate neighbor Ethernet0 route-map BGP-IPV6 in maximum-paths 64 exit-address-family ! address-family ipv6 vpn neighbor Ethernet0 activate neighbor Ethernet0 route-map BGP-IPV6 in exit-address-family ! exit ! router bgp 65001 vrf Vrf1 no bgp ebgp-requires-policy sid vpn per-vrf export 101 ! address-family ipv4 unicast redistribute connected rd vpn export 10.0.0.1:1 nexthop vpn export fc00:0:1::1 rt vpn both 1:1 export vpn import vpn exit-address-family ! address-family ipv6 unicast redistribute connected rd vpn export 10.0.0.1:1 rt vpn both 1:1 export vpn import vpn exit-address-family exit router bgp 65001 vrf Vrf2 ...snip... ! route-map BGP-IPV6 permit 20 set ipv6 next-hop prefer-global exit ! ip nht resolve-via-default ! segment-routing srv6 encapsulation source-address fc00:0:1::1 locators locator MAIN behavior usid prefix fc00:0:1::/48 block-len 32 node-len 16 exit ! exit ! exit ! srv6 explicit-sids sid fc00:0:1:: behavior uN ...snip...
  40. config: FRRouting (sonic03) SRv6 in SONiC | SRv6研究会#18 @ 新潟・柏崎

    | Kentaro Ebsiawa | 2023/08/24 ipv6 route fc00:0:3::/48 Loopback0 ! router bgp 65003 bgp router-id 10.0.0.3 bgp log-neighbor-changes no bgp ebgp-requires-policy no bgp default ipv4-unicast bgp bestpath as-path multipath-relax neighbor Ethernet0 interface remote-as 65001 neighbor Ethernet4 interface remote-as 65002 ! segment-routing srv6 locator MAIN exit ! address-family ipv4 vpn neighbor Ethernet0 activate neighbor Ethernet0 route-map BGP-IPV6 in neighbor Ethernet4 activate neighbor Ethernet4 route-map BGP-IPV6 in exit-address-family ! address-family ipv6 unicast network fc00:0:3::/48 network fc00:0:3::1/128 neighbor Ethernet0 activate neighbor Ethernet0 route-map BGP-IPV6 in neighbor Ethernet4 activate neighbor Ethernet4 route-map BGP-IPV6 in maximum-paths 64 exit-address-family ! address-family ipv6 vpn neighbor Ethernet0 activate neighbor Ethernet0 route-map BGP-IPV6 in neighbor Ethernet4 activate neighbor Ethernet4 route-map BGP-IPV6 in exit-address-family exit ! route-map BGP-IPV6 permit 20 set ipv6 next-hop prefer-global exit ! ip nht resolve-via-default segment-routing srv6 encapsulation source-address fc00:0:3::1 locators locator MAIN behavior usid prefix fc00:0:3::/48 block-len 32 node-len 16 exit ! exit ! exit ! srv6 explicit-sids sid fc00:0:3:: behavior uN exit ! exit ! exit ! exit ! end
  41. SONiC APPL_DB SRv6 in SONiC | SRv6研究会#18 @ 新潟・柏崎 |

    Kentaro Ebsiawa | 2023/08/24 sonic-db-cli APPL_DB keys ¥* | grep SR admin@sonic01:~$ sonic-db-cli APPL_DB keys ¥* | grep SR SRV6_MY_SID_TABLE:32:16:16:0:fc00:0:1:6600:: SRV6_MY_SID_TABLE:32:16:16:0:fc00:0:1:6500:: SRV6_MY_SID_TABLE:32:16:16:0:fc00:0:1:: admin@sonic01:~$ sonic-db-cli APPL_DB HGETALL "SRV6_MY_SID_TABLE:32:16:16:0:fc00:0:1:6600::" {'action': 'udt46', 'vrf': 'Vrf2'} admin@sonic01:~$ sonic-db-cli APPL_DB HGETALL "SRV6_MY_SID_TABLE:32:16:16:0:fc00:0:1:6500::" {'action': 'udt46', 'vrf': 'Vrf1'} admin@sonic01:~$ sonic-db-cli APPL_DB HGETALL "SRV6_MY_SID_TABLE:32:16:16:0:fc00:0:1::" {'action': 'un'}
  42. Routing tables: SONiC CLI SRv6 in SONiC | SRv6研究会#18 @

    新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 admin@sonic01:~$ show ipv6 route S>*fc00:0:1::/48 [1/0] is directly connected, eth0, 00:47:06 C>*fc00:0:1::1/128 is directly connected, Loopback0, 00:48:35 B>*fc00:0:1:6500::/128 [20/0] is directly connected, Vrf1, 00:47:06 B>*fc00:0:1:6600::/128 [20/0] is directly connected, Vrf2, 00:47:06 ... snip ... admin@sonic01:~$ show ip route vrf all VRF Vrf1: C>* 10.101.1.0/24 is directly connected, Ethernet4, 23:50:58 B>* 10.101.2.0/24 [20/0] via fe80::5054:ff:fe74:c103, Ethernet0 (vrf default), label 413696, seg6local unspec unknown(seg6local_context2str), flavors unknown(seg6local_context2str), seg6 fc00:0:2:6500::, weight 1, 23:45:59 VRF Vrf2: C>* 10.102.1.0/24 is directly connected, Ethernet8, 23:50:58 B>* 10.102.2.0/24 [20/0] via fe80::5054:ff:fe74:c103, Ethernet0 (vrf default), label 417792, seg6local unspec unknown(seg6local_context2str), flavors unknown(seg6local_context2str), seg6 fc00:0:2:6600::, weight 1, 23:45:59 VRF default: K>* 0.0.0.0/0 [0/0] via 192.168.122.1, eth0, 23:50:58 C>* 10.0.0.1/32 is directly connected, Loopback0, 23:50:58 C>* 192.168.122.0/24 is directly connected, eth0, 23:50:58
  43. Routing tables: FRR via vtysh SRv6 in SONiC | SRv6研究会#18

    @ 新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 admin@sonic01:~$ vtysh -c "show ipv6 route" S>* fc00:0:1::/48 [1/0] is directly connected, eth0, seg6local End USP, flavors next-csid lblen 32 nflen 16, seg6 ::, weight 1, 00:44:59 C>* fc00:0:1::1/128 is directly connected, Loopback0, 00:46:28 B>* fc00:0:1:6500::/128 [20/0] is directly connected, Vrf1, seg6local uDT46 unknown(seg6local_context2str), flavors unknown(seg6local_context2str), seg6 ::, weight 1, 00:44:59 B>* fc00:0:1:6600::/128 [20/0] is directly connected, Vrf2, seg6local uDT46 unknown(seg6local_context2str), flavors unknown(seg6local_context2str), seg6 ::, weight 1, 00:44:59 admin@sonic01:~$ vtysh -c "show ip route vrf all" VRF Vrf1: C>* 10.101.1.0/24 is directly connected, Ethernet4, 23:53:18 B>* 10.101.2.0/24 [20/0] via fe80::5054:ff:fe74:c103, Ethernet0 (vrf default), label 413696, seg6local unspec unknown(seg6local_context2str), flavors unknown(seg6local_context2str), seg6 fc00:0:2:6500::, weight 1, 23:48:19 VRF Vrf2: C>* 10.102.1.0/24 is directly connected, Ethernet8, 23:53:18 B>* 10.102.2.0/24 [20/0] via fe80::5054:ff:fe74:c103, Ethernet0 (vrf default), label 417792, seg6local unspec unknown(seg6local_context2str), flavors unknown(seg6local_context2str), seg6 fc00:0:2:6600::, weight 1, 23:48:19 VRF default: K>* 0.0.0.0/0 [0/0] via 192.168.122.1, eth0, 23:53:18 C>* 10.0.0.1/32 is directly connected, Loopback0, 23:53:18 C>* 192.168.122.0/24 is directly connected, eth0, 23:53:18
  44. Routing tables: Linux Kernel SRv6 in SONiC | SRv6研究会#18 @

    新潟・柏崎 | Kentaro Ebsiawa | 2023/08/24 admin@sonic01:~$ ip -6 route ::1 dev lo proto kernel metric 256 pref medium fc00:0:1::1 dev Loopback0 proto kernel metric 256 pref medium fc00:0:1:6500:: nhid 260 encap seg6local action End.DT46 vrftable 1001 dev Vrf1 proto bgp metric 20 pref medium fc00:0:1:6600:: nhid 261 encap seg6local action End.DT46 vrftable 1002 dev Vrf2 proto bgp metric 20 pref medium fc00:0:1::/48 nhid 248 encap seg6local action End flavors next-csid lblen 32 nflen 16 dev eth0 proto 196 metric 20 pref medium admin@sonic01:~$ ip route show default via 192.168.122.1 dev eth0 192.168.122.0/24 dev eth0 proto kernel scope link src 192.168.122.98 240.127.1.0/24 dev docker0 proto kernel scope link src 240.127.1.1 linkdown admin@sonic01:~$ ip route show vrf Vrf1 10.101.1.0/24 dev Ethernet4 proto kernel scope link src 10.101.1.1 10.101.2.0/24 nhid 255 encap seg6 mode encap segs 1 [ fc00:0:2:6500:: ] via inet6 fe80::5054:ff:fe74:c103 dev Ethernet0 proto bgp metric 20 admin@sonic01:~$ ip route show vrf Vrf2 10.102.1.0/24 dev Ethernet8 proto kernel scope link src 10.102.1.1 10.102.2.0/24 nhid 256 encap seg6 mode encap segs 1 [ fc00:0:2:6600:: ] via inet6 fe80::5054:ff:fe74:c103 dev Ethernet0 proto bgp metric 20