You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/ipn
Simon Law e84e58c567 ipn/ipnlocal: use rendezvous hashing to traffic-steer exit nodes
With auto exit nodes enabled, the client picks exit nodes from the
ones advertised in the network map. Usually, it picks the one with the
highest priority score, but when the top spot is tied, it used to pick
randomly. Then, once it made a selection, it would strongly prefer to
stick with that exit node. It wouldn’t even consider another exit node
unless the client was shutdown or the exit node went offline. This is
to prevent flapping, where a client constantly chooses a different
random exit node.

The major problem with this algorithm is that new exit nodes don’t get
selected as often as they should. In fact, they wouldn’t even move
over if a higher scoring exit node appeared.

Let’s say that you have an exit node and it’s overloaded. So you spin
up a new exit node, right beside your existing one, in the hopes that
the traffic will be split across them. But since the client had this
strong affinity, they stick with the exit node they know and love.

Using rendezvous hashing, we can have different clients spread
their selections equally across their top scoring exit nodes. When an
exit node shuts down, its clients will spread themselves evenly to
their other equal options. When an exit node starts, a proportional
number of clients will migrate to their new best option.

Read more: https://en.wikipedia.org/wiki/Rendezvous_hashing

The trade-off is that starting up a new exit node may cause some
clients to move over, interrupting their existing network connections.
So this change is only enabled for tailnets with `traffic-steering`
enabled.

Updates tailscale/corp#29966
Fixes #16551

Signed-off-by: Simon Law <sfllaw@tailscale.com>
5 months ago
..
auditlog ipn/ipnext: remove some interface indirection to add hooks 8 months ago
conffile ipn/conffile: don't depend on hujson on iOS/Android 1 year ago
desktop ipn/ipnext: remove some interface indirection to add hooks 8 months ago
ipnauth ipn/{ipnauth,ipnlocal,localapi}: make EditPrefs return an error if changing exit node is restricted by policy 6 months ago
ipnext ipn/ipnlocal: make GetExt work earlier, before extension init 7 months ago
ipnlocal ipn/ipnlocal: use rendezvous hashing to traffic-steer exit nodes 5 months ago
ipnserver ipn: add missing entries for OpenBSD 6 months ago
ipnstate cmd/tailscale, ipn/ipnstate, wgengine/magicsock: update ping output for peer relay (#16515) 6 months ago
lapitest ipn/ipn{server,test}: extract the LocalAPI test client and server into ipntest 8 months ago
localapi ipn/ipnlocal: sort tailscale debug peer-relay-servers slice (#16579) 5 months ago
policy ipn,tailconfig: clean up unreleased and removed app connector service 2 years ago
store ipn/store: make StateStore.All optional (#16409) 6 months ago
backend.go ipn: add watch opt to include actions in health messages 7 months ago
conf.go ipn: ensure that conffile is source of truth for advertised services. (#15361) 9 months ago
doc.go ipn: generate LoginProfileView and use it instead of *LoginProfile where appropriate 11 months ago
ipn_clone.go cmd/tailscale/cli,ipn,ipn/ipnlocal: add AutoExitNode preference for automatic exit node selection 6 months ago
ipn_test.go all: do not depend on the testing package 2 years ago
ipn_view.go cmd/tailscale/cli,ipn,ipn/ipnlocal: add AutoExitNode preference for automatic exit node selection 6 months ago
prefs.go ipn: move ParseAutoExitNodeID from ipn/ipnlocal to ipn 6 months ago
prefs_test.go ipn: move ParseAutoExitNodeID from ipn/ipnlocal to ipn 6 months ago
serve.go tailcfg: add ServiceName 11 months ago
serve_test.go scripts/check_license_headers.sh: delete, rewrite as a Go test 6 months ago
store.go tailcfg: report StateEncrypted in Hostinfo (#16434) 6 months ago
store_test.go ipn/store: automatically migrate between plaintext and encrypted state (#16318) 6 months ago