FreeBSD Based Gaming Router
Zaphoid writes "Lan Game Reviews has posted an article on how to use an old computer and FreeBSD distro m0n0wall to create a gaming router. Gaming routers allow users to use their full bandwidth for downloads and other high bandwidth apps, and low latency applications at the same time. By keeping packet queues on the router side, rather than the modem side. Users are able to achive great pings in online games, while fully using their download bandwidth. This is a great alternitive to expensive gaming routers on the market today."
"This is a great alternitive to expensive gaming routers on the market today."
:)
Yes, this is exactly what the gaming world has been waiting for. The funny thing is that when somebody tries to create a product that is designed for USERS, they complain. However, when you design something so obscure out of your own whim that might never be used by anybody else, that is considered cool. Discuss.
Cover your eyes and click this link!
Interesting, but I don't know how well this is going to work, given FreeBSD's crappy TCP-IP stack. ^_^
____
~ |rip/\/\aster /\/\onkey
You can do this with a wrt54g and the sveasoft firmware, too. I prefer that way, so you don't have to worry about another machine that sucks a lot of power lying about. IIRC, you can get the sveasoft firmware at alternate locations, just google for it. I broke down and bought it ($20/year), and got my money's worth.
You might even be able to do it with the free wrt54g firmware, openwrt, but I've never tried it.
This little box is extemely reliable, has very low power consumption, it's cheap and it's small. Plus, it does wireless (WPA, etc).
Such routers seem to be under $100.
& btnG=Search+Froogle
http://froogle.google.com/froogle?q=gaming+router
I don't see how a loud, hot old PC is necessarily better. And if you want an embedded system, those are normally quite pricey.
I'm not convinced that using an old PC is the best way to go here. Hacking a WRT* might seem more reasonable -- but a lot trickier.
I really don't like having lots of big boxes around, humming. But then I don't like games either.
http://www.thebricktestament.com/the_law/when_to_
Gamers aren't likely to spend time they could be gaming with installing, configuring and maintaining a router setup. It's far more sensible, in today's age of commodity broadband routers, to pick up a Linksys WRT54G or similar from a local supplier and use that instead, a simple and out-of-the box solution that should require fairly little maintainance after installation and won't require an entire machine sitting humming away in the corner just to route packets. The WRT54G specifically makes a great case for this, because it can be flashed with different open source firmware to improve its flexibility and stability.
In other situations, the dedicated machine would probably have a numerous array of other uses, making it a more useful overall package, but since this article focuses on gaming the box running FreeBSD is unlikely to be able to be used for gameplay, so its pretty much relegated to packet routing and other miscellaneous duties. That, to me, seems like a complete waste in this instance
Business Voyeur
I don't see how a loud, hot old PC is necessarily better.
Not to mention power consumption is certainly worse.
Guys (and the few but very welcome gals), before we all start flaming about how hard it is to set up OpenBSD/FreeBSD and a firewall for a newbie, please take a look at the m0n0wall site. m0n0wall is completely self contained and is very easy to set up. It is completely web interface driven and is managed in much the same way as a consumer broadband router is. m0n0wall is, in my humble opinion having used it for a number of years and loveing it, and excellent firewall product and is very capable. If you have not seen it, grab a copy and have a look. Cheers, Tim.
Basically it tells you to install m0n0wall, activate the shaper, and they'll post again sometime on how to make rules for specific games.
Why was this posted now, instead of in a few weeks when there's some actual content?
Part of the hacker mindset is a love of tinkering -- the fantastic knowledge that you don't need anyone's help to create, to build, to acheive, to overcome. That with that computer that was going to be in the dumpster, you can now do something cool, regardless of the fact that it might take you longer to do it.
You have a point, but the problem is that it strikes at a target that doesn't really exist. The point of Slashdot isn't to advertise every new technology that comes out, but to advertise what is interesting to its readership. Given that a lot of us a predisposed to hacking and wonderful stuff like that, it makes sense that this should be posted here.
FTR, though, I don't think you're a troll.
argh reading "FreeBSD distro" sounded so, so wrong to me.
Cut and pasted from my Linksys WRT54GS under the QoS tab
Two types of Quality of Service features are available, Wired QoS which controls devices plugged in to the router with a Ethernet cable, and Wireless QoS, which control devices that are wirelessly connected to the router.
Wired QoS
Device Priority : You may specify priority for all traffic from a device on your network by giving the device a Device Name, specifying priority and entering its MAC address.
Ethernet Port Priority : You may control your data rate according to which physical LAN port your device is plugged into. You may assign High or Low priority to data traffic from devices connected on LAN ports 1 through 4.
Application Priority : You may control your data rate with respect to the application that is consuming bandwidth. Check Optimize Gaming Applications to automatically allow common game application ports to have a higher priority. You may customize up to eight applications by entering the port number they use.
Wireless QoS
Wireless QoS is also referred to as Wi-Fi MultiMediaTM (WMM) by the Wi-Fi AllianceTM. Select Enable to utilize WMM if you are using other wireless devices that are also WMM certified.
No Acknowledgement : Enable this option if you would like to disable acknowledgement. If this option is enabled, the router will not re-send data if an error occurs.
Life is not for the lazy.
http://www.benzedrine.cx/ackpri.html
That should do it. I've been using ack prioritization since a couple months after the artitcle was released. I've noticed recently that I still get good pings when torrenting and playing RTCW:ET.
Have fun.
Beware TPB
Both the v1.0 and v1.1 WRT54G routers have 16MB of RAM and a MIPS processor running at 125Mhz. The v2.0 of the same router has the 200Mhz CPU.
If you have a WRT54GS, it comes backed with 32MB of RAM and a 200Mhz CPU also. That's some beefy hardware for just routing alone! Even better, these routers run on a version of Linux. The source code is available from Linksys for free.
Screw having another bulky PC laying around. You can have my Linksys when you pry it from my dead cold hands!
Life is not for the lazy.
While I'm all about the FreeBSD solution here (m0n0wall is a great package), the idea of using a hub instead of a switch is just asinine. In a gaming environment, where bandwidth is critical and having delays in play can make the difference between a frag and getting fragged, having seperate collision domains is a must. A gaming network should use switches to ensure that collisions won't affect gameplay.
I've been using monowall for probably almost a year now, for a couple different routers. Here's why I like it. Put 3 net cards in a computer. 1 for the diesel modem, 1 for the LAN, and one for the wireless access point. Block all traffic from wireless to LAN, and then allow only VPN traffic in. You have free unencrypted wi-fi for friends and neighbors, and encryption for yourself far superior to WEP.
i doubt it. really expensive routers have custom ASICs that are designed specifically for ROUTING. the latency of your PC box router vs a real Cisco or Juniper router will be noticed when you put it into production in a major backbone.
there is a reason why these companies put R&D effort into making custom hardware for routers.. just becuase you can do the same functions in software doesn't mean its just as good.
Lord High Crapflooder The Right Honourable Vlad Craig Esther McDavenpherson III
Destroyer of Mercatur.Net
You do realize that firmware is just software on embedded devices? It's usually stored in some sort of non-volatile memory. This doesn't make it any faster then software stuck on a hard or floppy disk.
And That Old Pentium's 66Mhz backplane is so much more then enough to push around a cablemodem's maximum throughput.
If you actually read the article, you'd see that this is a distribution of one of the BSD's that is trimmed down and web-interfacified making it extremely easy to install and configure. Install two network cards, load up the CD, and you're pretty much good to go. I don't think installing some network cards is a big deal for a lot of gamers that build their own machines.
- It's not the Macs I hate. It's Digg users. -
For this project, I recommend no less than a 486DX2 133Mhz processor with 64 megs of ram
Because there sure is a lot wrong with asking for a 486 DX2 133MHz. Ain't no such thing exist.
First, saying that the chip is a DX2 implies that the motherboard opperated at a 66MHz bus speed, which no 486 had the blessing to experience (66MHz bus speeds didn't happen until the Pentium line). The 2 in DX2 implied that the CPU operated at a frequency twice that of the bus speed (DX2 66MHz = 33MHz bus speed). There were certainly DX4s though, where the CPU frequency was 3x that of the bus speed (why it wasn't the DX3, I don't know). DX4 75MHz (25 MHz bus) and 100MHz (33MHz bus).
Second, the only chip manufacturer ever to release a 133MHz 486 processor was AMD (a true DX4, 33MHz x 4), and by that time, but the Pentium left all 486s in their dust. There was no market for it, and it was laid out to pasture. I doubt anybody still has one running. Well, perhaps except for these guys.
Traffic shaping only affects UPSTREAM data.
There's unfortunatly no 100% effective way a simple user could get rid of the queues at the ISP side during heavy downloads. ICMP Source Quench were supposed to be an answer to this, but the potential exploits lead many admins to simply filter them out. IMHO, 'gaming firewalls' could ease a bit latency on assymetric lines (ADSL mostly), but true QoS can only be achieved if _both_ ends do shape their traffic (the above applies to IPv4).
As far as I've seen by experimenting myself, the benefit of such an assymetric setup is to prevent excessive pings (several seconds). Playing a FPS during heavy use is still a no go as it implies irregular ping, and an average of 100-150 ms. However, it's quite a nice setup if you plan to play some MMORPG or want to get connected through SSH.
Regards.
f you RTFA this "game router" is really only adding traffic shaping/prioritization, which is something a middle of the road router can do anyway in FIRMWARE which will be lots faster than that software.
Your typical cable routers "firmware" is either pf/netfilter or something very similiar, and isn't imparted any speedup.
If your box did something like l7-filter in hardware, then you'd have an argument...
T-3 at work. Shared among 3 sites. No special queue or anything else. 37Mb/s for 28 minutes.
Router is FreeBSD 4.11, PIII 450 with 2 3COM 3C905B's Around 1100 lines in ipf rule set. Not very well optimized, I have 1 group. I have NAT enabled, but this is not using NAT.
Does this help for some numbers?
The real issue with these kinds of routers is the fact that the cable/dsl modems themselves are not interactive once their data queue becomes filled. Sure, traffic shapers are execellent and I've read http://lartc.org/howto/ which has great information for linux. Cable/DSL connections are asymetrical, and when you send data from your pc to the actual cable modem, you send it at 10/100megbit (whatever speed the nic in your pc and cable modem agree on) Your ISP will limit you to 512kBit upload for example. The modem cannot send data to your ISP as fast as you can send it to your modem thus the data queue fills very fast and your modem has trouble keeping up. These shapers can simply slow down the rate at which your PC sends data to the modem and thus stopping the filling of the data queue in the modem which will allow it to be more interactive. That is the biggest problem you'll have with cable/dsl connections for a few users. Sure, more detailed protocol based shaping can and should be used to reserve bandwidth on a larger scale.
Actually I'm still running several AMD DX4's, with various versions of FreeBSD. A DX4 133 is about the same speed as a Pentium 100 and allowed many to upgrade their CPU speed without changing their motherboard, so actually there was a decent market for them, for a while anyways. AMD made 486's that could be clocked to 40Mhz bus speeds, and so the DX4 was actually capable of 160Mhz, which generally beat out Pentium 100's for many things (except floating point). Such machines have plenty of horsepower to run simple websites.
I'm a bone arsed lazy WRT54G owner. Can you show me where to get firmware to do this? :-)
It's important, because although FreeBSD does have SOME of ALTQ, and SOME of KAME, it does not have the most recent code and (certainly in the case of KAME) not even all of the older code.
Some people mentioned crashes with sessions, in other posts. I couldn't prove these were due to things like ALTQ or KAME, but it is entirely plausible that it is due to something of that sort. The *BSD folk have some of the most complete, not to mention some of the most powerful, networking code out there. The problems arise when it remains out there and doesn't get merged in.
(Linux isn't much better. USAGI - an alternative IPv6 stack - is not included. SGI's STP was never really looked at. GAMMA - an excellent network layer for clusters, a common use for Linux, is barely known outside of a cult following. Same for ABISS. Web100 - a neat instrumentation layer for Linux' network code - also hasn't gone very far.)
In this day and age, there is really no excuse for poor networking code. The patches exist. The validators and instrumentation exist. The extensions and refinements all exist.
I'm one of the first to take issue with Windows folks who don't patch their systems - whether for security or for capability - and damnit, I'm not going to be any slower just because I happen to like both Linux and the *BSDs. If anything, I'm going to be faster on the draw, precisely because I do care and want these systems to really show what they're capable of.
Why do you think I ran the FOLK project for the 2.4 kernels? Because I like pain? No, it's because of the sheer volume of unknown and neglected code that could make a huge difference. The FOLK patch was getting close to the size of the kernel itself! And that was just extensions, I had very few of the maintenance patches included - some of the -ac stuff, but almost nothing from the -aa series.
If there was a chance in hell of being paid for it, I'd be happy to invest the time and effort to get either the Linux or the *BSD network code absolutely right. Someone needs to.
It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
Who on earth said anything about it being faster? My guess is that the performance difference between dedicated hardware and PC is quite negligible. All the article said was that you can do quality-of-service queueing with regular PC hardware pretty easily, and that if you already have a spare PC, that's cheaper than buying dedicated hardware for the purpose. As far as I know, the article didn't claim that a PC was any better at the job than dedicated hardware; it just claimed that routing with quality-of-service is better than routing with it.
Getting back to the subject of performance for a moment, the low bandwidth involved in most home network connections (even if they are called "broadband") is so small that just about any computer that can run current software can handle it. Remember, computers are built to move hundreds of megabytes around in a second, and we are only talking about fractions of a megabyte.
That leaves only the issue of latency. But, on regular 10 megabit ethernet, a full-size 1536 byte frame can transmit in not much longer than 1 ms. Lots of fancy routing hardware is built so it can figure out how to retransmit a packet before the entire packet has been received, so a router could in theory add less than 1 ms of latency on 10 megabit ethernet. But even if your PC receives the whole packet and then waits a whole extra millisecond before starting to retransmit it, you've still only added 2 ms of latency, which is really not that much. At least, on my cable modem, if I ping the local university, my latency averages about 125 ms. How big of a deal is it if I had 2 ms to that?
For what it's worth, I just did two ping tests to test how much latency going through a PC does add. I first pinged the local university from my firewall machine, which is a 600 MHz Athlon running Solaris 8. The lowest ping time recorded was 9 ms. Then, I pinged the same machine from a Mac that sits inside the firewall, so that the Solaris 8 machine is routing the ICMP packets it was (in the previous test) originating. The result? The lowest ping time recorded for the Mac going through the Solaris machine was 9.178 ms. It's hard to say since the Solaris machine doesn't measure in fractions of a millisecond, but the point is that ping times were not increased dramatically. In fact, it appears to be less than one millisecond difference.
Comment removed based on user account deletion
So lets say you happen to have an old PC laying around unused and two NICs to stick in it. Let's then say you downclock the FSB and CPU to conserve power so that the machine only uses about 100W average. And let's say that the reason you need this type of router is to have good throughput on gaming and websurfing and still maximize your throughput on P2P apps that are flooding your connextion.
So you're running a PC at 100W 24/7. At 8 cents per kwh, that comes to $5.76/month. Of course, your power probably costs 12-15 cents per kwh, and your old PC probably takes 150-200W power, so you're probably using more like $8+/month. Also add in extra air conditioning costs in the summer to offset heat from the extra PC you have running.
I built a PC based router back when basic standalone units cost $250. Once they hit the $50 mark (two years ago, I probably paid more like $30 AR), I decided I was long overdue to buy one. I recouped my entire cost in less than 6 months. Unless there's something a $50 (now) Linksys WRT54g can't be modified to do, you shouldn't be bothering with a PC based solution.
The only way the PC router solution makes any sense is if you also happen to be using it as a print and file server, or a PC jukebox or running ftp/http services.
I was looking to get a gaming router, and I can't find the reviews right now, but there was a good roundup on anandtech or one of those sites.
They did their benchmarks using various p2p apps and games. They'd launch the games when the p2p apps were maxing the bandwidth.
Basically the benchmarks went like this for all of them:
Without 'super duper bandwidth adjuster thingie' average game ping 600
With super thingie: 450
So they all went from totally unplayable to totally unplayable.
I want to set up a box for gaming and voip, a linux box can be dedicated for this but I've read it's tricky to get it all working. But in the end it actually works unlike every gaming router I've read about.
If your personal experience is different, please post, but I've read the reviews for about 6 of em, and none of them were up to the job. Sure they knocked off 100 milliseconds, but not near enough to make it actually worth it to get a gaming router.
Want to drive yourself nuts? Put a pair of Sveasoft-hacked Linksys WiFi units between a PC and a server, and try to do something intensive like a CVS checkout. The thing works OK when it's not the bottleneck, which is the case when you're talking over some low-bandwidth link to the outside world. But when the WiFi link is the bottleneck, something breaks in queuing.
Yeah, we tried Sveasoft support. They're in denial about the problem, and we don't have time to debug it for them.
You can do lots of things to cool those PCs down though. Sleep (Suspend to RAM) or Hiberation (Suspend to Disk) are always good options if you aren't using the computer when it's not around. Personally, I use my computer 24/7 to do something, but you can still negate a lot of heat:
- If you are using an Athlon 64, use the Cool'n'Quiet tech to dynamically clock your system down to as little as 800Mhz -- it sips power at that speed. To be fair, Pentium 4 Prescott owners also have a similar feature, but it can only clock the system down to 2800Mhz (or whatever the 14x multiplier would net you, if you are overclocking or underclocking your bus).
- Take advantage of the automatic turning off of disks and displays available on any modern ACPI PC.
- You can always underclock parts of your system, even dynamically. For instance, any modern nVidia GPU can be dynamically clocked down when running in 2D mode and then throttle back up when 3D apps need the power. I'm sure there are similar features for ATI GPUs.
- For the more adventurous, you can buy water cooling kits, and place the radiator outside, or in a window blowing exhaust air out. Make sure your pump can move the water over the delta in height, though!
My system has six disks in it (1x80GB system, 1x200GB "misc", and 4x300GB in a RAID-5), as well as 2 19" LCDs, so the hard disk and monitor features really help me out. I unforunately don't have a processor capable of dynamic clocking yet (I'm still on an Athlon XP), but I do dynamically adjust the bus down 25Mhz or so when I'm not using the computer heavily. For my laptop though, you can't beat suspend-to-disk: it takes about 14 seconds to boot in to Windows, exactly the same way as I left it. I've also offloaded all my critical services to an old, passively cooled PII/266 so that the desktop can be shut off as often as possible (e.g. when Remote Desktop and FTP aren't required).
"you still have the TCP/IP traffic to deal with so that packets get TO the game."
o rking.pdf - FreeBSD 5.3 can route 1m packets per second on a 2.8 ghz Xeon, while it's doubtful it would have to do about 1/10000 that for a cable modem on a computer about 1/50 as fast.
Stateful firewalls know all they need to know about TCP/IP to handle packets on a per-connection level. The game is running on another system, so the firewall need only needs to get a packet out onto the appropriate interface. I know PF can do this at the firewall level (see the fastroute keyword). Even if it does have to use the network stack (IPFW or IPF might not be able to route independantly, I'm not sure) FreeBSD can route packets very quickly[1].
"If you RTFA this "game router" is really only adding traffic shaping/prioritization, which is something a middle of the road router can do anyway in FIRMWARE which will be lots faster than that software."
Firmware is software that gets loaded onto a general purpose processor. Usually ARM or MIPS for broadband routers, IIRC. It doesn't matter whether it comes from an EEPROM, a flash memory chip, or a hard drive. Once it's in memory it's pretty much the same. The traffic shaping available with this will be a lot more configurable, and they wrapped the OS up into an easy-to-use distribution. It's not unusual for gamers to have unused computers sitting around, given their upgrade cycle, so it would be cheaper to use this if you have the hardware.
"Also you have to use good NICs (more $$$) on the old PC, which if it is an ISA bus PC good luck finding them, and if you find then you still got a 66MHz backplane in that old Pentium."
How many spare NICs do you have? Be honest. Until they started putting them on the motherboard most computers had one and whenever the computer died the NIC was always left over.
Pretty much any NIC will do for the purposes of broadband routing. The 66 mhz bus on a Pentium is also more than you need. A 486 can handle it. I've used a 486 with ISA NICs as a firewall on a cable modem with 5 megabits downstream bandwidth.
"There are lots of complexities here, it's not something your average gamer is going to build."
An easy to use package that runs on PCs a gamer already has? All they need to do is add a NIC or two? When they spend half their time putting in new video cards and RAID arrays on their other PC? When it'll save them enough money to get more game hardware? Sounds pretty plausible to me.
1 - http://people.freebsd.org/~andre/FreeBSD-5.3-Netw
I rarely criticize things I don't care about.
http://www.openwrt.org/
It's the most open of the alternativesd, last I looked. Not necessarily great for the lazy, though, since it will want some hand-configuring.
I've been doing this with tc on Linux for several years now, and never knew it was something so grandiose as a "gaming router".