1. 16 Aug, 2023 2 commits
    • Paolo Lungaroni's avatar
      selftests: seg6: add selftest for NEXT-C-SID flavor in SRv6 End.X behavior · 1c53717c
      Paolo Lungaroni authored
      This selftest is designed for testing the support of NEXT-C-SID flavor
      for SRv6 End.X behavior. It instantiates a virtual network composed of
      several nodes: hosts and SRv6 routers. Each node is realized using a
      network namespace that is properly interconnected to others through veth
      pairs, according to the topology depicted in the selftest script file.
      The test considers SRv6 routers implementing IPv4/IPv6 L3 VPNs leveraged
      by hosts for communicating with each other. Such routers i) apply
      different SRv6 Policies to the traffic received from connected hosts,
      considering the IPv4 or IPv6 protocols; ii) use the NEXT-C-SID
      compression mechanism for encoding several SRv6 segments within a single
      128-bit SID address, referred to as a Compressed SID (C-SID) container.
      
      The NEXT-C-SID is provided as a "flavor" of the SRv6 End.X behavior,
      enabling it to properly process the C-SID containers. The correct
      execution of the enabled NEXT-C-SID SRv6 End.X behavior is verified
      through reachability tests carried out between hosts belonging to the
      same VPN.
      Signed-off-by: default avatarPaolo Lungaroni <paolo.lungaroni@uniroma2.it>
      Co-developed-by: default avatarAndrea Mayer <andrea.mayer@uniroma2.it>
      Signed-off-by: default avatarAndrea Mayer <andrea.mayer@uniroma2.it>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Link: https://lore.kernel.org/r/20230812180926.16689-3-andrea.mayer@uniroma2.itSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1c53717c
    • Andrea Mayer's avatar
      seg6: add NEXT-C-SID support for SRv6 End.X behavior · 7458575a
      Andrea Mayer authored
      The NEXT-C-SID mechanism described in [1] offers the possibility of
      encoding several SRv6 segments within a single 128 bit SID address. Such
      a SID address is called a Compressed SID (C-SID) container. In this way,
      the length of the SID List can be drastically reduced.
      
      A SID instantiated with the NEXT-C-SID flavor considers an IPv6 address
      logically structured in three main blocks: i) Locator-Block; ii)
      Locator-Node Function; iii) Argument.
      
                              C-SID container
      +------------------------------------------------------------------+
      |     Locator-Block      |Loc-Node|            Argument            |
      |                        |Function|                                |
      +------------------------------------------------------------------+
      <--------- B -----------> <- NF -> <------------- A --------------->
      
         (i) The Locator-Block can be any IPv6 prefix available to the provider;
      
        (ii) The Locator-Node Function represents the node and the function to
             be triggered when a packet is received on the node;
      
       (iii) The Argument carries the remaining C-SIDs in the current C-SID
             container.
      
      This patch leverages the NEXT-C-SID mechanism previously introduced in the
      Linux SRv6 subsystem [2] to support SID compression capabilities in the
      SRv6 End.X behavior [3].
      An SRv6 End.X behavior with NEXT-C-SID flavor works as an End.X behavior
      but it is capable of processing the compressed SID List encoded in C-SID
      containers.
      
      An SRv6 End.X behavior with NEXT-C-SID flavor can be configured to support
      user-provided Locator-Block and Locator-Node Function lengths. In this
      implementation, such lengths must be evenly divisible by 8 (i.e. must be
      byte-aligned), otherwise the kernel informs the user about invalid
      values with a meaningful error code and message through netlink_ext_ack.
      
      If Locator-Block and/or Locator-Node Function lengths are not provided
      by the user during configuration of an SRv6 End.X behavior instance with
      NEXT-C-SID flavor, the kernel will choose their default values i.e.,
      32-bit Locator-Block and 16-bit Locator-Node Function.
      
      [1] - https://datatracker.ietf.org/doc/html/draft-ietf-spring-srv6-srh-compression
      [2] - https://lore.kernel.org/all/20220912171619.16943-1-andrea.mayer@uniroma2.it/
      [3] - https://datatracker.ietf.org/doc/html/rfc8986#name-endx-l3-cross-connectSigned-off-by: default avatarAndrea Mayer <andrea.mayer@uniroma2.it>
      Reviewed-by: default avatarHangbin Liu <liuhangbin@gmail.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Link: https://lore.kernel.org/r/20230812180926.16689-2-andrea.mayer@uniroma2.itSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      7458575a
  2. 15 Aug, 2023 12 commits
  3. 14 Aug, 2023 26 commits