Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jan 1997 07:54:05 +0700
From:      Eka Kelana <eka@werty.wasantara.net.id>
To:        freebsd-bugs@freebsd.org
Cc:        mbarkah@hemi.com, freebsd-hackers@freebsd.org, dg@root.com
Subject:   Re: bug in setsockopt()... ? 
Message-ID:  <25801E10313@bandung.wasantara.net.id>

next in thread | raw e-mail | index | archive | help
>>I've observed that in FreeBSD, after a connect(), the buffer size 
>>is adjusted according to the MTU of the connecting interface inde-
>>pendent of the socket buffer high water mark. Perhaps the intent
>>is to automatically reserve reasonable buffer sizes based on the
>>interface MTU. 
>
>   This is actually a bug that Garrett has on his whiteboard...
>

I have observed this behaviour and found this:

1. The minimum buffer size (window size) is 17820. Setting socket high water
mark below this value will affect nothing.

2. The first window size advertised by the sender (in the first SYN segment)
will always be 16384. This is the default socket buffer size. Even changing
the sender socket buffer size, wouldn't change the window size in this first
SYN segment.

3. The window size advertised by the receiver in the next SYN|ACK segment,
will be whatever the receiver socket buffer size. A process can change this
size to a value beyond 17280 but not to a value below 17280, as I found in
point #1. 

4. The next ACK segment and the rest segment sent by the sender will have
window size of 17280. 

Here I put the first five output lines resulted from running tcpdump while
sending a packet:

14:34:52.115081 shuttle.mad_dog.net.id.1049 >
Empritz.mad_dog.net.id.commplex-link: S 1711296001:1711296001(0) win 16384
<mss 1460,nop,wscale0,nop,nop,timestamp|

14:34:52.116329 Empritz.mad_dog.net.id.commplex-link >
shuttle.mad_dog.net.id.1049: S 712000001:712000001(0) ack 1711296002 win 0
<mss 1460,nop,wscale1,nop,nop,timestamp|

14:34:52.116634 shuttle.mad_dog.net.id.1049 >
Empritz.mad_dog.net.id.commplex-link: . ack 1 win 17280 <nop,nop,timestamp
26709 11105,nop,nop|

14:34:56.860243 shuttle.mad_dog.net.id.1049 >
Empritz.mad_dog.net.id.commplex-link: . 1:2(1) ack 1 win 17280
<nop,nop,timestamp 26718 11105,nop,nop|

14:34:57.047734 Empritz.mad_dog.net.id.commplex-link >
shuttle.mad_dog.net.id.1049: . ack 2 win 65535 <nop,nop,timestamp 11115
26718,nop,nop|


The sender is host shuttle and the receiver is host Empritz. I set the
receiver and sender buffer size to 65536 and send 8192 bytes packet. I use
10Mb ethernet.

Well, my question is: is this really a bug or just what mr. Barkah said ?
I wish there is someone here who can tell me which code in FreeBSD
networking code that cause this behaviour.

Thank's for all!

-Eka Kelana-
STTTelkom




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?25801E10313>