After a Tcp connection is established between two bgp peers. which peer will send the open message first ? the active peer(which is initiating outbound connection) or the passive peer?(peer which is accepting a inbound connection).
Or is it independent of this active passive state ? Can any of the peer send the first open message based on scheduling?
What will happen when a open mesage is received before the local router sends out a open message?
Is there any good BGP Peer fsm diagram? RFC4271 doesn't have a fsm diagram 🙁
Best Answer
Normally, the speaker that opens the socket sends the first OPEN message. But it actually doesn't matter (ref the DelayOpen timer), because BGP also provides a way to delay the OPEN message so the opposite peer can send first:
In the event that both speakers open duplicate TCP sessions and send OPEN messages on each socket simultaneously, the BGP Identifier is used to resolve which socket should be closed. See RFC 4271, Section 6.8:
Wikipedia has this simplified BGP FSM.