BGP Connection Collision Detection(RFC4271)less
If a pair of BGP speakers try to establish a BGP connection with each
other simultaneously, then two parallel connections well be formed.
If the source IP address used by one of these connections is the same
as the destination IP address used by the other, and the destination
IP address used by the first connection is the same as the source IP
address used by the other, connection collision has occurred. In the
event of connection collision, one of the connections MUST be closed.ide
Based on the value of the BGP Identifier, a convention is established
for detecting which BGP connection is to be preserved when a
collision occurs. The convention is to compare the BGP Identifiers
of the peers involved in the collision and to retain only the
connection initiated by the BGP speaker with the higher-valued BGP
Identifier.this
Upon receipt of an OPEN message, the local system MUST examine all of
its connections that are in the OpenConfirm state. A BGP speaker MAY
also examine connections in an OpenSent state if it knows the BGP
Identifier of the peer by means outside of the protocol. If, among
these connections, there is a connection to a remote BGP speaker
whose BGP Identifier equals the one in the OPEN message, and this
connection collides with the connection over which the OPEN message
is received, then the local system performs the following collision
resolution procedure:code
1) The BGP Identifier of the local system is compared to the BGP Identifier of the remote system (as specified in the OPEN message). Comparing BGP Identifiers is done by converting them to host byte order and treating them as 4-octet unsigned integers. 2) If the value of the local BGP Identifier is less than the remote one, the local system closes the BGP connection that already exists (the one that is already in the OpenConfirm state), and accepts the BGP connection initiated by the remote system. 3) Otherwise, the local system closes the newly created BGP connection (the one associated with the newly received OPEN message), and continues to use the existing one (the one that is already in the OpenConfirm state).
Unless allowed via configuration, a connection collision with an
existing BGP connection that is in the Established state causes
closing of the newly created connection.orm
Note that a connection collision cannot be detected with connections
that are in Idle, Connect, or Active states.router
Closing the BGP connection (that results from the collision
resolution procedure) is accomplished by sending the NOTIFICATION
message with the Error Code Ceaseip
BGP鏈接衝突檢測
若是一對BGP設備彼此同時嘗試創建BGP鏈接,那麼2個並行的鏈接將會創建。若是源地址等於另外一個鏈接的目的IP,同時目的IP也用於了另一個鏈接的源IP,那麼鏈接衝突就發生了。
基於BGP的ID值
一般會基於BGP的路由器ID來完成約定俗稱的比較,若是BGP鏈接發生衝突,那麼僅保留由較大路由器ID的BGP設備發起TCP鏈接。
收到OPEN報文後,本設備必須檢查全部處於OpenConfirm狀態的鏈接。 BGP設備若是遠端設備的BGP路由器ID,可能也會檢查處於OpenSent狀態的連接。
若是本地BGP標識符的值小於遠程BGP標識符的值,則本地系統將關閉已存在的BGP鏈接(已經處於OpenConfirm狀態的BGP鏈接),並接受由遠程系統啓動的BGP鏈接。
不然,本地系統將關閉新建立的BGP鏈接(與新接收到的OPEN消息關聯的鏈接),並繼續使用現有的BGP鏈接(已經處於OpenConfirm狀態的鏈接)。
注意TCP鏈接衝突不能檢測處於IDLE、鏈接或者Active狀態的BGP狀態,關閉因爲TCP鏈接衝突的BGP鏈接經過發送BGP差錯報文完成
爲了不這種極端狀況發生,能夠使用以下命令開控制主被動:
[R3-bgp]peer Ender listen-only //被動接受
R3(config-router)#neighbor Ender transport connection-mode passiveci