Subject: [nvo3] OUI Extended Ethertypes as next-protocol

From: [email-masked] (Dale R. Worley)
Date: Sun, 27 Aug 2017 11:04:00 -0400

Don Eastlake mentioned the use of OUI Extended Ethertypes.  Assuming
that Geneve encapsulates an Ethernet header, that header can specify
the 88B7 Ethertype, and be followed by the OUI Extended Ethertype
(sub-)header.

But things get messier if Geneve directly encapsulates a protocol which
is described by an OUI Extended Ethertype, because Geneve only
reserves two octets for the Protocol Type field.

So I thought I would try to design a way of handling the situation
that avoided obvious shortcomings.

Though OUI Ethertypes are often described as an extension of the 802
header, they act as a further header after an 802 header whose
ethertype is 88B7, and is then followed by the payload (that is, the
payload described by the OUI Ethertype):

      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                       Destination MAC Address                 |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |       Destination MAC Address |         Source MAC Address    |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                         Source MAC Address                    |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |       Ethertype=0x88B7        |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |      Organizationally Unique Identifier       | Ethertype     |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |  Ethertype    |
      +-+-+-+-+-+-+-+-+

      +-+-+-+-+-+-+-+-+-
      |      Payload ...
      +-+-+-+-+-+-+-+-+-

The OUI Ethertype header is essentially the same as the Subnetwork
Access Protocol header.

So the natural way of using OUI Ethertypes as the next-protocol in
Geneve is to put the "OUI Ethertype" Ethertype in Geneve header, and
then follow it with the OUI Ethertype header:

      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |Ver|  Opt Len  |O|C|    Rsvd.  |     Protocol Type 88B7        |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |        Virtual Network Identifier (VNI)       |    Reserved   |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                    Options ...                                |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |      Organizationally Unique Identifier       | Ethertype     |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |  Ethertype    |
      +-+-+-+-+-+-+-+-+

      +-+-+-+-+-+-+-+-+-
      |      Payload ...
      +-+-+-+-+-+-+-+-+-

Unfortunately, that leaves the payload not aligned on a 4-octet
boundary, which is undesirable.  (E.g., draft-dt-nvo3-encap-01,
section 6.4)

The desiderata for the situation seem to be:

1. The Geneve header together with the OUI Ethertype specification must
   be a multiple of 4 octets.
2. The incremental length for an OUI Ethertype should be as small as
   possible.
3. The consumption of currently reserved fields should be minimal.

There are three locations where the OUI Ethertype could be carried:

A. Incorporate the OUI Ethertype into the Geneve fixed part.
B. Incorporate the OUI Ethertype into a Geneve option.
C. The OUI Ethertype follows the Geneve header.

Incorporating the OUI Ethertype into Geneve fixed part aligns with the
attitude that the OUI Ethertype field is an extension of the Ethernet
header.  One possibility for this is:

      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |Ver|  Opt Len  |O|C|    Rsvd.  |   Protocol Type 88B7          |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |        Virtual Network Identifier (VNI)       |    OUI        |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |  OUI                          |   Ethertype                   |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                    Options ...                                |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

A large disadvantage is that this makes the location of the first
Geneve option variable relative to the start of the Geneve header,
conditional on the Protocol Type field, which is not
upward-compatible.  It's also not TCAM-friendly, unless a flag bit is
allocated to indicate an OUI Ethertype, since a test for "not equal
88B7" can't be done with TCAM.  This format also allocates the
reserved octet in the fixed part.

Incorporating the OUI Ethertype into a Geneve option avoids most of
these problems, but the option must be 12 octets long.

So the best choice is putting the OUI Ethertype after the Geneve
header, but using a method which avoids the alignment problem of the
naive method.

In order to avoid adding 3 octets of padding to achieve 4-octet
alignment, we want to reduce the OUI Ethertype header to 4 octets,
which requires placing one octet of it (presumably the first octet of
the OUI) in the Geneve header.  The choices that do not lengthen the
Geneve header are:

F. the reserved octet
G. one octet of the Protocol Type

These interact with the possibilities for signaling that the
next-protocol is OUI Extended Ethertype:

L. Protocol Type equals 88B7
M. allocating a flag bit
N. using a special value (0..5) of the high-order octet of Protocol Type

Choice N. exploits the fact that the high-order octet of an Ethertype
cannot be 0, 1, 2, 3, 4, or 5.  (IEEE 802-2014 section 9.2.1)

Note that choices L. and N. are TCAM-friendly in regard to accessing
the Geneve header itself.

Choice F. is undesirable by desideratum 3 (avoid allocating reserved
fields).  Similarly, choice M. is undesirable, though less so.  Choice
N. also allocates a reserved resource, one of the 6 special values of
the high-order octet of Protocol Type.  However, it does not reduce
the bits available in the Geneve fixed part when using an ordinary
Ethertype.

Choice G. is incompatible with choice L.

This leaves the combination of N. and G. the best available way to
provide a octet for the OUI Extended Ethernet.  Assuming we use 1 as
the reserved value, the combination of Geneve and OUI Ethernet headers
is:

      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |Ver|  Opt Len  |O|C|    Rsvd.  |      1        |  OUI          |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |        Virtual Network Identifier (VNI)       |    Reserved   |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |  OUI                          |   Ethertype                   |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                    Options ...                                |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |    OUI                        |   Ethertype                   |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

      +-+-+-+-+-+-+-+-+-
      |      Payload ...
      +-+-+-+-+-+-+-+-+-

Dale