Skip to content

Commit f4cdcfb

Browse files
authored
wgengine/netstack: switch to cubic congestion control (#24)
See tailscale#8106
1 parent 18faafc commit f4cdcfb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

wgengine/netstack/netstack.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ func Create(logf logger.Logf, tundev *tstun.Wrapper, e wgengine.Engine, mc *magi
179179
if tcpipErr != nil {
180180
return nil, fmt.Errorf("could not enable TCP SACK: %v", tcpipErr)
181181
}
182+
congestionOpt := tcpip.CongestionControlOption("cubic") // Reno is used by default
183+
tcpipErr = ipstack.SetTransportProtocolOption(tcp.ProtocolNumber, &congestionOpt)
184+
if tcpipErr != nil {
185+
return nil, fmt.Errorf("could not set TCP congestion control: %v", tcpipErr)
186+
}
182187
linkEP := &protectedLinkEndpoint{Endpoint: channel.New(512, tstun.DefaultMTU(), "")}
183188
if tcpipProblem := ipstack.CreateNIC(nicID, linkEP); tcpipProblem != nil {
184189
return nil, fmt.Errorf("could not create netstack NIC: %v", tcpipProblem)

0 commit comments

Comments
 (0)