summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJordan Whited <jordan@tailscale.com>2024-08-08 15:38:18 -0700
committerJordan Whited <jordan@tailscale.com>2024-08-08 15:48:19 -0700
commitac0f1cfcf4f14b5c54269616f436339e41e9c6a2 (patch)
treea6bfdd5143c7b548f74915ab6cf9f58ac697da29
parentf23932bd9858539ce4730b413709f4febb5bac93 (diff)
downloadtailscale-jwhited/derp-https-tcp-connect.tar.xz
tailscale-jwhited/derp-https-tcp-connect.zip
net/netcheck: change DERP HTTPS latency measurement to TCP connect timejwhited/derp-https-tcp-connect
HTTPS and ICMP latency are fallbacks when STUN doesn't work. The lowest value wins. When ICMP doesn't work you just get HTTPS. HTTPS latency was way more variable than it needed to be as we were measuring "server processing time" (inclusive of TLS, HTTPS) instead of just TCP connect time. We don't need to perform an HTTPS request, we really just need a TCP ping, but aiming for a simpler change to start. Updates tailscale/corp#22114 Signed-off-by: Jordan Whited <jordan@tailscale.com>
-rw-r--r--net/netcheck/netcheck.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/netcheck/netcheck.go b/net/netcheck/netcheck.go
index 8eb50a61d..0d4f1af99 100644
--- a/net/netcheck/netcheck.go
+++ b/net/netcheck/netcheck.go
@@ -1108,9 +1108,9 @@ func (c *Client) measureHTTPSLatency(ctx context.Context, reg *tailcfg.DERPRegio
}
result.End(c.timeNow())
- // TODO: decide best timing heuristic here.
- // Maybe the server should return the tcpinfo_rtt?
- return result.ServerProcessing, ip, nil
+ // TODO(jwhited): consider simplified TCP RTT. We don't need HTTPS or TLS
+ // involvement above.
+ return result.TCPConnection, ip, nil
}
func (c *Client) measureAllICMPLatency(ctx context.Context, rs *reportState, need []*tailcfg.DERPRegion) error {