> Yep, from external interface (me to remote): > 10:19:22.885036 213.155.153.61.37850 > 128.32.18.176.33186: S [tcp sum ok] > 1400725148:1400725148(0) win 16960 <mss 1460,nop,wscale 4,nop,nop, > sackOK> (ttl 127, id 2006) > This windows XP box (mine, on my desk) was not previously tweaked in anyway. > All Windows Updates installed, except .Net and WMP9. I have now changed it > to turn SACK off, but can easily turn it back on for any testing.
Egads. A scale of 4. That is a stack tuned for the TCP benchmarks if I ever saw one. > I have sent files to Daniel. Do you want same Mike ? Please apply this diff from -current first. If it doesn't work, then ya, the pcap would be useful. Index: sys/net/pf.c =================================================================== RCS file: /cvs/src/sys/net/pf.c,v retrieving revision 1.347 retrieving revision 1.348 diff -u -r1.347 -r1.348 --- sys/net/pf.c 12 May 2003 17:49:03 -0000 1.347 +++ sys/net/pf.c 12 May 2003 22:53:47 -0000 1.348 @@ -2145,9 +2145,16 @@ s->src.seqhi++; s->src.wscale = pf_get_wscale(m, off, th->th_off, af); } + s->src.max_win = MAX(ntohs(th->th_win), 1); + if (s->src.wscale & PF_WSCALE_MASK) { + /* Remove scale factor from initial window */ + int win = s->src.max_win; + win += 1 << (s->src.wscale & PF_WSCALE_MASK); + s->src.max_win = (win - 1) >> + (s->src.wscale & PF_WSCALE_MASK); + } if (th->th_flags & TH_FIN) s->src.seqhi++; - s->src.max_win = MAX(ntohs(th->th_win), 1); s->dst.seqlo = 0; /* Haven't seen these yet */ s->dst.seqhi = 1; s->dst.max_win = 1; @@ -2989,7 +2996,24 @@ end = seq + pd->p_len; if (th->th_flags & TH_SYN) { end++; - src->wscale = pf_get_wscale(m, off, th->th_off, pd->af); + if (dst->wscale & PF_WSCALE_FLAG) { + src->wscale = pf_get_wscale(m, off, th->th_off, + pd->af); + if (src->wscale & PF_WSCALE_FLAG) { + /* Remove scale factor from initial + * window */ + sws = src->wscale & PF_WSCALE_MASK; + win = ((u_int32_t)win + (1 << sws) - 1) + >> sws; + dws = dst->wscale & PF_WSCALE_MASK; + } else { + /* fixup other window */ + dst->max_win <<= dst->wscale & + PF_WSCALE_MASK; + /* in case of a retrans SYN|ACK */ + dst->wscale = 0; + } + } } if (th->th_flags & TH_FIN) end++; @@ -3052,8 +3076,8 @@ SEQ_GEQ(seq, src->seqlo - (dst->max_win << dws)) && /* Retrans: not more than one window back */ (ackskew >= -MAXACKWINDOW) && - /* Acking not more than one window back */ - (ackskew <= MAXACKWINDOW)) { + /* Acking not more than one reassembled fragment backwards */ + (ackskew <= (MAXACKWINDOW << dws))) { /* Acking not more than one window forward */ (*state)->packets++;