mbox series

[net-next,v5,0/6] Support for the IOAM Pre-allocated Trace with IPv6

Message ID 20210720194301.23243-1-justin.iurman@uliege.be
Headers show
Series Support for the IOAM Pre-allocated Trace with IPv6 | expand

Message

Justin Iurman July 20, 2021, 7:42 p.m. UTC
v5:
 - Refine types, min/max and default values for new sysctls
 - Introduce a "_wide" sysctl for each "ioam6_id" sysctl
 - Add more validation on headers before processing data
 - RCU for sc <> ns pointers + appropriate accessors
 - Generic Netlink policies are now per op, not per family anymore
 - Address other comments/remarks from Jakub (thanks again)
 - Revert "__packed" to "__attribute__((packed))" for uapi headers
 - Add tests to cover the functionality added, as requested by David Ahern

v4:
 - Address warnings from checkpatch (ignore errors related to unnamed bitfields
   in the first patch)
 - Use of hweight32 (thanks Jakub)
 - Remove inline keyword from static functions in C files and let the compiler
   decide what to do (thanks Jakub)

v3:
 - Fix warning "unused label 'out_unregister_genl'" by adding conditional macro
 - Fix lwtunnel output redirect bug: dst cache useless in this case, use
   orig_output instead

v2:
 - Fix warning with static for __ioam6_fill_trace_data
 - Fix sparse warning with __force when casting __be64 to __be32
 - Fix unchecked dereference when removing IOAM namespaces or schemas
 - exthdrs.c: Don't drop by default (now: ignore) to match the act bits "00"
 - Add control plane support for the inline insertion (lwtunnel)
 - Provide uapi structures
 - Use __net_timestamp if skb->tstamp is empty
 - Add note about the temporary IANA allocation
 - Remove support for "removable" TLVs
 - Remove support for virtual/anonymous tunnel decapsulation

In-situ Operations, Administration, and Maintenance (IOAM) records
operational and telemetry information in a packet while it traverses
a path between two points in an IOAM domain. It is defined in
draft-ietf-ippm-ioam-data [1]. IOAM data fields can be encapsulated
into a variety of protocols. The IPv6 encapsulation is defined in
draft-ietf-ippm-ioam-ipv6-options [2], via extension headers. IOAM
can be used to complement OAM mechanisms based on e.g. ICMP or other
types of probe packets.

This patchset implements support for the Pre-allocated Trace, carried
by a Hop-by-Hop. Therefore, a new IPv6 Hop-by-Hop TLV option is
introduced, see IANA [3]. The three other IOAM options are not included
in this patchset (Incremental Trace, Proof-of-Transit and Edge-to-Edge).
The main idea behind the IOAM Pre-allocated Trace is that a node
pre-allocates some room in packets for IOAM data. Then, each IOAM node
on the path will insert its data. There exist several interesting use-
cases, e.g. Fast failure detection/isolation or Smart service selection.
Another killer use-case is what we have called Cross-Layer Telemetry,
see the demo video on its repository [4], that aims to make the entire
stack (L2/L3 -> L7) visible for distributed tracing tools (e.g. Jaeger),
instead of the current L5 -> L7 limited view. So, basically, this is a
nice feature for the Linux Kernel.

This patchset also provides support for the control plane part, but only for the
inline insertion (host-to-host use case), through lightweight tunnels. Indeed,
for in-transit traffic, the solution is to have an IPv6-in-IPv6 encapsulation,
which brings some difficulties and still requires a little bit of work and
discussion (ie anonymous tunnel decapsulation and multi egress resolution).

- Patch 1: IPv6 IOAM headers definition
- Patch 2: Data plane support for Pre-allocated Trace
- Patch 3: IOAM Generic Netlink API
- Patch 4: Support for IOAM injection with lwtunnels
- Patch 5: Documentation for new IOAM sysctls
- Patch 6: Test for the IOAM insertion with IPv6

  [1] https://tools.ietf.org/html/draft-ietf-ippm-ioam-data
  [2] https://tools.ietf.org/html/draft-ietf-ippm-ioam-ipv6-options
  [3] https://www.iana.org/assignments/ipv6-parameters/ipv6-parameters.xhtml#ipv6-parameters-2
  [4] https://github.com/iurmanj/cross-layer-telemetry

Justin Iurman (6):
  uapi: IPv6 IOAM headers definition
  ipv6: ioam: Data plane support for Pre-allocated Trace
  ipv6: ioam: IOAM Generic Netlink API
  ipv6: ioam: Support for IOAM injection with lwtunnels
  ipv6: ioam: Documentation for new IOAM sysctls
  selftests: net: Test for the IOAM insertion with IPv6

 Documentation/networking/ioam6-sysctl.rst  |  26 +
 Documentation/networking/ip-sysctl.rst     |  17 +
 include/linux/ioam6.h                      |  13 +
 include/linux/ioam6_genl.h                 |  13 +
 include/linux/ioam6_iptunnel.h             |  13 +
 include/linux/ipv6.h                       |   3 +
 include/net/ioam6.h                        |  67 ++
 include/net/netns/ipv6.h                   |   3 +
 include/uapi/linux/in6.h                   |   1 +
 include/uapi/linux/ioam6.h                 | 133 +++
 include/uapi/linux/ioam6_genl.h            |  52 ++
 include/uapi/linux/ioam6_iptunnel.h        |  20 +
 include/uapi/linux/ipv6.h                  |   3 +
 include/uapi/linux/lwtunnel.h              |   1 +
 net/core/lwtunnel.c                        |   2 +
 net/ipv6/Kconfig                           |  11 +
 net/ipv6/Makefile                          |   3 +-
 net/ipv6/addrconf.c                        |  37 +
 net/ipv6/af_inet6.c                        |  10 +
 net/ipv6/exthdrs.c                         |  61 ++
 net/ipv6/ioam6.c                           | 910 +++++++++++++++++++++
 net/ipv6/ioam6_iptunnel.c                  | 274 +++++++
 net/ipv6/sysctl_net_ipv6.c                 |  19 +
 tools/testing/selftests/net/Makefile       |   2 +
 tools/testing/selftests/net/config         |   1 +
 tools/testing/selftests/net/ioam6.sh       | 298 +++++++
 tools/testing/selftests/net/ioam6_parser.c | 403 +++++++++
 27 files changed, 2395 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/networking/ioam6-sysctl.rst
 create mode 100644 include/linux/ioam6.h
 create mode 100644 include/linux/ioam6_genl.h
 create mode 100644 include/linux/ioam6_iptunnel.h
 create mode 100644 include/net/ioam6.h
 create mode 100644 include/uapi/linux/ioam6.h
 create mode 100644 include/uapi/linux/ioam6_genl.h
 create mode 100644 include/uapi/linux/ioam6_iptunnel.h
 create mode 100644 net/ipv6/ioam6.c
 create mode 100644 net/ipv6/ioam6_iptunnel.c
 create mode 100644 tools/testing/selftests/net/ioam6.sh
 create mode 100644 tools/testing/selftests/net/ioam6_parser.c

Comments

David Ahern July 22, 2021, 2:52 a.m. UTC | #1
On 7/20/21 1:43 PM, Justin Iurman wrote:
> +run()

> +{

> +  echo -n "IOAM test... "

> +

> +  ip netns exec ioam-node-alpha ping6 -c 5 -W 1 db02::2 &>/dev/null

> +  if [ $? != 0 ]; then

> +    echo "FAILED"

> +    cleanup &>/dev/null

> +    exit 0

> +  fi

> +

> +  ip netns exec ioam-node-gamma ./ioam6_parser veth0 2 ${IOAM_NAMESPACE} ${IOAM_TRACE_TYPE} 64 ${ALPHA[0]} ${ALPHA[1]} ${ALPHA[2]} ${ALPHA[3]} ${ALPHA[4]} ${ALPHA[5]} ${ALPHA[6]} ${ALPHA[7]} ${ALPHA[8]} "${ALPHA[9]}" 63 ${BETA[0]} ${BETA[1]} ${BETA[2]} ${BETA[3]} ${BETA[4]} ${BETA[5]} ${BETA[6]} ${BETA[7]} ${BETA[8]} &

> +

> +  local spid=$!

> +  sleep 0.1

> +

> +  ip netns exec ioam-node-alpha ping6 -c 5 -W 1 db02::2 &>/dev/null

> +

> +  wait $spid

> +  [ $? = 0 ] && echo "PASSED" || echo "FAILED"

> +}

> +

> +cleanup &>/dev/null

> +setup

> +run

> +cleanup &>/dev/null


Can you add negative tests as well? i.e, things work like they should
when enabled and configured properly, fail when the test should not and
include any invalid combinations of parameters.
Justin Iurman July 22, 2021, 6:12 p.m. UTC | #2
>> +run()

>> +{

>> +  echo -n "IOAM test... "

>> +

>> +  ip netns exec ioam-node-alpha ping6 -c 5 -W 1 db02::2 &>/dev/null

>> +  if [ $? != 0 ]; then

>> +    echo "FAILED"

>> +    cleanup &>/dev/null

>> +    exit 0

>> +  fi

>> +

>> +  ip netns exec ioam-node-gamma ./ioam6_parser veth0 2 ${IOAM_NAMESPACE}

>> ${IOAM_TRACE_TYPE} 64 ${ALPHA[0]} ${ALPHA[1]} ${ALPHA[2]} ${ALPHA[3]}

>> ${ALPHA[4]} ${ALPHA[5]} ${ALPHA[6]} ${ALPHA[7]} ${ALPHA[8]} "${ALPHA[9]}" 63

>> ${BETA[0]} ${BETA[1]} ${BETA[2]} ${BETA[3]} ${BETA[4]} ${BETA[5]} ${BETA[6]}

>> ${BETA[7]} ${BETA[8]} &

>> +

>> +  local spid=$!

>> +  sleep 0.1

>> +

>> +  ip netns exec ioam-node-alpha ping6 -c 5 -W 1 db02::2 &>/dev/null

>> +

>> +  wait $spid

>> +  [ $? = 0 ] && echo "PASSED" || echo "FAILED"

>> +}

>> +

>> +cleanup &>/dev/null

>> +setup

>> +run

>> +cleanup &>/dev/null

> 

> Can you add negative tests as well? i.e, things work like they should

> when enabled and configured properly, fail when the test should not and

> include any invalid combinations of parameters.


Hmmm... I think I got your point but not sure on details you have in mind. Maybe should we take a table during the netdev conf and discuss it live.