Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BPF] make conntrack timeouts configurable #9607

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tomastigera
Copy link
Contributor

@tomastigera tomastigera commented Dec 17, 2024

BPFConntrackTimers overides the default values for the specified conntrack timer if
set. It is a key-value make, where each value can be either a duration or `auto` to
pick the value from a Linux conntrack timeout.

Possible values for the keys are: CreationGracePeriod, TCPPreEstablished,
TCPEstablished, TCPFinsSeen, TCPResetSeen, UDPLastSeen, GenericIPLastSeen,
ICMPLastSeen.

Unset or incorrect values are replaced by the default values with a warning log for
incorrect values.

Current auto mappings:

TCPPreEstablished: nf_conntrack_tcp_timeout_syn_sent
TCPEstablished:    nf_conntrack_tcp_timeout_established
TCPFinsSeen:       nf_conntrack_tcp_timeout_time_wait
GenericIPLastSeen: nf_conntrack_generic_timeout
ICMPLastSeen:      nf_conntrack_icmp_timeout

If there is no mapping, 'auto' is replaced by the default value.

[Default:
     CreationGracePeriod: 10s
     TCPPreEstablished:   20s
     TCPEstablished:      1h
     TCPFinsSeen:         auto (30s is default)
     TCPResetSeen:        40s
     UDPLastSeen:         60s
     GenericIPLastSeen:   10m
     ICMPLastSeen:        5s
]

refs #9372

Description

Related issues/PRs

Todos

  • Tests
  • Documentation
  • Release note

Release Note

ebpf: conntrack timers are configurable, closed TCP connections are closed now by default after /proc/sys/net/netfilter/nf_conntrack_tcp_timeout_time_wait seconds (120 by default) up from 30s.

Reminder for the reviewer

Make sure that this PR has the correct labels and milestone set.

Every PR needs one docs-* label.

  • docs-pr-required: This change requires a change to the documentation that has not been completed yet.
  • docs-completed: This change has all necessary documentation completed.
  • docs-not-required: This change has no user-facing impact and requires no docs.

Every PR needs one release-note-* label.

  • release-note-required: This PR has user-facing changes. Most PRs should have this label.
  • release-note-not-required: This PR has no user-facing changes.

Other optional labels:

  • cherry-pick-candidate: This PR should be cherry-picked to an earlier release. For bug fixes only.
  • needs-operator-pr: This PR is related to install and requires a corresponding change to the operator.

@tomastigera tomastigera requested a review from a team as a code owner December 17, 2024 01:07
@marvin-tigera marvin-tigera added this to the Calico v3.30.0 milestone Dec 17, 2024
@marvin-tigera marvin-tigera added release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Dec 17, 2024
@tomastigera tomastigera added docs-not-required Docs not required for this change and removed docs-pr-required Change is not yet documented labels Dec 17, 2024
Copy link
Member

@sridhartigera sridhartigera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

BPFConntrackTimers overides the default values for the specified conntrack timer if
set. It is a struct of values, where each value can be either a duration or `auto` to
pick the value from a Linux conntrack timeout.

Possible values for the keys are: CreationGracePeriod, TCPPreEstablished,
TCPEstablished, TCPFinsSeen, TCPResetSeen, UDPLastSeen, GenericIPLastSeen,
ICMPLastSeen.

Unset or incorrect values are replaced by the default values with a warning log for
incorrect values.

Current auto mappings:

TCPPreEstablished: nf_conntrack_tcp_timeout_syn_sent
TCPEstablished:    nf_conntrack_tcp_timeout_established
TCPFinsSeen:       nf_conntrack_tcp_timeout_time_wait
GenericIPLastSeen: nf_conntrack_generic_timeout
ICMPLastSeen:      nf_conntrack_icmp_timeout

If there is no mapping, 'auto' is replaced by the default value.

[Default:
     CreationGracePeriod: 10s
     TCPPreEstablished:   20s
     TCPEstablished:      1h
     TCPFinsSeen:         auto (30s is default)
     TCPResetSeen:        40s
     UDPLastSeen:         60s
     GenericIPLastSeen:   10m
     ICMPLastSeen:        5s
]
@tomastigera tomastigera force-pushed the tomas-bpf-ct-timeouts branch from b8e9ba7 to dd2d130 Compare December 26, 2024 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-candidate docs-not-required Docs not required for this change release-note-required Change has user-facing impact (no matter how small)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants