Hi Bob,
We can avoid this situation by specifically identifying which BGP peer should acts as server ( i .e start listening on tcp port 179 and do not initiate TCP handshake until heard from other bgp peer) and which BGP peer should act as a client ( initiates TCP hand shakes at TCP port 179 as destination port)
This will ensure there will be only single TCP session between BGP peers
EXAMPLE:
R1--199.199.199.0/30---R2
R1;
router bgp 1
neighbor 199.199.199.2 remote-as 1 ( expect connection request from 199.199.199.2 on TCP port 179)
neighbor 199.199.199.2 transport connection-mode passive ( do not initiate TCP hand shake with BGP peer 199.199.199.2)
Above config will instruct R1 to start listening on TCP port 179 and do not initiate TCP session for BGP i.e do not start TCP hand shake unless R2 sends TCP SYN at TCP port 179.
It will help us avoid collision you mentioned, optionally you can configure R2 as active but it is not required
R2
router bgp 1
neighbor 199.199.199.1 remote-as 1
neighbor 199.199.199.1 transport connection-mode active
NOTE:
The only thing you need to ensure service provider 's router is not configured with " neighbor X.X.X.X transport connection-mode passive
Where X.X.X.X is the IP your router 's IP being used for BGP.