Friday, October 27, 2017

Learn Segment Routing with ASR 9000 (1) --- Prefix&Adjacency Sid Assignment




From days on, I will publish a series of blogs related with segment routing cause I am learning this new technology and it is the trend definitely. The best way to understand it in fast way is to try it in real. I am using cisco xrv 9000 for experiment, which support almost all segment routing features and easy to get.
Below is the topology used.
xrv1 & xrv2:  PE
xrv 3: P node
xrv 5 & xrv6: RR.
xrv 4: IGW
xrv7: ISP

1. Basic segment routing configuration example:

below is the ISIS configuration on xrv1. This is a configuration with tuned parameters already. Segment routing related commands are marked out for reference.
router isis 1
 is-type level-2-only
 net 49.0001.0101.2722.4001.00
 lsp-gen-interval maximum-wait 10000 initial-wait 0 secondary-wait 10 level 2
 address-family ipv4 unicast
  metric-style wide level 2
  mpls traffic-eng level-2-only
  mpls traffic-eng router-id Loopback0

  spf-interval maximum-wait 10000 initial-wait 0 secondary-wait 10 level 2
  segment-routing mpls
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 1001
  !
 !
 interface GigabitEthernet0/0/0/1
  point-to-point
  address-family ipv4 unicast
   fast-reroute per-prefix level 2
   fast-reroute per-prefix ti-lfa level 2
  !
 !
 interface GigabitEthernet0/0/0/2
  point-to-point
  address-family ipv4 unicast
   fast-reroute per-prefix level 2
   fast-reroute per-prefix ti-lfa level 2
  !
 !
!
Configuration on xrv2,3,4 are similar. Only net id is different. But xrv5 and xrv6 are not enabled with segment routing as they are used for RR and should NOT be used for traffic forwarding. xrv7 is used for simulating higher tier service provider that without segment routing capability.

Next we are going to check the result and see how prefix and adjacency sid are allocated.

Check the global-sid block: 

this block is reserved for prefix sid to ensure labels used for identify nodes are available on all nodes. This block is the default value. It is suggested all nodes are configured with same range. If you modify this range, you might need to reboot the device as some of the labels in the range might been used by LDP/TE protocols.

RP/0/0/CPU0:Edge1#show mpls label table detail
Tue Aug 29 12:45:40.331 UTC
Table Label   Owner                           State  Rewrite
----- ------- ------------------------------- ------ -------
0     0       LSD(A)                          InUse  Yes
0     1       LSD(A)                          InUse  Yes
0     2       LSD(A)                          InUse  Yes
0     13      LSD(A)                          InUse  Yes
0     16000   ISIS(A):1                       InUse  No  (Lbl-blk SRGB, vers:0, (start_label=16000, size=8000)0     24000   ISIS(A):1                       InUse  Yes
  (SR Adj Segment IPv4, vers:0, index=1, type=0, intf=Gi0/0/0/2, nh=3.3.3.23)
0     24001   ISIS(A):1                       InUse  Yes
  (SR Adj Segment IPv4, vers:0, index=3, type=0, intf=Gi0/0/0/2, nh=3.3.3.23)
0     24002   LDP(A)                          InUse  Yes
  (IPv4, vers:0, 'default':4U, 3.3.3.28/31)
0     24003   LDP(A)                          InUse  Yes
  (IPv4, vers:0, 'default':4U, 10.127.224.2/32)
0     24004   LDP(A)                          InUse  Yes
  (IPv4, vers:0, 'default':4U, 10.127.224.3/32)
0     24005   LDP(A)                          InUse  Yes
  (IPv4, vers:0, 'default':4U, 3.3.3.60/31)
0     24006   LDP(A)                          InUse  Yes
  (IPv4, vers:0, 'default':4U, 3.3.3.48/31)
0     24007   LDP(A)                          InUse  Yes
  (IPv4, vers:0, 'default':4U, 3.3.3.40/31)
0     24008   LDP(A)                          InUse  Yes
  (IPv4, vers:0, 'default':4U, 3.3.3.10/31)
0     24009   LDP(A)                          InUse  Yes
  (IPv4, vers:0, 'default':4U, 10.127.224.4/32)
0     24010   LDP(A)                          InUse  Yes
  (IPv4, vers:0, 'default':4U, 10.127.224.101/32)
0     24011   LDP(A)                          InUse  Yes
  (IPv4, vers:0, 'default':4U, 10.127.224.102/32)
0     24012   ISIS(A):1                       InUse  Yes
  (SR Adj Segment IPv4, vers:0, index=1, type=0, intf=Gi0/0/0/1, nh=3.3.3.25)
0     24013   ISIS(A):1                       InUse  Yes
  (SR Adj Segment IPv4, vers:0, index=3, type=0, intf=Gi0/0/0/1, nh=3.3.3.25)

Check prefix-sid learned:

Use ISIS command to check, currently I only find prefix-sid information vis ISSI CLI:
RP/0/0/CPU0:Edge1# show isis route detail
Tue Aug 29 16:11:47.403 UTC
IS-IS 1 IPv4 Unicast routes
Codes: L1 - level 1, L2 - level 2, ia - interarea (leaked into level 1)
       df - level 1 default (closest attached router), su - summary null
       C - connected, S - static, R - RIP, B - BGP, O - OSPF
       E - EIGRP, A - access/subscriber, M - mobile, a - application
       i - IS-IS (redistributed from another instance)
Maximum parallel path count: 8
L2 3.3.3.10/31 [20/115] low priority
     via 3.3.3.25, GigabitEthernet0/0/0/1, Core, SRGB Base: 16000, Weight: 0
     src Core.00-00, 10.127.224.3
C  3.3.3.22/31
     is directly connected, GigabitEthernet0/0/0/2
   L2 adv [10] IS-IS interface
C  3.3.3.24/31
     is directly connected, GigabitEthernet0/0/0/1
   L2 adv [10] IS-IS interface
L2 3.3.3.28/31 [20/115] low priority
     via 3.3.3.25, GigabitEthernet0/0/0/1, Core, SRGB Base: 16000, Weight: 0
     via 3.3.3.23, GigabitEthernet0/0/0/2, Edge2, SRGB Base: 16000, Weight: 0
     src Core.00-00, 10.127.224.3
     src Edge2.00-00, 10.127.224.2
L2 3.3.3.40/31 [20/115] low priority
     via 3.3.3.25, GigabitEthernet0/0/0/1, Core, SRGB Base: 16000, Weight: 0
     src Core.00-00, 10.127.224.3
L2 3.3.3.48/31 [20/115] low priority
     via 3.3.3.25, GigabitEthernet0/0/0/1, Core, SRGB Base: 16000, Weight: 0
     src Core.00-00, 10.127.224.3
L2 3.3.3.60/31 [10/115] low priority
     via 3.3.3.25, GigabitEthernet0/0/0/1, Core, SRGB Base: 16000, Weight: 0
     src Core.00-00, 10.127.224.3
C  10.127.224.1/32
     is directly connected, Loopback0
   L2 adv [10] IS-IS interface, prefix-SID index 1001, R:0 N:1 P:0 E:0 V:0 L:0
L2 10.127.224.2/32 [20/115] medium priority
     via 3.3.3.23, GigabitEthernet0/0/0/2, Edge2, SRGB Base: 16000, Weight: 0
     src Edge2.00-00, 10.127.224.2, prefix-SID index 1002, R:0 N:1 P:0 E:0 V:0
         L:0
L2 10.127.224.3/32 [20/115] medium priority
     via 3.3.3.25, GigabitEthernet0/0/0/1, Core, SRGB Base: 16000, Weight: 0
     src Core.00-00, 10.127.224.3, prefix-SID index 1003, R:0 N:1 P:0 E:0 V:0
         L:0
L2 10.127.224.4/32 [30/115] medium priority
     via 3.3.3.25, GigabitEthernet0/0/0/1, Core, SRGB Base: 16000, Weight: 0
     src Border.00-00, 10.127.224.4, prefix-SID index 1004, R:0 N:1 P:0 E:0 V:0
         L:0
L2 10.127.224.101/32 [30/115] medium priority
     via 3.3.3.25, GigabitEthernet0/0/0/1, Core, SRGB Base: 16000, Weight: 0
     src RR1.00-00, 10.127.224.101
L2 10.127.224.102/32 [30/115] medium priority
     via 3.3.3.25, GigabitEthernet0/0/0/1, Core, SRGB Base: 16000, Weight: 0
     src RR2.00-00, 10.127.224.102
Related information can also be checked via a commonly used CLI: show mpls forwarding

RP/0/0/CPU0:Edge1#show mpls forwarding
Tue Aug 29 16:15:12.289 UTC
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes    
Label  Label       or ID              Interface                    Switched  
------ ----------- ------------------ ------------ --------------- ------------
17002  Pop         SR Pfx (idx 1002)  Gi0/0/0/2    3.3.3.23        0          
       17002       SR Pfx (idx 1002)  Gi0/0/0/1    3.3.3.25        0            (!)
17003  Pop         SR Pfx (idx 1003)  Gi0/0/0/1    3.3.3.25        0          
       17003       SR Pfx (idx 1003)  Gi0/0/0/2    3.3.3.23        0            (!)
17004  17004       SR Pfx (idx 1004)  Gi0/0/0/1    3.3.3.25        0          
       17004       SR Pfx (idx 1004)  Gi0/0/0/2    3.3.3.23        0            (!)
24000  Pop         SR Adj (idx 1)     Gi0/0/0/2    3.3.3.23        0        
       17002       SR Adj (idx 1)     Gi0/0/0/1    3.3.3.25        0            (!)
24001  Pop         SR Adj (idx 3)     Gi0/0/0/2    3.3.3.23        0        
24002  Unlabelled  3.3.3.28/31        Gi0/0/0/1    3.3.3.25        0        
       Unlabelled  3.3.3.28/31        Gi0/0/0/2    3.3.3.23        0        
24003  Pop         10.127.224.2/32    Gi0/0/0/2    3.3.3.23        0        
       17002       10.127.224.2/32    Gi0/0/0/1    3.3.3.25        0            (!)
24004  Pop         10.127.224.3/32    Gi0/0/0/1    3.3.3.25        0        
       17003       10.127.224.3/32    Gi0/0/0/2    3.3.3.23        0            (!)
24005  Unlabelled  3.3.3.60/31        Gi0/0/0/1    3.3.3.25        0        
       Unlabelled  3.3.3.60/31        Gi0/0/0/2    3.3.3.23        0            (!)
24006  Unlabelled  3.3.3.48/31        Gi0/0/0/1    3.3.3.25        0        
       Unlabelled  3.3.3.48/31        Gi0/0/0/2    3.3.3.23        0            (!)
24007  Unlabelled  3.3.3.40/31        Gi0/0/0/1    3.3.3.25        0        
       Unlabelled  3.3.3.40/31        Gi0/0/0/2    3.3.3.23        0            (!)
24008  Unlabelled  3.3.3.10/31        Gi0/0/0/1    3.3.3.25        0        
       Unlabelled  3.3.3.10/31        Gi0/0/0/2    3.3.3.23        0            (!)
24009  17004       10.127.224.4/32    Gi0/0/0/1    3.3.3.25        0        
       17004       10.127.224.4/32    Gi0/0/0/2    3.3.3.23        0            (!)
24010  Unlabelled  10.127.224.101/32  Gi0/0/0/1    3.3.3.25        47200    
       Unlabelled  10.127.224.101/32  Gi0/0/0/2    3.3.3.23        0            (!)
24011  Unlabelled  10.127.224.102/32  Gi0/0/0/1    3.3.3.25        47000    
       Unlabelled  10.127.224.102/32  Gi0/0/0/2    3.3.3.23        0            (!)
24012  Pop         SR Adj (idx 1)     Gi0/0/0/1    3.3.3.25        0        
       17003       SR Adj (idx 1)     Gi0/0/0/2    3.3.3.23        0            (!)
24013  Pop         SR Adj (idx 3)     Gi0/0/0/1    3.3.3.25        0           

Check adjacency-sid learned:

The following command show the most abundant information: 
RP/0/0/CPU0:Edge1#show mpls traffic-eng segment-routing
Tue Aug 29 16:21:42.863 UTC
IGP[0]:: IS-IS 1 level 2 , Strict SPF Disabled
Nodes:
  IGP Id: 0101.2722.4001.00, MPLS TE Id: 10.127.224.1
    Segment-Routing:
      TE Node-SID Index: 1001i
      SRGB Info: Start 16000, Size 8000
    Link[0]:Point-to-Point, Nbr IGP Id:0101.2722.4002.00, Nbr Node Id:2, gen:5345
      Frag Id:0, Intf Address:3.3.3.22, Intf Id:0
      Segment-Routing Adjacency-SIDs: 2
      Adjacency-SID[0]: 24001, Flags: V, L to Nbr:: IGP Id: 0101.2722.4002.00, MPLS TE Id: 10.127.224.2
      Adjacency-SID[1]: 24000, Flags: B, V, L to Nbr:: IGP Id: 0101.2722.4002.00, MPLS TE Id: 10.127.224.2
      Nbr Intf Address:3.3.3.23, Nbr Intf Id:0
      TE Metric:10, IGP Metric:10
      Ext Admin Group:
        Length: 256 bits
        Value : 0x::
      Attribute Names:
    Link[1]:Point-to-Point, Nbr IGP Id:0101.2722.4003.00, Nbr Node Id:3, gen:5346
      Frag Id:0, Intf Address:3.3.3.24, Intf Id:0
      Segment-Routing Adjacency-SIDs: 2
      Adjacency-SID[0]: 24013, Flags: V, L to Nbr:: IGP Id: 0101.2722.4003.00, MPLS TE Id: 10.127.224.3
      Adjacency-SID[1]: 24012, Flags: B, V, L to Nbr:: IGP Id: 0101.2722.4003.00, MPLS TE Id: 10.127.224.3
      Nbr Intf Address:3.3.3.25, Nbr Intf Id:0
      TE Metric:10, IGP Metric:10
      Ext Admin Group:
        Length: 256 bits
        Value : 0x::
      Attribute Names:
  IGP Id: 0101.2722.4002.00, MPLS TE Id: 10.127.224.2
    Segment-Routing:
      TE Node-SID Index: 1002i
      SRGB Info: Start 16000, Size 8000
    Link[0]:Point-to-Point, Nbr IGP Id:0101.2722.4001.00, Nbr Node Id:1, gen:5347
      Frag Id:0, Intf Address:3.3.3.23, Intf Id:0
      Segment-Routing Adjacency-SIDs: 2
      Adjacency-SID[0]: 24004, Flags: V, L to Nbr:: IGP Id: 0101.2722.4001.00, MPLS TE Id: 10.127.224.1
      Adjacency-SID[1]: 24003, Flags: B, V, L to Nbr:: IGP Id: 0101.2722.4001.00, MPLS TE Id: 10.127.224.1
      Nbr Intf Address:3.3.3.22, Nbr Intf Id:0
      TE Metric:10, IGP Metric:10
      Ext Admin Group:
        Length: 256 bits
        Value : 0x::
      Attribute Names:
    Link[1]:Point-to-Point, Nbr IGP Id:0101.2722.4003.00, Nbr Node Id:3, gen:5348
      Frag Id:0, Intf Address:3.3.3.28, Intf Id:0
      Segment-Routing Adjacency-SIDs: 2
      Adjacency-SID[0]: 24006, Flags: V, L to Nbr:: IGP Id: 0101.2722.4003.00, MPLS TE Id: 10.127.224.3
      Adjacency-SID[1]: 24005, Flags: B, V, L to Nbr:: IGP Id: 0101.2722.4003.00, MPLS TE Id: 10.127.224.3
      Nbr Intf Address:3.3.3.29, Nbr Intf Id:0
      TE Metric:10, IGP Metric:10
      Ext Admin Group:
        Length: 256 bits
        Value : 0x::
      Attribute Names:
  IGP Id: 0101.2722.4003.00, MPLS TE Id: 10.127.224.3
    Segment-Routing:
      TE Node-SID Index: 1003i
      SRGB Info: Start 16000, Size 8000
    Link[0]:Point-to-Point, Nbr IGP Id:0101.2722.4004.00, Nbr Node Id:4, gen:5349
      Frag Id:0, Intf Address:3.3.3.11, Intf Id:0
      Segment-Routing Adjacency-SIDs: 2
      Adjacency-SID[0]: 24001, Flags: V, L to Nbr:: IGP Id: 0101.2722.4004.00, MPLS TE Id: 10.127.224.4
      Adjacency-SID[1]: 24000, Flags: B, V, L to Nbr:: IGP Id: 0101.2722.4004.00, MPLS TE Id: 10.127.224.4
      Nbr Intf Address:3.3.3.10, Nbr Intf Id:0
      TE Metric:10, IGP Metric:10
      Ext Admin Group:
        Length: 256 bits
        Value : 0x::
      Attribute Names:
    Link[1]:Point-to-Point, Nbr IGP Id:0101.2722.4002.00, Nbr Node Id:2, gen:5350
      Frag Id:0, Intf Address:3.3.3.29, Intf Id:0
      Segment-Routing Adjacency-SIDs: 2
      Adjacency-SID[0]: 24003, Flags: V, L to Nbr:: IGP Id: 0101.2722.4002.00, MPLS TE Id: 10.127.224.2
      Adjacency-SID[1]: 24002, Flags: B, V, L to Nbr:: IGP Id: 0101.2722.4002.00, MPLS TE Id: 10.127.224.2
      Nbr Intf Address:3.3.3.28, Nbr Intf Id:0
      TE Metric:10, IGP Metric:10
      Ext Admin Group:
        Length: 256 bits
        Value : 0x::
      Attribute Names:
    Link[2]:Point-to-Point, Nbr IGP Id:0101.2722.4102.00, Nbr Node Id:-1, gen:5351
      Frag Id:0, Intf Address:3.3.3.48, Intf Id:0
      Segment-Routing Adjacency-SIDs: 0
      Nbr Intf Address:3.3.3.49, Nbr Intf Id:0
      TE Metric:10, IGP Metric:10
      Ext Admin Group:
        Length: 256 bits
        Value : 0x::
      Attribute Names:
    Link[3]:Point-to-Point, Nbr IGP Id:0101.2722.4001.00, Nbr Node Id:1, gen:5352
      Frag Id:0, Intf Address:3.3.3.25, Intf Id:0
      Segment-Routing Adjacency-SIDs: 2
      Adjacency-SID[0]: 24009, Flags: V, L to Nbr:: IGP Id: 0101.2722.4001.00, MPLS TE Id: 10.127.224.1
      Adjacency-SID[1]: 24008, Flags: B, V, L to Nbr:: IGP Id: 0101.2722.4001.00, MPLS TE Id: 10.127.224.1
      Nbr Intf Address:3.3.3.24, Nbr Intf Id:0
      TE Metric:10, IGP Metric:10
      Ext Admin Group:
        Length: 256 bits
        Value : 0x::
      Attribute Names:
    Link[4]:Point-to-Point, Nbr IGP Id:0101.2722.4101.00, Nbr Node Id:-1, gen:5353
      Frag Id:0, Intf Address:3.3.3.40, Intf Id:0
      Segment-Routing Adjacency-SIDs: 0
      Nbr Intf Address:3.3.3.41, Nbr Intf Id:0
      TE Metric:10, IGP Metric:10
      Ext Admin Group:
        Length: 256 bits
        Value : 0x::
      Attribute Names:
  IGP Id: 0101.2722.4004.00, MPLS TE Id: 10.127.224.4
    Segment-Routing:
      TE Node-SID Index: 1004i
      SRGB Info: Start 16000, Size 8000
    Link[0]:Point-to-Point, Nbr IGP Id:0101.2722.4003.00, Nbr Node Id:3, gen:5354
      Frag Id:0, Intf Address:3.3.3.10, Intf Id:0
      Segment-Routing Adjacency-SIDs: 2
      Adjacency-SID[0]: 24001, Flags: V, L to Nbr:: IGP Id: 0101.2722.4003.00, MPLS TE Id: 10.127.224.3
      Adjacency-SID[1]: 24000, Flags: B, V, L to Nbr:: IGP Id: 0101.2722.4003.00, MPLS TE Id: 10.127.224.3
      Nbr Intf Address:3.3.3.11, Nbr Intf Id:0
      TE Metric:10, IGP Metric:10
      Ext Admin Group:
        Length: 256 bits
        Value : 0x::
      Attribute Names:
Prefixes:
 10.127.224.1/32,  SID index:         1001, flags: N
   Adv. router(s)
   --------------
   0101.2722.4001.00
   Paths
   -----
   No paths
 10.127.224.2/32,  SID index:         1002, flags: N
   Adv. router(s)
   --------------
   0101.2722.4002.00
   Paths
   -----
   Path Id Role          Outgoing Interface Next Hop        Outgoing Label
   ------- ------------- ------------------ --------------- --------------
   1       Primary       Gi0/0/0/2          3.3.3.23        Pop
           Backup (65)   Gi0/0/0/1          3.3.3.25        17002
 10.127.224.3/32,  SID index:         1003, flags: N
   Adv. router(s)
   --------------
   0101.2722.4003.00
   Paths
   -----
   No paths
 10.127.224.4/32,  SID index:         1004, flags: N
   Adv. router(s)
   --------------
   0101.2722.4004.00
   Paths
   -----
   No paths
Now we have already finished basic configuration of segment routing. Both prefix and adjacency sid already assigned. Next blog we will see how to inherent services over the segment routing and how to control the priorities if multiple transport protocols exists.



No comments:

Post a Comment