1

I am planning to turn my raspberry pi B+ into a router. The main motto is to create a QOS application on my Pi so that I can limit the bandwidth usage to a particular application. For example if I want to limit the usage of the bandwidth to www.facebook.com, I should be able to do it.So, is this possible ? I know that openWRT is used for routers but how it works for RPI, is it as stable as other distributions to Raspberry.

So, for the application I mentioned which is the better option, should I stick to Raspbian or port OpenWRT to my PI?

1

OpenWRT has two potential advantages, but they don't really apply on the pi:

  • It is very compact for use on low memory devices, but the pi is not low memory in this sense.

  • It may include patches for particular hardware, but that's what raspbian et. al. do for the pi already.

So I do not think it will be worthwhile bothering with.

For example if I want to limit the usage of the bandwidth to www.facebook.com, I should be able to do it.So, is this possible ?

Yes, this kind of thing is done by manipulating the kernel netfilter firewall using iptables, which will be exactly the same on raspbian or openWRT, or anything else using the linux kernel. Specific questions about how to do specific things this way are more appropriate to the Unix & Linux Exchange. First search around online for a tutorial to familiarize yourself with iptables. There's lots of them -- e.g. this one is probably a good introduction, this one is much more in-depth.

Routing is mostly done with network address translation, a feature of iptables/netfilter, although there are other optional aspects.

  • Thanks for the answer. Other than this is their application specific benefit of using openWRT. From your answer I understood that the router specific applications provided by openWRT can be implemented using raspbian.Am I correct ? I installed openWRT on my Pi B+ and from that experience and the stuff I read from internet I came to know that openWRT do not have a stable support for Raspberry Pi yet. Is this true ? – Ravi Dec 28 '14 at 7:49
  • I imagine since openWRT is geared toward routers, it will be better for that out of the box than raspbian. However, 1) Routing is mostly about configuring iptables, which will be the same in both cases, 2) Any software that runs on openWRT will almost certainly be available in some form for raspbian. With regard to the pi port, I doubt much effort has been put in because 1) It's not necessary since regular linux will work fine with the amount of RAM, etc. 2) The pi would likely make a lousy router because it only has one NIC. If you add more via the USB jacks, or use wifi... – goldilocks Dec 28 '14 at 13:52
  • ...for the clients, they'll all still have to share the same bus which has a total bandwidth of 480 Mbps -- and all the traffic has to go through, i.e., in and out, on that bus. I presume you've already thought about this and it's fine in your context, but for most uses it would not be worthwhile, I think. Even on a normal home LAN with a few people, streaming videos, phones, etc. it would be easy for it to end up as a bottleneck. – goldilocks Dec 28 '14 at 13:59
  • I have found that using a RPi 2B as a router cuts my Internet bandwidth in half. QoS of a crude sort, I suppose, but probably not what you're after. – bobstro Apr 24 '15 at 12:03
0

OpenWRT/LEDE is now supported on most of the Raspberry Pis. It has a range of features and is designed around deployment to embedded systems. For example it uses the Linux OverlayFS in conjunction with a read-only root filesystem image to provide for robust operation in the face of Flash memory corruption and arbitrary power cycling. Whilst a number of features may also be achieved using a conventional Linux distribution on a Pi OpenWRT does provide a packaged reliable solution ready to go with a web interface.

For general info in QoS on Linux see LARTC and for OpenWRT. To control queuing on Linux you'll need to use the tc command. E.g to show detailed info and stats on the current queue configuration for the eth0 interface:

tc -s -d qdisc ls dev eth0

With the latest versions of OpenWRT the default queue is now the fq_codel which has been designed to alleviate the problems of "Bufferbloat".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.