Bandwidth Management & Traffic Shaping

Hello,

what features does the RouterOS provide for Bandwidth Management & Traffic Shaping? I need a device on the network for just that task:

Distribute Bandwidth equally among users, without capping it artificially. Let’s say I have 10Mb on the network. If 1 user is online, he might use all the available bandwidth (10Mb). If 10 users are online downloading heavily, no one should get more than 1Mb.

Also, I need QoS to prioritize VoIP (SIP, Skype etc) and video streams.

And finally I also need bandwidth monitoring and reporting to see the network usage.

Is all this possible with RouterOS?

Thanks

Most of that is possible yes depending how much you want to do and how deep you want to get into configuring stuff.

The MikroTik is primarily a layer3 device, so it is up to you to set up the proper configuration to identify the traffic you want and what you don’t want. Once you identify the classes of traffic that you want and mark them appropriately in the router, you then set up your queue rules. Based off of what you are saying you want, you will want to do PCQ with the Queue trees. There are several examples on the Wiki that you should read through, as well as several posts on the forum. The main thing is, you are going to have to be willing to get dirty and learn how to set these things up, and be willing to experiment.

As for monitoring and reporting, it depends on how much detail you are looking for. The MikroTik supports Netflows, this will tell you where people went, when, and how much traffic was passed, as well as usually get you a bandwidth chart, but it is up to you to set up the Netflows collector server. You can also use the built in bandwidth charts to see usage, but both of these methods take a 5 minute average. You could also use an SNMP server to get and generate bandwidth charts.

Thanks for your reply, Feklar.

I’m willing to learn RouterOS if it gets me where I want to go. It’s said to be difficult, but at least in Linux, difficulty is proportional with the accuracy/quality of documentation. So I hope there’s good documentation out there :slight_smile: I will lookup the threads on PCQ with the Queue Trees.

I mostly need VoIP prioritized, the rest is not that critical as the ISP seems to do some basic traffic shaping already. My main concern is distributing available bandwidth between users. Those features seem to be taken for granted, yet rarely available in bandwidth managers (except those really expensive appliances)… It’ easy to cap each user at 1Mb, but what if he’s alone on the network, and you want to give him all that’s available (10Mb)? Many solutions I looked into can’t do that.

For monitoring, I just need to get an idea of usage to see if bandwidth upgrades are required, identify peak hours etc… Nothing too sophisticated.

Would you recommend a RB433AH to do all of the above on a network with about 20Mb?

Thanks!

don’t know if this is what your after,

But we have a very advanced, customizable ‘radius server’ using freeradius

the system

has customer ‘plans’ with data limits and set speeds ( such as 1500/512 or 12Mbit/1mbit)
it bills, it shapes users when they hit monthly limit ( to 128k)
it auto unshapes them on anniversary date, generates all invoices ect
lets them buy bonus quota ect..

also ofc accounts for all usage, every 5 mins it updates the customers download usage ect.

If you want the wireless interfaces, then the 433AH should be enough to handle those needs, otherwise the 450 or 450G are good choices. We have several 450 boards running 100+ room hotels and they handle them fine. This will give you a rough idea what you can expect out of the board with just basic settings.
http://routerboard.com/pdf/RouterBOARD_Price_Performance_Comparison.pdf
The more services you run and the more complex the rules, the more it eats into performance. So plan accordingly, spending an extra 30-50 bucks now can save you a lot of headaches later.

MikroTik has decent documentation for most of their stuff, and there are plenty of user examples. Queue’s in general are just confusing though, so it will require quite a bit of playing around to get it to a point where you are happy. PCQ will get you what you want in being able to dynamically give people more bandwidth when there are limited number of users on. It generates sub queues automatically based on what rules you feed it, so if 10 people are online each get 1 Meg if 1 person is online he can get his 10 megs. One word of advice, be sure to set the max limit to a little bellow what is actually capable on the ISP, usually 90% of capacity is good. Otherwise your queuing seems to get shot by the ISP.

For the monitoring aspect, the built in graphs will probably be enough then, I just sometimes have problems getting them to stay saved to the flash drive, so a basic SNMP server might be good for you to get as the main source of holding this information for trending.

Depending on what kind of VoIP system you are thinking about, it should be fairly easy for you to prioritize that over everything. I know services like Skype use some non standard ports, so that can throw you for a loop. When you start playing around with queues and mangle rules, this document will be invaluable in you figuring out what needs to go where.
http://wiki.mikrotik.com/wiki/Packet_Flow#Diagram
In general it is going to be a lot easier to determine the kinds of traffic you like and then mark everything else as low priority. Once you have the services set up that people are going to notice as not working right when there is low bandwidth, no one will really notice a lower quality of service on other traffic.

Thanks again for the valuable info, Feklar! I’ve ordered a 450G just to be safe with performance and will get started soon.

Would you recommend to have Skype users use a specific port range (let’s say 18,100 - 18,200) and have that on the QoS priority list? Or if possible, could multiple skype users share the same port (let’s say 18,000)? That would make life easier if I could tell them to use a specific port (the same for all).

Btw, the Mikrotik hardware is very sweet and there’s plenty of choices: wired, wireless, dual band etc… I can see myself using it even at home to manage internet traffic or for local sector antennas…

I will also look into Freeradius; never heard of it before. We are looking into Sputnik for billing as well, but Freeradius might be much better featurewise and ‘free’…

You would have to run some Torch on your interfaces to see what Skype does, but most of the Skype traffic by default I have seen, if I remember correctly, has been a src-port of 10000 and a dst-port of 10000 instead of using the standard SIP ports of 5060 and 5061 for the src-port. Skype should have it documented what port ranges it can use, but most users won’t ever deviate from the default settings. If you can force your Skype users to use a predefined port range all the better for you to classify the traffic, that just creates more overhead for you which is often not worth it. For most other VoIP systems you can usually rely upon them using the standard SIP ports. Where the problem has come into play for me in my setups is a lot of popular VPNs use those same dst and src ports of 10000 for their tunnels. Not a huge issue, but something to be aware of.

This wiki page could be a good place for you to start in building a QoS system, at least as far as VoIP is concerned. This is where I got started and grew out from there once I understood more of what was going on. I’m no expert, but I know enough to get myself into a lot of trouble with it :laughing: .
http://wiki.mikrotik.com/wiki/Manual:Connection_Rate

If you are looking for a back end system for billing, there are several options out there. If you go with FreeRadius, that is just the authentication piece, you still need a back end system for the other parts. We have our own back end system that we developed to handle all of those billing, access codes, and authentication pieces for us.

Skype picks a random port after installation from my experience. It could be anything really, similar to torrent clients which choose a random port that you can change afterwards…

But it would be no big deal for me to let users know to configure Skype for port 10000 lets say if they want QoS. There’s very few of them anyway, it’s not that popular around here. Most have Vonage or Magicjack (which sounds bad no matter what you do) which are SIP.

What is Torch? I googled and got a math library for Linux…

Thanks for the bit about Freeradius. We’ll have to go with a turnkey system for billing. We don’t have the time/budget to develop one… If you know something better than Sputnik, please let me know :slight_smile:

Torch: http://wiki.mikrotik.com/wiki/Manual:Troubleshooting_tools#Torch_.28.2Ftool_torch.29

Well I obviously think what we have is better than Sputnik :sunglasses: . If interested I can get you in touch with my CTO and he would be happy to line up a web demo or something. There are a few other packages that are mentioned throughout the forum too that might do what you want. It all depends on what your goals are what features you are looking for.

And as Normis mentioned, Torch is a MikroTik tool. You run it on an interface and it will tell you a lot of useful information like the src and dst IP and port of a connection, and the current Rx and Tx of that connection. It basically lets you see what is going on over the router and if a client is passing traffic or not. Very invaluable tool for troubleshooting.