In this section, I want to talk about the “Segment Routing” mechanism, in other words Control-Plane and the Data-Plane Process.

segment routing review

As you remember in the first video of Segment Routing, definition of Segment Routing, the segment routing network is a network where the traffic route is inserted into the packet itself. That means, when a packet arrives at the edge of the network, we can determine the path of the traffic based on our policy and the QoS requirements of the traffic and then add that path to the traffic or packet itself. by the edge of the network I mean access switches in the LAN and data center network, where receive the traffic from the server and host and PE routers in the service provider networks which receive  customer traffic.

segment routing definition

How do we add the path of the traffic in the packet itself? As we have seen, we add the ID of routers or the ID of links through which the packet should be transmitted, into the packet itself. In other words, we add the segments over which the packet is to be transmitted into the packet itself.

We have two types of segments, prefix-SID or id of the router and adj-SID or id of the link.

segment routing tutorial

In summary, when a packet arrives at the edge of the network, we first determine the path based on our policy and packet’s QoS requirements, then we add prefix-SID and adj-SID of the path in the packet itself. Then packet is routed to the destination but through the path that we have interested in the packet.

We know that the goal of segment routing is traffic engineering. This means that we control the path of traffic at the edge of the network based on our policies and the traffic’s QoS requirements. Some traffic need high bandwidth and some other traffic like voice need minimum delay.

but, if we don’t define a policy for our traffic, the traffic path would be the same as the IGP path. In other words, when we don’t define a policy in the segment routing network, segment routing path should be the same with IGP path. This is also true for MPLS network. When there is no policy in MPLS network,  MPLS path and IGP path are the same.

how segment routing works?

In order to better understand the default process of segment routing, consider this topology that the routers xrv1, xrv2, xrv4, xrv5 and xrv6 are connected sequentially. xrv1 and xrv6 are the edge of the networks. If traffic is received in xrv1 whose destination is xrv6, or is sent to a destination where the next-hop router is xrv6, then router xrv1 inserts the ID of router xrv6 or prefix-SID of xrv6 into the packet, assuming the network is a segment routing network.

Topology of our Segment Routing Network

Then xrv1 asks itself how I can route the traffic to xrv6. It decides based on the best IGP path and forwards the packet to xrv2. When xrv2 receives the traffic it sees that a segment of xrv6 has already been added to the packet. That means, the packet should be forwarded to xrv6. How can I forward the package to xrv6? It decides based on the best IGP path and forwards the packet to xrv4. But before forwarding to xrv4, it swap the label xrv6 with xrv6.

Yes, you are right. It swap the label xrv6 with xrv6. why xrv2 swap the label with itself. Because with MPLS network we have three main actions: pop to remove the top label, push to insert a new label, and swap to change the label. In this scenario, it swaps the label, but the incoming label and the outgoing label are the same.

In router xrv4 the same process is repeated. xrv6 label is swapped with the same label. But in xrv5, it is different since it is the last router before destination and because of PHP or “pen-ultimate hop popping” rule of MPLS., it pop the label from incoming packet. we assume that you know PHP mechanism and we don’t talk about it here. Just know that the router before the last router, pop the label and forward the packet without any label to xrv6.

data-plane process in segment routing with no policy at the edge

So this is the data-plane process in the segment routing network, when no policy is defined at the edge of the network. In this process, each router choose a prefix-SID for itself, which is unique globally through the network. For example router xrv6, chooses 16006 as a prefix-SID for its loopback interface and advertise it through OSPF and ISIS to all other routers in the network.

Notice that there is no LDP to advertise label but the labels are advertised through OSPF and ISIS extensions.

In addition to prefix-SID, each router chooses an ID for each of its directly connected links, called adj-SID, which is locally significant. For example router xrv5 has two direct links and chooses an adj-SID for each of its links.

I repeat again that prefix-SID is globally unique and we will configure it manually, but adj-SID is locally significant and it is generated dynamically. Prefix-SID is globally unique, it means that if router xrv6 selects 16006 as the prefix-SID, the other routers can not use the same prefix SID.

Both prefix-SID and adj-SID are advertised through OSPF or ISIS in the network and so all routers know each other’s prefix SID and adj-SIDs. This allows the routers to include their interesting path in the packet based on a mixture of prefix SID and adj SID.

segment routing configuration

To better understand the control plane and data plane process of segment routing, I have already implemented a similar topology. As you can see, every router has a loopback interface with the IP addresses 1.1.1.1, 2.2.2.2 and so on, according to their router number. the IP address for each link is selected also based on the router number. For example 10.2.4.x for the connection between router xrv2 and xrv4 and the address 10.4.5.x for the connection between router xrv4 and xrv5.

segment routing configuration

The configuration is done in three step: 1. IP addressing of loopback and ethernet interfaces. 2. Enable ISIS level2 in all routers and all links. And the most important section is to enable segment routing in ISIS. As you see we don’t need any other control-plane protocol like LDP.

“metric style wide” is required to enable segment routing in ISIS and then segment routing with MPLS is activated. In segment routing we have two options for data-plane: MPLS and IPV6. In this section we are talking about MPLS version of segment routing and not IPv6. then we choose a Prefix-SID for every router which have to be globally unique in the network. For example 16001 for xrv1, 16002 for xrv2 and, 16006 for xrv6. The Prefix-SID range by default is between 16000 and 23999 and also changeable. Prefix-SID can be configured as an index or as an absolute amount. Index 1 means 16001, index 2 means 16002 since default range is between 16000 and 23999. Contrary to prefix-SID, adj-SID is dynamically assigned and locally significant and not need to be configured.   Both Prefix-SID and adj-SID are advertised through IGP.

To better understand the segment routing mechanism, let’s first review the configuration and then review the control plane and data plane process of our scenario.

First we review the configuration with these commands.

RP/0/RP0/CPU0:xrv1#show ipv4 interface brief
Wed Jun 16 22:37:20.497 UTC

Interface                      IP-Address      Status          Protocol Vrf-Name
Loopback0                      1.1.1.1         Up              Up       default
MgmtEth0/RP0/CPU0/0            unassigned      Shutdown        Down     default
GigabitEthernet0/0/0/0         10.1.2.1        Up              Up       default
GigabitEthernet0/0/0/1         unassigned      Up              Up       default
GigabitEthernet0/0/0/2         unassigned      Shutdown        Down     default
GigabitEthernet0/0/0/3         unassigned      Shutdown        Down     default
GigabitEthernet0/0/0/4         unassigned      Shutdown        Down     default
GigabitEthernet0/0/0/5         unassigned      Shutdown        Down     default
GigabitEthernet0/0/0/6         unassigned      Shutdown        Down     default
RP/0/RP0/CPU0:xrv1#
RP/0/RP0/CPU0:xrv1#show running-config router isis
Wed Jun 16 22:38:06.850 UTC
router isis LAB
 is-type level-2-only
 net 49.0000.0000.0001.00
 address-family ipv4 unicast
  metric-style wide
  segment-routing mpls
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 1
  !
 !
 interface GigabitEthernet0/0/0/0
  address-family ipv4 unicast
  !
 !
!

RP/0/RP0/CPU0:xrv1#

segment routing data plane

Now let’s look at the segment routing data-plane process. When IP traffic in xrv1 is received at the edge of the network with the destination or the next hop of xrv6, CEF table is processed to find out the outgoing interface and outgoing label.

RP/0/RP0/CPU0:xrv1#show cef 6.6.6.6/32
Wed Jun 16 22:38:44.927 UTC
6.6.6.6/32, version 93, labeled SR, internal 0x1000001 0x81 (ptr 0xe1b4778) [1], 0x0 (0xe376aa8), 0xa28 (0xe7fb3e8)
 Updated Jun 15 13:40:26.001
 remote adjacency to GigabitEthernet0/0/0/0
 Prefix Len 32, traffic index 0, precedence n/a, priority 1
   via 10.1.2.2/32, GigabitEthernet0/0/0/0, 6 dependencies, weight 0, class 0 [flags 0x0]
    path-idx 0 NHID 0x0 [0xf1041d0 0x0]
    next hop 10.1.2.2/32
    remote adjacency
     local label 16006      labels imposed {16006}
RP/0/RP0/CPU0:xrv1#

the output of the CEF table shows that the packet must be forwarded to the router vrv2 and label 16006 will be pushed to the packet. Packet with label 1606 Is received in the router xrv2, LFIB table in xrv2 is processed to find out the outgoing interface and the outgoing label.

RP/0/RP0/CPU0:xrv2#show mpls forwarding
Wed Jun 16 22:39:44.856 UTC
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes
Label  Label       or ID              Interface                    Switched
------ ----------- ------------------ ------------ --------------- ------------
16001  Pop         SR Pfx (idx 1)     Gi0/0/0/0    10.1.2.1        11500
16004  Pop         SR Pfx (idx 4)     Gi0/0/0/2    10.2.4.4        500
16005  16005       SR Pfx (idx 5)     Gi0/0/0/2    10.2.4.4        500
16006  16006       SR Pfx (idx 6)     Gi0/0/0/2    10.2.4.4        13000
24002  Pop         SR Adj (idx 1)     Gi0/0/0/2    10.2.4.4        0
24003  Pop         SR Adj (idx 3)     Gi0/0/0/2    10.2.4.4        0
24004  Pop         SR Adj (idx 1)     Gi0/0/0/0    10.1.2.1        0
24005  Pop         SR Adj (idx 3)     Gi0/0/0/0    10.1.2.1        0
RP/0/RP0/CPU0:xrv2#

As you can see for the incoming label 16006, the outgoing label is also 16006 and the packet needs to be forwarded to the xrv4 router.

The same output can be seen in the xrv4 router. but in xrv5, when the packet with label 16006 is received, the label is popped due to PHP or the penultimate pop-hopping rule and packet without label will be forwarded to router xrv6.

RP/0/RP0/CPU0:xrv5#show mpls forwarding
Wed Jun 16 22:41:39.663 UTC
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes
Label  Label       or ID              Interface                    Switched
------ ----------- ------------------ ------------ --------------- ------------
16001  16001       SR Pfx (idx 1)     Gi0/0/0/1    10.4.5.4        11000
16002  16002       SR Pfx (idx 2)     Gi0/0/0/1    10.4.5.4        0
16004  Pop         SR Pfx (idx 4)     Gi0/0/0/1    10.4.5.4        0
16006  Pop         SR Pfx (idx 6)     Gi0/0/0/2    10.5.6.6        13000
24000  Pop         SR Adj (idx 1)     Gi0/0/0/2    10.5.6.6        0
24001  Pop         SR Adj (idx 3)     Gi0/0/0/2    10.5.6.6        0
24002  Pop         SR Adj (idx 1)     Gi0/0/0/1    10.4.5.4        0
24003  Pop         SR Adj (idx 3)     Gi0/0/0/1    10.4.5.4        0
RP/0/RP0/CPU0:xrv5#

In “show mpls forwarding” output, you can also see how much traffic is forwarded with each label. To make sure, in router xrv1, we send some traffic to router xrv6 with ping command and check the amount of traffic to see if is updated or not.

# ping 6.6.6.6

segment routing control plane

Now let’s look at the segment routing control-plane process. As you know, in control plane every router assign an adj-SID for each link dynamically, which is locally significant. In addition to that, we assign a prefix-SID for loopback interface of every routers manually. Prefix-SID and adj-SID are advertised through ISIS in the network.

For example, let’s check the adj-SID of the links connected to xrv5 and then check the ISIS database on router xrv1 to make sure these adj-SID and prefix-SID of xrv5 is advertised on the network and received in xrv1.

With “show isis adj details” we can check the adj-SID assigned for each link. As you can see, there are two labels assigned to each link. Protected and not protected. For now, we’re ignoring protected adj-SID since we haven’t still discussed about protection in segment routing network. in the next videos, we will discuss also protection in segment routing.

RP/0/RP0/CPU0:xrv5#show isis adjacency detail
Wed Jun 16 22:43:13.075 UTC

IS-IS LAB Level-2 adjacencies:
System Id      Interface                SNPA           State Hold Changed  NSF IPv4 IPv6
                                                                               BFD  BFD
xrv4           Gi0/0/0/1                000c.2930.6268 Up    9    1d09h    Yes None None
  Area Address:           49
  Neighbor IPv4 Address:  10.4.5.4*
  Adjacency SID:          24002
  Non-FRR Adjacency SID:  24003
  DIS Priority:           64
  Local Priority:         64
  Neighbor Priority:      64 (DIS)
  Topology:               IPv4 Unicast
xrv6           Gi0/0/0/2                000c.2928.601c Up    8    1d09h    Yes None None
  Area Address:           49
  Neighbor IPv4 Address:  10.5.6.6*
  Adjacency SID:          24000
  Non-FRR Adjacency SID:  24001
  DIS Priority:           64
  Local Priority:         64
  Neighbor Priority:      64 (DIS)
  Topology:               IPv4 Unicast

Total adjacency count: 2
RP/0/RP0/CPU0:xrv5#

with “show isis database verbose xrv5” in xrv1, we make sure that adj-SID and prefix-SID related to router xrv5 are received in xrv1.

RP/0/RP0/CPU0:xrv1#show isis database verbose xrv5
Wed Jun 16 22:44:14.339 UTC

IS-IS LAB (Level-2) Link State Database
LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime/Rcvd  ATT/P/OL
xrv5.00-00            0x000000a0   0x3cdb        667  /1200         0/0/0
  Area Address:   49
  NLPID:          0xcc
  IP Address:     5.5.5.5
  Metric: 10         IP-Extended 5.5.5.5/32
    Prefix-SID Index: 5, Algorithm:0, R:0 N:1 P:0 E:0 V:0 L:0
    Prefix Attribute Flags: X:0 R:0 N:1
  Metric: 10         IP-Extended 10.4.5.0/24
    Prefix Attribute Flags: X:0 R:0 N:0
  Metric: 10         IP-Extended 10.5.6.0/24
    Prefix Attribute Flags: X:0 R:0 N:0
  Hostname:       xrv5
  Router Cap:     5.5.5.5 D:0 S:0
    Segment Routing: I:1 V:0, SRGB Base: 16000 Range: 8000
    SR Algorithm:
      Algorithm: 0
      Algorithm: 1
    Node Maximum SID Depth:
      Label Imposition: 10
  Metric: 10         IS-Extended xrv4.03
    Interface IP Address: 10.4.5.5
    Link Maximum SID Depth:
      Label Imposition: 10
    LAN-ADJ-SID: F:0 B:0 V:1 L:1 S:0 P:0 weight:0 Adjacency-sid: 24003 System ID:xrv4
  Metric: 10         IS-Extended xrv6.03
    Interface IP Address: 10.5.6.5
    Link Maximum SID Depth:
      Label Imposition: 10
    LAN-ADJ-SID: F:0 B:0 V:1 L:1 S:0 P:0 weight:0 Adjacency-sid: 24001 System ID:xrv6

 Total Level-2 LSP count: 1     Local Level-2 LSP count: 0
RP/0/RP0/CPU0:xrv1#

 

Back to: Segment Routing > segment routing basic process and configuration

Leave a Reply

Your email address will not be published. Required fields are marked *


Post comment