A Networker Blog.-

BGP Keepalives

Posted in BGP, Cisco, Routing by vcappuccio on 17/11/2007

http://www.cisco.com/en/US/products/ps6350/products_configuration_guide_chapter09186a00804435fc.html

Since BGP uses TCP session, there is no way to verify the presence of a BGP Neighbor, except when sending BGP Traffic, so BGP sends keepalives every 60 seconds

Keepalive interval value is not communicated in the BGP Open Message

Default Values:
Keepalive 60 Seconds
HoldTime 180 Seconds

NOTE:

BGP does not use any transport protocol-based keep-alive mechanism to determine if peers are reachable. Instead, KEEPALIVE messages are exchanged between peers often enough as not to cause the Hold Timer to expire. A reasonable maximum time between KEEPALIVE messages would be one third of the Hold Time interval. KEEPALIVE messages MUST NOT be sent more frequently than one per second. An implementation MAY adjust the rate at which it sends KEEPALIVE

Example of this:

R3 and R4 in AS 34

R3 and R4 in AS 34


Smaller integer in relation to (holtime/3), if holdtime of neigh is used and keepalive > (holdtime/3)

R3#
router bgp 34
timers bgp 15 30

R3#show ip bgp neigh | in keep
Last read 00:00:06, last write 00:00:06, hold time is 30, keepalive interval i
s 10 seconds
Configured hold time is 30,keepalive interval is 15 seconds, Minimum holdtime
from neighbor is 0 seconds

R4(config-router)#do show ip bgp neigh | in keep
Last read 00:00:02, last write 00:00:02, hold time is 30, keepalive interval i
s 10 seconds

Notice the configured Keepalive (15) in R3 and the selected keepalive in R4 10 seconds, but R3 is using 10 as the keepalive, since is the lowest keepalive (holdtime /3)

Another example

R3(config-router)#timer bgp 20 30
R3(config-router)#do clear ip bgp *

R3(config-router)#do show ip bgp neigh | in keep
Last read 00:00:07, last write 00:00:07, hold time is 30, keepalive interval i
s 10 seconds
Configured hold time is 30,keepalive interval is 20 seconds, Minimum holdtime
from neighbor is 0 seconds

R4(config-router)#do show ip bgp neigh | in keep
Last read 00:00:05, last write 00:00:05, hold time is 30, keepalive interval i
s 10 seconds

Notice now that R3 had been configured with 20 of keepalive and 30 of holdtime
and the selected values are 30 and 10

if the holddtime interval of the neigbor is selected and the locally configured keepalive is less than a third of the holdtime intercal the peers use the locally configured keep alive

R3(config-router)#timer bgp 9 30
R3(config-router)#do clear ip bgp *
R3(config-router)#
*Nov 17 16:31:25.853: %BGP-5-ADJCHANGE: neighbor 1.1.1.4 Down User reset
R3(config-router)#
*Nov 17 16:31:27.885: %BGP-5-ADJCHANGE: neighbor 1.1.1.4 Up
R3(config-router)#do show ip bgp neigh | in keep
Last read 00:00:06, last write 00:00:06, hold time is 30, keepalive interval i
s 9 seconds
Configured hold time is 30,keepalive interval is 9 seconds, Minimum holdtime f
rom neighbor is 0 seconds
R3(config-router)#

R4(config-router)#do show ip bgp neigh | in keep
Last read 00:00:01, last write 00:00:08, hold time is 30, keepalive interval i
s 10 seconds

Another Example

R4(config-router)#timer bgp 7 60
R4(config-router)#do clear ip bgp *
R4(config-router)#
%BGP-5-ADJCHANGE: neighbor 1.1.1.3 Down User reset
%BGP-5-ADJCHANGE: neighbor 1.1.1.3 Up
R4(config-router)#do show ip bgp neigh | in keep
Last read 00:00:04, last write 00:00:05, hold time is 30, keepalive interval i
s 7 seconds
Configured hold time is 60,keepalive interval is 7 seconds, Minimum holdtime f
rom neighbor is 0 seconds
R4(config-router)#

R3(config-router)#do show run | in timer
timers bgp 9 30
R3(config-router)#do show ip bgp neigh | in keep
Last read 00:00:05, last write 00:00:03, hold time is 30, keepalive interval i
s 9 seconds
Configured hold time is 30,keepalive interval is 9 seconds, Minimum holdtime f
rom neighbor is 0 seconds
R3(config-router)#

R4(config-router)#timer bgp 11 60
R4(config-router)#do clear ip bgp *

%BGP-5-ADJCHANGE: neighbor 1.1.1.3 Down User reset
%BGP-5-ADJCHANGE: neighbor 1.1.1.3 Up
R4(config-router)#do show ip bgp

R4(config-router)#do show ip bgp neigh | in keep
Last read 00:00:07, last write 00:00:07, hold time is 30, keepalive interval i
s 10 seconds
Configured hold time is 60,keepalive interval is 11 seconds, Minimum holdtime
from neighbor is 0 seconds
R4(config-router)#

R4(config-router)#no timers bgp 11 60
R4(config-router)#do clear ip bgp *
%BGP-5-ADJCHANGE: neighbor 1.1.1.3 Down User reset
%BGP-5-ADJCHANGE: neighbor 1.1.1.3 Up
R4(config-router)#do show ip bgp neigh | in keep
Last read 00:00:04, last write 00:00:04, hold time is 30, keepalive interval i
s 10 seconds
R4(config-router)#

R3(config-router)#timers bgp 11 40
R3(config-router)#do clear ip bgp *

R4(config-router)#do show ip bgp neigh | in keep
Last read 00:00:03, last write 00:00:02, hold time is 40, keepalive interval i
s 13 seconds

R3(config-router)#do show ip bgp neigh | in keep
Last read 00:00:00, last write 00:00:09, hold time is 40, keepalive interval i
s 11 seconds
Configured hold time is 40,keepalive interval is 11 seconds, Minimum holdtime
from neighbor is 0 seconds

R3(config-router)#no timers bgp 11 40
R3(config-router)#do clear ip bgp *
R3(config-router)#
%BGP-5-ADJCHANGE: neighbor 1.1.1.4 Down User reset
%BGP-5-ADJCHANGE: neighbor 1.1.1.4 Up
R3(config-router)#do show ip bgp neigh | in keep
Last read 00:00:13, last write 00:00:13, hold time is 180, keepalive interval
is 60 seconds

R4(config-router)#do show ip bgp neigh | in keep
Last read 00:00:29, last write 00:00:29, hold time is 180, keepalive interval
is 60 seconds

R4(config-router)#timers bgp 10 59
R4(config-router)#do clear ip bgp *
R4(config-router)#
%BGP-5-ADJCHANGE: neighbor 1.1.1.3 Down User reset
R4(config-router)#
*Nov 17 16:43:13.489: %BGP-5-ADJCHANGE: neighbor 1.1.1.3 Up

R3(config-router)#do show ip bgp neigh | in keep
Last read 00:00:01, last write 00:00:01, hold time is 59, keepalive interval i
s 19 seconds

R4(config-router)#do show ip bgp neigh | in keep
Last read 00:00:12, last write 00:00:01, hold time is 59, keepalive interval i
s 10 seconds
Configured hold time is 59,keepalive interval is 10 seconds, Minimum holdtime
from neighbor is 0 seconds

Is there any more options you could see :)

A Networker Blog

Advertisement

2 Responses

Subscribe to comments with RSS.

  1. worldwide people search said, on 18/01/2010 at 14:59

    I wanted to thank you for this great read!! I definitely enjoying every little bit of it.I have you bookmarked to check out new stuff you post.

  2. Patrick said, on 09/02/2010 at 21:10

    I think that is an interesting point, it made me think a bit. Thanks for sparking my thinking cap.


Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.