此产品的文档集力求使用非歧视性语言。在本文档集中,非歧视性语言是指不隐含针对年龄、残障、性别、种族身份、族群身份、性取向、社会经济地位和交叉性的歧视的语言。由于产品软件的用户界面中使用的硬编码语言、基于 RFP 文档使用的语言或引用的第三方产品使用的语言,文档中可能无法确保完全使用非歧视性语言。 深入了解思科如何使用包容性语言。
思科采用人工翻译与机器翻译相结合的方式将此文档翻译成不同语言,希望全球的用户都能通过各自的语言得到支持性的内容。 请注意:即使是最好的机器翻译,其准确度也不及专业翻译人员的水平。 Cisco Systems, Inc. 对于翻译的准确性不承担任何责任,并建议您总是参考英文原始文档(已提供链接)。
本文档介绍了解、配置和验证不带路径计算元素控制器的区域间SR-TE的方面。
贡献者:思科技术支持中心 (TAC) 工程师 Elvin Arias。
读者无需满足任何前提条件即可理解本文档内容。
本文档没有任何特定的要求。
本文档中的信息基于 Cisco IOS-XR® 和 IOS-XE®。
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您使用的是真实网络,请确保您已经了解所有命令的潜在影响。
网段路由流量工程(SR-TE)能够引导流量通过核心,而不在核心中形成任何状态会话。SR-TE 策略表示为一个指定路径的分段列表,称为分段 ID (SID) 列表。无需信令,因为数据包中的状态和SID列表是由支持中转SR的路由器作为一组指令处理的。
多域通常通过使用显式路径选项中的松散下一跳扩展来使用资源预留协议流量工程(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前缀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
注意:PCALC事件可以使用debug mpls traffic-eng path lookup命令进行验证。
如果我们检查全局RIB,可以看到到5.5.5.5/32的路由是通过隧道接口15设置的。
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,可以看到隧道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
根据prefix-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之间形成了环路,即使这是次优路径,由于LSP设置正确,因此我们仍然可以路由到XR5 5.5.5.5/32,而无问题。
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策略的尾端来建立。其他显式路径定义将失败。