-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
windows TCP SACK slow the download speed #10343
Comments
I'm having trouble seeing how a negative value gets passed in. That value could be negative due to casting in snd.go: if !seg.sequenceNumber.LessThan(end) {
return false
}
available := int(seg.sequenceNumber.Size(end))
if available == 0 {
return false
} But because of the What sort of machine are you running on? Is it a 32 or 64 bit machine? |
os is windows 11 |
There is one more question |
It should work on 32 bit Windows, but clearly there's a bug here (likely an overflow). Netstack will be slower than native. And since it is rarely used on Windows, I don't think it's ever been optimized for Windows at all. That huge slowdown isn't normal (and isn't what we see on other systems), and there's also whatever tun2socks is doing that could slow things down. But native will be faster. |
I also suspect that overflow in 32-bit mode causes the length to become a negative number, causing panic. |
Unfortunately I don't think we have cycles to debug and optimize netstack on Windows, but we'd welcome the help if you're up to try. |
I may not have that ability because I have encountered many situations during use that I cannot understand |
Hey, could you try something for me? I have a suspicion about the slowdown from SACK. Can you apply this patch and give me the log output?
It's possible that the endpoint is being setup with a very small MTU. In that case, enabling SACK could shrink the usable MSS enough that it affects throughput. |
sackenable true:
iperf out:
sackenable false:
iperf out:
ipferf raw speed out :
|
Description
on windows 11
when I set tcpip.TCPSACKEnabled(true) I test download speed use iperf3 it just 1G/s
but when I set tcpip.TCPSACKEnabled(false) and test download speed use iperf3 is 3G/s but get panic halfway
follow is panic info:
panic: length < 0
goroutine 112 [running]:
gvisor.dev/gvisor/pkg/tcpip/stack.PacketData.CapLength({0x4290708}, 0x80000840)
D:/gocode/src/gvisor.dev/gvisor/pkg/tcpip/stack/packet_buffer.go:581 +0x5b
gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*sender).splitSeg(0x432ca08, 0x428c788, 0x80000840)
D:/gocode/src/gvisor.dev/gvisor/pkg/tcpip/transport/tcp/snd.go:630 +0x12d
gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*sender).maybeSendSegment(0x432ca08, 0x428c788, 0x80000840, 0x62d1c255)
D:/gocode/src/gvisor.dev/gvisor/pkg/tcpip/transport/tcp/snd.go:899 +0x197
gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*sender).sendData(0x432ca08)
D:/gocode/src/gvisor.dev/gvisor/pkg/tcpip/transport/tcp/snd.go:1022 +0x1bf
gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*Endpoint).sendData(0x4804508, 0x428c788)
D:/gocode/src/gvisor.dev/gvisor/pkg/tcpip/transport/tcp/connect.go:1007 +0x4d
gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*Endpoint).Write(0x4804508, {0xebfff0, 0x40f8b40}, {0x0, 0x0, 0x0, 0x0, {0x0, 0x0, 0x0, ...}})
D:/gocode/src/gvisor.dev/gvisor/pkg/tcpip/transport/tcp/endpoint.go:1663 +0x112
gvisor.dev/gvisor/pkg/tcpip/adapters/gonet.(*TCPConn).Write(0x4311480, {0x46ca000, 0xf000, 0xf000})
D:/gocode/src/gvisor.dev/gvisor/pkg/tcpip/adapters/gonet/gonet.go:389 +0x23a
client-cdn/tun2socks/gvisor-netstack.copyConn({0xec4d54, 0x4311480}, {0xec4b14, 0x459c3e8}, 0x0)
D:/gocode/src/client-cdn/tun2socks/gvisor-netstack/tcp.go:55 +0x138
client-cdn/tun2socks/gvisor-netstack.handleTCP(0x4311480)
D:/gocode/src/client-cdn/tun2socks/gvisor-netstack/tcp.go:42 +0x1f8
client-cdn/tun2socks/gvisor-netstack.Start.func1(0x4040390)
D:/gocode/src/client-cdn/tun2socks/gvisor-netstack/tun2socks.go:153 +0x25f
created by gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*Forwarder).HandlePacket in goroutine 303
D:/gocode/src/gvisor.dev/gvisor/pkg/tcpip/transport/tcp/forwarder.go:98 +0x2c0
adapter is wintun
I routed 192.168.3.35 to wintun gateway
ipfer3 command is: iperf3.exe -c 192.168.3.35 -R
Is this feature related to a specific bug?
No response
Do you have a specific solution in mind?
No response
The text was updated successfully, but these errors were encountered: