...当我用 ATM 交换机替换 MPLS 时,负载平衡工作。
这听起来不像是并行比较,因为路由器不关心您是通过 ATM PVC 还是 MPLS LSP 转发,它们将以相同的方式进行负载平衡,假设路由器具有相同的配置。也许您对 ATM VC 做了一些不寻常的事情,但这不是本问题的重点。
然而,对于 MPLS 路由器,即使存在拥塞,所有 TCP 和 UDP 流量也会通过 R3 和 R5,因此从不使用 R4 和 R6。最奇怪的是,当我从 R1 跟踪路由 R7 时,数据包通过 R4 和 R6。
这实际上并不奇怪,这就是路由的工作方式。路由基于每跳发生;路由器没有前瞻性的智慧来预测特定路径的后续跃点上的拥塞。路由协议在其度量计算中不携带有关负载的信息(EIGRP除外,如果您使用 K 值玩游戏,但这样做可能会导致路径不稳定)。
也就是说,在这种情况下,您可以使用不同的算法并强制进行负载平衡,ip load-sharing per-packet
在 R2(串行 2/1 和串行 2/2)以及 R7(串行 2/0 和 2/1)上使用:
interface Serial2/1
ip address 192.168.0.5 255.255.255.252
no shutdown
mpls label protocol ldp
mpls ip
mpls mtu 1512
ip route-cache cef
ip load-sharing per-packet
!
interface Serial2/2
ip address 192.168.0.9 255.255.255.252
no shutdown
mpls label protocol ldp
mpls ip
mpls mtu 1512
ip route-cache cef
ip load-sharing per-packet
每包负载平衡强制路由器在目的地之间循环流量。你永远不应该在不考虑后果的情况下使用这是一个生产网络(大多数情况下,重新排序数据包......这使得 VoIP / 视频,有时 TCP 不满意)。
每包负载平衡在实验室中非常有用,但在生产中通常是不明智的,除非您处于非常特殊的情况并且知道自己在做什么。每包负载平衡也有非常不稳定的平台支持……一些 Cisco 路由器(例如 Catalyst 6500 Sup720)根本不会使用每包负载平衡。
当出现拥塞风险时,MPLS骨干网如何进行流量负载均衡?我已经读过 OSPF 应该默认这样做,但在我的情况下它没有?
正如我上面提到的,你误解了路由的工作原理......这是一个很大的话题,但我将在这里总结最相关的信息......
默认情况下 Cisco IOS 负载平衡的工作原理
默认情况下,Cisco 路由器在入口标签边缘路由器 (LER) 处使用IP 地址的每个源/每个目标哈希来决定采用哪条路径。您可以通过执行来查看此操作show ip cef exact-route [src-ip] [dst-ip]
... 注意label [FOO] TAG adj
下面的输出,它指示 LDP 分配的 MPLS 标签。
PE4#sh ip cef exact-route 192.168.4.1 192.168.0.5
192.168.4.1 -> 192.168.0.5 => label 154 TAG adj out of GigabitEthernet1/0/0,
addr 10.10.1.189
如果我选择不同的源地址或目标地址,则可能会看到选择的不同路径...
PE4#sh ip cef exact-route 192.168.4.1 192.168.0.12
192.168.4.1 -> 192.168.0.12 => label 152 TAG adj out of GigabitEthernet1/0/1,
addr 10.10.1.193
如果您想查看路由器上的一般负载平衡配置,请使用show ip cef [dst] internal
(借用此博客的输出)...另请注意所选的负载平衡算法 ( per-destination sharing
)。
R2#show ip cef 10.200.4.1 internal
10.200.4.1/32, epoch 0, flags rib only nolabel, rib defined all labels, RIB[B], refcount 5,
per-destination sharing
sources: RIB
feature space:
IPRM: 0x00018000
ifnums:
FastEthernet1/1(5): 192.168.23.3
FastEthernet2/0(6): 172.16.23.3
path 6896722C, path list 68991DF0, share 1/1, type recursive, for IPv4
recursive via 10.4.4.4[IPv4:Default], fib 6894F9B0, 1 terminal fib, v4:Default:10.4.4.4/32
path 689672A4, path list 68991E3C, share 0/1, type attached nexthop, for IPv4
MPLS short path extensions: MOI flags = 0x0 label 19
nexthop 172.16.23.3 FastEthernet2/0 label 19, adjacency IP adj out of FastEthernet2/0,
addr 172.16.23.3 686FC0A0
path 6896731C, path list 68991E3C, share 1/1, type attached nexthop, for IPv4
MPLS short path extensions: MOI flags = 0x0 label 19
nexthop 192.168.23.3 FastEthernet1/1 label 19, adjacency IP adj out of FastEthernet1/1,
addr 192.168.23.3 686FC360
output chain:
loadinfo 689C4DA0, per-session, 2 choices, flags 0003, 6 locks
flags: Per-session, for-rx-IPv4
16 hash buckets
< 0 > label 19 TAG adj out of FastEthernet2/0, addr 172.16.23.3 686FBF40
< 1 > label 19 TAG adj out of FastEthernet1/1, addr 192.168.23.3 686FC200
< 2 > label 19 TAG adj out of FastEthernet2/0, addr 172.16.23.3 686FBF40
< 3 > label 19 TAG adj out of FastEthernet1/1, addr 192.168.23.3 686FC200
< 4 > label 19 TAG adj out of FastEthernet2/0, addr 172.16.23.3 686FBF40
< 5 > label 19 TAG adj out of FastEthernet1/1, addr 192.168.23.3 686FC200
< 6 > label 19 TAG adj out of FastEthernet2/0, addr 172.16.23.3 686FBF40
< 7 > label 19 TAG adj out of FastEthernet1/1, addr 192.168.23.3 686FC200
< 8 > label 19 TAG adj out of FastEthernet2/0, addr 172.16.23.3 686FBF40
< 9 > label 19 TAG adj out of FastEthernet1/1, addr 192.168.23.3 686FC200
<10 > label 19 TAG adj out of FastEthernet2/0, addr 172.16.23.3 686FBF40
<11 > label 19 TAG adj out of FastEthernet1/1, addr 192.168.23.3 686FC200
<12 > label 19 TAG adj out of FastEthernet2/0, addr 172.16.23.3 686FBF40
<13 > label 19 TAG adj out of FastEthernet1/1, addr 192.168.23.3 686FC200
<14 > label 19 TAG adj out of FastEthernet2/0, addr 172.16.23.3 686FBF40
<15 > label 19 TAG adj out of FastEthernet1/1, addr 192.168.23.3 686FC200
Subblocks:
None
带有 CEF 负载平衡的 Cisco IOS,在 L4 端口上散列......
在 IOS 12.4 中,思科引入了另一种算法来基于 L4 端口对流量进行负载平衡……ip cef load-sharing algorithm include-ports source destination
在全局配置级别使用。
MPLS TE 为负载均衡引入了另一种转折,包括路径离线优化的潜力;通常您会购买一个应用程序来执行网络中各种 MPLS TE 隧道之间的离线负载优化。这也是一个非常深刻的主题......我提到它只是因为您在询问“自动”使用 MPLS 进行负载平衡。