SR TE 配置案例

最近接触了一个案例,其中包含很多的SR方面的知识,所以想趁着熟悉记录下来。具体包括了以下的内容:Policy SR-TEInterface SR-TEBGP EPETE BSID等。

  • SR
  • Interface SR TE
  • TE BSID
  • BGP EPE
  • Policy SR TE

写在最前面

首先先介绍一下这个环境。

1. AS9929使能SR,并建立PE1和PE2之间的tunnel隧道.

2. CE与PE之间使能BGP EPE,为CE与PE之间的链路分配标签.

3. CE与CE之间起Policy的SR TE, 其中segment list为<EPE label,BSID,EPE label>.

SR

从一年前接触SP这一块开始就听到有人提及到Segment routing这项技术,与相对于传统的LDP标签分发方式,SR意味着你可以在你的网络中少配置一种路由协议,不用考虑IGP于LDP互操新问题;SR TE相对于RSVP TE更是优点多多,例如原生的支持ECMP,例如TI-LFA等。所以运营商在测并部署SR, 并将原有的RSVP TE迁移到SR TE中来。 SR的配置其实很简单,例如在ISIS中使能SR,可以参考以下配置:

RP/0/RSP0/CPU0:PE1#show run router isis xx
Tue Aug 13 05:46:44.186 UTC
router isis xx
 is-type level-2-only
 net 49.0000.0000.0002.00
 address-family ipv4 unicast
  metric-style wide                <<<< 必须是wide模式,以为只有在wide模式下才有SR相关的TLV
  mpls traffic-eng level-2-only
  mpls traffic-eng router-id Loopback1
  mpls traffic-eng igp-intact
  segment-routing mpls sr-prefer   <<<< 只需要在AFI下配置该命令,sr-prefer参数是为了在LDP共存网络使用SR标签转发
 !
 interface Loopback1
  address-family ipv4 unicast
   prefix-sid absolute 16002       <<<< 为每一个设备loopback接口配置prefix sid,absolute 或者index形式
  !

Interface SR-TE

配置方法可以参考RSVP TE的配置,唯一特殊的是需要添加segment-routing 关键字,如下 :

RP/0/RSP0/CPU0:PE1#show run int tunnel-te 1
Tue Aug 13 05:50:54.801 UTC
interface tunnel-te1
 bandwidth 102400
 ipv4 unnumbered Loopback1
 logging events all
 destination 3.3.3.3
 binding-sid mpls label 4004        <<< BSID
 path-option 100 explicit name test segment-routing    <<<<
!

RP/0/RSP0/CPU0:PE1#show run explicit-path 
Tue Aug 13 05:50:59.592 UTC
explicit-path name test             <<<<显示路径会包含到达目标节点路径上的prefix-sid
 index 10 next-label 16004
 index 20 next-label 16113

TE BSID

BSID的概念其实是用来固定一个TE tunel的标签的,如果一个TE tunel down了, 而在其up起来后为之分配的标签改变了,那么如果我们手写的静态路径用到这个label,就会失效。通过BSID为一个tunnel分配固定的标签就可以解决这个问题。

BGP EPE

EPE主要是用于多CE接入多PE时,选择何种CE或者PE转发路径,例如我们规划流量从某一个PE抓发,那么在写静态路径时可以将CE与PE之间链路的EPE标签写进转发路径中去。如图所示,CE与PE之间使能了EPE feature.

RP/0/RSP0/CPU0:PE1#show run router bgp 9919 neighbor 200.1.12.1
Tue Aug 13 06:06:33.362 UTC
router bgp 9919
 neighbor 200.1.12.1
  remote-as 100
  egress-engineering     <<<<<<
  address-family ipv4 unicast
   route-policy pass in
   route-policy pass out
  !
  
RP/0/RSP0/CPU0:PE1#show bgp egress-engineering 
Tue Aug 13 06:06:50.991 UTC

 Egress Engineering Peer Set: 200.1.12.1/32 (1363f018)
     Nexthop: 200.1.12.1
     Version: 2, rn_version: 2
       Flags: 0x00000006
   Local ASN: 9919
  Remote ASN: 100
   Local RID: 2.2.2.1
  Remote RID: 114.112.50.60
   First Hop: 200.1.12.1
        NHID: 2
         IFH: 0x6001000
       Label: 24002, Refcount: 3      <<<<<
     rpc_set: 144c92a4
RP/0/RSP0/CPU0:ASR9910-A#

Policy SR-TE

CE上配置Policy的SE-TE,目的节点为对端CE:

RP/0/RSP0/CPU0:CE1#show run segment-routing 
Tue Aug 13 12:59:31.627 UTC
segment-routing
 global-block 16000 23999
 traffic-eng
  segment-list to_QD_CC
   index 10 mpls label 24021    <<<EPE label
   index 20 mpls label 4004     <<<BSID
   index 30 mpls label 24007    <<<EPE label
  !
  policy SRTE_to_QDCC
   color 888 end-point ipv4 5.5.5.5
   candidate-paths
    preference 100
     explicit segment-list to_QD_CC
     !

将流量引入该TE 隧道, 从该BGP邻居学来的路由都回被引入到TE tunel中 。

router bgp 100
 neighbor 5.5.5.5
  remote-as 65535
  ebgp-multihop 10
  update-source Loopback2
  address-family vpnv4 unicast
   route-policy pass-all in
   route-policy set_color out      <<<<
   next-hop-unchanged
  !
RP/0/RSP0/CPU0:CE1#show run extcommunity-set opaque color_888 
Tue Aug 13 13:03:04.740 UTC
extcommunity-set opaque color_888   <<<<
  888
end-set
!
RP/0/RSP0/CPU0:ASR9001-D-R1#show run route-policy set_color 
Tue Aug 13 13:01:31.096 UTC
route-policy set_color
  set extcommunity color color_888   <<<<
end-policy
!

验证联通性.

CE与PE之间的互联链路属于vrf SZ_CC, CE与PE之间路由协议为BGP,PE1与PE2之间的起VPNv4 BGP邻居关系, 以传递CE之间的环回口地址。

RP/0/RSP0/CPU0:CE1#show bgp ipv4 unicast summary 
Tue Aug 13 13:08:15.030 UTC
BGP router identifier 114.112.50.60, local AS number 100
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0xe0000000   RD version: 195
BGP main routing table version 195
BGP NSR Initial initsync version 6 (Reached)
BGP NSR/ISSU Sync-Group versions 0/0
BGP scan interval 60 secs

BGP is operating in STANDALONE mode.


Process       RcvTblVer   bRIB/RIB   LabelVer  ImportVer  SendTblVer  StandbyVer
Speaker             195        195        195        195         195           0

Neighbor        Spk    AS MsgRcvd MsgSent   TblVer  InQ OutQ  Up/Down  St/PfxRcd
100.1.12.2        0  9919    7836    7813      195    0    0    5d07h          4

RP/0/RSP0/CPU0:CE1#show bgp ipv4 unicast         
Tue Aug 13 13:08:23.432 UTC
BGP router identifier 114.112.50.60, local AS number 100
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0xe0000000   RD version: 195
BGP main routing table version 195
BGP NSR Initial initsync version 6 (Reached)
BGP NSR/ISSU Sync-Group versions 0/0
BGP scan interval 60 secs

Status codes: s suppressed, d damped, h history, * valid, > best
              i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network            Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32         0.0.0.0                  0         32768 ?
*> 5.5.5.5/32         100.1.12.2                             0 9919 65535 ?

CE与CE之间使用换回地址建立VPNv4的邻居关系以传递次级CE的VPN路由:

RP/0/RSP0/CPU0:CE1#show bgp vpnv4 unicast summary 
Tue Aug 13 13:11:02.556 UTC
BGP router identifier 114.112.50.60, local AS number 100
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0x0   RD version: 0
BGP main routing table version 96
BGP NSR Initial initsync version 7 (Reached)
BGP NSR/ISSU Sync-Group versions 0/0
BGP scan interval 60 secs

BGP is operating in STANDALONE mode.


Process       RcvTblVer   bRIB/RIB   LabelVer  ImportVer  SendTblVer  StandbyVer
Speaker              96         96         96         96          96           0

Neighbor        Spk    AS MsgRcvd MsgSent   TblVer  InQ OutQ  Up/Down  St/PfxRcd
5.5.5.5           0 65535    3747    3792       96    0    0 04:44:16          1

RP/0/RSP0/CPU0:CE1#
RP/0/RSP0/CPU0:ASR9001-D-R1#show bgp vpnv4 unicast         
Tue Aug 13 13:11:05.518 UTC
BGP router identifier 114.112.50.60, local AS number 100
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0x0   RD version: 0
BGP main routing table version 96
BGP NSR Initial initsync version 7 (Reached)
BGP NSR/ISSU Sync-Group versions 0/0
BGP scan interval 60 secs

Status codes: s suppressed, d damped, h history, * valid, > best
              i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network            Next Hop            Metric LocPrf Weight Path
   
Route Distinguisher: 5.5.5.5:0
*> 33.33.33.33/32     5.5.5.5 C:888            0             0 65535 ?
Route Distinguisher: 114.112.50.60:1 (default for vrf Metro)
*> 22.22.22.22/32     0.0.0.0                  0         32768 ?
*> 33.33.33.33/32     5.5.5.5 C:888            0             0 65535 ?

Processed 4 prefixes, 4 paths

次级CE流量通过Policy SR TE的segment list转发到对端CE:

RP/0/RSP0/CPU0:CE1#traceroute vrf Metro 33.33.33.33 source 22.22.22.22
Tue Aug 13 13:13:01.548 UTC

Type escape sequence to abort.
Tracing the route to 33.33.33.33

 1  200.1.12.2 [MPLS: Labels 4004/24007/24000 Exp 0] 3 msec  1 msec  1 msec 
 2  10.1.24.4 [MPLS: Labels 16113/24007/24000 Exp 0] 1 msec  1 msec  1 msec 
 3  10.1.34.3 [MPLS: Labels 24007/24000 Exp 0] 1 msec  1 msec  1 msec 
 4  200.1.35.5 3 msec  *  2 msec 
RP/0/RSP0/CPU0:CE1#

RP/0/RSP0/CPU0:CE1#traceroute vrf Metro 33.33.33.33 source 22.22.22.22
Tue Aug 13 13:13:01.548 UTC

Type escape sequence to abort.
Tracing the route to 33.33.33.33

 1  200.1.12.2 [MPLS: Labels 4004/24007/24000 Exp 0] 3 msec  1 msec  1 msec 
 2  10.1.24.4 [MPLS: Labels 16113/24007/24000 Exp 0] 1 msec  1 msec  1 msec 
 3  10.1.34.3 [MPLS: Labels 24007/24000 Exp 0] 1 msec  1 msec  1 msec 
 4  200.1.35.5 3 msec  *  2 msec 
RP/0/RSP0/CPU0:ASR9001-D-R1#
RP/0/RSP0/CPU0:ASR9001-D-R1#
RP/0/RSP0/CPU0:ASR9001-D-R1#show cef vrf Metro 33.33.33.33
Tue Aug 13 13:13:31.357 UTC
33.33.33.33/32, version 37, internal 0x5000001 0x0 (ptr 0x9de49df4) [1], 0x0 (0x0), 0x208 (0x9e27c344)
 Updated Aug 13 08:26:51.380
 Prefix Len 32, traffic index 0, precedence n/a, priority 3
   via local-label 24022, 3 dependencies, recursive, bgp-ext [flags 0x6020]
    path-idx 0 NHID 0x0 [0x9e35ed88 0x0]
    recursion-via-label
    next hop VRF - 'default', table - 0xe0000000
    next hop via 24022/0/21
     next hop srte_c_888_e labels imposed {ImplNull 24000}
     
RP/0/RSP0/CPU0:CE1#show segment-routing traffic-eng policy 
Tue Aug 13 13:14:01.437 UTC

SR-TE policy database
---------------------

Color: 888, End-point: 5.5.5.5
  Name: srte_c_888_ep_5.5.5.5
  Status:
    Admin: up  Operational: up for 5d06h (since Aug  8 06:47:23.502)
  Candidate-paths:
    Preference: 100 (configuration) (active)
      Name: SRTE_to_QDCC
      Requested BSID: dynamic
      Explicit: segment-list to_QD_CC (valid)
        Weight: 1, Metric Type: TE
          24021
          4004
          24007
  Attributes:
    Binding SID: 24022
    Forward Class: 0
    Steering BGP disabled: no
    IPv6 caps enable: yes
 


RP/0/RSP0/CPU0:CE1#show bgp vrf Metro 33.33.33.33/32 detail 
Tue Aug 13 13:14:54.055 UTC
BGP routing table entry for 33.33.33.33/32, Route Distinguisher: 114.112.50.60:1
Versions:
  Process           bRIB/RIB  SendTblVer
  Speaker                 96          96
    Flags: 0x00001001+0x00000000; 
Last Modified: Aug 13 08:26:50.892 for 04:48:03
Paths: (1 available, best #1)
  Not advertised to any peer
  Path #1: Received by speaker 0
  Flags: 0x4000000005060001, import: 0x80
  Not advertised to any peer
  65535
    5.5.5.5 C:888 (bsid:24022) from 5.5.5.5 (5.5.5.5)
      Received Label 24000 
      Origin incomplete, metric 0, localpref 100, valid, external, best, group-best, import-candidate, imported
      Received Path ID 0, Local Path ID 1, version 96
      Extended community: Color:888 RT:3001:3001 
      Origin-AS validity: not-found
      SR policy color 888, up, not-registered, bsid 24022

      Source AFI: VPNv4 Unicast, Source VRF: default, Source Route Distinguisher: 5.5.5.5:0
           

No comments

Comments feed for this article

Reply

Your email address will not be published.