From freebsd.xn--wesstrm-f1a.sethis article explaining the technical problem. The solution proposed in the article was to manipulate the outgoing data packets by rearranging them and making sure the used upload bandwidth never exceeded the available bandwidth. The tool to accomplish this was a traffic shaping framework called ALTQ but this framework also needed some kind of controlling mechanism and the suggested software for this was pf, the native firewall of the operating system OpenBSD. This was back in 2003 and without any prior UNIX knowledge I eventually got this to work and have used this technique since then. For various reasons I did however switch to FreeBSD when pf was ported to this operating system in 2004.
Since then, I have helped several of my friends to build their own FreeBSD routers. Due to the complexity of the installation, I eventually found it necessary to write down the steps involved, allowing me to build new routers without missing any important configuration steps. This wiki is the result of that work and I share it here with you in case you find it useful and want to build a router of your own.
To better understand what a FreeBSD-based router can do for you, let's establish a few goals.
- Allow full utilization of upload and download bandwidth simultaneously.
- Maintain low and stable ping for online gaming regardless of upload bandwidth utilization.
- Allow low bandwidth tasks (like browsing and emailing) to be performed without latency regardless of upload bandwidth utilization.
- Deploy a secure and efficient stateful firewall.
- Provide NAT, DHCP and other basic network services to the computers on your home LAN.
- Stability - you should be able to run this router for years without rebooting it.
It's important to understand that the goals involving low latency and stable ping only can be achieved as long as they depend on the upload bandwidth because this is the only traffic you can shape. If you download heavily, it doesn't matter what you do with the traffic once it reaches your router, because it has already crossed your DSL or cable connection by then and rearranging the data packets at that point doesn't make any difference. Heavy downloading will continue to delay other traffic and the only way around that would be to prioritize the traffic at your ISP's upstream router which you probably don't have access to.
There is of course another purpose to this wiki too. I don't claim to be an expert in any way on the things I explain here. The initial version of this wiki will build upon the experience and knowledge I've gathered for five years using OpenBSD and FreeBSD. There are many things I still don't comprehend and lots of functionality I'd like to add to my own router but can't since I simply don't understand certain concepts. My hope is that people who read this wiki will help by adding their own knowledge and experience and in that process teach me the things I don't know.