Setup guide
queues should always be configured on the outgoing interface regarding the traffic flow. There are
two additional virtual interfaces in queue tree which are used to limit all the traffic coming to
(global-in) or leaving (global-out) the router regardless of physical interface.
Specifications
Packages required: system
License required: level1 (limited to 1 queue), level3
queue
Standards and Technologies: None
Hardware usage: significant
Related Documents
• Package Management
• IP Addresses and ARP
• Firewall Filters
Description
Clasless Queues
There are four types of simple queues implemented in RouterOS: PFIFO, BFIFO, SFQ and RED.
With Bytes First-In First-Out (BFIFO) and Packets First-In First-Out (PFIFO) packets are served in
the same order as they are received. The only difference between BFIFO and PFIFO is that PFIFO
has a length measured in packets, BFIFO in bytes. Generally, you do not want to use BFIFO or
PFIFO as traffic shapers. It's better to use them just for statistics as they are pretty fast. The only
exception is when you are running out of resources with RED and/or with complicated queue tree.
Stochastic Fair Queuing (SFQ) cannot limit traffic at all. Its main idea is to equalize sessions (not
computer traffic, but session traffic, it is sometimes mentioned as SFQ drawback) when your link is
completely full. It works in round-robin fashion, giving each session a chance to send sfq-allot
bytes. Its algorithm can distinguish only 1024 sessions, and that is why several sessions can be
treated as one. Each sfq-perturb seconds it drops internal table mixing all the connections and
creates a new table. As it is very fast, you may want to use it as a child queue.
The normal behavior of queues is called tail-drop. Tail-drop works by queuing up to a certain
amount, then dropping all traffic that 'spills over'. Random Early Detection (RED is also known as
Random Early Drop because it actually works that way) statistically drops packets from flows
before it reaches its hard limit. This causes a congested backbone link to slow more gracefully. It
starts dropping packets when threshold reaches red-min-threshold mark randomly with increasing
probability as threshold rising. Maximum probability is used when traffic reaches
red-max-threshold mark. Then packets are simply thrown away. burst parameter is the number of
packets allowed to burst through the interface when the link is empty (generally value of
(red-min-threshold+red-min-threshold+red-max-threshold)/3000 works fine). The minimum
value that can be used here is equal to the value of red-min-threshold.
Classful Queues
Classful queues are very useful if you have different kinds of traffic which should have different
treatment. Generally, we can set only one queue on the interface, but in RouterOS even simple