SRv6 Fundamentals


An IPv6 packet consists of an IPv6 header, 0 to N (N ≥ 1) extension headers, and payload. To implement Segment Routing based on the IPv6 forwarding plane, a new type of IPv6 routing header (RH), known as SRH, is added to IPv6 packets. The SRH specifies an IPv6 explicit path and stores IPv6 segment lists that are similar to SR-MPLS segment lists.

The ingress adds an SRH to each IPv6 packet, so that transit nodes can forward the packets based on path information contained in the SRH. Figure 1 shows the SRH format.
Figure 1 SRH format
Table 1 describes the fields in an SRH.
Table 1 Fields in an SRH




Next Header

8 bits

Type of the header immediately following the SRH. The common types are as follows:

  • 4: IPv4 encapsulation
  • 41: IPv6 encapsulation
  • 43: routing header for IPv6 (IPv6-Route)
  • 58: ICMPv6
  • 59: no next header

Hdr Ext Len

8 bits

Length of the SRH, excluding the first 8 bytes (fixed length).

Routing Type

8 bits

Routing header type. SRHs have a routing type value of 4.

Segments Left

8 bits

Number of explicitly listed transit nodes to be visited before traffic reaches the destination.

Last Entry

8 bits

Index of the last element in a segment list.


8 bits

Packet flags.


16 bits

Tag indicating a packet as part of a class or group of packets.

Segment List [0] to Segment List [n]

128 bits

Segment list that is encoded from the last segment of a path and expressed using the IPv6 address format.

  • Segment List [0] indicates the last segment of a path.
  • Segment List [1] indicates the penultimate segment of a path.
  • ...
  • Segment List [n–1] indicates the second segment of a path.
  • Segment List [n] indicates the first segment of a path.

Optional TLV Objects


Optional TLVs, such as Padding TLVs and Hash-based Message Authentication Code (HMAC) TLVs.

Figure 2 shows the abstract SRH format. The SIDs in Figure 2 (a) are listed in forward order identified using <>, and those in Figure 2 (b) are listed in reverse order identified using (). The reverse order better represents the actual SRv6 encapsulation format.
Figure 2 Abstract SRH format
Fields involved are as follows:
  • IPv6 Destination Address (IPv6 DA): destination address of an IPv6 packet. For common IPv6 packets, the IPv6 DA is fixed. In SRv6, the IPv6 DA identifies only the next hop of a packet and changes constantly.
  • <Segment List [0], Segment List [1], ..., Segment List [n–1], Segment List [n]>: segment list information in an SRv6 packet. It is similar to an MPLS label stack in SR-MPLS and generated on the ingress. On an SRv6 path, Segment List [n] is the first segment list to be processed, Segment List [n–1] is the second, Segment List [1] is the penultimate, and Segment List [0] is the last.

SRH Processing

In SRv6, every time a packet passes through an SRv6-capable node, the value of the Segments Left (SL) field is decremented by 1 and the IPv6 DA is updated, as shown in Figure 3. The SL and Segment List fields are both used to determine an IPv6 DA.
  • If the value of the SL field is n, the IPv6 DA value is equal to the SID [0] value.
  • If the value of the SL field is n–1, the IPv6 DA value is equal to the SID [1] value.
  • ...
  • If the value of the SL field is 1, the IPv6 DA value is equal to the SID [n–1] value.
  • If the value of the SL field is 0, the IPv6 DA value is equal to the SID [n] value.
Figure 3 SRH processing

According to the preceding description, segment lists in an SRv6 SRH are processed from the bottom up, which is different from SR-MPLS processing.

Another difference between SRv6 and SR-MPLS is that segments in SRv6 SRHs are not popped after being processed by nodes. This is mainly caused by three reasons. First, because the earliest IPv6 RH design was not closely related to MPLS, the segment pop option did not exist at the time. Second, in contrast to MPLS labels that are independently placed on the top of packets and therefore can be directly popped, SRv6 segments are placed in the SRH and associated with information (such as security encryption and verification information) in other extension headers. Third, because the pop operation is not performed, the SRv6 header retains path information, which can be used for path backtracking. In addition, some innovative factors regarding SRv6 segments have been taken into account to reuse the segments for new function extensions.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
Next topic >