Routing headers are defined in [
RFC 8200]. The Segment Routing Header (SRH) has a new Routing Type (4).
The SRH is defined as follows:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Next Header | Hdr Ext Len | Routing Type | Segments Left |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Last Entry | Flags | Tag |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Segment List[0] (128-bit IPv6 address) |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| |
...
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Segment List[n] (128-bit IPv6 address) |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
// //
// Optional Type Length Value objects (variable) //
// //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
where:
-
Next Header:
-
Defined in RFC 8200, Section 4.4.
-
Hdr Ext Len:
-
Defined in RFC 8200, Section 4.4.
-
Routing Type:
-
4.
-
Segments Left:
-
Defined in RFC 8200, Section 4.4.
-
Last Entry:
-
contains the index (zero based), in the Segment List, of the last element of the Segment List.
-
Flags:
-
8 bits of flags. Section 8.1 creates an IANA registry for new flags to be defined. The following flags are defined:
0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+
|U U U U U U U U|
+-+-+-+-+-+-+-+-+
-
-
U: Unused and for future use. MUST be 0 on transmission and ignored on receipt.
-
Tag:
-
Tag a packet as part of a class or group of packets -- e.g., packets sharing the same set of properties. When Tag is not used at the source, it MUST be set to zero on transmission. When Tag is not used during SRH processing, it SHOULD be ignored. Tag is not used when processing the SID defined in Section 4.3.1. It may be used when processing other SIDs that are not defined in this document. The allocation and use of tag is outside the scope of this document.
-
Segment List[0..n]:
-
128-bit IPv6 addresses representing the nth segment in the Segment List. The Segment List is encoded starting from the last segment of the SR Policy. That is, the first element of the Segment List (Segment List[0]) contains the last segment of the SR Policy, the second element contains the penultimate segment of the SR Policy, and so on.
-
TLV:
-
Type Length Value (TLV) is described in Section 2.1.
In the SRH, the Next Header, Hdr Ext Len, Routing Type, and Segments Left fields are defined in
Section 4.4 of
RFC 8200. Based on the constraints in that section, Next Header, Header Ext Len, and Routing Type are not mutable while Segments Left is mutable.
The mutability of the TLV value is defined by the most significant bit in the type, as specified in
Section 2.1.
Section 4.3 defines the mutability of the remaining fields in the SRH (Flags, Tag, Segment List) in the context of the SID defined in this document.
New SIDs defined in the future
MUST specify the mutability properties of the Flags, Tag, and Segment List and indicate how the Hashed Message Authentication Code (HMAC) TLV (
Section 2.1.2) verification works. Note that, in effect, these fields are mutable.
Consistent with the SR model, the source of the SRH always knows how to set the Segment List, Flags, Tag, and TLVs of the SRH for use within the SR domain. How it achieves this is outside the scope of this document but may be based on topology, available SIDs and their mutability properties, the SRH mutability requirements of the destination, or any other information.
This section defines TLVs of the Segment Routing Header.
A TLV provides metadata for segment processing. The only TLVs defined in this document are the HMAC (
Section 2.1.2) and padding TLVs (
Section 2.1.1). While processing the SID defined in
Section 4.3.1, all TLVs are ignored unless local configuration indicates otherwise (
Section 4.3.1.1.1). Thus, TLV and HMAC support is optional for any implementation; however, an implementation adding or parsing TLVs
MUST support PAD TLVs. Other documents may define additional TLVs and processing rules for them.
TLVs are present when the Hdr Ext Len is greater than (Last Entry+1)*2.
While processing TLVs at a segment endpoint, TLVs
MUST be fully contained within the SRH as determined by the Hdr Ext Len. Detection of TLVs exceeding the boundary of the SRH Hdr Ext Len results in an ICMP Parameter Problem, Code 0, message to the Source Address, pointing to the Hdr Ext Len field of the SRH, and the packet being discarded.
An implementation
MAY limit the number and/or length of TLVs it processes based on local configuration. It
MAY limit:
-
the number of consecutive Pad1 (Section 2.1.1.1) options to 1. If padding of more than one byte is required, then PadN (Section 2.1.1.2) should be used.
-
The length in PadN to 5.
-
The maximum number of non-Pad TLVs to be processed.
-
The maximum length of all TLVs to be processed.
The implementation
MAY stop processing additional TLVs in the SRH when these configured limits are exceeded.
0 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-----------------------
| Type | Length | Variable-length data
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-----------------------
-
Type:
-
An 8-bit codepoint from the "Segment Routing Header TLVs" [IANA-SRHTLV]. Unrecognized Types MUST be ignored on receipt.
-
Length:
-
The length of the variable-length data field in bytes.
-
Variable-length data:
-
data that is specific to the Type.
Type Length Value (TLV) entries contain
OPTIONAL information that may be used by the node identified in the Destination Address (DA) of the packet.
Each TLV has its own length, format, and semantic. The codepoint allocated (by IANA) to each TLV Type defines both the format and the semantic of the information carried in the TLV. Multiple TLVs may be encoded in the same SRH.
The highest-order bit of the TLV type (bit 0) specifies whether or not the TLV data of that type can change en route to the packet's final destination:
-
0: TLV data does not change en route
-
1: TLV data does change en route
All TLVs specify their alignment requirements using an xn+y format. The xn+y format is defined as per [
RFC 8200]. The SR source nodes use the xn+y alignment requirements of TLVs and Padding TLVs when constructing an SRH.
The Length field of the TLV is used to skip the TLV while inspecting the SRH in case the node doesn't support or recognize the Type. The Length defines the TLV length in octets, not including the Type and Length fields.
The following TLVs are defined in this document:
Additional TLVs may be defined in the future.
There are two types of Padding TLVs, Pad1 and PadN, and the following applies to both:
-
Padding TLVs are used for meeting the alignment requirement of the subsequent TLVs.
-
Padding TLVs are used to pad the SRH to a multiple of 8 octets.
-
Padding TLVs are ignored by a node processing the SRH TLV.
-
Multiple Padding TLVs MAY be used in one SRH.
Alignment requirement: none
0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+
| Type |
+-+-+-+-+-+-+-+-+
A single Pad1 TLV
MUST be used when a single byte of padding is required. A Pad1 TLV
MUST NOT be used if more than one consecutive byte of padding is required.
Alignment requirement: none
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Length | Padding (variable) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
// Padding (variable) //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
Type:
-
4
-
Length:
-
0 to 5. The length of the Padding field in bytes.
-
Padding:
-
Padding bits have no semantic. They MUST be set to 0 on transmission and ignored on receipt.
The PadN TLV
MUST be used when more than one byte of padding is required.
Alignment requirement: 8n
The keyed Hashed Message Authentication Code (HMAC) TLV is
OPTIONAL and has the following format:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Length |D| RESERVED |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| HMAC Key ID (4 octets) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| //
| HMAC (variable) //
| //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
where:
-
Type:
-
5.
-
Length:
-
The length of the variable-length data in bytes.
-
D:
-
1 bit. 1 indicates that the Destination Address verification is disabled due to use of a reduced Segment List (see Section 4.1.1).
-
RESERVED:
-
15 bits. MUST be 0 on transmission.
-
HMAC Key ID:
-
A 4-octet opaque number that uniquely identifies the pre-shared key and algorithm used to generate the HMAC.
-
HMAC:
-
Keyed HMAC, in multiples of 8 octets, at most 32 octets.
The HMAC TLV is used to verify that the SRH applied to a packet was selected by an authorized party and to ensure that the segment list is not modified after generation. This also allows for verification that the current segment (by virtue of being in the authorized Segment List) is authorized for use. The SR domain ensures that the source node is permitted to use the source address in the packet via ingress filtering mechanisms as defined in BCP 84 [
RFC 3704] or other strategies as appropriate.
Local configuration determines when to check for an HMAC. This local configuration is outside the scope of this document. It may be based on the active segment at an SR Segment endpoint node, the result of an Access Control List (ACL) that considers incoming interface, HMAC Key ID, or other packet fields.
An implementation that supports the generation and verification of the HMAC supports the following default behavior, as defined in the remainder of this section.
The HMAC verification begins by checking that the current segment is equal to the destination address of the IPv6 header. The check is successful when either:
-
HMAC D bit is 1 and Segments Left is greater than Last Entry, or
-
HMAC Segments Left is less than or equal to Last Entry, and the destination address is equal to Segment List[Segments Left].
The HMAC field is the output of the HMAC computation as defined in [
RFC 2104], using:
-
key: The pre-shared key identified by HMAC Key ID
-
HMAC algorithm: Identified by the HMAC Key ID
-
Text: A concatenation of the following fields from the IPv6 header and the SRH, as it would be received at the node verifying the HMAC:
-
IPv6 header: Source address (16 octets)
-
SRH: Last Entry (1 octet)
-
SRH: Flags (1 octet)
-
SRH: HMAC 16 bits following Length
-
SRH: HMAC Key ID (4 octets)
-
SRH: All addresses in the Segment List (variable octets)
The HMAC digest is truncated to 32 octets and placed in the HMAC field of the HMAC TLV.
For HMAC algorithms producing digests less than 32 octets long, the digest is placed in the lowest-order octets of the HMAC field. Subsequent octets
MUST be set to zero such that the HMAC length is a multiple of 8 octets.
If HMAC verification is successful, processing proceeds as normal.
If HMAC verification fails, an ICMP error message (parameter problem, error code 0, pointing to the HMAC TLV)
SHOULD be generated (but rate limited) and logged, and the packet
SHOULD be discarded.
The HMAC Key ID field allows for the simultaneous existence of several hash algorithms (SHA-256, SHA3-256 ... or future ones) as well as pre-shared keys.
The HMAC Key ID field is opaque -- i.e., it has neither syntax nor semantic except as an identifier of the right combination of pre-shared key and hash algorithm.
At the HMAC TLV generating and verification nodes, the Key ID uniquely identifies the pre-shared key and HMAC algorithm.
At the HMAC TLV generating node, the Text for the HMAC computation is set to the IPv6 header fields and SRH fields as they would appear at the verification node(s), not necessarily the same as the source node sending a packet with the HMAC TLV.
Pre-Shared key rollover is supported by having two key IDs in use while the HMAC TLV generating node and verifying node converge to a new key.
The HMAC TLV generating node may need to revoke an SRH for which it previously generated an HMAC. Revocation is achieved by allocating a new key and key ID, then rolling over the key ID associated with the SRH to be revoked. The HMAC TLV verifying node drops packets with the revoked SRH.
An implementation supporting HMAC can support multiple hash functions. An implementation supporting HMAC
MUST implement SHA-2 [
FIPS180-4] in its SHA-256 variant.
The selection of pre-shared key and algorithm and their distribution is outside the scope of this document. Some options may include:
-
setting these items in the configuration of the HMAC generating or verifying nodes, either by static configuration or any SDN-oriented approach
-
dynamically using a trusted key distribution protocol such as [RFC 6407]
While key management is outside the scope of this document, the recommendations of BCP 107 [
RFC 4107] should be considered when choosing the key management system.