What is SRH Segment routing header

SRH (Segment Routing Header) Explained in Detail

The Segment Routing Header (SRH) is a crucial component in Segment Routing IPv6 (SRv6), a technique for establishing traffic paths within an IPv6 network. It provides a mechanism for specifying an explicit path for packets to travel through the network.

Structure of the SRH:

The SRH is an extension header added to an IPv6 packet. It comprises several key fields:

  • Next Header: This field indicates the type of header following the SRH in the packet (e.g., TCP, UDP).
  • Length: This field specifies the length of the SRH in units of 8 octets, excluding the first 8 octets (Next Header and Length fields).
  • Routing Type: This field signifies the type of routing header. For SRH, it's always set to the value 4.
  • Segments Left: This field indicates the number of remaining hops (segments) the packet needs to traverse before reaching its final destination.
  • Last Entry: This field points to the index of the last element (IPv6 address) within the segment list carried in the SRH.
  • Flags (Optional): These flags offer additional functionalities for SRv6, such as indicating a bypass or a prepend operation.
  • Tag (Optional): This field allows tagging packets for classification or membership within a specific traffic group.
  • Segment List: This section contains a list of IPv6 addresses representing the segments (hops) the packet needs to traverse along the designated path. The order is significant, with the first entry being the next hop and subsequent entries representing further hops on the path.

SRH Processing:

  1. SR Capable Nodes: Only nodes that understand SRv6 can process the SRH. Non-SRv6 capable nodes will discard packets with an SRH.
  2. Segments Left Decrement: When an SRv6 node receives a packet with an SRH, it decrements the "Segments Left" field by 1.
  3. Next Hop Determination: The next hop address is retrieved from the segment list based on the value of the "Last Entry" field.
  4. Forwarding: The packet is forwarded towards the next hop address obtained from the segment list.
  5. SRH Removal: Once the "Segments Left" field reaches zero, the SRH has served its purpose and is removed from the packet.

Benefits of SRH:

  • Explicit Path Control: SRH allows for defining and controlling the exact path a packet takes through the network, offering more granular traffic engineering possibilities compared to traditional routing protocols.
  • Scalability: SRH facilitates efficient traffic management in large and complex IPv6 networks.
  • Flexibility: The ability to specify paths within the packet header enables dynamic routing adjustments without requiring extensive network configuration changes.

Additional Points:

  • SRH can optionally carry additional information encoded as TLVs (Type-Length-Value) for advanced functionalities.
  • Security mechanisms like HMAC (Hashed Message Authentication Code) can be employed with SRH to ensure data integrity and prevent unauthorized path manipulation.