You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Overview

A queue is a collection of data packets collectively waiting to be transmitted by a network device using a pre-defined structure methodology. Queuing works almost on the same methodology used at banks or supermarkets, where the customer is treated according to its arrival.

Queues are used to:

  • limit data rate for certain IP addresses, subnets, protocols, ports, etc.;
  • limit peer-to-peer traffic;
  • packet prioritization;
  • configure traffic bursts for traffic acceleration;
  • apply different time-based limits;
  • share available traffic among users equally, or depending on the load of the channel

Queue implementation in MikroTik RouterOS is based on Hierarchical Token Bucket (HTB). HTB allows to create hierarchical queue structure and determine relations between queues. These hierarchical structures can be attached at two different places, the Packet Flow diagram illustrate both input and postrouting chains.

There are two different ways how to configure queues in RouterOS:

  • /queue simple menu - designed to ease configuration of simple, every day queuing tasks (such as single client upload/download limitation, p2p traffic limitation, etc.).
  • /queue tree menu - for implementing advanced queuing tasks (such as global prioritization policy, user group limitations). Requires marked packet flows from /ip firewall mangle facility.

Rate limitation principles


Rate limiting is used to control the rate of traffic flow sent or received on a network interface. Traffic which rate that is less than or equal to the specified rate is sent, whereas traffic that exceeds the rate is dropped or delayed.

Rate limiting can be performed in two ways:

  1. discard all packets that exceed rate limit – rate-limiting (dropper or shaper) (100% rate limiter when queue-size=0)
  2. delay packets that exceed specific rate limit in the queue and transmit its when it is possible – rate equalizing (scheduler) (100% rate equalizing when queue-size=unlimited)

Next figure explains the difference between rate limiting and rate equalizing:

As you can see in the first case all traffic exceeds a specific rate and is dropped. In another case, traffic exceeds a specific rate and is delayed in the queue and transmitted later when it is possible, but note that the packet can be delayed only until the queue is not full. If there is no more space in the queue buffer, packets are dropped.

For each queue we can define two rate limits:

  • CIR (Committed Information Rate) – (limit-at in RouterOS) worst-case scenario, the flow will get this amount of traffic rate regardless of other traffic flows. At any given time, the bandwidth should not fall below this committed rate.
  • MIR (Maximum Information Rate) – (max-limit in RouterOS) best-case scenario, the maximum available data rate for flow, if there is free any part of the bandwidth.

Simple Queue


/queue simple

A simple queue is a plain way how to limit traffic fora particular target. Also, you can use simple queues to build advanced QoS applications. They have useful integrated features:

  • peer-to-peer traffic queuing;
  • applying queue rules on chosen time intervals;
  • prioritization;
  • using multiple packet marks from /ip firewall mangle
  • traffic shaping (scheduling) of bidirectional traffic (one limit for the total of upload + download)

Simple queues have a strict order - each packet must go through every queue until it reaches one queue which conditions fit packet parameters or until the end of the queues list is reached. For example, In the case of 1000 queues, a packet for the last queue will need to proceed through 999 queues before it will reach the destination. 

Configuration example

TODO kaut ko pavisam vienkāršu un ar modernāku diagrammu

Queue Tree

/queue tree

Queue tree creates only a one-directional queue in one of the HTBs. It is also the only way how to add queue on the separate interface. This way it is possible to ease mangle configuration - you don't need separate marks for download and upload - only upload will get to Public interface and only download will get to Private interface. The main difference from Simple Queues is that Queue tree is not ordered - all traffic pass it together.

Configuration example

TODO kaut ko pavisam vienkāršu un ar modernāku diagrammu

  • No labels