Let's say we have two routers running a BGP that is fully converged and both routers are advertising routes to each other. The link between them fails (physically so to speak). Now, after the hold down timer and both routers deemed the other as down. What happens when the link comes back to life? Do we have to re-configure the BGP session all over again? If not, what happens to the networks that are advertised from each router to the other? Is it instantly advertised again once the link comes back up, or there is some kind of update timer so that each router deems the other as an up neighbor?
2 Answers
It's treated as a fresh session up when the peers restart. TCP handshake, capability re-negotiation, address family advertisement, and then NLRI exchange. If the hold down timer expires, the peer is marked as dead, the session goes into the IDLE state, and follows its own rules for transitioning from IDLE to Active (actively attempting to establish a TCP connection). Note that a peer in the IDLE state can still accept an inbound TCP handshake from the other router.
Exact time needed for a specific route to be available again is dependent on the total # of NLRIs to be exchanged between the two routers. If you're exchanging full tables (500K+ NLRI), depending on processor size on both routers, it could take upwards of 5 minutes. If you only have 20 routes to announce, they'll process the NLRI real quick like.
BGP sends KEEPALIVE packets in specified interval (60 seconds by default). If BGP not received 3 keepalive packets from neighbour, HOLD DOWN timer expires and the neighbour is considered as dead. Assuming the neighbor is down, shutting down the BGP session, and withdrawing all routes from it's announcements.
HOLD DOWN timer, it's three times KEEPALIVE (180 seconds by default).
When link between BGP peers came back to life (physically) and neighbours received KEEPALIVE packets the session is automatically UP. Peers starts advertise their routes in announcements, according to specified criteria. You don't have to reconfigure BGP session again. It would not make sense, because in real environments, BGP session fails quite a often.
-
Thanks for the reply, but the question here is, when the link is up again and the keepalive is sent, will the routes be advertised instantly or will it have to wait for a certain time? Commented Jan 1, 2015 at 17:31
-
When link is up again and neighbours are in active state. Routes will be advertise instantly by first UPDATE packet. Network layer reachability information is part of UPDATE packet where you can find this information. Commented Jan 1, 2015 at 18:25
-
How long does it take the neighbors to be in active state? Commented Jan 1, 2015 at 18:31
-
2@abdelrahman the details vary somewhat depending on the vendor you use. Please tell us what bgp implementation you're using Commented Jan 1, 2015 at 18:59
-
It is not an implementation that I am using. I am working on a concept that will enhance the convergence time of BGP. Since the BGP is the routing protocol of the internet, it doesn't advertise updates as soon as it has one unlike IGPs like OSPF and EIGRP. I just need the exact time that will take a route from a Router A to be in Router B's routing table after the link between them is restored. The only thing I came across was that it will take 30 seconds after the link is physically connected again. Need to make sure of this. Thanks a lot for the help. Commented Jan 1, 2015 at 19:13