Thursday, September 17th, 2015 | Author:
  • Part 1 – IntroductionSetting up Simple Queues (This post)
  • Part 2 – Reliably Identifying trafficSetting up Mangle Rules (Coming Soon TM)
  • Part 3 – Priorities and LimitsSetting up Queue Trees (Coming Soon TM)
  • Part 4 – Monitoring UsageRedefining QueuesLimiting Abusive Devices (Coming Soon TM)
  • Part 5 – ??? Profit ???

Introduction

The first problem one usually comes across after being tasked with improving an Internet connection is that the connection is overutilised. Typically nobody knows why, who, or what is causing the problemexcept of course everyone blames the ISP. Sometimes it is the ISPbut typically you can’t prove that without having an alternative connection immediately available. I currently manage or help manage foursites/premisesthat use QoS to manage their Internet connectivity. One is my workplace, two are home connections, and the last one is a slightly variable oneusually just a home connection but alternatively, for a weekend every few months, it becomes a 140-man (and growing) LAN. Fun. 🙂

MikroTik and RouterOS

MikroTik‘s RouterOS is very powerful in the right hands. Many other routers support QoS but not with the fine-grain control MikroTik provides. Alternatively you could utilise other Linux-based router OS’s, such as DD-WRT, Smoothwall, Untangle, and so forth. Most of these typically require that you have a spare server lying about or a compatible hardware router. Mikrotik sells RouterBoards that have RouterOS builtinand they are relatively inexpensive.

My experience with routers is primarily with Cisco and MikroTikand my experience with QoS is primarily with Allot’s NetEnforcer/NetXplorer systems and MikroTik. The most popular MikroTik devices in my experience (other than their dedicated long-range wireless devices) have been their rb750 (new version namedhEX“) and rb950-based boards. They have many others available and are relatively inexpensive. In historical comparison with Cisco’s premium devices, I’ve tended to describe MikroTik’s devices as “90% the features at 10% the cost”. As this guide is aimed primarily at SME/Home use, inexpensive makes more sense. If you’re looking at getting a MikroTik device, note that MikroTik routers do not typically include DSL modems, thus your existing equipment is typically still necessary. Note also that this is not a tutorial on setting up a MikroTik device from scratch. There are plenty of guides available online for that already.

Theory into practicefirst steps

To set up QoS correctly, you need to have an idea of a policy that takes into account the following:

  • The overall connection speed
  • How many users/devices will be using the connection
  • The users/devices/services/protocols that should be prioritised for latency and/or throughput

To achieve the above in my examples, I will assume the following:

  • The MikroTik is set up with the default network configuration where the local network is 192.168.88.0/24 and the Internet connection is provided via PPPoE.
  • The connection speed is 10/2Mbps (10 Mbps download speed; 2 Mbps upload speed)
  • There will be 5 users with as many as 15 devices (multiple computers/tablets/mobile phones/WiFi etc)
  • Typical downloads require high priority with throughput but low-priority with latency
  • Gaming/Skype/Administrative protocols require high priority with both latency and throughput
  • No users are to be prioritised over others

The first and probably quickest step is to set up what RouterOS refers to as a Simple Queue.

I’ve made a short script that I have saved on my MikroTik devices to set up the simple queues. It is as follows:

:for x from 1 to 254 do={
 /queue simple add name="internet-usage-$x" dst="pppoe" max-limit=1900k/9500k target="192.168.88.$x"
}

What the above does is limit the maximum speed any individual device can use to “1900k” (1.9Mb) upload and “9500k” (9.5Mb) боргирӣ.

Notes:

  • The reason why the max limits are at 95% of the line’s maximum speed is that this guarantees no single device can fully starve the connection, negatively affecting the other users. With a larger userbase I would enforce this limit further. For example, with 100 users on a 20Mb service I might set this limit to 15Mb or even as little as 1Mb. This is entirely dependent on howabusivethe users are and, as you figure out where and how much abuse occurs, you can adjust it appropriately.
  • The prefixinternet-usagein the name parameter can be customised. Typically I set these to refer to the premises name. For example, with premises namedalphaandbeta”, I will typically putinternet-alphaandinternet-beta”. This helps with instinctively differentiating between sites.
  • The dst parameter haspppoein the example. This should be substituted with the name of the interface that provides the Internet connection.

Ensure you customise the script to be appropriate to your configuration. Save the script to the MikroTik and run itor paste it directly into the MikroTik’s terminal to execute it.

In my next post I will go over setting up what RouterOS refers to as Mangle rules. These rules serve to identify/classify the network traffic in order to make finer-grained QoS possible.

саҳм
Category: random
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Leave a Reply » Log in