Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

IPv6 Segment Routing Header (ipv6_srh)

  • Layer: L3 (network)
  • Header: variable length
  • Final destination: while segments_left is not 0, element 0 of segment_list replaces the destination address of the lower pseudo header (RFC 8200 §8.1)
  • Notes: SRv6 SRH / SR-MPLS (P2)

Reached from

Lower layerSelectorValue
ipv68 bits of the payload after its first 16 bits when next_header = 43 (0x2b)4 (0x04)
ipv6_hopopts8 bits of the payload after its first 16 bits when next_header = 43 (0x2b)4 (0x04)
ipv6_route8 bits of the payload after its first 16 bits when next_header = 43 (0x2b)4 (0x04)
ipv6_srh8 bits of the payload after its first 16 bits when next_header = 43 (0x2b)4 (0x04)
ipv6_frag8 bits of the payload after its first 16 bits when next_header = 43 (0x2b)4 (0x04)
ipv6_dstopts8 bits of the payload after its first 16 bits when next_header = 43 (0x2b)4 (0x04)

Fields

FieldTypeDefaultAutoDescription
next_headeruint(8)253Protocol number of the next layer (see Next layer)Protocol number of the header following this extension header (Auto).
hdr_ext_lenuint(8)Length of the header in 64-bit words (-1)Length of this extension header in 8-octet units, not counting the first 8 octets (Auto).
routing_typeenum(8)4 (segment_routing)Routing header type (e.g. 2 = Mobile IPv6, 4 = SRH).
segments_leftuint(8)1Segments Left: index (in the segment list) of the next segment to visit; 0 at the last one.
last_entryuint(8)Number of items of segment_list (-1)Last Entry: index of the last element of the segment list, i.e. number of segments - 1 (Auto).
flagsuint(8)0Flags (no flag defined by RFC 8754; 0).
taguint(16)0Tag: marks packets as part of a class or group (0 = unused).
segment_listlist<ipv6> — last_entry * 16 + 16 octets2 itemsSegment list (SIDs) in reverse path order: element 0 is the last segment, the last element the first. While Segments Left is non-zero, upper-layer checksums use element 0 as the destination.
tlvstlv — up to offset hdr_ext_len * 8 + 8 of the groupOptional TLVs (8-bit type, 8-bit length): Pad1, PadN, HMAC (the HMAC value is Manual). The header is then padded with Pad1 octets to a multiple of 8 (Auto).
paddingpadding(8)Zero padding (Pad1) of the extension header to a multiple of 8 octets (Auto).

routing_type

ValueName
4 (0x04)segment_routing

tlvs

  • Type 8 bits, length 8 bits.
  • The length counts the value only.
  • Unknown types are kept as raw value octets.
TypeNameValue fieldsDescription
0 (0x00)pad1(type only, no length or value)
4 (0x04)padnpadding
5 (0x05)hmacd, reserved, hmac_key_id, hmac

tlvs › padn

FieldTypeDefaultAutoDescription
paddingbytes — rest of the PDU

tlvs › hmac

FieldTypeDefaultAutoDescription
duint(1)0
reserveduint(15)0
hmac_key_iduint(32)1
hmacbytes — rest of the PDU00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Next layer

The next layer is selected by next_header; when the field is Auto the builder writes the value of the protocol stacked above.

ValueProtocolNote
0 (0x00)ipv6_hopopts
4 (0x04)ipv4
6 (0x06)tcp
17 (0x11)udp
41 (0x29)ipv6
43 (0x2b)ipv6_route
44 (0x2c)ipv6_frag
46 (0x2e)rsvp
47 (0x2f)gre
58 (0x3a)icmpv6
60 (0x3c)ipv6_dstopts
88 (0x58)eigrp
89 (0x59)ospfv3
112 (0x70)vrrpv3_ipv6
115 (0x73)l2tpv3
132 (0x84)sctp
143 (0x8f)ethernet2

8 bits of the payload after its first 16 bits when next_header = 43 (0x2b)

ValueProtocol
4 (0x04)ipv6_srh
(any other value)ipv6_route

Constraints

LevelRule
warningrouting_type = 4

Sample templates