tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: BSD doesn't track window size changes correctly.



Dennis Ferguson wrote:
...

Notice there's another inconsistency, however.  While the zero window
packet NetBSD sends is carrying data which advances the (NetBSD) sequence
to 4438371, the FreeBSD packets are carrying an ack for 4441251.  FreeBSD
has seen NetBSD packets which are not in that trace, it is reasonable for
FreeBSD to ignore the zero window in those old packets, and there's no way
to tell whether what it is doing is reasonable without seeing the NetBSD
packet with a sequence of 4441251.

I think the only brokenness there is evidence for in that trace is the trace
itself.  There's not enough of the conversation to figure out what is going
on.

09:03:38.011416 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], ack 4436931, win 7520, options [nop,nop,TS val 1076481 ecr 249], length 0 09:03:38.019028 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], ack 4436931, win 8033, options [nop,nop,TS val 1076482 ecr 249], length 0 09:03:38.020855 IP NetBSD.ssh > FreeBSD.35421: Flags [.], ack 230249, win 295, options [nop,nop,TS val 249 ecr 1076458], length 0 09:03:38.053904 IP NetBSD.ssh > FreeBSD.35421: Flags [.], ack 232917, win 211, options [nop,nop,TS val 249 ecr 1076458], length 0 09:03:38.080020 IP NetBSD.ssh > FreeBSD.35421: Flags [.], ack 235568, win 128, options [nop,nop,TS val 249 ecr 1076463], length 0 09:03:38.112052 IP NetBSD.ssh > FreeBSD.35421: Flags [.], ack 238424, win 39, options [nop,nop,TS val 249 ecr 1076464], length 0 09:03:38.222896 IP NetBSD.ssh > FreeBSD.35421: Flags [.], seq 4438371:4439811, ack 238424, win 39, options [nop,nop,TS val 249 ecr 1076479], length 1440 09:03:38.223740 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], seq 239664:239672, ack 4436931, win 8280, options [nop,nop,TS val 1076502 ecr 249,nop,nop,sack 1 {4438371:4439811}], length 8 09:03:38.225524 IP NetBSD.ssh > FreeBSD.35421: Flags [.], seq 4439811:4441251, ack 238424, win 39, options [nop,nop,TS val 249 ecr 1076479], length 1440 09:03:38.226304 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], ack 4436931, win 8280, options [nop,nop,TS val 1076502 ecr 249,nop,nop,sack 1 {4438371:4441251}], length 0 09:03:38.416891 IP NetBSD.ssh > FreeBSD.35421: Flags [.], ack 239664, win 0, options [nop,nop,TS val 249 ecr 1076479], length 0 09:03:38.437943 IP NetBSD.ssh > FreeBSD.35421: Flags [.], seq 4436931:4438371, ack 239672, win 0, options [nop,nop,TS val 249 ecr 1076502], length 1440 09:03:38.439168 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], seq 239672:241112, ack 4441251, win 7740, options [nop,nop,TS val 1076524 ecr 249], length 1440 09:03:38.439290 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], seq 241112:242552, ack 4441251, win 8139, options [nop,nop,TS val 1076524 ecr 249], length 1440 09:03:38.439412 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], seq 242552:243992, ack 4441251, win 8139, options [nop,nop,TS val 1076524 ecr 249], length 1440 09:03:38.439535 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], seq 243992:245432, ack 4441251, win 8139, options [nop,nop,TS val 1076524 ecr 249], length 1440 09:03:38.439657 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], seq 245432:246872, ack 4441251, win 8139, options [nop,nop,TS val 1076524 ecr 249], length 1440 09:03:38.439780 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], seq 246872:248312, ack 4441251, win 8139, options [nop,nop,TS val 1076524 ecr 249], length 1440 09:03:38.439902 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], seq 248312:249752, ack 4441251, win 8139, options [nop,nop,TS val 1076524 ecr 249], length 1440 09:03:38.440024 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], seq 249752:251192, ack 4441251, win 8139, options [nop,nop,TS val 1076524 ecr 249], length 1440 09:03:38.440147 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], seq 251192:252632, ack 4441251, win 8139, options [nop,nop,TS val 1076524 ecr 249], length 1440 09:03:38.440269 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], seq 252632:254072, ack 4441251, win 8139, options [nop,nop,TS val 1076524 ecr 249], length 1440 09:03:38.440393 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], seq 254072:255512, ack 4441251, win 8139, options [nop,nop,TS val 1076524 ecr 249], length 1440 09:03:38.440516 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], seq 255512:256952, ack 4441251, win 8139, options [nop,nop,TS val 1076524 ecr 249], length 1440 09:03:38.440638 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], seq 256952:258392, ack 4441251, win 8139, options [nop,nop,TS val 1076524 ecr 249], length 1440 09:03:38.440761 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], seq 258392:259832, ack 4441251, win 8139, options [nop,nop,TS val 1076524 ecr 249], length 1440 09:03:38.440885 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], seq 259832:261272, ack 4441251, win 8139, options [nop,nop,TS val 1076524 ecr 249], length 1440 09:03:38.441007 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], seq 261272:262712, ack 4441251, win 8139, options [nop,nop,TS val 1076524 ecr 249], length 1440 09:03:38.441143 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], seq 262712:264152, ack 4441251, win 8139, options [nop,nop,TS val 1076524 ecr 249], length 1440 09:03:38.441250 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], seq 264152:265592, ack 4441251, win 8139, options [nop,nop,TS val 1076524 ecr 249], length 1440 09:03:39.128537 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], seq 239672:241112, ack 4441251, win 8280, options [nop,nop,TS val 1076593 ecr 249], length 1440 09:03:39.720321 IP NetBSD.ssh > FreeBSD.35421: Flags [.], seq 4436931:4438371, ack 239672, win 0, options [nop,nop,TS val 252 ecr 1076502], length 1440 09:03:39.721146 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], ack 4441251, win 8280, options [nop,nop,TS val 1076652 ecr 249], length 0 09:03:39.932057 IP NetBSD.ssh > FreeBSD.35421: Flags [.], ack 239672, win 0, options [nop,nop,TS val 252 ecr 1076502], length 0 09:03:42.722687 IP NetBSD.ssh > FreeBSD.35421: Flags [.], seq 4436931:4438371, ack 239672, win 0, options [nop,nop,TS val 258 ecr 1076502], length 1440 09:03:42.723459 IP FreeBSD.35421 > NetBSD.ssh: Flags [.], ack 4441251, win 8280, options [nop,nop,TS val 1076952 ecr 252], length 0 09:03:42.937384 IP NetBSD.ssh > FreeBSD.35421: Flags [.], seq 4441251:4442691, ack 239672, win 0, options [nop,nop,TS val 258 ecr 1076952], length 1440

Now when I modified FreeBSD's TCP to track all window changes (NetBSD
uses the same logic), not just those that increased the window, the
behaviour observed was this:

16:43:12.670784 IP FreeBSD.56171 > NetBSD.ssh: . 216603:217839(1236) ack 4387088 win 8280 <nop,nop,timestamp 259836 269,nop,nop,sack 1 {4388528:4391408}> 16:43:12.672440 IP NetBSD.ssh > FreeBSD.56171: . 4387088:4388528(1440) ack 213747 win 157 <nop,nop,timestamp 269 259812> 16:43:12.673315 IP FreeBSD.56171 > NetBSD.ssh: . ack 4391408 win 7740 <nop,nop,timestamp 259836 269> 16:43:12.675599 IP FreeBSD.56171 > NetBSD.ssh: . ack 4391408 win 8280 <nop,nop,timestamp 259836 269> 16:43:12.799261 IP NetBSD.ssh > FreeBSD.56171: . ack 216603 win 68 <nop,nop,timestamp 270 259812> 16:43:12.900628 IP NetBSD.ssh > FreeBSD.56171: . 4391408:4392848(1440) ack 217839 win 30 <nop,nop,timestamp 270 259836> 16:43:12.903525 IP NetBSD.ssh > FreeBSD.56171: . 4392848:4394288(1440) ack 217839 win 30 <nop,nop,timestamp 270 259836> 16:43:12.904630 IP FreeBSD.56171 > NetBSD.ssh: . 217839:218799(960) ack 4394288 win 8100 <nop,nop,timestamp 259859 270> 16:43:12.906231 IP NetBSD.ssh > FreeBSD.56171: . 4394288:4395728(1440) ack 217839 win 30 <nop,nop,timestamp 270 259836> 16:43:12.907031 IP FreeBSD.56171 > NetBSD.ssh: . ack 4395728 win 8280 <nop,nop,timestamp 259859 270> 16:43:13.131700 IP NetBSD.ssh > FreeBSD.56171: . 4395728:4397168(1440) ack 218799 win 0 <nop,nop,timestamp 270 259859> 16:43:13.134319 IP NetBSD.ssh > FreeBSD.56171: . 4397168:4398608(1440) ack 218799 win 0 <nop,nop,timestamp 270 259859> 16:43:13.135221 IP FreeBSD.56171 > NetBSD.ssh: . ack 4398608 win 8100 <nop,nop,timestamp 259882 270> 16:43:13.136843 IP NetBSD.ssh > FreeBSD.56171: . 4398608:4400048(1440) ack 218799 win 0 <nop,nop,timestamp 270 259859> 16:43:13.137692 IP FreeBSD.56171 > NetBSD.ssh: . ack 4400048 win 8280 <nop,nop,timestamp 259882 270> 16:43:13.139551 IP NetBSD.ssh > FreeBSD.56171: . 4400048:4401488(1440) ack 218799 win 0 <nop,nop,timestamp 270 259859> 16:43:13.142504 IP NetBSD.ssh > FreeBSD.56171: . 4401488:4402928(1440) ack 218799 win 0 <nop,nop,timestamp 270 259859> 16:43:13.143268 IP FreeBSD.56171 > NetBSD.ssh: . ack 4402928 win 7993 <nop,nop,timestamp 259883 270>

However that was not a perfect change because the connection ends like this:
16:43:31.734465 IP FreeBSD.56171 > NetBSD.ssh: . 477711:479143(1432) ack 5174804 win 7113 <nop,nop,timestamp 261742 308> 16:43:31.739882 IP FreeBSD.56171 > NetBSD.ssh: . ack 5174804 win 7625 <nop,nop,timestamp 261743 308> 16:43:31.744796 IP FreeBSD.56171 > NetBSD.ssh: . ack 5174804 win 8157 <nop,nop,timestamp 261743 308> 16:43:31.905789 IP NetBSD.ssh > FreeBSD.56171: . ack 453231 win 0 <nop,nop,timestamp 308 261704> 16:43:31.956684 IP NetBSD.ssh > FreeBSD.56171: . 5176244:5177684(1440) ack 453231 win 0 <nop,nop,timestamp 308 261704> 16:43:31.957530 IP FreeBSD.56171 > NetBSD.ssh: . ack 5174804 win 8280 <nop,nop,timestamp 261765 308,nop,nop,sack 1 {5176244:5177684}> 16:43:31.958955 IP NetBSD.ssh > FreeBSD.56171: . ack 453231 win 0 <nop,nop,timestamp 308 261704> 16:43:32.174523 IP NetBSD.ssh > FreeBSD.56171: . 5174804:5176244(1440) ack 453231 win 0 <nop,nop,timestamp 308 261765> 16:43:32.175434 IP FreeBSD.56171 > NetBSD.ssh: . ack 5177684 win 7920 <nop,nop,timestamp 261786 308> 16:43:32.175500 IP FreeBSD.56171 > NetBSD.ssh: . ack 5177684 win 8280 <nop,nop,timestamp 261786 308> 16:43:32.177426 IP NetBSD.ssh > FreeBSD.56171: . 5177684:5179124(1440) ack 453231 win 0 <nop,nop,timestamp 308 261765> 16:43:32.185135 IP NetBSD.ssh > FreeBSD.56171: . ack 453231 win 128 <nop,nop,timestamp 308 261765> 16:43:32.186063 IP FreeBSD.56171 > NetBSD.ssh: . 453231:454671(1440) ack 5179124 win 8280 <nop,nop,timestamp 261787 308> 16:43:32.186184 IP FreeBSD.56171 > NetBSD.ssh: . 454671:456111(1440) ack 5179124 win 8280 <nop,nop,timestamp 261787 308> 16:43:32.186289 IP FreeBSD.56171 > NetBSD.ssh: . 456111:457327(1216) ack 5179124 win 8280 <nop,nop,timestamp 261787 308> 16:43:32.392350 IP NetBSD.ssh > FreeBSD.56171: . 5179124:5180564(1440) ack 453231 win 128 <nop,nop,timestamp 309 261786> 16:43:32.394970 IP NetBSD.ssh > FreeBSD.56171: . 5180564:5182004(1440) ack 453231 win 128 <nop,nop,timestamp 309 261786> 16:43:32.395842 IP FreeBSD.56171 > NetBSD.ssh: . ack 5182004 win 8100 <nop,nop,timestamp 261808 309> 16:43:32.397691 IP NetBSD.ssh > FreeBSD.56171: . 5182004:5183444(1440) ack 453231 win 128 <nop,nop,timestamp 309 261786> 16:43:32.408085 IP FreeBSD.56171 > NetBSD.ssh: . ack 5183444 win 8280 <nop,nop,timestamp 261810 309> 16:43:32.416708 IP NetBSD.ssh > FreeBSD.56171: . 5183444:5184884(1440) ack 454671 win 83 <nop,nop,timestamp 309 261787> 16:43:32.419593 IP NetBSD.ssh > FreeBSD.56171: . 5184884:5186324(1440) ack 454671 win 83 <nop,nop,timestamp 309 261787> 16:43:32.420415 IP FreeBSD.56171 > NetBSD.ssh: . ack 5186324 win 8100 <nop,nop,timestamp 261811 309> 16:43:32.439702 IP NetBSD.ssh > FreeBSD.56171: . ack 457327 win 0 <nop,nop,timestamp 309 261787> 16:43:32.610095 IP NetBSD.ssh > FreeBSD.56171: . ack 457327 win 0 <nop,nop,timestamp 309 261787> 16:43:32.622473 IP NetBSD.ssh > FreeBSD.56171: . ack 457327 win 0 <nop,nop,timestamp 309 261787> 16:43:32.634325 IP NetBSD.ssh > FreeBSD.56171: . ack 457327 win 0 <nop,nop,timestamp 309 261787> 16:43:33.446151 IP FreeBSD.56171 > NetBSD.ssh: . ack 5186324 win 8280 <nop,nop,timestamp 261914 309> 16:43:33.660807 IP NetBSD.ssh > FreeBSD.56171: . ack 457327 win 0 <nop,nop,timestamp 311 261787> 16:43:34.410749 IP NetBSD.ssh > FreeBSD.56171: . 5179124:5180564(1440) ack 457327 win 0 <nop,nop,timestamp 313 261787> 16:43:34.411650 IP FreeBSD.56171 > NetBSD.ssh: . ack 5186324 win 8280 <nop,nop,timestamp 262010 311> 16:43:34.625870 IP NetBSD.ssh > FreeBSD.56171: . ack 457327 win 0 <nop,nop,timestamp 313 261787> 16:43:37.412651 IP NetBSD.ssh > FreeBSD.56171: . 5179124:5180564(1440) ack 457327 win 0 <nop,nop,timestamp 319 261787> 16:43:37.413365 IP FreeBSD.56171 > NetBSD.ssh: . ack 5186324 win 8280 <nop,nop,timestamp 262310 313> 16:43:37.628045 IP NetBSD.ssh > FreeBSD.56171: . ack 457327 win 0 <nop,nop,timestamp 319 261787> 16:43:43.414789 IP NetBSD.ssh > FreeBSD.56171: . 5179124:5179648(524) ack 457327 win 0 <nop,nop,timestamp 331 261787> 16:43:43.415237 IP FreeBSD.56171 > NetBSD.ssh: . ack 5186324 win 8280 <nop,nop,timestamp 262911 319> 16:43:43.629769 IP NetBSD.ssh > FreeBSD.56171: . ack 457327 win 0 <nop,nop,timestamp 331 261787> 16:43:55.423047 IP NetBSD.ssh > FreeBSD.56171: . 5179124:5179648(524) ack 457327 win 0 <nop,nop,timestamp 355 261787> 16:43:55.423645 IP FreeBSD.56171 > NetBSD.ssh: . ack 5186324 win 8280 <nop,nop,timestamp 264112 331> 16:43:55.637501 IP NetBSD.ssh > FreeBSD.56171: . ack 457327 win 0 <nop,nop,timestamp 355 261787>

and eventually is reset after a couple of minutes of those last three
packets being replayed.

Darren



Home | Main Index | Thread Index | Old Index