< Home

timer (BGP)

Function

The timer command configures the Keepalive and Holdtime interval of BGP. The Holdtime period must be at least three times of the Keepalive period.

The undo timer command restores the default values of the Keepalive and Holdtime timer.

By default, the Keepalive time is 60 seconds, and the Holdtime is 180 seconds.

Format

timer keepalive keepalive-time hold hold-time [ min-holdtime min-holdtime ]

undo timer keepalive keepalive-time hold hold-time [ min-holdtime min-holdtime ]

undo timer keepalive hold [ min-holdtime ]

Parameters

Parameter Description Value
keepalive keepalive-time

Specifies the Keepalive interval.

It is an integer that ranges from 0 to 21845, in seconds.

hold hold-time

Specifies the Holdtime interval.

The value is 0 or an integer that ranges from 3 to 65535, in seconds.
NOTE:
Setting the hold interval of a BGP peer to be longer than 20s is recommended. If the hold interval of a BGP peer is shorter than 20s, the session may be closed.
min-holdtime min-holdtime
Specifies the minimum Holdtime configured on the local device.
NOTE:

The value of min-holdtime configured cannot exceed the value of hold-time.

The value is an integer ranging from 20 to 65535, in seconds.

Views

BGP view

Default Level

2: Configuration level

Usage Guidelines

Applicable Environment

After establishing a BGP connection, two peers send Keepalive messages periodically to each other to detect the status of the BGP connection. If a device receives no Keepalive message or any other types of packets from its peer within the Holdtime, the device considers the BGP connection closed, and it closes the BGP connection.

After peers set up connections, the values of keepalive-time and hold-time are determined by negotiations between the peers. Each of the two peers sends the other an Open packet containing hold-time. The smaller of the hold-time values contained in Open packets from both peers is used. The smaller of the locally configured keepalive-time value and one third of the negotiated hold-time value is used as the actual keepalive-time value.

The timer command is used to set the Keepalive period and Holdtime.
  • If short Keepalive period and Holdtime are set, BGP can detect a link fault quickly and implement link switching. The number of Keepalive messages on the network, however, is increased. This increases device loads and consumption of network bandwidth resources.
  • If long Keepalive period and Holdtime are set, the number of Keepalive messages on the network is reduced. This reduces device loads. If, however, the Keepalive period is too long, BGP is unable to detect link status changes in a timely manner, causing many packets to be lost.

If the local device establishes BGP peer relationships with many devices, it needs to process huge BGP messages. If hold-time negotiated among BGP peers is small, the timer may expire before the local device processes the Keepalive messages sent from other BGP peers. The peer relationships are then interrupted, and routes flap. To solve the preceding problem, you can configure an appropriate value for min-holdtime min-holdtime based on the CPU processing capability of the local device.

If the value of min-holdtime is changed, but the values of keepalive-time and hold-time negotiated between two BGP peers remain unchanged, the established peer relationship is not affected. Only when the local device attempts to re-establish a relationship with a remote device, the value of min-holdtime configured on the local device takes effect. The local device compares min-holdtime with hold-time sent from the remote device. If the value of min-holdtime exceeds that of hold-time, hold-time negotiation fails, and the peer relationship fails to be established.

If min-holdtime is configured on the local device, and the value of hold-time sent from the remote device is 0, hold-time negotiation between the two devices succeeds. The negotiated value of hold-time is 0, and the peer relationship is established. The value 0 of hold-time indicates that the peer relationship never expires.

Effect

If the value of a timer changes, the BGP peer relationship among routers is disconnected because the peers need to re-negotiate the Keepalive period and Holdtime. Exercise caution when using the timer command.

Note

In actual configuration, the Holdtime period must be at least three times of the Keepalive period.

When setting the values of the two timers, note the following points:

  • The values of the keepalive-time and the hold-time cannot both be set to 0. This renders the BGP timers invalid. BGP is unable to detect link faults using the timers.

  • The hold-time value cannot be significantly greater than the keepalive-time value. A setting of timer keepalive 1 hold 65535, for example, would be improper. If the Holdtime is too long, link faults cannot be detected in a timely manner.

The Keepalive period and Holdtime can be configured globally, or on a particular peer or peer group. The Keepalive period and Holdtime configured on a specific peer or peer group takes precedence over the global Keepalive period and Holdtime. This command can globally change the Keepalive period and Holdtime on all peers, but cannot change the value on a peer or peer group configured through the peer timer command.

Example

# Configure Keepalive and Holdtime timers of BGP.

<sysname> system-view
[sysname] bgp 100
[sysname-bgp] timer keepalive 30 hold 90
Warning: Changing the parameter in this command resets the peer session. Continue?(Y/N):y
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >