diff options
| author | Jordan Whited <jordan@tailscale.com> | 2024-01-23 09:37:32 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-23 09:37:32 -0800 |
| commit | 8b47322acc2f3dabff40cbc4dcee9576f4d19bc5 (patch) | |
| tree | c3455d1242abbf27e5f1bb623802c4c846c57bb1 /control/controlknobs/controlknobs.go | |
| parent | 0e2cb76abe1867736fe2aea89d3bc5bbdb5911dd (diff) | |
| download | tailscale-8b47322acc2f3dabff40cbc4dcee9576f4d19bc5.tar.xz tailscale-8b47322acc2f3dabff40cbc4dcee9576f4d19bc5.zip | |
wgengine/magicsock: implement probing of UDP path lifetime (#10844)
This commit implements probing of UDP path lifetime on the tail end of
an active direct connection. Probing configuration has two parts -
Cliffs, which are various timeout cliffs of interest, and
CycleCanStartEvery, which limits how often a probing cycle can start,
per-endpoint. Initially a statically defined default configuration will
be used. The default configuration has cliffs of 10s, 30s, and 60s,
with a CycleCanStartEvery of 24h. Probing results are communicated via
clientmetric counters. Probing is off by default, and can be enabled
via control knob. Probing is purely informational and does not yet
drive any magicsock behaviors.
Updates #540
Signed-off-by: Jordan Whited <jordan@tailscale.com>
Diffstat (limited to 'control/controlknobs/controlknobs.go')
| -rw-r--r-- | control/controlknobs/controlknobs.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/control/controlknobs/controlknobs.go b/control/controlknobs/controlknobs.go index f9ed69812..6a36c9261 100644 --- a/control/controlknobs/controlknobs.go +++ b/control/controlknobs/controlknobs.go @@ -69,6 +69,10 @@ type Knobs struct { // renewing node keys without breaking connections. // http://go/seamless-key-renewal SeamlessKeyRenewal atomic.Bool + + // ProbeUDPLifetime is whether the node should probe UDP path lifetime on + // the tail end of an active direct connection in magicsock. + ProbeUDPLifetime atomic.Bool } // UpdateFromNodeAttributes updates k (if non-nil) based on the provided self @@ -95,6 +99,7 @@ func (k *Knobs) UpdateFromNodeAttributes(selfNodeAttrs []tailcfg.NodeCapability, forceIPTables = has(tailcfg.NodeAttrLinuxMustUseIPTables) forceNfTables = has(tailcfg.NodeAttrLinuxMustUseNfTables) seamlessKeyRenewal = has(tailcfg.NodeAttrSeamlessKeyRenewal) + probeUDPLifetime = has(tailcfg.NodeAttrProbeUDPLifetime) ) if has(tailcfg.NodeAttrOneCGNATEnable) { @@ -116,6 +121,7 @@ func (k *Knobs) UpdateFromNodeAttributes(selfNodeAttrs []tailcfg.NodeCapability, k.LinuxForceIPTables.Store(forceIPTables) k.LinuxForceNfTables.Store(forceNfTables) k.SeamlessKeyRenewal.Store(seamlessKeyRenewal) + k.ProbeUDPLifetime.Store(probeUDPLifetime) } // AsDebugJSON returns k as something that can be marshalled with json.Marshal @@ -138,5 +144,6 @@ func (k *Knobs) AsDebugJSON() map[string]any { "LinuxForceIPTables": k.LinuxForceIPTables.Load(), "LinuxForceNfTables": k.LinuxForceNfTables.Load(), "SeamlessKeyRenewal": k.SeamlessKeyRenewal.Load(), + "ProbeUDPLifetime": k.ProbeUDPLifetime.Load(), } } |
