09-06-2018 09:49 AM
Hi
Can anyone tell how to find which router first initiate the TCP session in BGP.
Thanks in Advance.
Solved! Go to Solution.
09-06-2018 10:12 AM
Good (should read) article already linked.. but unfortunately the author didn't mention about the connection collision.
RFC 4271
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. 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.
09-06-2018 09:55 AM
check this post:
09-06-2018 10:12 AM
Good (should read) article already linked.. but unfortunately the author didn't mention about the connection collision.
RFC 4271
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. 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.
09-06-2018 10:16 AM
thanks for point that out +5
09-06-2018 10:52 AM
09-06-2018 11:17 AM
@sivam siva You welcome!
09-06-2018 11:27 AM
Hello
Just like to add.... The simplistic way is to check the local/foreign tcp port of the peering. (port 179 is the initiated side)
sh ip bgp neighbors xxx | in port
09-06-2018 11:44 AM - edited 09-06-2018 11:45 AM
@paul driver hmm I am a bit confused by 'port 179 is the initiated side'
Would the initiated side not have a random source port with destination port 179?
Thinking about TCP, would server not be listening on 179?
Am I missing something?
09-06-2018 12:08 PM - edited 09-07-2018 12:13 AM
Hello
Not a problem , You are indeed correct 179 is the server port- my first statement the wrong away around, foreign port is the initiated port.
However my understanding of bgp is that it is some different how it handles the peering, You are correct in saying the initiated rtr (client) will at first source from a random port to dest tcp 179 however in the returning syn acks the client/server roles can be swapped around so the replying rtr could become the client, So when finally the peering is established it can be the rtr that first initiated the session that has ended up with the local tcp179 port and its peer that has the foreign port as a random number.
09-06-2018 01:52 PM
Apologies to be a pain.. I do not understand the swap.
R3#sh tcp bri | b TCB TCB Local Address Foreign Address (state) F28B8F90 3.3.3.3.60425 4.4.4.4.179 ESTAB R3#sh ip bgp nei 4.4.4.4 | i _port Local host: 3.3.3.3, Local port: 60425 Foreign host: 4.4.4.4, Foreign port: 179 R3#
09-06-2018 03:19 PM - edited 09-07-2018 12:27 AM
Hello
Apply a debug ( ip packet detail ) Then create a bgp session from scratch and watch the trace as the session is established you should eventually see the rtr which becomes the initiated speaker.
Now going back to the OP, checking the bgp neighboring local/foreign ports will show you the bgp initiator
12-03-2024 07:08 AM - edited 12-03-2024 07:08 AM
Hi All,
Just want to understand TCP handshake in BGP Process.
1. How Server and client selection process happens in TCP handshake in BGP.
2. is BGP router id only comes in picture if collision happens during TCP 3-way initialization.
3. How BGP router can know the router-id of neighbor before 3-way handshake completed and OPEN message sent.
12-03-2024 09:01 AM
Possibly you're confusing BGP session establishment with TCP session establishment. The former uses the latter, the latter doesn't "know" the former. (Just as TCP doesn't "know" whether it's BGP, FTP, telnet, RCP, HTTP, etc. using it.)
I.e. TCP attempts to setup a session, and if established, then BGP uses the TCP session for its purposes.
Basically, setting up a BGP session would be a "race" condition. Both peers know of the other, and both will try to setup a BGP session with each other. This does, though, easily allows dual TCP sessions to be established, which the quoted RFC allows for and dictates one of the BGP parallel sessions be dropped (and how to choose which to drop).
12-03-2024 09:03 AM
Make new post
MHM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide