Segment Routing Flex Algo Link Color

今回はFlex Algoのトポロジーに対してLink Colorを割り当てる方法を説明します。

 

概要

Flex AlgoのトポロジーのLink Color

Algorithm ID 0のトポロジーとは別に、Flex AlgoのAlgorithm ID 128~255のトポロジーの各リンクに対してColorを割り当てることが可能です。(Algorithm ID 128~255のトポロジーではLink Colorの情報は共有されます。)

 

各リンクのAlgorithm ID 128~255のトポロジー用のLink Colorの情報はASLA(Application Specific Link Attributes) Sub-TLVのLInk Attribute sub-sub-TLVsに格納されます。

 

前回の記事のMetric Typeと同様に、Flex Algoのトポロジーにおいて、各Prefixへのベストパスを計算する際に考慮するLink Colorの制約は、FAD TLVのSub-TLVに格納されます。

 

検証の基本設定

基本設定の内容

R1-R2-R3-R4間でOSPF Area 0を構成します。
R2-R3間のTE用のメトリックを50に変更します。
OSPFでSR-TEを有効にします。

R1、R2、R3、R4をAlgorithm ID 0と128のトポロジーに参加させます。

R1とR3をAS 100に所属させ、IBGPネイバーを構成します。
R3において、BGP経由で、10.5.5.0/24にColor 1を付加して広報します。

R1でLoopback Interfaceの1.1.1.1/32にPrefix SIDとして20101(Algorithm ID 0)と20102(Algorithm ID 128)を割り当てます。
R2でLoopback Interfaceの2.2.2.2/32にPrefix SIDとして20201(Algorithm ID 0)と20202(Algorithm ID 128)を割り当てます。
R3でLoopback Interfaceの3.3.3.3/32にPrefix SIDとして20301(Algorithm ID 0)と20302(Algorithm ID 128)を割り当てます。
R4でLoopback Interfaceの4.4.4.4/32にPrefix SIDとして20401(Algorithm ID 0)と20302(Algorithm ID 128)を割り当てます。

Algorithm ID 0ではないトポロジーにおいて、R1-R2間とR2-R4間とR3-R4間にはColor RED、R2-R3間にはColor BLUEを割り当てます。

R1でAlgorithm ID 128のトポロジーを使用するODNが有効なSR-TE Policyを設定します。

初期設定


interface Loopback0
 ipv4 address 1.1.1.1 255.255.255.255
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.1.1.1 255.255.255.0
!
router ospf 1
 distribute link-state
 router-id 1.1.1.1
 segment-routing mpls
 affinity-map
  RED bit-position 0
  BLUE bit-position 1
 !
 area 0
  mpls traffic-eng
  interface Loopback0
   prefix-sid absolute 20101
   prefix-sid algorithm 128 absolute 20102
  !
  interface GigabitEthernet0/0/0/0
   network point-to-point
   affinity flex-algo
    RED
   !
  !
 !
 flex-algo 128
  advertise-definition
 !
!
router bgp 100
 bgp router-id 1.1.1.1
 address-family ipv4 unicast
 !
 neighbor 3.3.3.3
  remote-as 100
  update-source Loopback0
  address-family ipv4 unicast
  !
 !
!
segment-routing
 traffic-eng
  on-demand color 1
   dynamic
    sid-algorithm 128
            


interface Loopback0
 ipv4 address 2.2.2.2 255.255.255.255
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.1.1.2 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 10.2.2.2 255.255.255.0
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.3.3.2 255.255.255.0
!
router ospf 1
 router-id 2.2.2.2
 segment-routing mpls
 affinity-map
  RED bit-position 0
  BLUE bit-position 1
 !
 area 0
  mpls traffic-eng
  interface Loopback0
   prefix-sid absolute 20201
   prefix-sid algorithm 128 absolute 20202
  !
  interface GigabitEthernet0/0/0/0
   network point-to-point
   affinity flex-algo
    RED
   !
  !
  interface GigabitEthernet0/0/0/1
   network point-to-point
   affinity flex-algo
    BLUE
   !
  !
  interface GigabitEthernet0/0/0/2
   network point-to-point
   affinity flex-algo
    RED
   !
  !
 !
 flex-algo 128
  advertise-definition
 !
!
segment-routing
 traffic-eng
            


interface Loopback0
 ipv4 address 3.3.3.3 255.255.255.255
!
interface Loopback1
 ipv4 address 10.5.5.3 255.255.255.0
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.2.2.3 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 10.4.4.3 255.255.255.0
!
extcommunity-set opaque COLOR_EXT_COMMUNITY_SET
  1
end-set
!
route-policy BGP_ROUTE_POLICY
  if destination in (10.5.5.0/24) then
    set extcommunity color COLOR_EXT_COMMUNITY_SET
  endif
  pass
end-policy
!
router ospf 1
 router-id 3.3.3.3
 segment-routing mpls
 affinity-map
  RED bit-position 0
  BLUE bit-position 1
 !
 area 0
  mpls traffic-eng
  interface Loopback0
   prefix-sid absolute 20301
   prefix-sid algorithm 128 absolute 20302
  !
  interface GigabitEthernet0/0/0/0
   network point-to-point
   affinity flex-algo
    BLUE
   !
  !
  interface GigabitEthernet0/0/0/1
   network point-to-point
   affinity flex-algo
    RED
   !
  !
 !
 flex-algo 128
  advertise-definition
 !
!
router bgp 100
 bgp router-id 3.3.3.3
 address-family ipv4 unicast
  network 10.5.5.0/24
 !
 neighbor 1.1.1.1
  remote-as 100
  update-source Loopback0
  address-family ipv4 unicast
   route-policy BGP_ROUTE_POLICY out
  !
 !
!
segment-routing
 traffic-eng
            


interface Loopback0
 ipv4 address 4.4.4.4 255.255.255.255
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.3.3.4 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 10.4.4.4 255.255.255.0
!
router ospf 1
 router-id 4.4.4.4
 segment-routing mpls
 affinity-map
  RED bit-position 0
  BLUE bit-position 1
 !
 area 0
  mpls traffic-eng
  interface Loopback0
   prefix-sid absolute 20401
   prefix-sid algorithm 128 absolute 20402
  !
  interface GigabitEthernet0/0/0/0
   network point-to-point
   affinity flex-algo
    RED
   !
  !
  interface GigabitEthernet0/0/0/1
   network point-to-point
   affinity flex-algo
    RED
   !
  !
 !
 flex-algo 128
  advertise-definition
 !
!
segment-routing
 traffic-eng
            

 

OSPFのFlex Algo用のLink Colorの設定確認

Flex Algoのトポロジーで使用するLink Colorはaffinity-map<color-name> bit-position <bit>コマンドにより定義します。
そして、affinity flex-algo<color-name>コマンドを使用して、インターフェースに対してLink Colorを割り当てます。

R1

router ospf 1
 affinity-map
  RED bit-position 0
  BLUE bit-position 1
 !
 area 0
  interface GigabitEthernet0/0/0/0
   affinity flex-algo
    RED
            

 

LSDBの状態確認

R1が生成したOSPFv2 Extended Prefix Opaque LSAを見ると、Flex Algoのトポロジー用のLink Colorを格納したASLA Sub-TLVが存在することが確認できます。

R1

RP/0/RP0/CPU0:R1#show ospf database opaque-area 8.0.0.7 adv-router 1.1.1.1

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Type-10 Opaque Link Area Link States (Area 0)

  LS age: 313
  Options: (No TOS-capability, DC)
  LS Type: Opaque Area Link
  Link State ID: 8.0.0.7
  Opaque Type: 8
  Opaque ID: 7
  Advertising Router: 1.1.1.1
  LS Seq Number: 8000000f
  Checksum: 0x2aec
  Length: 156

    Extended Link TLV: Length: 132
      Link-type : 1
      Link ID   : 2.2.2.2
      Link Data : 10.1.1.1

     Adj sub-TLV: Length: 7
        Flags     : 0x60
        MTID      : 0
        Weight    : 0
        Label     : 24000

     Local-ID Remote-ID sub-TLV: Length: 8
        Local Interface ID: 7
        Remote Interface ID: 7

     Remote If Address sub-TLV: Length: 4
        Neighbor Address: 10.1.1.2

     Link MSD sub-TLV: Length: 2
        Type: 1, Value 10

     Link MAX BW sub-TLV: Length: 4
         Maximum bandwidth : 125000000

     ASLA sub-TLV: Length: 24
         SABM Len:    4
         UDABM Len:   0
         SABM Val:    0x10000000
         Admin Group Sub-Sub-TLV: Length:  4
             Admin Group Val:  0x00000001
         Ext Admin Group Sub-Sub-TLV: Length:  4
             Ext Admin Group Val:  0x00000001

     ASLA sub-TLV: Length: 16
         SABM Len:    4
         UDABM Len:   0
         SABM Val:    0x50000000
          TE Metric : 1
            

 

Algorithm ID 128のトポロジーでLink Colorの制約無しの場合

LFIBの状態確認

R2のLFIBを見ると、Algorithm ID 128のトポロジーにおいて、3.3.3.3へのネクストホップが10.2.2.3であることが確認できます。

R2

RP/0/RP0/CPU0:R2#show mpls forwarding
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes
Label  Label       or ID              Interface                    Switched
------ ----------- ------------------ ------------ --------------- ------------
20101  Pop         SR Pfx (idx 4101)  Gi0/0/0/0    10.1.1.1        14829
20102  Pop         SR Pfx (idx 4102)  Gi0/0/0/0    10.1.1.1        0
20301  Pop         SR Pfx (idx 4301)  Gi0/0/0/1    10.2.2.3        1539
20302  Pop         SR Pfx (idx 4302)  Gi0/0/0/1    10.2.2.3        630
20401  Pop         SR Pfx (idx 4401)  Gi0/0/0/2    10.3.3.4        0
20402  Pop         SR Pfx (idx 4402)  Gi0/0/0/2    10.3.3.4        0
24000  Pop         SR Adj (idx 0)     Gi0/0/0/0    10.1.1.1        0
24001  Pop         SR Adj (idx 0)     Gi0/0/0/1    10.2.2.3        0
24002  Pop         SR Adj (idx 0)     Gi0/0/0/2    10.3.3.4        0
            

 

SR-TE Policyの状態確認

R1のSR-TE Policyを見ると、R1からR3へのLSPが10.2.2.0/24を経由していることが確認できます。

R1

RP/0/RP0/CPU0:R1#show segment-routing traffic-eng policy

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

Color: 1, End-point: 3.3.3.3
  Name: srte_c_1_ep_3.3.3.3
  Status:
    Admin: up  Operational: up for 01:09:38 (since Jun 21 13:47:33.577)
  Candidate-paths:
    Preference: 200 (BGP ODN) (active)
      Requested BSID: dynamic
      Constraints:
        Prefix-SID Algorithm: 128
        Maximum SID Depth: 10
      Dynamic (valid)
        Metric Type: TE,   Path Accumulated Metric: 3
          20302 [Prefix-SID: 3.3.3.3, Algorithm: 128]
    Preference: 100 (BGP ODN)
      Last error: Constraint cannot be enforced: flex-algorithm
      Requested BSID: dynamic
      PCC info:
        Symbolic name: bgp_c_1_ep_3.3.3.3_discr_100
        PLSP-ID: 1
      Constraints:
        Prefix-SID Algorithm: 128
        Maximum SID Depth: 10
      Dynamic (pce) (invalid)
        Metric Type: NONE,   Path Accumulated Metric: 0
  Attributes:
    Binding SID: 24004
    Forward Class: Not Configured
    Steering labeled-services disabled: no
    Steering BGP disabled: no
    IPv6 caps enable: yes
            

 

疎通確認

R1の1.1.1.1からR3の10.5.5.3へTracerouteを実施します。

 

R1⇒R2⇒R3の順でパケットが転送されていることが確認できます。

R1

RP/0/RP0/CPU0:R1#traceroute 4.4.4.4 source 1.1.1.1

Type escape sequence to abort.
Tracing the route to 10.5.5.3

 1  10.1.1.2 [MPLS: Label 20302 Exp 0] 64 msec  48 msec  64 msec
 2  10.2.2.3 58 msec  *  66 msec
            

 

Algorithm ID 128のトポロジーでLink Colorの制約有りの場合

Flex Algoの設定確認

Flex Algoのトポロジー用のColorの制約はaffinity include-anyaffinity include-allaffinity exclude-any<color>コマンドを使用して設定します。今回は、Algorithm ID 128のトポロジーのSPFのパス計算ではColor REDが割り当てられたリンクのみを考慮します。

R1,R2,R3,R4

router ospf 1
 flex-algo 128
  affinity include-any
   RED
            

 

LSDBの状態確認

R1が生成したRI Opaque LSAを見ると、FAD TLVが存在し、Link Colorの制約に関する情報が格納されていることが確認できます。

R1

RP/0/RP0/CPU0:R1#show ospf database opaque-area 4.0.0.0 adv-router 1.1.1.1

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Type-10 Opaque Link Area Link States (Area 0)

  LS age: 337
  Options: (No TOS-capability, DC)
  LS Type: Opaque Area Link
  Link State ID: 4.0.0.0
  Opaque Type: 4
  Opaque ID: 0
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000016
  Checksum: 0x3cb6
  Length: 100

    Router Information TLV: Length: 4
    Capabilities:
      Graceful Restart Helper Capable
      Stub Router Capable
      Traffic Engineering enabled area
      All capability bits: 0x70000000

    Segment Routing Algorithm TLV: Length: 3
      Algorithm: 0
      Algorithm: 1
      Algorithm: 128

    Segment Routing Range TLV: Length: 12
      Range Size: 8000

        SID sub-TLV: Length 3
         Label: 16000

    Node MSD TLV: Length: 2
        Type: 1, Value 10

    Segment Routing Local Block TLV: Length: 12
      Range Size: 1000

        SID sub-TLV: Length 3
         Label: 15000

    Segment Routing FAD TLV: Length: 12
      Flex Algo Number : 128
      Flex Algo Metric Type : 0
      Flex Algo Priority : 128
      Flex Algo Calc_type : 0

        FAD Include Any sub-TLV: Length 4
          FAD Include Any Group : 0x00000001

    Dynamic Hostname TLV: Length: 2
      Hostname: R1
            

 

LFIBの状態確認

R2のLFIBを見ると、Algorithm ID 128のトポロジーにおいて、3.3.3.3へのネクストホップが10.3.3.4であることが確認できます。

R2

RP/0/RP0/CPU0:R2#show mpls forwarding
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes
Label  Label       or ID              Interface                    Switched
------ ----------- ------------------ ------------ --------------- ------------
20101  Pop         SR Pfx (idx 4101)  Gi0/0/0/0    10.1.1.1        21764
20102  Pop         SR Pfx (idx 4102)  Gi0/0/0/0    10.1.1.1        0
20301  Pop         SR Pfx (idx 4301)  Gi0/0/0/1    10.2.2.3        5882
20302  20302       SR Pfx (idx 4302)  Gi0/0/0/2    10.3.3.4        0
20401  Pop         SR Pfx (idx 4401)  Gi0/0/0/2    10.3.3.4        0
20402  Pop         SR Pfx (idx 4402)  Gi0/0/0/2    10.3.3.4        0
24000  Pop         SR Adj (idx 0)     Gi0/0/0/0    10.1.1.1        0
24001  Pop         SR Adj (idx 0)     Gi0/0/0/1    10.2.2.3        0
24002  Pop         SR Adj (idx 0)     Gi0/0/0/2    10.3.3.4        0
            

 

SR-TE Policyの状態確認

R1のSR-TE Policyを見ると、R1からR3へのLSPが10.3.3.0/24を経由していることが確認できます。

R1

RP/0/RP0/CPU0:R1#show segment-routing traffic-eng policy

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

Color: 1, End-point: 3.3.3.3
  Name: srte_c_1_ep_3.3.3.3
  Status:
    Admin: up  Operational: up for 01:53:34 (since Jun 21 13:47:33.577)
  Candidate-paths:
    Preference: 200 (BGP ODN) (active)
      Requested BSID: dynamic
      Constraints:
        Prefix-SID Algorithm: 128
        Maximum SID Depth: 10
      Dynamic (valid)
        Metric Type: TE,   Path Accumulated Metric: 3
          20302 [Prefix-SID: 3.3.3.3, Algorithm: 128]
    Preference: 100 (BGP ODN)
      Last error: Constraint cannot be enforced: flex-algorithm
      Requested BSID: dynamic
      PCC info:
        Symbolic name: bgp_c_1_ep_3.3.3.3_discr_100
        PLSP-ID: 1
      Constraints:
        Prefix-SID Algorithm: 128
        Maximum SID Depth: 10
      Dynamic (pce) (invalid)
        Metric Type: NONE,   Path Accumulated Metric: 0
  Attributes:
    Binding SID: 24004
    Forward Class: Not Configured
    Steering labeled-services disabled: no
    Steering BGP disabled: no
    IPv6 caps enable: yes
            

 

疎通確認

R1の1.1.1.1からR3の10.5.5.3へTracerouteを実施します。

 

R1⇒R2⇒R4⇒R3の順でパケットが転送されていることが確認できます。

R1

RP/0/RP0/CPU0:R1#traceroute 10.5.5.3 source 1.1.1.1

Type escape sequence to abort.
Tracing the route to 10.5.5.3

 1  10.1.1.2 [MPLS: Label 20302 Exp 0] 46 msec  54 msec  59 msec
 2  10.3.3.4 [MPLS: Label 20302 Exp 0] 60 msec  61 msec  60 msec
 3  10.4.4.3 43 msec  *  55 msec
            

コメント

タイトルとURLをコピーしました