net/traffic: switch rendezvous hashing from SHA256 to FNV-1a (#19821)

In PR tailscale/corp#30448, we originally decided to break ties using
SHA256 for our rendezvous hashing algorithm. Now that we’ve had some
experience with it, we think that FNV-1a is a better choice. It
distributes bits evenly, it’s much faster, and it doesn’t need to be
cryptographically secure. The FNV designers recommend FNV-1a over the
deprecated FNV-1.

This PR makes the switch and updates the related tests, since changing
the algorithm changes which stable pick gets selected. As of 2026-05,
this is the best time to make this change, since there are almost no
clients in the wild with traffic steering enabled.

Updates #17366
Updates tailscale/corp#29964
Updates tailscale/corp#29966
Updates tailscale/corp#33033

Signed-off-by: Simon Law <sfllaw@tailscale.com>
This commit is contained in:
Simon Law
2026-05-21 10:11:59 -07:00
committed by GitHub
parent aa5da2e5f2
commit 7dabebc691
8 changed files with 22 additions and 8 deletions
+1 -1
View File
@@ -1099,7 +1099,7 @@ tailscale.com/cmd/k8s-operator dependencies: (generated by github.com/tailscale/
hash from compress/zlib+
hash/adler32 from compress/zlib
hash/crc32 from compress/gzip+
hash/fnv from google.golang.org/protobuf/internal/detrand
hash/fnv from google.golang.org/protobuf/internal/detrand+
hash/maphash from go4.org/mem
html from html/template+
html/template from tailscale.com/util/eventbus
+1
View File
@@ -335,6 +335,7 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de
fmt from compress/flate+
hash from crypto+
hash/crc32 from compress/gzip+
hash/fnv from tailscale.com/net/traffic
hash/maphash from go4.org/mem
html from tailscale.com/ipn/ipnlocal+
internal/abi from hash/maphash+
+1
View File
@@ -356,6 +356,7 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de
fmt from compress/flate+
hash from crypto+
hash/crc32 from compress/gzip+
hash/fnv from tailscale.com/net/traffic
hash/maphash from go4.org/mem
html from tailscale.com/ipn/ipnlocal+
internal/abi from hash/maphash+
+1
View File
@@ -665,6 +665,7 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de
hash from compress/zlib+
hash/adler32 from compress/zlib+
hash/crc32 from compress/gzip+
hash/fnv from tailscale.com/net/traffic
hash/maphash from go4.org/mem
html from html/template+
html/template from tailscale.com/util/eventbus
+1
View File
@@ -482,6 +482,7 @@ tailscale.com/cmd/tsidp dependencies: (generated by github.com/tailscale/depawar
hash from crypto+
W hash/adler32 from compress/zlib
hash/crc32 from compress/gzip+
hash/fnv from tailscale.com/net/traffic
hash/maphash from go4.org/mem
html from html/template+
html/template from tailscale.com/util/eventbus+