From owner-freebsd-hackers Thu Jan 16 17:08:38 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id RAA28613 for hackers-outgoing; Thu, 16 Jan 1997 17:08:38 -0800 (PST) Received: from mailgate ([202.159.65.166]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id RAA28606; Thu, 16 Jan 1997 17:08:29 -0800 (PST) Received: from bandung.wasantara.net.id (bandung.wasantara.net.id [202.159.69.35]) by mailgate (8.6.11/8.6.9) with ESMTP id HAA09743; Fri, 17 Jan 1997 07:54:05 +0700 Date: Fri, 17 Jan 1997 07:54:05 +0700 Received: from BANDUNG/SpoolDir by bandung.wasantara.net.id (Mercury 1.21); 17 Jan 97 09:00:27 GMT+0700 Received: from SpoolDir by BANDUNG (Mercury 1.21); 17 Jan 97 08:59:43 GMT+0700 Received: from shuttle.wasantara.net.id by bandung.wasantara.net.id (Mercury 1.21); 17 Jan 97 08:59:36 GMT+0700 X-Sender: eka@werty.wasantara.net.id (Unverified) X-Mailer: Windows Eudora Pro Version 2.1.2 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: freebsd-bugs@freebsd.org From: Eka Kelana Subject: Re: bug in setsockopt()... ? Cc: mbarkah@hemi.com, freebsd-hackers@freebsd.org, dg@root.com Message-ID: <25801E10313@bandung.wasantara.net.id> Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >>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 shuttle.mad_dog.net.id.1049: S 712000001:712000001(0) ack 1711296002 win 0 Empritz.mad_dog.net.id.commplex-link: . ack 1 win 17280 Empritz.mad_dog.net.id.commplex-link: . 1:2(1) ack 1 win 17280 shuttle.mad_dog.net.id.1049: . ack 2 win 65535