本產品的文件集力求使用無偏見用語。針對本文件集的目的,無偏見係定義為未根據年齡、身心障礙、性別、種族身分、民族身分、性別傾向、社會經濟地位及交織性表示歧視的用語。由於本產品軟體使用者介面中硬式編碼的語言、根據 RFP 文件使用的語言,或引用第三方產品的語言,因此本文件中可能會出現例外狀況。深入瞭解思科如何使用包容性用語。
思科已使用電腦和人工技術翻譯本文件,讓全世界的使用者能夠以自己的語言理解支援內容。請注意,即使是最佳機器翻譯,也不如專業譯者翻譯的內容準確。Cisco Systems, Inc. 對這些翻譯的準確度概不負責,並建議一律查看原始英文文件(提供連結)。
本檔案將說明了解、設定和驗證沒有路徑計算元素控制器的區域間SR-TE的各個方面。
作者:思科TAC工程師Elvin Arias。
本檔案沒有先決條件。
本文件沒有特定需求。
本檔案中的資訊是根據Cisco IOS-XR®和IOS-XE®。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路正在作用,請確保您已瞭解任何指令可能造成的影響。
分段路由流量工程(SR-TE)提供引導流量通過核心的功能,而不會在核心中形成任何狀態會話。SR-TE策略表示為指定路徑的段清單,稱為段ID(SID)清單。不需要任何訊號,因為狀態在封包中,且支援SR的傳輸路由器會將SID清單作為一組指令處理。
傳統上,多域通過資源預留協定流量工程(RSVP-TE)來實現,通過在顯式路徑選項中使用鬆散的下一跳擴展。當執行計算時,管理員會建立一個路徑,在該路徑中,區域間網際網路協定(IP)地址定義鬆散,以允許通過約束最短路徑優先(CSPF)進行端到端計算。
SR-TE沒有鬆散下一跳的概念,因此對於多域計算,問題是如何執行此過程?計算是可能的,實際設計是放置一個集中控制器(XTC、WAE、NOS)以便執行相應的多域計算。將計算從頭端分流到頭端,將使裝置能夠計算路徑,而無需檢視整個拓撲。因為使用了路徑計算元素(PCE)實體,其理念是該實體具有域的完整可見性,執行計算並跟蹤所計算的LSP。
如果暫時無法設定控制器,並且需要在分段路由核心中進行多域計算,則我們可以執行不同的配置,以允許在區域間方案中建立隧道。
SR-TE允許我們定義多個路徑型別,通常稱為顯式路徑和動態路徑。對於動態路徑和顯式路徑,這是簡單的,我們讓SR-TE演算法根據動態條件來計算路徑,通常是TE或IGP度量到尾端。對於顯式路徑,我們可以定義多種型別,可以做的有很多:
定義區域間SR-TE策略時,我們必須定義通往末端的顯式路徑,這是因為我們沒有拓撲的完整可視性。對於區域間SR-TE,我們需要按如下方式配置策略:
附註:如果需要動態區域間路徑選項,則 必須將路徑計算委託給PCE實體。
在接下來的情況下,我們將使用此OSPF區域間拓撲,示例將基於嘗試計算跨越區域邊界的XR1到XR5的SR-TE隧道。
附註:SR-TE的示例基於OSPF,但它也適用於IS-IS。
XR1 hostname XR1 icmp ipv4 rate-limit unreachable disable interface Loopback0 ipv4 address 1.1.1.1 255.255.255.255 ! interface Loopback1 ipv4 address 1.1.1.11 255.255.255.255 ! interface GigabitEthernet0/0/0/0.12 ipv4 address 12.0.0.1 255.255.255.0 encapsulation dot1q 12 ! router ospf 1 router-id 1.1.1.1 segment-routing mpls segment-routing forwarding mpls segment-routing sr-prefer address-family ipv4 area 12 mpls traffic-eng interface Loopback0 prefix-sid index 1 ! interface Loopback1 prefix-sid index 11 ! interface GigabitEthernet0/0/0/0.12 cost 100 network point-to-point ! ! mpls traffic-eng router-id Loopback0 ! mpls traffic-eng interface GigabitEthernet0/0/0/0.12 admin-weight 100 ! ! end
XR2 hostname XR2 logging console debugging explicit-path identifier 4 index 10 next-label 16004 ! interface Loopback0 ipv4 address 2.2.2.2 255.255.255.255 ! interface GigabitEthernet0/0/0/0.12 ipv4 address 12.0.0.2 255.255.255.0 encapsulation dot1q 12 ! interface GigabitEthernet0/0/0/0.23 ipv4 address 23.0.0.2 255.255.255.0 encapsulation dot1q 23 ! interface GigabitEthernet0/0/0/0.26 ipv4 address 26.0.0.2 255.255.255.0 encapsulation dot1q 26 ! router ospf 1 router-id 2.2.2.2 segment-routing mpls segment-routing forwarding mpls segment-routing sr-prefer address-family ipv4 area 0 mpls traffic-eng interface Loopback0 prefix-sid index 2 ! interface GigabitEthernet0/0/0/0.23 cost 100 network point-to-point ! ! area 12 mpls traffic-eng interface GigabitEthernet0/0/0/0.12 cost 100 network point-to-point ! ! area 246 mpls traffic-eng interface GigabitEthernet0/0/0/0.26 cost 200 network point-to-point ! ! mpls traffic-eng router-id Loopback0 ! mpls oam ! mpls traffic-eng interface GigabitEthernet0/0/0/0.12 admin-weight 100 ! interface GigabitEthernet0/0/0/0.23 admin-weight 100 ! interface GigabitEthernet0/0/0/0.26 admin-weight 1 ! ! end
XR3 hostname XRv3 interface Loopback0 ipv4 address 3.3.3.3 255.255.255.255 ! interface MgmtEth0/0/CPU0/0 shutdown ! interface GigabitEthernet0/0/0/0.23 ipv4 address 23.0.0.3 255.255.255.0 encapsulation dot1q 23 ! interface GigabitEthernet0/0/0/0.34 ipv4 address 34.0.0.3 255.255.255.0 encapsulation dot1q 34 ! router ospf 1 router-id 3.3.3.3 segment-routing mpls segment-routing forwarding mpls segment-routing sr-prefer address-family ipv4 area 0 mpls traffic-eng interface Loopback0 prefix-sid index 3 ! interface GigabitEthernet0/0/0/0.23 cost 100 network point-to-point ! interface GigabitEthernet0/0/0/0.34 cost 100 network point-to-point ! ! mpls traffic-eng router-id Loopback0 ! mpls oam ! mpls traffic-eng interface GigabitEthernet0/0/0/0.23 admin-weight 100 ! interface GigabitEthernet0/0/0/0.34 admin-weight 100 ! ! end
XR4 hostname XR4 interface Loopback0 ipv4 address 4.4.4.4 255.255.255.255 ! interface GigabitEthernet0/0/0/0.34 ipv4 address 34.0.0.4 255.255.255.0 encapsulation dot1q 34 ! interface GigabitEthernet0/0/0/0.45 ipv4 address 45.0.0.4 255.255.255.0 encapsulation dot1q 45 ! interface GigabitEthernet0/0/0/0.46 ipv4 address 46.0.0.4 255.255.255.0 encapsulation dot1q 46 ! router ospf 1 distribute bgp-ls router-id 4.4.4.4 segment-routing mpls segment-routing forwarding mpls segment-routing sr-prefer address-family ipv4 area 0 mpls traffic-eng interface Loopback0 prefix-sid index 4 ! interface GigabitEthernet0/0/0/0.34 cost 100 network point-to-point ! ! area 45 mpls traffic-eng interface GigabitEthernet0/0/0/0.45 cost 100 network point-to-point ! ! area 246 mpls traffic-eng interface GigabitEthernet0/0/0/0.46 cost 200 network point-to-point ! ! mpls traffic-eng router-id Loopback0 ! mpls oam ! mpls traffic-eng interface GigabitEthernet0/0/0/0.34 admin-weight 100 ! interface GigabitEthernet0/0/0/0.45 admin-weight 100 ! interface GigabitEthernet0/0/0/0.46 admin-weight 1 ! ! end
XR5 hostname XRv5 interface Loopback0 ipv4 address 5.5.5.5 255.255.255.255 ! interface Loopback1 ipv4 address 5.5.5.55 255.255.255.255 ! interface GigabitEthernet0/0/0/0.45 ipv4 address 45.0.0.5 255.255.255.0 encapsulation dot1q 45 ! router ospf 1 router-id 5.5.5.5 segment-routing mpls segment-routing forwarding mpls segment-routing sr-prefer address-family ipv4 area 45 mpls traffic-eng interface Loopback0 prefix-sid index 5 ! interface Loopback1 prefix-sid index 55 ! interface GigabitEthernet0/0/0/0.45 cost 100 network point-to-point ! ! mpls traffic-eng router-id Loopback0 ! mpls oam ! mpls traffic-eng interface GigabitEthernet0/0/0/0.45 admin-weight 100 ! ! end
XR6 hostname XR6 icmp ipv4 rate-limit unreachable disable interface Loopback0 ipv4 address 6.6.6.6 255.255.255.255 ! interface GigabitEthernet0/0/0/0.26 ipv4 address 26.0.0.6 255.255.255.0 encapsulation dot1q 26 ! interface GigabitEthernet0/0/0/0.46 ipv4 address 46.0.0.6 255.255.255.0 encapsulation dot1q 46 ! router ospf 1 router-id 6.6.6.6 segment-routing mpls segment-routing forwarding mpls segment-routing sr-prefer address-family ipv4 area 246 mpls traffic-eng interface Loopback0 prefix-sid index 6 ! interface GigabitEthernet0/0/0/0.26 cost 200 network point-to-point ! interface GigabitEthernet0/0/0/0.46 cost 200 network point-to-point ! ! mpls traffic-eng router-id Loopback0 ! mpls oam ! mpls traffic-eng interface GigabitEthernet0/0/0/0.26 admin-weight 1 ! interface GigabitEthernet0/0/0/0.46 admin-weight 1 ! ! end
OSPF域中的裝置已在它們之間構建LSP,我們可以檢查XR1到XR5之間的LSP來驗證這一點。
RP/0/0/CPU0:XR1#ping mpls ipv4 5.5.5.5/32 fec-type generic verbose
Sending 5, 100-byte MPLS Echos to 5.5.5.5/32, timeout is 2 seconds, send interval is 0 msec: Codes: '!' - success, 'Q' - request not sent, '.' - timeout, 'L' - labeled output interface, 'B' - unlabeled output interface, 'D' - DS Map mismatch, 'F' - no FEC mapping, 'f' - FEC mismatch, 'M' - malformed request, 'm' - unsupported tlvs, 'N' - no rx label, 'P' - no rx intf label prot, 'p' - premature termination of LSP, 'R' - transit router, 'I' - unknown upstream index, 'X' - unknown return code, 'x' - return code 0 Type escape sequence to abort. ! size 100, reply addr 45.0.0.5, return code 3 ! size 100, reply addr 45.0.0.5, return code 3 ! size 100, reply addr 45.0.0.5, return code 3 ! size 100, reply addr 45.0.0.5, return code 3 ! size 100, reply addr 45.0.0.5, return code 3 Success rate is 100 percent (5/5), round-trip min/avg/max = 1/6/10 ms
我們將從XR1建立SR-TE策略,以計算指向XR5 prefix-SID(對應於5.5.5.5/32)的路徑。字首5.5.5.5/32的索引已配置為5,這是我們將提供給PCALC以計算該路徑的唯一標籤。
附註:拓撲中的所有路由器都具有相同的SRGB塊。
explicit-path name CASE1 index 10 next-label 16005 ! interface tunnel-te15 ipv4 unnumbered Loopback0 autoroute destination 5.5.5.5 destination 5.5.5.5 path-selection metric te segment-routing adjacency unprotected ! path-option 1 explicit name CASE1 segment-routing !
附註:自動通告在區域間案例中不起作用。
當提供SID清單作為計算的輸入時,只驗證第一個標籤,如果滿足此條件,隧道將啟動。如果驗證通道,我們可以看到通道已啟動,且路由正在執行。
RP/0/0/CPU0:XR1#show mpls traffic-eng tunnels segment-routing p2p 15 Name: tunnel-te15 Destination: 5.5.5.5 Ifhandle:0x130 Signalled-Name: XR1_t15 Status: Admin: up Oper: up Path: valid Signalling: connected path option 1, (Segment-Routing) type explicit CASE1 (Basis for Setup) G-PID: 0x0800 (derived from egress interface properties) Bandwidth Requested: 0 kbps CT0 Creation Time: Mon Nov 26 02:14:33 2018 (00:14:34 ago) Config Parameters: Bandwidth: 0 kbps (CT0) Priority: 7 7 Affinity: 0x0/0xffff Metric Type: TE (interface) Path Selection: Tiebreaker: Min-fill (default) Protection: Unprotected Adjacency Hop-limit: disabled Cost-limit: disabled Path-invalidation timeout: 10000 msec (default), Action: Tear (default) AutoRoute: disabled LockDown: disabled Policy class: not set Forward class: 0 (default) Forwarding-Adjacency: disabled Autoroute Destinations: 1 Loadshare: 0 equal loadshares Auto-bw: disabled Path Protection: Not Enabled BFD Fast Detection: Disabled Reoptimization after affinity failure: Enabled SRLG discovery: Disabled History: Tunnel has been up for: 00:04:43 (since Mon Nov 26 02:24:24 UTC 2018) Current LSP: Uptime: 00:04:43 (since Mon Nov 26 02:24:24 UTC 2018) Prior LSP: ID: 5 Path Option: 1 Removal Trigger: tunnel shutdown Segment-Routing Path Info (OSPF 1 area 12) Segment0[Node]: 5.5.5.5, Label: 16005 Displayed 1 (of 1) heads, 0 (of 0) midpoints, 0 (of 0) tails Displayed 1 up, 0 down, 0 recovering, 0 recovered heads
注意:可以使用debug mpls traffic-eng path lookup 命令驗證PCALC事件。
如果檢查全域RIB,可以看到經由通道介面15設定到5.5.5.5/32的路由。
RP/0/0/CPU0:XR1#show route 5.5.5.5 Routing entry for 5.5.5.5/32 Known via "te-client", distance 2, metric 401 (connected) Installed Nov 26 02:24:24.336 for 00:07:03 Routing Descriptor Blocks directly connected, via tunnel-te15 Route metric is 401 No advertising protos.
如果檢查LFIB,我們可以看到tunnel-te15已經安裝並準備進行轉發。
RP/0/0/CPU0:XR1#ping 5.5.5.5 source 1.1.1.1 repeat 100 size 1500 Type escape sequence to abort. Sending 100, 1500-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Success rate is 100 percent (100/100), round-trip min/avg/max = 9/12/19 ms
RP/0/0/CPU0:XR1#show mpls forwarding tunnels detail Tunnel Outgoing Outgoing Next Hop Bytes Name Label Interface Switched ------------- ----------- ------------ --------------- ------------ tt15 (SR) 16005 Gi0/0/0/0.12 12.0.0.2 150400 Updated: Nov 26 02:24:24.357 Version: 200, Priority: 2 Label Stack (Top -> Bottom): { 16005 } NHID: 0x0, Encap-ID: N/A, Path idx: 0, Backup path idx: 0, Weight: 0 MAC/Encaps: 18/22, MTU: 1500 Packets Switched: 100 Interface Name: tunnel-te15, Interface Handle: 0x00000130, Local Label: 24003 Forwarding Class: 0, Weight: 0 Packets/Bytes Switched: 100/150000
為區域間定義SR-TE策略時,我們可以選擇混合標籤和IPv4地址。為了使PCALC成功計算到末端的路徑,為計算提供的IPv4地址必須是區域的本地地址,而對於區域以外的元素,必須提供字首鄰接SID。
explicit-path name CASE2 index 10 next-address strict ipv4 unicast 12.0.0.2 index 20 next-label 16006 index 50 next-label 16005 ! interface tunnel-te15 ipv4 unnumbered Loopback0 autoroute destination 5.5.5.5 destination 5.5.5.5 path-selection metric te segment-routing adjacency unprotected ! path-option 1 explicit name CASE2 segment-routing !
如前所述,我們已向PCALC指出路徑必須通過XR6(16006),然後到達最終字首SID(16005)。 驗證隧道計算結果可以看出它是如何計算的。
RP/0/0/CPU0:XR1#show mpls traffic-eng tunnels segment-routing p2p 15 Name: tunnel-te15 Destination: 5.5.5.5 Ifhandle:0x130 Signalled-Name: XR1_t15 Status: Admin: up Oper: up Path: valid Signalling: connected path option 1, (Segment-Routing) type explicit CASE2 (Basis for Setup) G-PID: 0x0800 (derived from egress interface properties) Bandwidth Requested: 0 kbps CT0 Creation Time: Mon Nov 26 02:14:33 2018 (00:40:44 ago) Config Parameters: Bandwidth: 0 kbps (CT0) Priority: 7 7 Affinity: 0x0/0xffff Metric Type: TE (interface) Path Selection: Tiebreaker: Min-fill (default) Protection: Unprotected Adjacency Hop-limit: disabled Cost-limit: disabled Path-invalidation timeout: 10000 msec (default), Action: Tear (default) AutoRoute: disabled LockDown: disabled Policy class: not set Forward class: 0 (default) Forwarding-Adjacency: disabled Autoroute Destinations: 1 Loadshare: 0 equal loadshares Auto-bw: disabled Path Protection: Not Enabled BFD Fast Detection: Disabled Reoptimization after affinity failure: Enabled SRLG discovery: Disabled History: Tunnel has been up for: 00:08:47 (since Mon Nov 26 02:46:30 UTC 2018) Current LSP: Uptime: 00:00:10 (since Mon Nov 26 02:55:07 UTC 2018) Reopt. LSP: Last Failure: LSP not signalled, identical to the [CURRENT] LSP Date/Time: Mon Nov 26 02:52:43 UTC 2018 [00:02:34 ago] Prior LSP: ID: 9 Path Option: 1 Removal Trigger: reoptimization completed Segment-Routing Path Info (OSPF 1 area 12) Segment0[Link]: 12.0.0.1 - 12.0.0.2, Label: 24001 Segment1[Node]: 6.6.6.6, Label: 16006 Segment2[Node]: 5.5.5.5, Label: 16005 Displayed 1 (of 1) heads, 0 (of 0) midpoints, 0 (of 0) tails Displayed 1 up, 0 down, 0 recovering, 0 recovered heads
如果使用traceroute ,我們可以看到下一跳,我們實際上通過XR6。
RP/0/0/CPU0:XR1#traceroute 5.5.5.5 source 1.1.1.1 Type escape sequence to abort. Tracing the route to 5.5.5.5 1 12.0.0.2 [MPLS: Labels 16006/16005 Exp 0] 9 msec 0 msec 0 msec 2 26.0.0.6 [MPLS: Label 16005 Exp 0] 0 msec 0 msec 0 msec 3 46.0.0.4 [MPLS: Label 16005 Exp 0] 0 msec 9 msec 0 msec 4 45.0.0.5 9 msec * 9 msec
我們可能會遇到這樣的情況:定義字首SID,但形成次優或循環流量模式。在這種情況下,我們將建立此情境。
explicit-path name CASE3 index 10 next-address strict ipv4 unicast 12.0.0.2 index 20 next-label 16006 index 30 next-label 16002 index 40 next-label 16003 index 50 next-label 16005
!
interface tunnel-te15
ipv4 unnumbered Loopback0
autoroute destination 5.5.5.5
destination 5.5.5.5
path-selection
metric te
segment-routing adjacency unprotected
!
path-option 1 explicit name CASE3 segment-routing
根據字首SID,我們可以看到流量應該通過XR6 -> XR2 -> XR3 -> XR5的字首SID。
RP/0/0/CPU0:XR1#show mpls traffic-eng tunnels segment-routing p2p 15 Admin: up Oper: up Path: valid Signalling: connected path option 1, (Segment-Routing) type explicit CASE3 (Basis for Setup)
<<Output omitted>>
Segment-Routing Path Info (OSPF 1 area 12) Segment0[Link]: 12.0.0.1 - 12.0.0.2, Label: 24001 Segment1[Node]: 6.6.6.6, Label: 16006 Segment2[Node]: 2.2.2.2, Label: 16002 Segment3[Node]: 3.3.3.3, Label: 16003 Segment4[Node]: 5.5.5.5, Label: 16005 Displayed 1 (of 1) heads, 0 (of 0) midpoints, 0 (of 0) tails
如果我們追蹤到5.5.5.5/32的路徑,我們可以看到我們在XR2和XR6之間形成了一個環路,即使這是次優路徑,我們仍然可以路由到XR5.5.5.5/32,而不會出現問題,因為LSP設定正確。
RP/0/0/CPU0:XR1#traceroute 5.5.5.5 source 1.1.1.1 Type escape sequence to abort. Tracing the route to 5.5.5.5 1 12.0.0.2 [MPLS: Labels 16006/16002/16003/16005 Exp 0] 19 msec 19 msec 9 msec 2 26.0.0.6 [MPLS: Labels 16002/16003/16005 Exp 0] 9 msec 9 msec 9 msec 3 26.0.0.2 [MPLS: Labels 16003/16005 Exp 0] 9 msec 9 msec 9 msec 4 23.0.0.3 [MPLS: Label 16005 Exp 0] 9 msec 9 msec 9 msec 5 34.0.0.4 [MPLS: Label 16005 Exp 0] 9 msec 9 msec 9 msec 6 45.0.0.5 9 msec * 9 msec
在分段路由流量工程中建立不帶PCE的多域策略時,我們沒有完整的鏈路狀態資料庫檢視,因此,由於缺乏可視性,我們必須設定滿足特定路由要求的顯式路徑。區域間隧道是可能的,它將通過定義顯式路徑來實現,這些路徑具有IPv4地址、鄰接SID和/或本地區域的字首SID(具有傳輸裝置的字首SID和/或SR-TE策略的尾端)。其他顯式路徑定義將失敗。