Join 3,512 readers in helping fund MetaFilter (Hide)


Ubuntu > Hotel router
December 5, 2010 3:24 PM   Subscribe

Hotel WiFi - Why is Ubuntu getting much better bandwidth than Windows?

I pay the minimum flat rate for wifi internet in my hotel, which gets me .4mbps and download speeds around 60kb.
I have a laptop and desktop, running Windows XP and 7 respectively.

I wanted to try out Ubuntu 10.10 for giggles, so I installed it on my laptop using an old spare hard drive. Worked great! So great in fact, that my internet speed became waaaay better, actually usable! I verified this with bandwidth speed tests and some test downloads. With Ubuntu I get around 3mbps.

I called the 24hr tech support for the wifi and explained my situation, I mostly wanted to make sure I wasnt being charged for a faster speed that I didnt opt for. They verified that I was still paying the low rate, and they seemed to not be bothered or surprised that I was getting better speeds..
So -
My question is - how or why is ubuntu bypassing the hotel router's speed limit, and how can I get my windows machines to do the same?

Thanks!
posted by Esefa to Technology (30 answers total) 3 users marked this as a favorite
 
Limit is per-tcp connection and ubuntu is set to make more of them by default in the web browser?

Do you get the faster speed with something like an apt-get update ?
posted by pharm at 3:30 PM on December 5, 2010


I bet it's using bigger IP packets.
posted by Chocolate Pickle at 3:40 PM on December 5, 2010


A caching proxy between the hotel wireless network and the internet could explain the perceived differences in performance.
posted by scatter gather at 3:44 PM on December 5, 2010


Thanks for the replies!

I cant check it right now but I do recall that the full update process took much less time than I had expected.

So no ideas on how to make windows do this?
posted by Esefa at 4:28 PM on December 5, 2010


Probably an automatically configured rate limiting proxy that Windows happily uses because it's told to. Also, (if you're using IE) I believe it limits the number of HTTP connections per page to a low number. It's not bigger IP packets, I would be flabbergasted if any hotel managed to have jumbo frames period, much less jumbo frames over wireless (not even sure that's possible). Otherwise, even in the best circumstances you can expect Linux to have better network performance than Windows, in poor circumstances Linux is much better than Windows in network performance.

Check the Windows machines for any sort of network proxy configuration and get rid of it. Don't use IE if you are.
posted by zengargoyle at 5:13 PM on December 5, 2010


Do you have QOS (quality of service) enabled among the services running on your wificard on windows? if im not wrong, it reserves up to 25% of a links bandwidth for windows updates. Or it could just be a badly written driver..
posted by 3mendo at 5:55 PM on December 5, 2010


Not exactly an answer to your question, but I can think of two possible workarounds:

(1) run Windows in a VM under Ubuntu. (As far as which VM system to use, VirtualBox was easier to set up than KVM last time I tried. I haven't run the free VMware recently, so can't comment on that.)

(2) Set up an Ubuntu machine as a router, and run your own private network for your Windows machines behind it.

As to the why, could it be your wireless card? Ubuntu might be running it in a higher-power mode. Take your laptop around the hotel, and find a spot where you get the best signal, and do your windows download speed tests there. It could be you are getting packet loss in your room when running windows.
posted by fings at 7:33 PM on December 5, 2010


My netbook when booted to Puppy Linux downloads at over twice the speed of Win XP. That is running FireFox under both OS's, with the same hardware, from the same web site, at the same coffee shop.

My conclusion is that Windows is just slower.
posted by rfs at 7:42 PM on December 5, 2010


Awesome answers everyone, much appreciated!

So far im definitely liking fings answer, #2 is sounding like a feasible option, if not at least a fun sounding project..

Ive also sort of stumbled on another workaround - A live cd. Tried it on my girlfriends laptop just to see, and sure enough got 6x improvement.. Still not a fix for my desktop, which what a ultimately want the speed for, because I have a usb wireless adapter that isnt compatible with linux :(
posted by Esefa at 8:32 PM on December 5, 2010


I don't know, but I agree with zengargoyle. Try turning off every "automatically detect" setting you can find under Internet Options.
posted by flabdablet at 8:37 PM on December 5, 2010


They verified that I was still paying the low rate, and they seemed to not be bothered or surprised that I was getting better speeds

The technician who set this up uses Linux.
posted by flabdablet at 8:38 PM on December 5, 2010 [1 favorite]


I have a usb wireless adapter that isnt compatible with linux

You can find a new wireless b/g USB adapter for $13.

Otherwise, if you would like to do #2, you could use a crossover cable to connect the desktop (wired) to the laptop (wired), and run the laptop as a router.

These might help:
https://help.ubuntu.com/community/Router
https://help.ubuntu.com/community/WifiDocs/WirelessLaptopInternetAccessPoint
posted by fings at 8:55 PM on December 5, 2010


Uber simple router... You may not need a special crossover cable, modern chipsets do all the crossover stuff internally automagically. It's worth trying with just a plain cable.

On the Ubuntu box, open a terminal and type 'sudo -i' and your password to become root for a while.

# turn on forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward

# enable Masquerade (NAT) for forwarded packets out your wireless (wlan0)
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

# add magic rule to track connections (may not be neded, is on CentOS with stateful firewall
iptables -A FORWARD -j ACCEPT

# configure wired interface
ifconfig eth0 inet 10.0.0.1 netmask 255.255.255.0 up

# go to windows box configure networking statically
IP: 10.0.0.2
Netmask: 255.255.255.0
Gateway: 10.0.0.1

# open a cmd prompt and try to ping 10.0.0.1 it should work, if not redo the ifconfig on
# Ubuntu side (mine dropped when other side wasn't up yet)
# once you can ping 10.0.0.1 try pinging 8.8.8.8 (google dns)

If that works, just set the windows DNS to Google DNS 8.8.8.8 and you're set. I just tried this with two netbooks, one with wireless, with a plain old ethernet cable between them.
This turns your Ubuntu box into a NAT router. I use this simple NAT setup all the time over an ssh tunnel to route my home traffic through my workplace desktop. If it works you might look into some of the packages that automate the process and restore it after rebooting or do DHCP/DNS etc.
posted by zengargoyle at 11:05 PM on December 5, 2010 [4 favorites]


If you're on wireless, any chance you're falling back to 802.11b on Windows and running 802.11g on Ubuntu? That's 11Mbs vs 54Mbs on wireless. That would explain a lot of the speed difference.
posted by blue_beetle at 8:00 AM on December 6, 2010


Also, if you're on a wired connection it could be a 10Mb/s vs. 100Mb/s negotiation with the router. From my understanding there are minimum packet sizes for these connections. Here's a guide to "high performance" Windows tcp/ip tuning.
posted by blue_beetle at 8:05 AM on December 6, 2010


Very awesome everyone!
Thanks zengargoyle for the step by step, it never fails to amaze me how linux folks can bang out commands like that and call it simple lol. But I guess when youve been using it for a good while somethings is bound to stick.. Im getting there, slowly. Im sure it would speed the process a lot if I committed and used it all the time instead of both.

Havent tried it yet, but when I get home ill do some tinkering!

Blue_beetle - You may be on to something there, but would that be a setting in their router or my computer telling it which to use? Any way I could check and/or do something about it?

Thanks again all
posted by Esefa at 3:27 PM on December 6, 2010


it never fails to amaze me how linux folks can bang out commands like that and call it simple lol

The thing about controlling a computer by typing commands into a terminal is that the process of doing so is simple. Anybody who can type a comment into Metafilter already has most of the required skills.

What's not so simple is understanding what the commands actually do. That's a language-learning task, it takes years to get fluent, and the learning never stops. For example, I've been typing commands into *nix boxes since 1983 but only now have I learned from zengargoyle's comment above that sudo -i does the job I've been using sudo su - for all these years.

But the process of typing (or, even better, pasting) commands into a terminal window to get a job done is almost always less fiddly than the process of doing the same job with pointing and clicking. Because Linux shares the Unix cultural heritage, there's almost always a well-documented way to get anything done with terminal commands, and just giving people a bunch of commands to type or paste is almost always less trouble than walking them through the GUI.

Windows is the other way around. I'm sure there is a command you could type or paste into a Windows XP cmd window that would tell Internet Explorer to turn proxy auto-discovery off, but finding out what that is would probably take more time than laying out the steps required to do it by clicking your way through Internet Options in the Control Panel:

1. Click Start.
2. Click Control Panel.
3. If the Control Panel presents in Category View, click Network and Internet Connections.
4. Click Internet Options.
5. In the Internet Properties window, click the Connections tab.
6. Click LAN Settings.
7. In the Local Area Network (LAN) Settings window, make sure the checkboxes for "Automatically detect settings", "Use automatic configuration script" and "Use a proxy server for your LAN" are all unchecked.
8. Click OK to dismiss the LAN Settings window.
9. Click OK to dismiss the Internet Properties window.

If blue_beetle is right about the 802.11b vs g thing, that will be a Windows wireless card driver setting; if the WAP was set up with g turned off and b turned on, you'd see the same speed from Linux as Windows. I've never seen a wireless driver in either OS prefer to connect via b than g, but it might be that falling back to b (or perhaps just picking a lower bit rate for its g connection) is something the Windows card driver tries if it detects interference or poor signal strength.

By the way, the only Windows wireless driver I would rate as anything like a quality product is the Intel one. Others often tend to be flaky.
posted by flabdablet at 5:24 PM on December 6, 2010 [1 favorite]


Very nicely put flabdablet, you have motivated me to begin learning how to use the terminal better. Ill start with basic stuff and slowly work up!

As for b vs g, now that I think of it im not sure if thats the case. Its not that windows is just running at a slower speed, it is being limited to a specific speed. 60kb, at all times, no more no less. Downloads, streams, windows updates.. all 60kb.

Linux on the other hand, is not being limited. Ill test it at one point and get 650kb downloads, then an hour later 100kb, and sometimes it slows to an un-usable rate (although its somewhat rare).

Sorry for not noticing and bringing that up sooner.

Havent been able to try the router thing yet, my desktop mobo decided that 2 weeks was a good lifespan.. Sent for a replacement from newegg this afternoon.. :(
posted by Esefa at 5:41 PM on December 6, 2010


There are two common ways to do rate limiting. The way ISPs do it is to rate-limit all IP traffic. This is often not achievable using a consumer-grade router (the Billion BiPac series like the one I have at home are an exception). The other way is to settle for rate-limiting HTTP traffic; support for doing that easily is built into most proxy cache software. That software can be run on any box attached to the LAN, and nothing clever needs to be done with the router.

But proxy-based HTTP rate limiting only works if the end-user's machine actually uses the proxy. If the tech who set up the hotel networking was slack, or the hotel has cheaped out and bought a totally crap router, it will be possible to make outbound connections straight through the router and ignore the proxy entirely. This is what Linux will do by default.

Windows, on the other hand, has something called the Windows Proxy Auto-Discovery Service (WPAD). If the checkboxes I mentioned above are turned on, it will "helpfully" search the LAN for a web proxy before even attempting to make a direct outbound web connection, and if it finds one, it will use it instead of going out direct.

So before you go fartarsing about turning your Linux box into a NAT router, it would certainly be worth trying simply turning WPAD off as zengargoyle initially suggested.
posted by flabdablet at 5:53 PM on December 6, 2010


By the way: the first commands anybody learning to use the shell needs to know are ls, cd, pwd, cp, mv, rm and man.

You need to know that a directory is the same thing as a folder,
. means the current directory,
.. is the directory that contains the current directory,
/ is the "root" of the directory tree i.e. the directory that contains all other directories,
~ is shorthand for the name of your home directory, and
foo/bar means item bar inside directory foo (this generalizes: foo/bar/qux is qux inside bar inside foo).

cd and cd ~ both do the same thing - they use your your home directory as the current directory.

cd /media/cdrom uses the cdrom directory inside the media directory inside the root directory as the current directory.

cp foo bar copies file foo from the current directory to file bar in the current directory, creating bar if it doesn't already exist or silently overwriting it if it does. And this is something else that newbie shell users really need to understand: if you tell the shell to do something, and nothing much appears to have happened, then it has probably just done exactly what you asked it to do - regardless of the amount of destruction involved, and regardless of whether that was what you meant to ask it to do. Only if it can't do what's asked of it will it spew messages. And the shell has no recycle bin. If you rm a file, or cp or mv another one on top of it: it's gone.

As an exercise, issue the following commands in sequence. Before each one, guess what it's going to do; then see if you can make sense of what it actually did.

cd /tmp
pwd
ls
mkdir baz
ls
cp foo baz
ls
cd baz
pwd
ls
cd ..
pwd
ls


Welcome to the literate way to operate a personal computer!
posted by flabdablet at 7:00 PM on December 6, 2010


Something else that's worth checking is whether Linux is in fact connecting to the the same WAP as Windows! You might be inadvertently leeching off an open wireless network run by one of the hotel's neigbors.
posted by flabdablet at 7:04 PM on December 6, 2010


Never ending useful info flabdablet! Thanks for the in the beginning link, dl'ed, will def read more of it.

Well I check the aforementioned windows settings, everything was already unchecked. I looked in firefox too, nothing jumped out at me..

Its definitely connecting to the same network, I generally tell it which one manually.
So it sounds like maybe the hotel has a decent router??
posted by Esefa at 10:00 PM on December 6, 2010


If I were at your hotel, I would now be completely intrigued, and I would be breaking out wireshark (Windows installer here; on Ubuntu, sudo aptitude install wireshark or search for it in the Software Center) to see if I could spot any differences in the pattern of packet activity or QoS headers or something. I mean yes, the Windows networking stack is widely and fairly regarded as rubbish, but a hard though apparently bypassable 60 kbytes/sec download rate limit is not something I've seen it do on its own before.
posted by flabdablet at 3:31 PM on December 7, 2010


Downloaded wireshark for both, did some research on how to use it. Managed to get it up and capturing on both, but stopped there. Its looking like its a little rich for my non-professional blood. Cant figure out what to look for or what to do if I find it.
Ill be at this hotel for roughly another month. Maybe ill try posting to some forums, any thoughts as to which?

Thanks again to everyone who took the time to help me out!
posted by Esefa at 2:50 PM on December 9, 2010


First thing with wireshark is to try the same operation (e.g. a web download) in both environments and make sure that both Windows and Linux end up talking to the same far-end servers. This will be far easier if you can get a Windows box and a Linux box running side by side; try the download on one, then on the other. If nobody was playing funny rate-limiting tricks, you should see the same sequence of network packets on both (provided they're both using the same browser).

If you like, try capturing the same download from both environments, then save the captures, mail me the .pcap files (address in profile) and I'll look them over and see if anything jumps out at me.
posted by flabdablet at 11:49 PM on December 9, 2010


Hmmm well I should have saved the capture while I was tinkering with it last time, because apparently ive been "caught". This laptop is now restricted to 60kb. Apparently they restrict based on mac address because it no longer matters what OS im using (ive tried 4).

However, if I use a live cd on my gf's laptop it still gets the unrestricted speeds...
Screwed myself somehow??
posted by Esefa at 11:04 PM on December 11, 2010


Spoof it and see if you get your speed back.

If you keep doing this, you will likely be asked not to.
posted by flabdablet at 1:59 AM on December 12, 2010


I did some looking into spoofing, not sure if that would work since the company knows it is me regardless of my mac. When I access the internet for the first time on a "new" system it prompts me to enter in my info (name, email, room #), this is how they do their billing. So I dont think id like to get into the spoofing thing, in my head I see penalty fees and or cancellation of services..
I try it though, got ubuntu to change my mac, but it couldnt connect to the router. I quit there. Probably could have got it working but see above...
Cool to learn about though! I didnt know that exists!

So as of now I can only get good speeds with a live cd on my gf's laptop. Would it do any good to do a wireshark capture from the live cd (if its even possible), side by side with XP?

If not I think im becoming more and more willing to throw in the towel. We leave this place in about 3 weeks, pretty sure I wont die if it stays slow..
Cant thank you enough for the help though, ive learned a lot here!
posted by Esefa at 2:30 PM on December 14, 2010


You can certainly install wireshark into an Ubuntu environment created by the live CD (it will install to RAM disk, and disappear at shutdown).

But before doing that, boot the live CD on your girlfriend's laptop again, verify that it still runs fast, then find out what its MAC address is (an unadorned ifconfig command in a Terminal window will reveal it). Shut that laptop down again, try spoofing that same MAC address onto one of your other computers and see what happens.

I'm still happy to interpret the sacred runes if you mail me some .pcap files.
posted by flabdablet at 6:15 PM on December 14, 2010


Sorry for the late reply! Its been a bit crazy around here. We just started the paperwork on a new place, and it looks like we will be moving much sooner than anticipated. We will be out of state at my folks place for the holidays, then we move into the new apt two days after we get back! So im not too worried about the sub-par internet anymore, I only need to endure it for a few more days.
Really stoked to be getting back on cable internet.
Id like to get to the bottom of this just for fun, but right now my time is being split between too many projects! If I find some random free time I may just shoot you those captures, but if not thanks for the offer!
posted by Esefa at 6:45 PM on December 19, 2010


« Older Brazil [Aracaju] filter: Best ...   |  Falling for someone that is le... Newer »
This thread is closed to new comments.