赞
踩
1.实验目的
默认情况下,BGP的keepalive报文周期为60秒,保持周期(holdtimer)为180秒。出于加速或减缓收敛的目的,可以通过bgp timers keepalive holdtime全局命令或者针对具体邻居的neighborxxxx timer keepalive holdtime命令进行调整。
但与OSPF等IGP协议不同,BGP邻居之间的timer可以不一致,通过TCP连接建立成功后的open报文交互中,协商使用最低值。
2.实验结果
(1)R1采用默认设置,keepalive60秒,hold time 180秒。R2进行调整,keepalive 10秒,hold time 30秒。
配置完成后,并不生效。因为相关参数的传递由open报文负责,而在BGP邻居状态使能的情况下,只有keepalive和update报文交互。使用clear ip bgp * 命令后,两端协商timer完成,如表5所示。
表4 BGP邻居timer情况(一)
R2#sh ip bgp neighbors 1.1.1.1 BGP neighbor is 1.1.1.1, remote AS 1, internal link BGP version 4, remote router ID 1.1.1.1 BGP state = Established, up for 00:00:19 Last read 00:00:09, last write 00:00:01, hold time is 30, keepalive interval is 10 seconds Configured hold time is 30, keepalive interval is 10 seconds !!!!在R1上查看R2的邻居状态情况 R1# sh ip bgp neighbors 2.2.2.2 BGP neighbor is 2.2.2.2, remote AS 1, internal link BGP version 4, remote router ID 2.2.2.2 BGP state = Established, up for 00:25:26 Last read 00:00:01, last write 00:00:01, hold time is 30, keepalive interval is 10 seconds |
(2)但从抓包情况看,open报文中,只有holdtime参数,并不包含keepalive参数,如图4所示。那么keepalive数值如何得出?
1) 为验证,调整R1和R2的timer参数,分别为:R1,keepalive 10秒,hold time 40秒。R2,keepalive 30秒,hold time100秒。此时两端协商后,由于只交互了hold time。R1的实际timer为,keepalive 10秒,hold time 40秒。R2的实际timer为,keepalive 13秒,hold time 40秒,keepalive数值为(最低的hold time值)/3的取整,如表5所示。
2) 为进一步验证,继续调整R1和R2的timer参数,分别为:R1,keepalive 10秒,hold time 20秒。R2,keepalive 30秒,hold time100秒。两端协商后,R1的实际timer为,keepalive 6秒,hold time 20秒。R2的实际timer为,keepalive 6秒,hold time 20秒,如表6所示。
对比两组实验结果,基本确定:
1) BGP邻居在交互open报文中,只包含holdtime字段,双方会取两者之间的最低值。
2) 但在本端keepalive数值确定中,两端均必须满足(hold time数值)≥(keepalive数值)*3。在配置的keepalive数值不满足此条件时,使用(最低的hold time值)/3的取整作为实际值。
表5 BGP邻居timer情况(二)
R2#sh ip bgp nei 1.1.1.1 BGP neighbor is 1.1.1.1, remote AS 1, internal link BGP version 4, remote router ID 1.1.1.1 BGP state = Established, up for 00:00:17 Last read 00:00:07, last write 00:00:07, hold time is 40, keepalive interval is 13 seconds Configured hold time is 100, keepalive interval is 30 seconds !!!!在R1上查看R2的邻居状态情况 R1#sh ip bgp nei 2.2.2.2 BGP neighbor is 2.2.2.2, remote AS 1, internal link BGP version 4, remote router ID 2.2.2.2 BGP state = Established, up for 00:00:06 Last read 00:00:06, last write 00:00:05, hold time is 40, keepalive interval is 10 seconds Configured hold time is 40, keepalive interval is 10 seconds |
表6 BGP邻居timer情况(三)
R1#sh ip bgp nei 2.2.2.2 BGP neighbor is 2.2.2.2, remote AS 1, internal link BGP version 4, remote router ID 2.2.2.2 BGP state = Established, up for 00:00:09 Last read 00:00:03, last write 00:00:02, hold time is 20, keepalive interval is 6 seconds Configured hold time is 20, keepalive interval is 10 seconds !!!!在R2上查看R1的邻居状态情况 2#sh ip bgp nei 1.1.1.1 BGP neighbor is 1.1.1.1, remote AS 1, internal link BGP version 4, remote router ID 1.1.1.1 BGP state = Established, up for 00:00:33 Last read 00:00:00, last write 00:00:02, hold time is 20, keepalive interval is 6 seconds Configured hold time is 100, keepalive interval is 30 seconds |
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。