From 10f774db9235f6b633c713687faa6e569da1f523 Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Tue, 9 May 2023 17:27:21 +0000 Subject: [PATCH] wgengine/netstack: switch to cubic congestion control See https://github.com/tailscale/tailscale/pull/8106 --- wgengine/netstack/netstack.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wgengine/netstack/netstack.go b/wgengine/netstack/netstack.go index 6161fa422bcf7..ec6a4a1c6e4ca 100644 --- a/wgengine/netstack/netstack.go +++ b/wgengine/netstack/netstack.go @@ -179,6 +179,11 @@ func Create(logf logger.Logf, tundev *tstun.Wrapper, e wgengine.Engine, mc *magi if tcpipErr != nil { return nil, fmt.Errorf("could not enable TCP SACK: %v", tcpipErr) } + congestionOpt := tcpip.CongestionControlOption("cubic") // Reno is used by default + tcpipErr = ipstack.SetTransportProtocolOption(tcp.ProtocolNumber, &congestionOpt) + if tcpipErr != nil { + return nil, fmt.Errorf("could not set TCP congestion control: %v", tcpipErr) + } linkEP := &protectedLinkEndpoint{Endpoint: channel.New(512, tstun.DefaultMTU(), "")} if tcpipProblem := ipstack.CreateNIC(nicID, linkEP); tcpipProblem != nil { return nil, fmt.Errorf("could not create netstack NIC: %v", tcpipProblem)