tailscale/net
Andrea Gottardo 6de6ab015f
net/dns: tweak DoH timeout, limit MaxConnsPerHost, require TLS 1.3 (#13564)
Updates tailscale/tailscale#6148

This is the result of some observations we made today with @raggi. The DNS over HTTPS client currently doesn't cap the number of connections it uses, either in-use or idle. A burst of DNS queries will open multiple connections. Idle connections remain open for 30 seconds (this interval is defined in the dohTransportTimeout constant). For DoH providers like NextDNS which send keep-alives, this means the cellular modem will remain up more than expected to send ACKs if any keep-alives are received while a connection remains idle during those 30 seconds. We can set the IdleConnTimeout to 10 seconds to ensure an idle connection is terminated if no other DNS queries come in after 10 seconds. Additionally, we can cap the number of connections to 1. This ensures that at all times there is only one open DoH connection, either active or idle. If idle, it will be terminated within 10 seconds from the last query.

We also observed all the DoH providers we support are capable of TLS 1.3. We can force this TLS version to reduce the number of packets sent/received each time a TLS connection is established.

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
2024-10-02 09:26:11 -07:00
..
art all: fix new lint warnings from bumping staticcheck 2024-08-22 12:31:08 -07:00
captivedetection net/captivedetection: set Timeout on net.Dialer (#13613) 2024-10-02 15:29:46 +00:00
connstats all: use Go 1.22 range-over-int 2024-04-16 15:32:38 -07:00
dns net/dns: tweak DoH timeout, limit MaxConnsPerHost, require TLS 1.3 (#13564) 2024-10-02 09:26:11 -07:00
dnscache net/dnscache: don't fall back to an IPv6 dial if we don't have IPv6 2024-10-02 10:41:08 -05:00
dnsfallback {control,net}: close idle connections of custom transports 2024-08-05 17:28:15 +01:00
flowtrack net/flowtrack: fix, test String method 2024-06-18 21:44:44 -07:00
ipset go.mod: bump bart 2024-07-08 19:10:44 -07:00
ktimeout net/ktimeout: add a package to set TCP user timeout 2024-02-20 10:49:58 -08:00
memnet net/memnet: export the network name (#9111) 2023-08-28 11:43:51 -07:00
netaddr all: update copyright and license headers 2023-01-27 15:36:29 -08:00
netcheck net/netcheck,wgengine/magicsock: plumb OnlyTCP443 controlknob through netcheck (#13491) 2024-09-17 12:24:42 -07:00
neterror net/neterror, wgengine/magicsock: use UDP GSO and GRO on Linux (#7791) 2023-04-04 16:32:16 -07:00
netkernelconf ipn/{ipnlocal,localapi},net/netkernelconf,client/tailscale,cmd/containerboot: optionally enable UDP GRO forwarding for containers (#12410) 2024-06-10 19:19:03 +01:00
netknob all: update copyright and license headers 2023-01-27 15:36:29 -08:00
netmon all: fix new lint warnings from bumping staticcheck 2024-08-22 12:31:08 -07:00
netns net/netns: remove some logspam by avoiding logging parse errors due to unspecified addresses 2024-07-31 12:34:16 -06:00
netstat all: add test for package comments, fix, add comments as needed 2024-07-10 09:57:00 -07:00
netutil {ipn,net,tsnet}: use tsaddr helpers 2024-09-26 12:17:31 +02:00
packet wgengine/magicsock: actually use AF_PACKET socket for raw disco 2024-09-03 12:50:09 -04:00
ping net/ping: fix ICMP echo code field to 0 2023-09-15 17:08:39 -07:00
portmapper net/portmapper: don't treat 0.0.0.0 as a valid IP 2024-10-01 16:11:47 -05:00
proxymux all: cleanup unused code, part 1 (#10661) 2023-12-20 14:50:30 -08:00
routetable net/{interfaces,netmon}, all: merge net/interfaces package into net/netmon 2024-04-28 07:34:52 -07:00
socks5 net/socks5: support UDP 2024-08-05 09:25:24 -07:00
sockstats net/{interfaces,netmon}, all: merge net/interfaces package into net/netmon 2024-04-28 07:34:52 -07:00
speedtest all: update copyright and license headers 2023-01-27 15:36:29 -08:00
stun ci: enable checklocks workflow for specific packages 2024-06-26 13:55:07 -04:00
stunserver all: use Go 1.22 range-over-int 2024-04-16 15:32:38 -07:00
tcpinfo all: use Go 1.22 range-over-int 2024-04-16 15:32:38 -07:00
tlsdial cmd/tta, vnet: add host firewall, env var support, more tests 2024-08-12 15:32:12 -07:00
tsaddr net/tsaddr: add WithoutExitRoutes and IsExitRoute 2024-09-26 12:17:31 +02:00
tsdial {control,net}: close idle connections of custom transports 2024-08-05 17:28:15 +01:00
tshttpproxy all: use Go 1.22 range-over-int 2024-04-16 15:32:38 -07:00
tstun util/usermetrics: make usermetrics non-global 2024-09-25 15:57:00 +02:00
wsconn go.{mod,sum}: migrate from nhooyr.io/websocket to github.com/coder/websocket 2024-08-14 21:23:49 -07:00