Cisco MPLS流量工程TE 隧道的基本配置
                       Maa 2007-8-9 NJ
 

1 流量工程简介

TETraffic Engineering的缩写,即流量工程的意思。流量工程的本质就是将业务流量映射到实际的物理路径上。就MPLS而言,其中心思想就是根据网络的实际情况为数据流确定合适的lsp并在该lsp上快速转发数据流,通过优化网络资源的使用,避免负载不均衡而导致的网络拥塞。
说到MPLS TE,不得不提到流量工程的四个基础功能部件,即信息发布、通路选择、信令和数据转发,这四个部件形成了整个流量工程的工作流程,因此是重中之重的内容,这里将介绍每个部件的主要作用。
信息发布:MPLS流量工程使用扩展的IGP-TE来向外通告和获取网络拓扑状态信息,并形成链路状态数据库LSDB和流量工程数据库TEDB,其中LSDB用于传统的SPF计算,而TEDB用于建立TE隧道时进行选路的计算。这里的信息发布组件就是IGP-TEIGP-TE是在普通IGP的基础之上扩展了对第10lsa的支持,即opaque-lsaopaque-lsa可以表征最大链路带宽、最大预约链路带宽、当前预留带宽、当前使用带宽和链路颜色等属性,从而形成对应的TEDB
通路选择组件:具体的通路选择组件当然是CSPF了,即基于约束的SPF算法。在TEDB形成之后,入口LSR使用CSPF计算每条lsp的物理路径。
信令组件:这里的信令组件可以是RSVP-TE或者CR-LDP,目前业界一般都使用RSVP-TE作为MPLS流量工程的信令组件,其作用主要是根据通路选择组件计算出来的路径建立lsp,预留资源并分发标签等。
数据转发组件:既然是MPLS流量工程,数据转发组件当然是MPLS了,在信令组件成功的建立了lsp之后,采用MPLS对数据报文进行标签交换和转发处理。
这样,整个MPLS流量工程大致的工作机制也就展现在大家眼前了,由于不是本文的重点,不再做更详细的阐述,仅为大家对流量工程的理解做一个铺垫。

2 Cisco流量工程的配置

配置要素如下:
配置IGP-TE,使IGP能够支持opaque-lsa
配置路由器支持TE功能,即全局模式下使能流量工程;
配置对应物理接口支持TE功能,即接口模式下使能流量工程;
配置TE隧道。
 
如下图拓扑,R1R2R3互连,从R1建立一条到R3TE隧道,其具体的配置如下,在此以R1为例对其配置进行关键注释:
 
Cisco MPLS流量工程TE隧道的基本配置_第1张图片
 
[R1]
R1#
R1#show run
Building configuration...
Current configuration : 1816 bytes
!
version 12.4
!
hostname R1
!
mpls traffic-eng tunnels /* 全局模式下使能 mpls-te 功能 */
!
interface Loopback0
 ip address 202.1.1.1 255.255.255.255
!
interface Tunnel1 /* 配置隧道 tunnel1*/
 ip unnumbered Loopback0 /* 配置该隧道 ip 地址,也可以使用 ip address 方式配置隧道 ip 地址 */
 tunnel destination 202.1.1.3 /* 配置该隧道的目的地址 */
 tunnel mode mpls traffic-eng /* 配置隧道的模式为 mpls-te*/
 tunnel mpls traffic-eng autoroute announce /* 配置该隧道的自动路由功能 */
 tunnel mpls traffic-eng priority 6 6 /* 配置该隧道的优先级 */
 tunnel mpls traffic-eng bandwidth 3000 /* 配置该隧道的带宽 */
 tunnel mpls traffic-eng path-option 16 explicit name t1 /* 配置隧道的显示路径 */
 tunnel mpls traffic-eng record-route /* 配置隧道记录标签信息 */
!
interface Ethernet4/0
 ip address 80.1.2.1 255.255.255.0
 duplex half
 mpls traffic-eng tunnels /* 接口模式下使能 mpls-te 功能 */
 ip rsvp bandwidth 10000 /* 配置接口的总 te 带宽 */
!
router ospf 1
 mpls traffic-eng router-id Loopback0 /* 使能 ospf-te mpls-te router-id*/
 mpls traffic-eng area 0 /* ospf-te area 0 中使能 mpls-te*/
network 80.1.2.0 0.0.0 .255 area 0
 network 202.1.1.1 0.0.0 .0 area 0
!
ip explicit-path name t1 enable /* 配置隧道使用的显示路径 */
 next-address 80.1.2.2
 next-address 80.2.3.2
!
end
R1#
 
[R2]
R2#
R2#show run
Building configuration...
Current configuration : 1495 bytes
!
version 12.4
!
hostname R2
!
mpls traffic-eng tunnels
!
interface Loopback0
 ip address 202.1.1.2 255.255.255.255
!
interface Ethernet4/0
 ip address 80.1.2.2 255.255.255.0
 duplex full
 mpls traffic-eng tunnels
 ip rsvp bandwidth 10000
!
interface Ethernet4/1
 ip address 80.2.3.1 255.255.255.0
 duplex half
 mpls traffic-eng tunnels
 ip rsvp bandwidth 15000
!
router ospf 1
 mpls traffic-eng router-id Loopback0
 mpls traffic-eng area 0
network 80.1.2.0 0.0.0 .255 area 0
 network 80.2.3.0 0.0.0 .255 area 0
 network 202.1.1.2 0.0.0 .0 area 0
!
end
R2#
 
[R3]
R3#show run
Building configuration...
Current configuration : 1423 bytes
!
version 12.4
!
hostname R3
!
mpls traffic-eng tunnels
!
interface Loopback0
 ip address 202.1.1.3 255.255.255.255
!
interface Ethernet4/1
 ip address 80.2.3.2 255.255.255.0
 duplex half
 mpls traffic-eng tunnels
 ip rsvp bandwidth 15000
!
router ospf 1
 mpls traffic-eng router-id Loopback0
 mpls traffic-eng area 0
network 80.2.3.0 0.0.0 .255 area 0
 network 202.1.1.3 0.0.0 .0 area 0
!
end
R3#
 

3 Cisco流量工程的诊断

上面完成了TE的相关配置,这时需要一些基本的诊断方式来确定隧道的状态是否状态,这些诊断命令如下:
1、  检查隧道的状态:
 
show mpls traffic-eng tunnels brief
该命令显示隧道的简要信息,用于在隧道数目比较多的时候方便查询隧道的信息,比如下面的信息:
 
R1#show mpls traffic-eng tunnels brief                                          
Signalling Summary:                                                            
    LSP Tunnels Process:            running                                    
    RSVP Process:                   running                                     
    Forwarding:                     enabled                                    
    Periodic reoptimization:        every 3600 seconds, next in 1015 seconds   
    Periodic auto-bw collection:    disabled                                    
TUNNEL NAME              DESTINATION      UP IF     DOWN IF   STATE/PROT
R1_t1                       202.1.1.3          -          Et4/0       up/up    
Displayed 1 (of 1) heads, 0 (of 0) midpoints, 0 (of 0) tails        
 
从上面的信息可以看出R1_t1的目的地为202.1.1.3,没有上行入接口(即该隧道为本地隧道),下行出接口为Et4/0,状态为up;同时可以看到一些全局的参数,比如周期性的重优化时间为3600秒,周期性自动带宽采集功能是禁用的等等。
 
show mpls traffic-eng tunnels
该命令显示经过本节点所有隧道的详细信息,由于查看隧道更具体的参数,比如下面的信息:
 
R1#show mpls traffic-eng tunnels                                               
                                                                               
Name: R1_t1                               (Tunnel1) Destination: 202.1.1.3     
  Status:                                                                      
    Admin: up         Oper: up     Path: valid       Signalling: connected     
                                                                               
    path option 16, type explicit t1 (Basis for Setup, path weight 20)         
                                                                                
  Config Parameters:                                                           
    Bandwidth: 3000     kbps (Global)  Priority: 6  6   Affinity: 0x0/0xFFFF   
    Metric Type: TE (default)                                                   
    AutoRoute:  enabled   LockDown: disabled  Loadshare: 3000     bw-based     
    auto-bw: disabled                                                          
                                                                                
  InLabel  :  -                                                                
  OutLabel : Ethernet4/0, 16                                                   
  RSVP Signalling Info:                                                         
       Src 202.1.1.1, Dst 202.1.1.3, Tun_Id 1, Tun_Instance 16                 
    RSVP Path Info:                                                            
      My Address: 80.1.2.1                                                      
      Explicit Route: 80.1.2.2 80.2.3.1 80.2.3.2 202.1.1.3                     
      Record Route:                                                            
      Tspec: ave rate=3000 kbits, burst=1000 bytes, peak rate=3000 kbits       
    RSVP Resv Info:                                                            
      Record Route: 80.1.2.2 80.2.3.2                                          
      Fspec: ave rate=3000 kbits, burst=1000 bytes, peak rate=3000 kbits       
  History:                                                                      
    Tunnel:                                                                    
      Time since created: 1 hours                                              
      Time since path change: 16 minutes, 42 seconds                           
    Current LSP:                                                               
      Uptime: 16 minutes, 42 seconds                                           
    Prior LSP:                                                                  
      ID: path option 16 [15]                                                  
      Removal Trigger: tunnel shutdown                                         
R1#                        
 
从上面的信息可以看出隧道带宽、优先级、亲和属性和管理组、自动路由和负载均衡等等参数,同时也可以看到隧道的入标签、入接口、出标签和出接口等等,这里就不详细阐述了。
                                    
2、  检查ospfopaque数据库
 
show ip ospf database opaque-area
该命令显示ospf-te生成的opaque-lsa数据库,用来检查是否有显示路径上的接口没有在该数据库中。
 
R1#show ip ospf database opaque-area                                            
                                                                               
            OSPF Router with ID (202.1.1.1) (Process ID 1)                     
                                                                                
                Type-10 Opaque Link Area Link States (Area 0)                  
                                                                               
  LS age: 1429                                                                 
  Options: (No TOS-capability, DC)                                             
  LS Type: Opaque Area Link                                                    
  Link State ID: 1.0.0 .0                                                       
  Opaque Type: 1                                                                
  Opaque ID: 0                                                                 
  Advertising Router: 202.1.1.1                                                
  LS Seq Number: 8000000B                                                       
  Checksum: 0x 8C 43                                                             
  Length: 132                                                                  
  Fragment number : 0                                                           
                                                                               
    MPLS TE router ID : 202.1.1.1                                              
                                                                                
    Link connected to Broadcast network                                        
      Link ID : 80.1.2.2                                                       
      Interface Address : 80.1.2.1                                              
      Admin Metric : 10                                                        
      Maximum bandwidth : 1250000                                              
      Maximum reservable bandwidth : 1250000                                   
      Number of Priority : 8                                                   
      Priority 0 : 1250000     Priority 1 : 1250000                            
      Priority 2 : 1250000     Priority 3 : 1250000                            
      Priority 4 : 1250000     Priority 5 : 1250000                            
      Priority 6 : 875000      Priority 7 : 875000                             
      Affinity Bit : 0x0                                                       
      IGP Metric : 10                                                           
                                                                               
    Number of Links : 1                                                        
                                                                                
  LS age: 2030                                                                 
  Options: (No TOS-capability, DC)                                             
  LS Type: Opaque Area Link                                                     
  Link State ID: 1.0.0 .0                                                       
  Opaque Type: 1                                                               
  Opaque ID: 0                                                                  
  Advertising Router: 202.1.1.2                                                
  LS Seq Number: 80000002                                                      
  Checksum: 0x79E7                                                             
  Length: 132                                                                  
  Fragment number : 0                                                          
                                                                               
    MPLS TE router ID : 202.1.1.2                                              
                                                                               
    Link connected to Broadcast network                                        
      Link ID : 80.1.2.2                                                        
      Interface Address : 80.1.2.2                                             
      Admin Metric : 10                                                        
      Maximum bandwidth : 1250000                                               
      Maximum reservable bandwidth : 1250000                                   
      Number of Priority : 8                                                   
      Priority 0 : 1250000     Priority 1 : 1250000                             
      Priority 2 : 1250000     Priority 3 : 1250000                            
      Priority 4 : 1250000     Priority 5 : 1250000                            
      Priority 6 : 1250000     Priority 7 : 1250000                             
      Affinity Bit : 0x0                                                       
      IGP Metric : 10                                                          
                                                                               
    Number of Links : 1                                                        
                                                                               
  LS age: 38                                                                   
  Options: (No TOS-capability, DC)                                             
  LS Type: Opaque Area Link                                                    
  Link State ID: 1.0.0 .0                                                       
  Opaque Type: 1                                                                
  Opaque ID: 0                                                                 
  Advertising Router: 202.1.1.3                                                
  LS Seq Number: 80000004                                                       
  Checksum: 0xD5EC                                                             
  Length: 132                                                                  
  Fragment number : 0                                                           
                                                                               
    MPLS TE router ID : 202.1.1.3                                              
                                                                                
    Link connected to Broadcast network                                        
      Link ID : 80.2.3.2                                                       
      Interface Address : 80.2.3.2                                              
      Admin Metric : 10                                                        
      Maximum bandwidth : 1250000                                              
      Maximum reservable bandwidth : 1875000                                   
      Number of Priority : 8                                                   
      Priority 0 : 1875000     Priority 1 : 1875000                            
      Priority 2 : 1875000     Priority 3 : 1875000                            
      Priority 4 : 1875000     Priority 5 : 1875000                            
      Priority 6 : 1875000     Priority 7 : 1875000                            
      Affinity Bit : 0x0                                                       
      IGP Metric : 10                                                           
                                                                               
    Number of Links : 1                                                        
                                                                                
  LS age: 1431                                                                 
  Options: (No TOS-capability, DC)                                             
  LS Type: Opaque Area Link                                                     
  Link State ID: 1.0.0 .1                                                       
  Opaque Type: 1                                                               
  Opaque ID: 1                                                                  
  Advertising Router: 202.1.1.2                                                
  LS Seq Number: 8000000A                                                       
  Checksum: 0xA360                                                             
  Length: 124                                                                  
  Fragment number : 1                                                          
                                                                               
    Link connected to Broadcast network                                        
      Link ID : 80.2.3.2                                                       
      Interface Address : 80.2.3.1                                             
      Admin Metric : 10                                                         
      Maximum bandwidth : 1250000                                              
      Maximum reservable bandwidth : 1875000                                   
      Number of Priority : 8                                                   
      Priority 0 : 1875000     Priority 1 : 1875000                            
      Priority 2 : 1875000     Priority 3 : 1875000                            
      Priority 4 : 1875000     Priority 5 : 1875000                            
      Priority 6 : 1500000     Priority 7 : 1500000                            
      Affinity Bit : 0x0                                                       
      IGP Metric : 10                                                           
                                                                               
    Number of Links : 1                                                        
                                                                                
R1#          
 
在本文拓扑中的TE隧道的显示路径共有四个接口,其ip地址分别是:80.1.2.180.1.2.280.2.3.180.2.3.2,我们在opaque数据库中可以看到interface address分别是这四个地址的链路状态信息,如果缺少显示路径上任何一个接口的链路状态信息的话,TE隧道是不可能建立起来的,同时该链路状态信息还记录了该链路可以提供的基于8个优先级的TE总带宽,当TE隧道有带宽的要求时,在cspf计算中还必须考虑到接口的带宽是否能够满足隧道的带宽需求,如果不满足,TE隧道仍然是不能建立的。
 
3、  诊断调试命令
 
debug ip rsvp
该命令用于对TE隧道的调试或者相关信息,尤其是信令信息的捕获,具体可以调试的功能如下:
 
R1#debug ip rsvp ?                                                             
  CLI              RSVP CLI events                                             
  all              RSVP messages for all categories                            
  api              RSVP API events                                             
  authentication   RSVP authentication events and messages                     
  database         RSVP database debugging                                     
  dump-messages    Dump RSVP message contents                                  
  filter           RSVP filter information                                     
  handles          RSVP database handles events                                 
  messages         RSVP messages (sent/received via IP) debugging              
  msg-mgr          RSVP Message Manager events                                 
  path             RSVP PATH messages                                           
  policy           RSVP policy information                                     
  proxy            RSVP Proxy API trace                                        
  rate-limit       RSVP Rate Limiting Messages                                  
  reliable-msg     RSVP Reliable Messages events                               
  resv             RSVP RESV messages                                          
  routing          RSVP Routing Messages                                       
  sbm              RSVP SBM messages                                           
  signalling       RSVP Signalling (PATH and RESV) messages                    
  snmp             RSVP SNMP events                                            
  summary-refresh  RSVP Srefresh and Bundle Messages events                    
  svc              RSVP SVC events                                             
  traffic-control  RSVP traffic control events                                 
  wfq              RSVP WFQ events                                             
                                                                  
 

4 Cisco流量工程的协议报文

流量工程的主要协议报文为pathresvpatherrresverrpathtearresvtear等,这里只列举正常情况下捕获的path消息和resv消息,其具体的作用在后续的文档中讨论,本文只对基本配置进行讲解。
 
Path
 
Cisco MPLS流量工程TE隧道的基本配置_第2张图片
 
 
Resv
 
Cisco MPLS流量工程TE隧道的基本配置_第3张图片