BGP: connect delay timer vs connect retry timer

Ondrej Zajicek santiago at crfreenet.org
Tue Aug 29 19:08:38 CEST 2023


On Tue, Aug 29, 2023 at 09:11:27PM +0530, Bala Sajja wrote:
> Hi Ondrej,
>      OK. understood. We can configure connect-retry-interval in the
> range 1..65535. We are trying to test this with different values as
> pasted below with logs. Things work as expected till the 1..25 seconds
> range. After that we always see the connection delay timer getting
> triggered, connect retry timer config has no impact.

This is really unrelated to connection delay timer. You get this behavior
because besides our connect retry timer there is also OS-level timer for
TCP connections. If our retry timer is small, it timeouts and we retry the
connection.

If our timer is large, we get socket error from OS first (that is the log
message 'Connection lost (Connection timed out)'), which leads to
complete restart of BGP state machine, including going through the
initial connection delay time.

It is true that we could likely avoid full restart from socket error when
we are still in the CONNECT state, and wait for our connect retry timer.


First case:
> Line 167: Aug 29 14:02:36 bird: bgp_10: Connecting to 10.220.152.55
> from local address 10.220.152.53
> Line 185: Aug 29 14:02:53 bird: bgp_10: Connecting to 10.220.152.55
> from local address 10.220.152.53
> Line 191: Aug 29 14:03:12 bird: bgp_10: Connecting to 10.220.152.55
> from local address 10.220.152.53
> Line 195: Aug 29 14:03:30 bird: bgp_10: Connecting to 10.220.152.55
> from local address 10.220.152.53
> Line 214: Aug 29 14:03:48 bird: bgp_10: Connecting to 10.220.152.55
> from local address 10.220.152.53


Second case:
> Line 297: Aug 29 14:05:12 bird: bgp_10: Started
> Line 298: Aug 29 14:05:12 bird: bgp_10: Connect delayed by 5 seconds
> Line 308: Aug 29 14:05:16 bird: bgp_10: Connecting to 10.220.152.55
> from local address 10.220.152.53
> Line 348: Aug 29 14:05:48 bird: bgp_10: Connection lost (Connection timed out)
> Line 349: Aug 29 14:05:48 bird: bgp_10: Connect delayed by 5 seconds
> Line 351: Aug 29 14:05:52 bird: bgp_10: Connecting to 10.220.152.55
> from local address 10.220.152.53
> Line 360: Aug 29 14:06:24 bird: bgp_10: Connection lost (Connection timed out)
> Line 361: Aug 29 14:06:24 bird: bgp_10: Connect delayed by 5 seconds
> Line 363: Aug 29 14:06:28 bird: bgp_10: Connecting to 10.220.152.55
> from local address 10.220.152.53
> Line 384: Aug 29 14:07:00 bird: bgp_10: Connection lost (Connection timed out)

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."


More information about the Bird-users mailing list