ICMP Redirect引起的網絡丟包
場景
當網絡設備發下發送給自己的數據包,下一跳地址和發送源地址在同一個子網時,就會回覆一個icmp redirect報文,用於向發送源設備指出存在一個更加優化的路由。當源設備接收到這個icmp redirect報文後,後續數據包就會直接發送給新的下一跳。
引起原因
這一般都是由於策略路由(PBR)或者不優化的路由(錯誤的靜態)引起的。
+---+ | +----------+ ---+ +---+ | | 10.1.1.2/24 | | | | +---+ |LAN +----------+ | | | +---+ | | 10.1.1.1/24 +---+ | | | +----------+----+ +---+ 10.1.1.3/24
如圖所示,假設10.1.1.2去往10.1.1.3的的數據包被策略路由強行髮網10.1.1.1,10.1.1.1會發現下一跳和自己在同一個網段,接下來將會向10.1.1.2回覆一個ICMP Redirect。
+---+ | +----------+ ---+ +---+ | | 10.1.1.2/24 | | | | +---+ |LAN +----------+ | | | +---+ | | 10.1.1.1/24 +---+ | | 192.168.1.0/24<-----+ +----------+----+ +---+ 10.1.1.3/24
如上圖,還有一種路由不優化的情況,假設路由設置如下:
10.1.1.2ip route 192.168.1.0/24 10.1.1.1
10.1.1.1ip route 192.168.1.0/24 10.1.1.3
10.1.1.3ip route 192.168.1.0/24 x.x.x.x
這種情況下,10.1.1.1同樣也會向10.1.1.2回覆ICMP Redirect。
危害
由於需要網絡設備回覆ICMP Redirect報文,數據包需要發送給CPU進行處理,這將增加CPU額外的負擔。
爲了避免這種情況(或***),Nexus在硬件層面對需要ICMP Redirect報文進行限速。
目前, IP redirects通過Layer 3 Time-to-Live (TTL) 速率限制。默認是500個包每秒。如果超過這個值,將帶來丟包。
N7K# show hardware rate-limiter Units for Config: packets per secondAllowed, Dropped & Total: aggregated since last clear counters rl-1: STP and Fabricpath-ISIS rl-2: L3-ISIS and OTV-ISIS rl-3: UDLD, LACP, CDP and LLDP rl-4: Q-in-Q and ARP request rl-5: IGMP, NTP, DHCP-Snoop, Port-Security, Mgmt and Copy traffic Module: 1Rate-limiter PG Multiplier: 1.00 R-L Class Config Allowed Dropped Total +------------------+--------+---------------+---------------+-----------------+ L3 mtu 500 0 0 0 L3 ttl 500 0 0 0 L3 control 10000 0 0 0
解決方案及建議
1、關閉ICMP Redirect
int vlan xx no ip redirect2、調整Hardware Rade-limite值
Example:N7K(config)# hardware rate-limiter layer-3 ttl 1000
本文參考文檔
Cisco Nexus 7000 Series NX-OS Security Configuration Guide