From owner-freebsd-hackers Sun Sep 9 16:27:47 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from elvis.mu.org (elvis.mu.org [216.33.66.196]) by hub.freebsd.org (Postfix) with ESMTP id 5163237B403 for ; Sun, 9 Sep 2001 16:27:45 -0700 (PDT) Received: by elvis.mu.org (Postfix, from userid 1192) id 3A81D81D01; Sun, 9 Sep 2001 18:27:45 -0500 (CDT) Date: Sun, 9 Sep 2001 18:27:45 -0500 From: Alfred Perlstein To: Kent Boortz Cc: freebsd-hackers@freebsd.org Subject: Re: How to force small TCP packets? Message-ID: <20010909182745.O2965@elvis.mu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from kent@erix.ericsson.se on Mon, Sep 10, 2001 at 12:49:25AM +0200 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Kent Boortz [010909 17:49] wrote: > > I want to run an application with the OS set to send small TCP packets > to spot programming errors like assuming that a write of 100 bytes on > a socket can be read in a single read operation. It may work most of > the time but break at some point. So if I could configure FreeBSD to > use small packets I can spot these programming errors faster. > > How can I do this? I can't just set the MTU on the interface right? > Can I use sysctl "net.inet.tcp.sendspace" or some other configuration? > Can I set it as low as sending one byte of data in each packet? Will > this still not help, i.e. if we are not reading fast enough we will > get all 100 bytes we wrote in a single read even if the packets were > small? Is there another way to force the behaviour that read() on a > socket just return a few bytes at the time? > > Sorry if this is a stupid question, I haven't gone deep enough in > Stevens "TCP/IP Illustrated" to understand things like this yet, there's a setsockopt for this called TCP_NODELAY in netinet/tcp.h. you should read further into stevens before posting such questions. -- -Alfred Perlstein [alfred@freebsd.org] 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message