I am trying to establish bgp session to HP-MSR Router using scapy with python. I am successful in creating a tcp socket. After this, Router is sending me one BGP Open message. In reply, I am sending BGP Open message, and acknowledging the Router's BGP Open. Router is also, acknowledging my BGP Open message. Finally Router is able to achieve "Open Confirm" state. When it achieves open confirm state, It starts sending some [TCP Re-transmission message, Group: Sequence] error. It remains in the Open Confirm state till the hold time expires.
Case 1) When my bgp id is lower than the Router id. In this case router is sending the Keep alive message, but it is also sending the same error [TCP Re-transmission message, Group: Sequence]. When I am sending some keep alive message, i am not getting any acknowledgement from router and it remains in the "Open confirm state" until hold timer expires. Router also sends a "Connection collision resolution" in this case, as expected.
Case 2) When my bgp id is greater than Router ID. In this case router is not sending any keep alive message, nor acknowledging mine. It keeps sending the same error message [TCP Re-transmission message, Group: Sequence] until hold timer expires.
I am considering that, Router should follow below bgp diagram:
-> syn
syn, ack <-
-> ack
Bgp open <-
-> BGP Open
-------------------- Open Confirm
Keep alive <-
-> Keep alive
-------------------- Established
I expect behavior explained in above figure.