Skip to contentSkip to conversation

exthdrs: Make ext. headers & options useful - Part I

PATCH Superseded Tom Herbert 3 participants 3 messages Apr 29, 2019 – May 5, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v9 cover exthdrs: Make ext. headers & options useful - Part I

Extension headers are the mechanism of extensibility for the IPv6 protocol, however to date they have only seen limited deployment. The reasons for that are because intermediate devices don't handle them well, and there haven't really be any useful extension headers defined. In particular, Destination and Hop-by-Hop options have not been deployed to any extent.

The landscape may be changing as there are now a number of serious efforts to define and deploy extension headers. In particular, a number of uses for Hop-by-Hop Options are currently being proposed, Some of these are from router vendors so there is hope that they might start start to fix their brokenness. These proposals include IOAM, Path MTU, Firewall and Service Tickets, SRv6, CRH, etc.

Assuming that IPv6 extension headers gain traction, that leaves a noticeable gap in IPv4 support. IPv4 options have long been considered a non-starter for deployment. An alternative being proposed is to enable use of IPv6 options with IPv4 (draft-herbert-ipv4-eh-00).

This series of patch sets endeavours to make extension headers and related options useful and easy to use. The following items will be addressed:

- Reorganize extension header files
- Allow registration of TLV handlers
- Elaborate on the TLV tables to include more characteristics
- Add a netlink interface to set TLV parameters (such as alignment requirements, authorization to send, etc.)
- Enhance validation of TLVs being sent. Validation is strict (unless overridden by admin) following that sending clause of the robustness principle
- Allow non-privileged users to set Hop-by-Hop and Destination Options if authorized by the admin
- Add an API that allows individual Hop-by-Hop and Destination Options to be set or removed for a connected socket. The backend end enforces permissions on what TLVs may be set and merges set TLVs per following the rules in the TLV parameter table (for instance, TLV parameters include a preferred sending order that merging adheres to)
- Add an infrastructure to allow Hop-by-Hop and Destination Options to be processed in the context of a connected socket
- Support for some of the aforementioned options
- Enable IPv4 extension headers

------

In this series:

- Create exhdrs_options.c. Move options specific processing to this file from exthdrs.c (for RA, Jumbo, Calipso, and HAO).
- Create exthdrs_common.c. This holds generic exthdr and TLV related functions that are not IPv6 specific. These functions will also be used with IPv4 extension headers.
- Allow modules to register TLV handlers for Destination and HBH options.
- Add parameters block to TLV type entries that describe characteristics related to the TLV. For the most part, these encode rules about sending each TLV (TLV alignment requirements for instance).
- Add a netlink interface to manage parameters in the TLV table.
- Add validation of HBH and Destination Options that are set on a socket or in ancillary data in sendmsg. The validation applies the rules that are encoded in the TLV parameters.
- TLV parameters includes permissions that may allow non-privileged users to set specific TLVs on a socket HBH options or Destination options. Strong validation can be enabled for this to constrain what the non-privileged user is able to do.

v2:

- Don't rename extension header files with IPv6 specific code before code for IPv4 extension headers is present
- Added patches for creating TLV parameters and validation

v3:

- Fix kbuild errors. Ensure build and operation when IPv6 is disabled.

v4:

- Remove patch that consolidated option cases in option cases in ip6_datagram_send_ctl per feedback

v5:

- Add signoffs.

v6:

- Fix init_module issue from kuild.

v7:

- Create exthdrs_common.c. Use this file for for generic functions that apply to IPv6 and IPv4 extension headers. Don't touch exthdr_core.c to preserve the semantics that that file contains functions that are needed when IPv6 (or IPv4 extension headers) is not enabled.
- A few other minor fixes and cleanup.
- Answered David Ahern's question about why use generic netlink instead of rtnetlink.

v8:

- Don't explicitly set fields to zero when initializing TLV paramter structures.

v9:

- Don't send extra patches in v8.

Tested:

Set Hop-by-Hop options on TCP/UDP socket and verified to be functional.

Tom Herbert (6):
exthdrs: Create exthdrs_options.c
exthdrs: Move generic EH functions to exthdrs_common.c
exthdrs: Registration of TLV handlers and parameters
exthdrs: Add TX parameters
ip6tlvs: Add netlink interface
ip6tlvs: Validation of TX Destination and Hop-by-Hop options

 include/net/ipv6.h         |  130 ++++++
 include/uapi/linux/in6.h   |   49 ++
 net/ipv6/Kconfig           |    4 +
 net/ipv6/Makefile          |    3 +-
 net/ipv6/datagram.c        |   51 ++-
 net/ipv6/exthdrs.c         |  394 ++--------------
 net/ipv6/exthdrs_common.c  | 1093 ++++++++++++++++++++++++++++++++++++++++++++
 net/ipv6/exthdrs_options.c |  345 ++++++++++++++
 net/ipv6/ipv6_sockglue.c   |   39 +-
 9 files changed, 1706 insertions(+), 402 deletions(-)
 create mode 100644 net/ipv6/exthdrs_common.c
 create mode 100644 net/ipv6/exthdrs_options.c
Signature · 1 line
2.7.4
maintainer
#1 lore raw

From: Tom Herbert <[email protected]>
Date: Mon, 29 Apr 2019 16:15:11 -0700

Quoted 14 lines

Extension headers are the mechanism of extensibility for the IPv6 protocol, however to date they have only seen limited deployment. The reasons for that are because intermediate devices don't handle them well, and there haven't really be any useful extension headers defined. In particular, Destination and Hop-by-Hop options have not been deployed to any extent.

The landscape may be changing as there are now a number of serious efforts to define and deploy extension headers. In particular, a number of uses for Hop-by-Hop Options are currently being proposed, Some of these are from router vendors so there is hope that they might start start to fix their brokenness. These proposals include IOAM, Path MTU, Firewall and Service Tickets, SRv6, CRH, etc.

Quoted 4 lines

Assuming that IPv6 extension headers gain traction, that leaves a noticeable gap in IPv4 support. IPv4 options have long been considered a non-starter for deployment. An alternative being proposed is to enable use of IPv6 options with IPv4 (draft-herbert-ipv4-eh-00).

"Assuming ipv6 extension headers gain traction, my patch set is useful."

Well, when they gain traction you can propose this stuff.

Until then, it's a facility implemented based upon wishful thinking.

Sorry Tom, I kept pushing back using trivial coding style feedback because I simply can't justify applying this.

#2 lore raw
Quoted 23 lines · David Miller

From: Tom Herbert <[email protected]>
Date: Mon, 29 Apr 2019 16:15:11 -0700

Quoted 14 lines

Extension headers are the mechanism of extensibility for the IPv6 protocol, however to date they have only seen limited deployment. The reasons for that are because intermediate devices don't handle them well, and there haven't really be any useful extension headers defined. In particular, Destination and Hop-by-Hop options have not been deployed to any extent.

The landscape may be changing as there are now a number of serious efforts to define and deploy extension headers. In particular, a number of uses for Hop-by-Hop Options are currently being proposed, Some of these are from router vendors so there is hope that they might start start to fix their brokenness. These proposals include IOAM, Path MTU, Firewall and Service Tickets, SRv6, CRH, etc.

Quoted 4 lines

Assuming that IPv6 extension headers gain traction, that leaves a noticeable gap in IPv4 support. IPv4 options have long been considered a non-starter for deployment. An alternative being proposed is to enable use of IPv6 options with IPv4 (draft-herbert-ipv4-eh-00).

Quoted 6 lines

"Assuming ipv6 extension headers gain traction, my patch set is useful."

Well, when they gain traction you can propose this stuff.

Until then, it's a facility implemented based upon wishful thinking.

Hi Dave,

"Assuming" was probably the wrong word here :-). They are gaining traction. A specific example is In-situ OAM (IOAM) which is being heavily pushed by Cisco (draft-brockners-inband-oam-data-07). This requires host to network signalling in data packets which goes far beyond what information the IP header contains. Their first inclination was to hack up UDP encapsulation protocols like Geneve, but that fundamentally doesn't work for various reasons. We were able to convince them that Hop-by-Hop Options is the correct mechanism so they are pursuing that in draft-ioametal-ippm-6man-ioam-ipv6-options-00. Naturally, they want to support both IPv6 and IPv4 for their products, but there is no usable mechanism in IPv4 (IP options are effectively obsoleted)-- hence the motivation for back porting extension headers to IPv4.

In short, we're at a crossroads. Extension headers are "use it or lose it". If we don't figure out how to make these usable and useful soon, that may never happen and they'll be relegated to a historical footnote just like IP options. IMO, it would be a shame if that happens since we'd be surrendering a valuable feature.

Tom

Quoted 3 lines

Sorry Tom, I kept pushing back using trivial coding style feedback because I simply can't justify applying this.