BGP 性能优化
目录
BGP连接的优化..............................................................................................................3 1、MSS ....................................................................................................................3 2、WIN....................................................................................................................4 3、PMTU.................................................................................................................5 4、保持队列............................................................................................................5 5、系统缓冲区.........................................................................................................5 对等体组..........................................................................................................................7 快速外部切断...................................................................................................................7 IGP和BGP的收敛交互.................................................................................................7 1、ISIS .....................................................................................................................7 2、OSPF...................................................................................................................8
Graceful-restart .................................................................................................................8 Dampening........................................................................................................................8 Soft reconfiguration ..........................................................................................................9 传输侧环路检测...............................................................................................................9 ORF.................................................................................................................................10
BGP性能优化
BGP连接的优化
BGP的连接是采用TCP 179(目的,源自选)的,对TCP各项参数的优化同时也就优化 了BGP的连接,主要参数如下。
1、MSS
目前缺省的BGP,对于直连的对端(包括IBGP\\EBGP)使用的是接口的MTU-40。而对于多跳 的对端(包括IBGP和EBGP),采用的是缺省值536(最小MTU576-40)。 目前在7200系列路由器上尚未找到修改MSS的方法,版本如下(严重怀疑为BUG) C-R5#show version
Cisco IOS Software, 7200 Software (C7200-ADVENTERPRISEK9-M), Version 12.4(11)T, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2006 by Cisco Systems, Inc.
Compiled Sun 19-Nov-06 01:10 by prod_rel_team ROM: ROMMON Emulation Microcode
BOOTLDR: 7200 Software (C7200-ADVENTERPRISEK9-M), Version 12.4(11)T, RELEASE SOFTWARE (fc2)
C-R5 uptime is 2 hours, 37 minutes
System returned to ROM by unknown reload cause - suspect boot_data[BOOT_COUNT] 0x0, BOOT_COUNT 0, BOOTDATA 19
System image file is \
This product contains cryptographic features and is subject to United States and local country laws governing import, export, transfer and use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption. Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you agree to comply with applicable laws and regulations. If you are unable to comply with U.S. and local laws, return this product immediately.
A summary of U.S. laws governing Cisco cryptographic products may be found at: http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
If you require further assistance please contact us by sending email to
Cisco 7206VXR (NPE400) processor (revision A) with 147456K/16384K bytes of memory. Processor board ID 4294967295
R7000 CPU at 150MHz, Implementation 39, Rev 2.1, 256KB L2 Cache 6 slot VXR midplane, Version 2.1 Last reset from power-on
PCI bus mb0_mb1 (Slots 0, 1, 3 and 5) has a capacity of 600 bandwidth points. Current configuration on bus mb0_mb1 has a total of 500 bandwidth points. This configuration is within the PCI bus capacity and is supported. PCI bus mb2 (Slots 2, 4, 6) has a capacity of 600 bandwidth points.
Current configuration on bus mb2 has a total of 300 bandwidth points This configuration is within the PCI bus capacity and is supported.
Please refer to the following document \Hardware Configuration Guidelines\for c7200 bandwidth points oversubscription and usage guidelines. 1 FastEthernet interface 4 Serial interfaces
1 ATM interface
1 Packet over SONET interface 125K bytes of NVRAM.
65536K bytes of ATA PCMCIA card at slot 0 (Sector size 512 bytes). 8192K bytes of Flash internal SIMM (Sector size 256K). Configuration register is 0x2102 C-R5#
2、WIN
这个参数和MSS参数共同协商,影响TCP数据报文的数目和ACK 报文的数目。 具体如下:
MSS 为每次发送的最大字节数。WIN 决定在接收到对端的ACK 前,能够发送多少字节的 数据。
BGP默认此参数是16384(16k)
CISCO 设备的修改方法为:(此参数为路由器全局参数,影响所有TCP连接) C-R1(config)#ip tcp window-size ? <0-1073741823> Window size C-R1(config)#ip tcp window-size
3、PMTU
建议在IBGP间开启PMTU机制,这样可以自动发现路径的最佳MTU值。 CISCO 开启方法如下:(此参数为路由器全局参数,影响所有TCP连接) C-R1(config)#ip tcp path-mtu-discovery ? age-timer Set PMTU aging timer
4、保持队列
Hold-queue为接口参数,缺省为75,影响所有的入流量报文。
默认BGP的队列计算如下:队列大小=窗口大小/(2*MSS)*对等体数目。
2*MSS的原因是BGP为了优化TCP ACK 报文,每2 个TCP数据报文就生成一个ACK 报 文。
CISCO 调整hold-queue命令如下: C-R1(config-if)#hold-queue ?
<0-4096> Queue length
当查看接口信息发现该行参数有drop时,可调整该数值: Input queue: 0/75/0/0 (size/max/drops/flushes);
5、系统缓冲区
这个是系统用于缓存数据的,可以用Show buffer 查看: C-R1#show buff Buffer elements:
1119 in free list (1119 max allowed) 25948 hits, 0 misses, 619 created Public buffer pools:
Small buffers, 104 bytes (total 283, permanent 50, peak 494 @ 01:35:41): 20 in free list (20 min, 150 max allowed)
24446 hits, 550 misses, 1360 trims, 1593 created 0 failures (0 no memory)
Middle buffers, 600 bytes (total 14, permanent 25, peak 49 @ 03:22:17): 14 in free list (10 min, 150 max allowed) 1911 hits, 9 misses, 39 trims, 28 created 0 failures (0 no memory)
Big buffers, 1536 bytes (total 46, permanent 50): 46 in free list (5 min, 150 max allowed)
1627 hits, 0 misses, 4 trims, 0 created 0 failures (0 no memory)
VeryBig buffers, 4520 bytes (total 56, permanent 10, peak 56 @ 01:06:42): 12 in free list (0 min, 100 max allowed) 433 hits, 23 misses, 0 trims, 46 created 0 failures (0 no memory)
Large buffers, 5024 bytes (total 0, permanent 0): 0 in free list (0 min, 10 max allowed) 0 hits, 0 misses, 0 trims, 0 created
0 failures (0 no memory)
Huge buffers, 18024 bytes (total 0, permanent 0): 0 in free list (0 min, 4 max allowed) 0 hits, 0 misses, 0 trims, 0 created 0 failures (0 no memory) 各参数解释如下:
Total:当前缓冲池中缓存数。 Permanent:缓存池中的永久缓存数目 Peak:峰值
free list:当前池中可用的数目
min:最小空闲数,小于该数字则创建缓存条目。 max allowed:最大允许,大于该数目则清理缓存。 Hits:成功分配的数目。
Misses:因缓存中没有可用缓存而分配失败的数目。 Trims:超过max allowed数,而被整理的次数。 Created:小于min而不创建的次数。
Failures:因内存不足而分配失败的次数。
修改buffer 前要检查系统内存数目show memory 。对于BGP来说特别是small缓存至关重 要,尤其是多个neighbor 的时候,因small缓存内大多是ACK 包。