Skip to content

Commit

Permalink
bgpv1: Set default IdleHoldTime after reset
Browse files Browse the repository at this point in the history
This change sets DefaultIdleHoldTimeAfterReset to 5s, so BGP session move from idle
to active state after reset is performed. Default in gobgp is 30s, which
is excessively long for session to be re-established.

Session reset is performed on some types of neighbor configuration changes, like timers.

Signed-off-by: harsimran pabla <hpabla@isovalent.com>
  • Loading branch information
harsimran-pabla authored and dylandreimerink committed Jun 9, 2023
1 parent a571731 commit 714ec54
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/bgpv1/gobgp/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import (
const (
wildcardIPv4Addr = "0.0.0.0"
wildcardIPv6Addr = "::"

// defaultIdleHoldTimeAfterReset defines time BGP session will stay idle after neighbor reset.
defaultIdleHoldTimeAfterReset = 5 * time.Second
)

var (
Expand Down Expand Up @@ -235,9 +238,10 @@ func (g *GoBGPServer) getPeerConfig(ctx context.Context, n *v2alpha1api.CiliumBG
peer.Timers.Config = &gobgp.TimersConfig{
// If any of the timers is not set (zero), it will be defaulted at the gobgp level.
// However, they should be already defaulted at this point.
ConnectRetry: uint64(n.ConnectRetryTime.Round(time.Second).Seconds()),
HoldTime: uint64(n.HoldTime.Round(time.Second).Seconds()),
KeepaliveInterval: uint64(n.KeepAliveTime.Round(time.Second).Seconds()),
ConnectRetry: uint64(n.ConnectRetryTime.Round(time.Second).Seconds()),
HoldTime: uint64(n.HoldTime.Round(time.Second).Seconds()),
KeepaliveInterval: uint64(n.KeepAliveTime.Round(time.Second).Seconds()),
IdleHoldTimeAfterReset: uint64(defaultIdleHoldTimeAfterReset.Seconds()),
}

// populate graceful restart config
Expand Down

0 comments on commit 714ec54

Please sign in to comment.