From owner-freebsd-ipfw@FreeBSD.ORG Fri Mar 30 10:02:50 2007 Return-Path: X-Original-To: freebsd-ipfw@freebsd.org Delivered-To: freebsd-ipfw@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3CDC16A5A5 for ; Fri, 30 Mar 2007 10:02:50 +0000 (UTC) (envelope-from dave@raven.za.net) Received: from elektra.opteqint.net (elektra.opteqint.net [209.25.178.105]) by mx1.freebsd.org (Postfix) with ESMTP id AFE8213C455 for ; Fri, 30 Mar 2007 10:02:50 +0000 (UTC) (envelope-from dave@raven.za.net) Received: from [196.209.87.107] (helo=DHA12123) by elektra.opteqint.net with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.66 (FreeBSD)) (envelope-from ) id 1HXDw8-000PHN-VG; Fri, 30 Mar 2007 02:02:33 -0800 From: "Dave Raven" To: "'Luigi Rizzo'" References: <015d01c77297$953ba250$bfb2e6f0$@za.net> <20070330005916.A76128@xorpc.icir.org> <01a501c772ab$1dcbd460$59637d20$@za.net> <20070330021442.A77652@xorpc.icir.org> In-Reply-To: <20070330021442.A77652@xorpc.icir.org> Date: Fri, 30 Mar 2007 12:02:28 +0200 Message-ID: <01be01c772b2$91e64180$b5b2c480$@za.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acdyq9RKQtjUozzsRwedzKAO1gPEUwABloXw Content-Language: en-us Cc: freebsd-ipfw@freebsd.org Subject: RE: Using "delay" to emulate a satellite link X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Mar 2007 10:02:50 -0000 Hi Luigi, Firstly sorry for the confusion - I mean even if I change it to 250/250 (e.g. 500ms of delay) I can't reach 1mbps of throughput. Is it a definite that because of the latency (if its bad enough) you can never achieve full throughput - because of TCP ack delays? Your 65kbytes/1000ms = 512kbit/s calculation - is that 65k from the send/recv space ? The maximum is 65k correct ? Does that mean that on a given 1000ms link you CANNOT achieve more than 512kbps ? Thanks so much for the help - I know its going a bit off topic Dave -----Original Message----- From: 'Luigi Rizzo' [mailto:rizzo@icir.org] Sent: Friday, March 30, 2007 11:15 AM To: Dave Raven Cc: freebsd-ipfw@freebsd.org Subject: Re: Using "delay" to emulate a satellite link On Fri, Mar 30, 2007 at 11:09:07AM +0200, Dave Raven wrote: > Hi Luigi, > Thanks for the reply -- these are my related send/recv space > settings on all of the boxes involved -- > > net.local.stream.sendspace: 65535 > net.local.stream.recvspace: 65535 > net.local.dgram.recvspace: 4096 > net.inet.tcp.sendspace: 65535 > net.inet.tcp.recvspace: 65535 > net.inet.udp.recvspace: 65535 > net.inet.raw.recvspace: 8192 > > What I have done is put 3 freebsd units plugged into eath other with > crossover cables, like so -- > > BOX 1 ----- BOX 2 ----- BOX 3 > > Box 3 has a 500meg /dev/urandom text file on a webserver. Box 1 wget's that > file. Box 2 has the ipfw delay setup. If I ping from BOX 1 to BOX 3 I get > +/-1000ms of delay. When I download I get less than half of the link speed > (1meg limited by box 2). which is fine - you get 65kbytes/1000ms = 512kbit/s > The latency directly affects the throughput - but my question is this -- If > I download something from a web server on the internet that I have 500ms of > delay to, I can get 1meg (on a 1meg link). When I emulate that delay with > dummynet I can't -- is there a difference in the type of delay experienced? well, it's twice as much in your case - your ping time is 1000ms instead of 500ms cheers luigi > Really anyone can - most people have delay of at least 300-500ms to remote > webservers (e.g. from me in Africa to America); but it doesn't hamper > download speed? > > Thanks again > Dave > > > > -----Original Message----- > From: Luigi Rizzo [mailto:rizzo@icir.org] > Sent: Friday, March 30, 2007 9:59 AM > To: Dave Raven > Cc: freebsd-ipfw@freebsd.org > Subject: Re: Using "delay" to emulate a satellite link > > On Fri, Mar 30, 2007 at 08:49:19AM +0200, Dave Raven wrote: > > Hi all, > > I've been looking at the ipfw (dummynet) ability to do delay and > > have a few questions - I hope this is the right list. I want to simulate a > > 1000ms RTT on a satellite link. To do that I've created an inbound and > > outbound pipe and given each 1mb and 500ms of delay. > > > > However, I'm unable to get anywhere near 1mb of throughput on it until I > > drop the delay. I believe I understand the slowdown due to the latency, > but > > my question is this - an http download through a 500ms "emulated" link > > that's running 1 mb can't get 1mb, yet if I download over the internet on > a > > site that's pinging 500ms, it goes 1mb > > > > Whats the difference between dummynet delay and real life distance delay? > > first make sure you are not comparing apples and oranges. > what sender and receiver are you using to get 1Mbit/s on a 500ms link ? > and, are you sure that if you ping from the source to the destination > you are using for your tests with dummynet you get the delay > you are expecting (1000ms as you configured it, and not 2000 ?) > > 500ms of delay on each pipe give at least 1000ms total > delay (assuming you have not misconfigured your dummynet box). > In order to fill the pipe you need at least 1Mbit worth of data > in the socket buffer/tcp window - the default on FreeBSD is > 32kbytes sending, 64Kbytes receiving, so you won't be > able to achieve that unless you increase these two sysctls: > > net.inet.tcp.sendspace: 32768 > net.inet.tcp.recvspace: 65536 > > if you draw the bw vs delay that you achieve on your connection > you will likely find that either the limit is your socket > buffers or a misconfigured ipfw which results in twice the delay > > cheers > luigi