MPLS and Segment Routing · Topic 3 of 4

Segment Routing Basics: Segments and the Control Plane

Learn segment routing basics: prefix, node, adjacency and binding segments, SRGB labels, IS-IS, OSPF and BGP extensions, and LDP interworking.

  • 5 min
  • Includes a diagram
In a nutshell
  • A prefix segment is global. An adjacency segment is local to one router and one link.
  • A node segment is a prefix segment for a loopback.
  • A binding segment is a label that stands for an SR policy.

What it is

Segment routing (SR) is a way to steer packets with a list of instructions called segments, carried by the packet itself.

A segment can mean a node, a link or a service. The ingress router puts the chosen segments on the packet, and the network follows them. Routers keep no per path state, so SR needs no LDP and no RSVP-TE.

IGPISIS or OSPFadvertises segmentsEvery routerlabel tableingress addsSegment liston the packetnetwork followsDestinationreached

This page covers SR with the MPLS data plane, called SR-MPLS. The next page covers policies and advanced features.

How it works

Segments are advertised by the IGP, and every router turns them into labels.

Segment types

SegmentScopeMeaning
Prefix segmentGlobalGo to this prefix by the shortest path
Node segmentGlobalA prefix segment for a router loopback
Anycast segmentGlobalA prefix segment shared by several routers
Adjacency segmentLocalSend the packet out of this link
Binding segmentLocalA label that stands for an SR policy

A prefix segment follows the ECMP shortest path. An adjacency segment forces one exact link, and it is only meaningful on the router that owns it.

Labels and the SRGB

R1 at 1.1.1.1 advertises prefix-sid index 10, and every router with SRGB 16000 to 23999 uses label 16010, the base plus the index, for that prefix. Each router reserves a block of labels for global segments, the segment routing global block (SRGB). A prefix segment ID is an index. The label on a router is the SRGB base plus the index.

If the base is 16000, which is the default SRGB start, then index 10 gives label 16010. All routers should use the same SRGB, so that the same label means the same prefix everywhere. Adjacency segments are taken from a local label range and are not part of the SRGB.

Prefix SID index10SRGB base 16000Label16010on every routerSame prefix1.1.1.1

Configuring SR with IS-IS on IOS XR

RP/0/RP0/CPU0:R1(config)# router isis CORE
RP/0/RP0/CPU0:R1(config-isis)# address-family ipv4 unicast
RP/0/RP0/CPU0:R1(config-isis-af)# metric-style wide
RP/0/RP0/CPU0:R1(config-isis-af)# segment-routing mpls
RP/0/RP0/CPU0:R1(config-isis-af)# exit
RP/0/RP0/CPU0:R1(config-isis)# interface Loopback0
RP/0/RP0/CPU0:R1(config-isis-if)# address-family ipv4 unicast
RP/0/RP0/CPU0:R1(config-isis-if-af)# prefix-sid index 10
RP/0/RP0/CPU0:R1(config-isis-if-af)# commit

The OSPF version enables SR in the process and sets the index on the loopback interface:

RP/0/RP0/CPU0:R1(config)# router ospf 1
RP/0/RP0/CPU0:R1(config-ospf)# segment-routing mpls
RP/0/RP0/CPU0:R1(config-ospf)# area 0
RP/0/RP0/CPU0:R1(config-ospf-ar)# interface Loopback0
RP/0/RP0/CPU0:R1(config-ospf-ar-if)# prefix-sid index 10

The global block can be set explicitly:

RP/0/RP0/CPU0:R1(config)# segment-routing
RP/0/RP0/CPU0:R1(config-sr)# global-block 16000 23999

On IOS XE, SR is also enabled with segment-routing mpls, and the prefix index is set with a connected prefix map. Check the exact syntax for the release.

RP/0/RP0/CPU0:R1# show isis segment-routing label table
RP/0/RP0/CPU0:R1# show mpls forwarding

SR control plane

The control plane is the existing IGP with extensions. No new protocol is needed.

ProtocolWhat carries the segments
IS-ISSub TLVs for the SRGB, prefix segments and adjacency segments
OSPFExtended prefix and extended link opaque LSAs
BGPThe prefix SID attribute with labelled unicast, for large or multidomain networks

The IGP floods each router's SRGB and its segments. Every router can then calculate the label to use for every other router.

IS-IS needs wide metrics, and OSPF uses its extended LSAs. The SPF calculation itself is unchanged.

BGP can carry prefix segments between domains, and it can also advertise the egress peer segments that steer traffic out to a chosen neighbour AS.

Interworking with LDP

A network can move to SR step by step. Some routers run SR and others run only LDP. A segment routing mapping server fixes the gap.

The mapping server advertises prefix segments on behalf of the LDP only routers. SR routers then have labels for those prefixes too, and they can build a path across the mixed network. Where SR meets LDP, the border router swaps between the two kinds of label.

What to remember for the exam

Seven facts cover most questions on this topic.

  • A prefix segment is global. An adjacency segment is local to one router and one link.
  • A node segment is a prefix segment for a loopback.
  • A binding segment is a label that stands for an SR policy.
  • Label equals SRGB base plus index, and the default base is 16000.
  • IS-IS and OSPF carry the segments with extensions, and BGP can carry prefix segments.
  • SR needs no LDP and no RSVP-TE, and the ingress holds the path state.
  • A mapping server gives LDP only routers prefix segments.
Exam tip

To find a label on an exam question, add the prefix index to the SRGB base of the router that receives the packet.

Common mistakes

These four mistakes appear often.

Using different SRGBs on routers. The same index then gives different labels, and paths become hard to follow.

Confusing global and local segments. An adjacency segment only works on the router that advertises it.

Forgetting wide metrics for IS-IS. SR extensions need them.

Thinking SR removes the IGP. The IGP still calculates the paths and advertises the segments.

Note

IOS XR reserves a separate local block for adjacency segments, so they do not overlap the SRGB.

Check yourself

Work through these three questions.

  • How is the label for a prefix segment worked out?

    It is the SRGB base plus the prefix index, so base 16000 and index 10 gives 16010.

  • What is the difference between a prefix segment and an adjacency segment?

    A prefix segment is global and follows the shortest path, while an adjacency segment is local and forces one link.

  • What does a mapping server do?

    It advertises prefix segments for LDP only routers, so SR and LDP can work together.

Topic 3 of 4 in MPLS and Segment Routing

Test yourself on MPLS and Segment Routing

The full Cisco CCNP 350-501 SPCOR question bank has 738 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Cisco. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.