Segment Routing Basics: Segment types


In this post I’m going to explain different types of segments used in Segment Routing. I’m concentrating on the MPLS data plane since it is more mature and widely available than SRv6.

Global and Local Segments

Segment Routing segments can global or local. Global segment instruction is supported by all nodes in a Segment Routing domain. Global segment is represented as a label value calculated by adding index value to SR Global Block (SRGB). The index value must be unique within domain. For example if SRGB=16000 and index=10, then global segment label value would be 16010.

Local segment instruction is supported only by originating node. Local segment label value can be any value outside SRGB.


Segment Routing Global Block (SRGB) is a reserved range of labels for global segments. SRGB range can be configured for each node and it is generally recommended to use same range for every node for ease of operations and troubleshooting.

IGP Prefix Segment

IGP prefix segment is global segment attached to prefix advertised through IGP domain. This segment type instructs nodes to forward packets to destination prefix using IGP calculated shortest path taking advantage of equal cost multipathing (ECMP) where possible.

Node segment

Node Segment is a special prefix segment that identifies specific node in a segment routing domain. Usually attached to prefix associated with loopback interface. Node segment is equal to normal prefix segment except it has N-flag set in advertisements.

Anycast Segment

Anycast segment is another special prefix segment that identifies anycast prefix advertised by multiple nodes. Same prefix segment id is used for same prefix on all nodes advertising the anycast segment. Traffic is forwarded to closest advertising node using IGP shortest path. If one node fails, traffic is automatically rerouted to next closest node. Anycast segment can be used for example to implement service high-availability or virtualization.

In the figure below, node N4 advertises prefix with segment 16004. Node N1 forwards traffic to using the segment label value. Assuming that all links are equal cost, N1 can take advantage of the two equal paths to N4. By default, N4 advertises the segment with P or NP flags that instruct N2 and N3 to pop the label before forwarding the plain IP packet to it. This is the normal Penultimate Hop Popping (PHP) technique used in MPLS.


IGP Adjacency Segment

IGP adjacency segment is local segment attached to one or more IGP adjacencies between nodes. It instructs node to forward packet over link that the adjacency is attached. If segment identifies multiple adjacencies, traffic can be load balanced between them.

Because adjacency segment enforces that packets are forwarded over defined interface(s), they can be used to express any path trough network. Adjacency segments can be used together with prefix segments to forward traffic to specified nodes using prefix segments and use adjacency segments where explicit path or links need to be used.

In the figure below, traffic from N1 to N5 is required to be forwarded through N4. This requirement is accomplished by first forwarding the traffic to N4 using node segment 16004 and then forwarding to N5 using adjacency segment 24005.


BGP Peering Segments

BGP peering segments are used in BGP Egress Peer Engineering (EPE) to steer outbound traffic through specific egress node.

  • Peer node segment is local segment that identifies connected BGP peer node.
  • Peer adjacency segment is local segment that identifies link to connected BGP peer node.
  • Peer set segment is local segment that identifies group of links which traffic will be load balanced across.

In common use case, egress node would advertise the BGP EPE routes to central controller which would program ingress nodes using Path Computation Element Communication Protocol (PCEP), BGP Labeled Unicast (BGP-LU) or NETCONF.

In the following figure, AS100 edge nodes N4 and N5 are enabled for EPE. N5 advertises the BGP peer segments through BGP-LS to controller. Controller then uses some algorithm to determine that the optimal path to destination network is through N5-N7 link and programs the ingress node N1. Traffic destined to will first be forwarded to egress node N5 using IGP prefix segment 16005 and then to N7 using BGP peer segment 24017.


Binding Segment

Binding segment is local segment that is used to map single segment into list of segments. It decreases the number of segments that the source node has to impose by aggregating list of segments behind the binding SID. When the binding segment originator receives packet with the binding SID, it pops the label and pushes the associated segment list.

Binding segment can be used for isolation between segment routing domains by hiding the internal topology from external domains. External domain sees only the binding segment and not the domain internal segments. Another benefit is that external domain is not impacted by changes of topology (and segment list) of internal topology because the binding segment does not change.

In the following figure, N7 has binding segment defined for policy that steers traffic to N10 through N9 and N8. When N7 receives packet with binding segment label 42007, it pops the label and pushes the segment list defined in the policy. As this example demonstrates, use of binding segment significantly reduces the size of the label stack that the source node N1 has to push. Also if the policy changes to steer traffic through N6 instead of N9, the source node doesn’t have to know about the change because the binding segment remains the same.



This was a quick look into the most common Segment Routing segment types. In a future post I will demonstrate Segment Routing in action with a more closer look at the different segments.

comments powered by Disqus