9front - general discussion about 9front
 help / color / mirror / Atom feed
* Bug in tcp.c(?) window sizes
@ 2019-05-22  3:42 Joe M
  2019-05-22 20:13 ` Joe M
  0 siblings, 1 reply; 2+ messages in thread
From: Joe M @ 2019-05-22  3:42 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 503 bytes --]

Hello,

I am testing with a tcp client from 9front. When the tcp server
(someone else) sends a SYN ACK with a window size lesser than what we
sent in the SYN and without a scale, we are using a much lesser window
size in the ACK.

tcp Client: SYN window size = 65536, scale = 4
tcp server: SYN ACK window size = 8190, no scale
our response: ACK window size = 4095, no scale

Shouldn't our ACK use atleast 8190?

I am attaching the wireshark .pcap file with the relevant packets.

Hope it helps.

Thanks

[-- Attachment #2: incorrecttcpwindow.pcap --]
[-- Type: application/vnd.tcpdump.pcap, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug in tcp.c(?) window sizes
  2019-05-22  3:42 Bug in tcp.c(?) window sizes Joe M
@ 2019-05-22 20:13 ` Joe M
  0 siblings, 0 replies; 2+ messages in thread
From: Joe M @ 2019-05-22 20:13 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 625 bytes --]

Fixed, thanks to cinap

On Tue, May 21, 2019 at 8:42 PM Joe M <joe9mail@gmail.com> wrote:
>
> Hello,
>
> I am testing with a tcp client from 9front. When the tcp server
> (someone else) sends a SYN ACK with a window size lesser than what we
> sent in the SYN and without a scale, we are using a much lesser window
> size in the ACK.
>
> tcp Client: SYN window size = 65536, scale = 4
> tcp server: SYN ACK window size = 8190, no scale
> our response: ACK window size = 4095, no scale
>
> Shouldn't our ACK use atleast 8190?
>
> I am attaching the wireshark .pcap file with the relevant packets.
>
> Hope it helps.
>
> Thanks

[-- Attachment #2: fixed_incorrecttcpwindow.pcap --]
[-- Type: application/vnd.tcpdump.pcap, Size: 10877 bytes --]

[-- Attachment #3: smarter_window_scaling.patch --]
[-- Type: text/x-patch, Size: 635 bytes --]

# HG changeset patch
# User joe
# Date 1558555901 25200
#      Wed May 22 13:11:41 2019 -0700
# Node ID 7063e86b449095b69630756e7e55fdc054eecbb1
# Parent  217a47c1f3b4831c52a03bd106cc3d936ac512c8
disable window scaling when the server does not support it

diff -r 217a47c1f3b4 -r 7063e86b4490 sys/src/9/ip/tcp.c
--- a/sys/src/9/ip/tcp.c	Fri May 10 14:24:56 2019 -0700
+++ b/sys/src/9/ip/tcp.c	Wed May 22 13:11:41 2019 -0700
@@ -3032,6 +3032,9 @@
 	}
 
 	tcb->snd.wnd = seg->wnd;
+	/* if the server does not support ws option, disable window scaling */
+	if (seg->ws == 0)
+		tcb->scale = tcb->snd.scale = 0;
 	initialwindow(tcb);
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-22 20:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-22  3:42 Bug in tcp.c(?) window sizes Joe M
2019-05-22 20:13 ` Joe M

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).