用OSPF实现基本MPLS 流量工程
MPLS Basic Traffic Engineering Using OSPF Configuration
Verify:
首先我们来看看在pesaro上面隧道有没有建立,使用show mpls tr tu
pesaro#sh mpls traffic-eng tunnels brief
Signalling Summary:
LSP Tunnels Process: running
RSVP Process: running
Forwarding: enabled
Periodic reoptimization: every 3600 seconds, next in 3054 seconds
Periodic auto-bw collection: disabled
TUNNEL NAME DESTINATION UP IF DOWN IF STATE/PROT
pesaro_t158 10.10.10.4 - Se2/0.3 up/up
pesaro_t159 10.10.10.4 - Se2/0.3 up/up
pescara_t1 10.10.10.6 Se2/0.3 - up/up
pescara_t3 10.10.10.6 Se2/0.3 - up/up
Displayed 2 (of 2) heads, 0 (of 0) midpoints, 2 (of 2) tails
pesaro#
可以看到pesaro上面有4条隧道建立了"pesaro_t158 ,up/up"。我们在看一下t158的详细信息,用sh mpls tr tu tu 158命令查看。
pesaro#sh mpls tr tu tu 158
Name: pesaro_t158 (Tunnel158) Destination: 10.10.10.4
Status:
Admin: up Oper: up Path: valid Signalling: connected
path option 1, type explicit low (Basis for Setup, path weight 780)
Config Parameters:
Bandwidth: 158 kbps (Global) Priority: 2 2 Affinity: 0x0/0xFFFF
Metric Type: TE (default)
AutoRoute: enabled LockDown: disabled Loadshare: 158 bw-based
auto-bw: disabled
InLabel : -
OutLabel : Serial2/0.3, 23
RSVP Signalling Info:
Src 10.10.10.6, Dst 10.10.10.4, Tun_Id 158, Tun_Instance 19
RSVP Path Info:
My Address: 10.10.10.6
Explicit Route: 10.1.1.21 10.1.1.10 10.1.1.1 10.1.1.14
10.10.10.4
Record Route: NONE
Tspec: ave rate=158 kbits, burst=1000 bytes, peak rate=158 kbits
RSVP Resv Info:
Record Route: NONE
Fspec: ave rate=158 kbits, burst=1000 bytes, peak rate=158 kbits
Shortest Unconstrained Path Info:
Path Weight: 585 (TE)
Explicit Route: 10.1.1.21 10.1.1.5 10.1.1.14 10.10.10.4
History:
Tunnel:
Time since created: 9 minutes, 49 seconds
Time since path change: 8 minutes
Current LSP:
Uptime: 8 minutes
Selection: reoptimation
Prior LSP:
ID: path option 1 [18]
Removal Trigger: label reservation removed
pesaro#
可以看到为隧道158保留了158k的带宽。另外我们还可以用sh ip rsvp interface 来看看pesaro与pomerol相连接的接口上的保留带宽。
pesaro#sh ip rsvp int
interface allocated i/f max flow max sub max
Se2/0.3 317K 512K 512K 0
Se2/0 0 0 0 0
pesaro#
因为在pesaro上有2条隧道一条保留158,一条保留159,所以158+159=317k,也就是说pesaro s2/0.3口上已经有317k的带宽被保留了。
接下来我们在看看隧道建立后mpls 的转发表 使用sh mpls for detail
pesaro#sh mpls for detail
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
16 16 10.1.1.0/30 0 Se2/0.3 point2point
MAC/Encaps=4/8, MRU=1500, Tag Stack{16}
94B18847 00010000
No output feature configured
Per-packet load-sharing
17 Pop tag 10.1.1.4/30 0 Se2/0.3 point2point
MAC/Encaps=4/4, MRU=1504, Tag Stack{}
94B18847
No output feature configured
Per-packet load-sharing
18 Pop tag 10.1.1.8/30 0 Se2/0.3 point2point
MAC/Encaps=4/4, MRU=1504, Tag Stack{}
94B18847
No output feature configured
Per-packet load-sharing
19 17 10.10.10.2/32 0 Se2/0.3 point2point
MAC/Encaps=4/8, MRU=1500, Tag Stack{17}
94B18847 00011000
No output feature configured
Per-packet load-sharing
20 Pop tag 10.10.10.3/32 0 Se2/0.3 point2point
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
MAC/Encaps=4/4, MRU=1504, Tag Stack{}
94B18847
No output feature configured
Per-packet load-sharing
21 18 10.1.1.12/30 0 Se2/0.3 point2point
MAC/Encaps=4/8, MRU=1500, Tag Stack{18}
94B18847 00012000
No output feature configured
Per-packet load-sharing
22 19 10.10.10.1/32 0 Se2/0.3 point2point
MAC/Encaps=4/8, MRU=1500, Tag Stack{19}
94B18847 00013000
No output feature configured
Per-packet load-sharing
23 Pop tag 10.10.10.4/32 0 Tu159 point2point
MAC/Encaps=4/8, MRU=1500, Tag Stack{22}, via Se2/0.3
94B18847 00016000
No output feature configured
Per-destination load-sharing, slots: 0 2 4 6 8 10 12 14
Pop tag 10.10.10.4/32 0 Tu158 point2point
MAC/Encaps=4/8, MRU=1500, Tag Stack{23}, via Se2/0.3
94B18847 00017000
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
No output feature configured
Per-destination load-sharing, slots: 1 3 5 7 9 11 13 15
pesaro#
我们可以看到到10。10。10。4有2条转发条目,一条是tu158,一条是tu159。
我们在看看其他有用的命令。sh mpls tr tu summary 是看隧道的建立情况汇总,另外一个是sh mpls tr tu brief这个是看看隧道比较详细的信息,一般用来
查看隧道有没有建立,rsvp的工作情况等,比较常用。
pesaro#sh mpls tr tu sum
Signalling Summary:
LSP Tunnels Process: running
RSVP Process: running
Forwarding: enabled
Head: 2 interfaces, 2 active signalling attempts, 2 established
5 activations, 3 deactivations
Midpoints: 0, Tails: 2
Periodic reoptimization: every 3600 seconds, next in 2873 seconds
Periodic auto-bw collection: disabled
pesaro#
pesaro#sh mpls tr tu brief
Signalling Summary:
LSP Tunnels Process: running
RSVP Process: running
Forwarding: enabled
Periodic reoptimization: every 3600 seconds, next in 2842 seconds
Periodic auto-bw collection: disabled
TUNNEL NAME DESTINATION UP IF DOWN IF STATE/PROT
pesaro_t158 10.10.10.4 - Se2/0.3 up/up
pesaro_t159 10.10.10.4 - Se2/0.3 up/up
pescara_t1 10.10.10.6 Se2/0.3 - up/up
pescara_t3 10.10.10.6 Se2/0.3 - up/up
Displayed 2 (of 2) heads, 0 (of 0) midpoints, 2 (of 2) tails
pesaro#
下面让我们来tracroute 一下,看看隧道的工作情况。
pesaro#traceroute 10.10.1.4
Type escape sequence to abort.
Tracing the route to 10.10.10.4
1 10.1.1.21 [MPLS: Label 23 Exp 0] 108 msec 244 msec 700 msec
2 10.1.1.5 [MPLS: Label 16 Exp 0] 484 msec
10.1.1.10 [MPLS: Label 20 Exp 0] 332 msec
10.1.1.5 [MPLS: Label 16 Exp 0] 112 msec
3 10.1.1.1 [MPLS: Label 17 Exp 0] 136 msec
10.1.1.14 328 msec
10.1.1.1 [MPLS: Label 17 Exp 0] 432 msec
pesaro#
可以看到有2条到10。10。10。4的条目,这与我们所与其的结果吻合。如果我们把pomerol与pulliac相连的接口shutdown会有什么现象出现?请大家自己做 实验的时候自己观察。
在来看看ospf的链路状态数据库,由于输出比较长,我截取一部分。
pesaro#sh ip ospf database opaque-area
OSPF Router with ID (10.10.10.6) (Process ID 9)
Type-10 Opaque Link Area Link States (Area 9)
LS age: 714
Options: (No TOS-capability, DC)
LS Type: Opaque Area Link
Link State ID: 1.0.0.0
Opaque Type: 1
Opaque ID: 0
ising Router: 10.10.10.1
LS Seq Number: 80000009
Checksum: 0x5C7
Length: 140
Fragment number : 0
MPLS TE router ID : 10.10.10.1
Link connected to Point-to-Point network
Link ID : 10.10.10.4
Interface Address : 10.1.1.13
Neighbor Address : 10.1.1.14
Admin Metric : 195
Maximum bandwidth : 64000
Maximum reservable bandwidth : 64000
Number of Priority : 8
Priority 0 : 64000 Priority 1 : 64000
Priority 2 : 44250 Priority 3 : 44250
Priority 4 : 24375 Priority 5 : 24375
Priority 6 : 24375 Priority 7 : 24375
Affinity Bit : 0x0
IGP Metric : 195
Number of Links : 1
LS age: 779
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: 10.10.10.2
LS Seq Number: 80000003
Checksum: 0xA316
Length: 140
Fragment number : 0
MPLS TE router ID : 10.10.10.2
Link connected to Point-to-Point network
Link ID : 10.10.10.3
Interface Address : 10.1.1.10
Neighbor Address : 10.1.1.9
Admin Metric : 195
Maximum bandwidth : 64000
Maximum reservable bandwidth : 64000
Number of Priority : 8
Priority 0 : 64000 Priority 1 : 64000
Priority 2 : 64000 Priority 3 : 64000
Priority 4 : 64000 Priority 5 : 64000
Priority 6 : 64000 Priority 7 : 64000
Affinity Bit : 0x0
IGP Metric : 195
Number of Links : 1
LS age: 715
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: 10.10.10.3
LS Seq Number: 80000007
Checksum: 0x5019
Length: 140
Fragment number : 0
MPLS TE router ID : 10.10.10.3
Link connected to Point-to-Point network
Link ID : 10.10.10.2
Interface Address : 10.1.1.9
Neighbor Address : 10.1.1.10
Admin Metric : 195
Maximum bandwidth : 64000
Maximum reservable bandwidth : 64000
到此,我们的mpls-te ospf实验就做到这里,其他好多有趣的命令和一些命令输出就看大家自己的了。
需要注意的是 如果你的机器性能比较低,那么你所模拟的设备可能会出现
pomerol#
*Mar 6 15:56:10.723: %LDP-5-NBRCHG: LDP Neighbor 10.10.10.6:0 (2) is DOWN (Disc
overy Hello Hold Timer expired)
pomerol#
*Mar 6 15:56:18.247: %LDP-5-NBRCHG: LDP Neighbor 10.10.10.6:0 (2) is UP
pomerol#
等信息,不影响以上实验效果。
参考文献:
www.cisco.com/go/mpls
http://www.ietf.org/html.charters/mpls-charter.html
Requirements for Traffic Engineering Over MPLS (RFC 2702)
Multiprotocol Label Switching Architecture (RFC 3031)
MPLS Basic Traffic Engineering Using OSPF Configuration Example
Cisco Press 的《Traffic Engineering with MPLS》
By Eric Osborne CCIE #4122, Ajay Simha CCIE #2970
ISBN : 1-58705-031-5
等。