Networking – Slower than expected 802.11n wireless network speeds

802.11nspeedwireless-networking

I have two ASUS laptops running Windows 7 connected wirelessly via 802.11n at 150 Mbit, as reported by Task Manager. The router is Netgear WNDR3700.

When testing the wireless connection speed using iperf, I'm not getting nearly 150 Mbit:

C:\>iperf -c 10.0.0.123 -t 30
------------------------------------------------------------
Client connecting to 10.0.0.123, TCP port 5001
TCP window size: 8.00 KByte (default)
------------------------------------------------------------
[148] local 10.0.0.116 port 53819 connected with 10.0.0.123 port 5001
[ ID] Interval       Transfer     Bandwidth
[148]  0.0-30.0 sec  41.2 MBytes  11.5 Mbits/sec

That's a typical result. Running parallel client threads does not increase the overall total speed.

Why would I only be getting 11.5 Mbit on a 150 Mbit connection? What is a reasonable max rate I should expect?

There are no other nearby wireless networks, nor cordless phones or microwave ovens.

Best Answer

The rule of thumb for TCP throughput over Wi-Fi is that you can get 50-60% of your signaling rate. So in your case, you should see 75-90 megabits per second of TCP throughput.

Wait, why is your TCP window size just 8 KibiBytes? That strikes me as an absurdly low default.

Let's see what yours should be by calculating a "Bandwidth x Delay product" for your connection.

If Windows 7 is reporting that you're getting a 150 mbps signaling rate, that's 150,000,000 bits per second, so let's use that as the bandwidth number.

As for delay, well, my average ping round trip time over Wi-Fi to my AP is a little under 3 milliseconds. But you're going from one wireless client to another, which gets relayed by the AP (to avoid the hidden node problem), so I'm guessing if you pinged one of your wireless clients from the other one, you'd get a round trip time of up to 6ms.

So 150,000,000 bits/sec of bandwidth * 0.006 seconds of delay = 900,000 bits you need to be able to put "in flight" before getting an Ack back, in order to keep the pipe full.

900,000 bits / 8192 bits per KibiByte = about 110 KibiBytes of TCP window needed. Let's be generous and make it a nice round 128.

Try adding -w 128K to your iperf argument lists on both the client and the server to force the TCP window to something reasonable, and see if that helps.

Since wireless is a fickle medium and there can sometimes be latency spikes due to transient noise forcing link-layer packet retransmissions, you could even try going larger than that, maybe up to 512KiB, but at some point there will be diminishing returns.

If increasing your TCP window size gets you up to around 75 megabits/sec of TCP throughput in IPerf, but if Windows 7 is defaulting your window size to 8KiB, then you probably need to figure out how to get Windows 7 to pick a better default TCP window size for all TCP connections.