Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Mar 2015 08:20:28 -0700
From:      Atom Powers <atom.powers@gmail.com>
To:        Malcolm Matalka <mmatalka@gmail.com>
Cc:        freebsd-performance@freebsd.org
Subject:   Re: NAT under performing direct connection by 10x
Message-ID:  <CAF-H=OnMTAphHKd62BdtXYntSMaEdHDsCLZw0n74ogF-i9uJMw@mail.gmail.com>
In-Reply-To: <87fv9bin7t.fsf@gmail.com>
References:  <87fv9bin7t.fsf@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
What are you using to implement NAT? ipf? iptables? Are you
reassembling packets or passing them straight through? Are your memory
buffers big enough?

Who is your Internet provider and do you see those same rates for
repeated tests? (Some provider will give you an early burst of speed
and then throttle you back.)

The window size could be significant. What happens if you manually set
the window size to different values?




On Wed, Mar 11, 2015 at 8:10 AM, Malcolm Matalka <mmatalka@gmail.com> wrote:
> I am setting up my Raspberry Pi Model B+ as a router and am experience
> a throughput bottleneck that I cannot track down.
>
> I'd like to preface my question with two things:
>
> - I'm new to this so it is quite possible this is something obvious and
>   I simply lack the knowledge to see it.  If so, sorry for wasting
>   anyones time and thank you very much to whoever points it out to me.
>
> - It is quite possible that my Raspberry Pi does not have the hardware
>   to support the desired throughput, but I'm having trouble finding
>   evidence to back up that hypothesis.
>
> The setup I have is:
>
> Laptop -> (wlan0 - RPi - ue0) -> Router
>
> I am using a USB dongle with a 'run0' interface running as a hostap.
> The RPi is then connected to a router which is connected to the
> internet.
>
> I have run the following command in different experiments:
>
> wget -O /dev/null
> ftp://ftp.freebsd.org/pub/FreeBSD/releases/VM-IMAGES/10.1-RELEASE/amd64/Latest/FreeBSD-10.1-RELEASE-amd64.raw.xz
>
> On the RPi: download speed of around 500 KB/s
>
> On the laptop: download speed of around 80 KB/s
>
> I have also scp'd a file from the laptop to another computer on the other
> side of the router:
>
> Laptop -> RPi -> Router -> Computer
>
> And I have a throughput of around 1 MB/s.  This exercises both network
> interfaces similar to downloading from the internet.
>
> The only difference I am aware of is that NAT is happening in the
> Internet case.
>
> I have:
>
> - Checked CPU, in the NAT case the load average does not break 0.2.  The
>   CPU does not seem stressed.
>
> - Interrupt %, in top, doesn't go above a peak of 4% in either case.
>
> - netstat -i and netstat -s do not show any errors happening (that I can
>   see).
>
> - While I have no idea if it is significant, I have noticed that in the
>   case of a local download (on the RPi), in tcpdump the "win" goes down
>   to around 1000.  In the NAT case it stays at around 4096.
>
> Currently I am at a loss to explain the bottleneck.  Is there a
> suggested next place to explore to track this down?  As I said, it could
> be that the RPi is not capable of these throughputs, I'm using this as
> an excuse to learn how to investigate a performance bottleneck in
> FreeBSD though so I'm more interested in the meta-discussion of how to
> determine where the problem is.
>
> Thank you,
> /Malcolm
> _______________________________________________
> freebsd-performance@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-performance
> To unsubscribe, send any mail to "freebsd-performance-unsubscribe@freebsd.org"



-- 
Perfection is just a word I use occasionally with mustard.
--Atom Powers--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAF-H=OnMTAphHKd62BdtXYntSMaEdHDsCLZw0n74ogF-i9uJMw>