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