BGP的消息報文有如下5種報文
網絡
open消息session
keepalive消息ide
update消息spa
notifacation消息orm
route-refresh消息router
j、Open消息blog
主要包含的內容:ip
BGP版本、AS號(可用其判斷是EBGP仍是IBGP);ci
Holdtime(表示路由器在收到Keeplive消息等待最長時間,cisco默認爲180s,若是雙方的holdtime時間不同,鄰居不會down,這點與OSPF不一樣,在BGP中將會協商,採用最小的holdtime時間做爲雙方的holdtime時間,通常狀況下,該值爲keepalive的三臺,默認狀況下keepalive時間爲60s);路由
BGP標識符(router-id);
可選項optionalpareameter(包含多協議支持的地址簇等);
k、Keepalive消息
是響應Open消息,用於保持鄰居關係,沒有攜帶什麼消息及數據,默認狀況下,60s發送一次keepalive消息;
l、notification消息
對錯誤的配置進行響應,具備差錯檢測功能,當檢測到錯誤時,會向對等體發送notification消息,並關閉BGP鏈接;
從中可知,有錯誤類型、錯誤代碼、錯誤子代碼(錯誤緣由)
*Dec 7 11:35:38.747: %BGP_SESSION-5-ADJCHANGE:neighbor 12.1.1.1 IPv4 Unicast topology base removed from session BGP Notificationsent
m、Update消息
用於對等體之間通告路由、已撤消的前輟路由、NLRI(網絡可達性消息)、路徑屬性值;
Withdrawn routeslength 表示不可達路由長度
Total pathattribute length 總路徑屬性長度,若是是0表示沒有path attributes字段;
n、route-Refresh消息
要求對等體從新發送路由更新信息,可用clearip bgp * soft in軟清讓路由器從新發送路由更新信息;
Address familyidentifier AFI: 地址族標識
Subsequesnt addressfamily identifier(SAFI)子地址族標識
R2#show ip bgp neighbors //用此命令可查看refresh報文的狀況
BGP neighbor is4.4.4.4, remote AS 100, internal link
BGP version 4, remote router ID 4.4.4.4
BGP state = Established, up for 00:11:33
Last read 00:00:40, last write 00:00:08, holdtime is 180, keepalive interval is 60 seconds
Neighbor sessions:
1 active, is not multisession capable(disabled)
Neighbor capabilities:
Route refresh: advertised and received(new)
Four-octets ASN Capability: advertised andreceived
Address family IPv4 Unicast: advertised andreceived
Enhanced Refresh Capability: advertised andreceived
Multisession Capability:
Stateful switchover support enabled: NO forsession 1
Message statistics:
InQ depth is 0
OutQ depth is 0
Sent Rcvd
Opens: 1 1
Notifications: 0 0
Updates: 4 1
Keepalives: 14 14
Route Refresh: 0 0
Total: 19 16
在上面可知,route refresh的報文數爲零,執行命令後
R2#clear ip bgp* soft in
R2#show ip bgpneighbors //再次查看狀況
BGP neighbor is4.4.4.4, remote AS 100, internal link
BGP version 4, remote router ID 4.4.4.4
BGP state = Established, up for 00:11:33
Last read 00:00:40, last write 00:00:08, holdtime is 180, keepalive interval is 60 seconds
Neighbor sessions:
1 active, is not multisession capable(disabled)
Neighbor capabilities:
Route refresh: advertised and received(new)
Four-octets ASN Capability: advertised andreceived
Address family IPv4 Unicast: advertised andreceived
Enhanced Refresh Capability: advertised andreceived
Multisession Capability:
Stateful switchover support enabled: NO forsession 1
Message statistics:
InQ depth is 0
OutQ depth is 0
Sent Rcvd
Opens: 1 1
Notifications: 0 0
Updates: 5 1
Keepalives: 24 25
Route Refresh: 1 0
Total: 33 31