From owner-freebsd-hackers Sun Sep 9 15:49:33 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from penguin-ext.wise.edt.ericsson.se (penguin-ext.wise.edt.ericsson.se [194.237.142.110]) by hub.freebsd.org (Postfix) with ESMTP id 231A037B406 for ; Sun, 9 Sep 2001 15:49:30 -0700 (PDT) Received: from super.du.uab.ericsson.se (super.du.uab.ericsson.se [134.138.176.16]) by penguin.wise.edt.ericsson.se (8.11.0/8.10.1/WIREfire-1.3) with ESMTP id f89MnRv06223 for ; Mon, 10 Sep 2001 00:49:28 +0200 (MEST) Received: from news.du.uab.ericsson.se (news [134.138.176.24]) by super.du.uab.ericsson.se (8.10.1/8.10.1/erix-1.8) with ESMTP id f89MnQ106694 for ; Mon, 10 Sep 2001 00:49:26 +0200 (MET DST) Received: (from news@localhost) by news.du.uab.ericsson.se (8.9.1b+Sun/8.9.1/news-1.1) id AAA14933 for freebsd-hackers@freebsd.org; Mon, 10 Sep 2001 00:49:26 +0200 (MET DST) Received: from GATEWAY by news with netnews for freebsd-hackers@freebsd.org (freebsd-hackers@freebsd.org) To: freebsd-hackers@freebsd.org Date: 10 Sep 2001 00:49:25 +0200 From: Kent Boortz Message-ID: Organization: Ericsson Utvecklings AB, Stockholm, Sweden Content-Type: text/plain; charset=us-ascii Subject: How to force small TCP packets? 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 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, kent To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message