SlideShare a Scribd company logo
1 of 67
Download to read offline
ยฉ MikroTik 2011
MikroTik RouterOS
Workshop
Lets talk about QoS
Las Vegas
MUM USA 2011
ยฉ MikroTik 2011 2
About Me
Jฤnis Meฤฃis, MikroTik
Jฤnis (Tehnical, Trainer, NOT Sales)
Support & Training Engineer for almost 7 years
Specialization: QoS, PPP, Firewall, Routing
Teaching MikroTik RouterOS classes since 2005
ยฉ MikroTik 2011 3
Workshop Plan
Packet Flow Diagram
HTB
Queue Types (PCQ, multi-queue-fifo)
Burst
Queue Size
Queue tree and Simple queues
ยฉ MikroTik 2011 4
Packet Flow Diagram
ยฉ MikroTik 2011 5
Packet Flow Diagram
Packet flow diagram is โ€œThe Big Pictureโ€ of
RouterOS
It is impossible to properly manage and
maintain complex configurations without the
knowledge - what happens when and why?
Packet flow Diagram consist of 2 parts
Bridging or Layer-2 (MAC) where Routing part is
simplified to one "Layer-3" box
Routing or Layer-3 (IP) where Bridging part is
simplified to one "Bridging" box
ยฉ MikroTik 2011 6
Bridging or Layer-2 (MAC)
ยฉ MikroTik 2011 7
Routing or Layer-3 (IP)
ยฉ MikroTik 2011 8
Diagram Abbreviations
ยฉ MikroTik 2011 9
Simple Routing
ยฉ MikroTik 2011 10
Bridging with IP firewall
ยฉ MikroTik 2011 11
Bridge-to-Bridge Routing (part1)
ยฉ MikroTik 2011 12
Bridge-to-Bridge Routing (part2)
ยฉ MikroTik 2011 13
IPSec Encryption
ยฉ MikroTik 2011 14
IPSec Decryption
ยฉ MikroTik 2011 15
Hierarchical Token Bucket
ยฉ MikroTik 2011 16
Lets Simplify!
QoS Packet Flow Diagram
ยฉ MikroTik 2011 17
Global-Out or Interface HTB?
There are two fundamental differences
In case of SRC-NAT (masquerade) Global-Out
will be aware of private client addresses, but
Interface HTB will not โ€“ Interface HTB is after
SRC-NAT
Each Interface HTB only receives traffic that will
be leaving through a particular interface โ€“ there
is no need for to separate upload and download
in mangle
ยฉ MikroTik 2011 18
Mangle
The mangle facility allows you to mark IP
packets with special marks.
These marks are used by other router facilities
like routing and bandwidth management to
identify the packets.
Additionally, the mangle facility is used to
modify some fields in the IP header, like TOS
(DSCP) and TTL fields.
ยฉ MikroTik 2011 19
Hierarchical Token Bucket
All bandwidth management implementation in
RouterOS is based on Hierarchical Token
Bucket (HTB)
HTB allows you to create hierarchical queue
structure and determine relations between
queues
RouterOS supports 3 virtual HTBs (global-in,
global-total, global-out) and one more just
before every output interface
ยฉ MikroTik 2011 20
HTB (cont.)
When packet travels through the router, it
passes all 4 HTB trees
When packet travels to the router, it passes
only global-in and global-total HTB.
When packet travels from the router, it passes
global-out, global-total and interface HTB.
ยฉ MikroTik 2011 21
HTB Features - Structure
As soon as queue have at least one child it
become parent queue
All child queues (don't matter how many levels
of parents they have) are on the same bottom
level of HTB
Child queues make actual traffic consumption,
parent queues are responsible only for traffic
distribution
Child queues will get limit-at first and then rest
of the traffic will distributed by parents
ยฉ MikroTik 2011 22
HTB Features - Structure
ยฉ MikroTik 2011 23
HTB Features โ€“ Dual Limitation
HTB has two rate limits:
CIR (Committed Information Rate) โ€“ (limit-at in
RouterOS) worst case scenario, flow will get this
amount of traffic no matter what (assuming we can
actually send so much data)
MIR (Maximal Information Rate) โ€“ (max-limit in
RouterOS) best case scenario, rate that flow can
get up to, if there queue's parent has spare
bandwidth
At first HTB will try to satisfy every child queue's
limit-at โ€“ only then it will try to reach max-limit
ยฉ MikroTik 2011 24
Dual Limitation
Maximal rate of the parent should be equal or
bigger than sum of committed rates of the
children
MIR (parent) โ‰ฅ CIR(child1) +...+ CIR(childN)
Maximal rate of any child should be less or
equal to maximal rate of the parent
MIR (parent) โ‰ฅ MIR(child1)
MIR (parent) โ‰ฅ MIR(child2)
MIR (parent) โ‰ฅ MIR(childN)
ยฉ MikroTik 2011 25
HTB - limit-at
ยฉ MikroTik 2011 26
HTB - max-limit
ยฉ MikroTik 2011 27
HTB Features - Priority
Work only for child queues to arrange them
8 is the lowest priority, 1 is the highest
Queue with higher priority will get chance to
satisfy its max-limit before other queues
Actual traffic prioritization will work only if limits
are specified. Queue without limits will not
prioritize anything
ยฉ MikroTik 2011 28
QoS Myth buster
HTB priority doesn't rearrange packet sequence
โ€“ it doesn't put some packets before others
In HTB โ€œPriorityโ€ is an option that helps to decide
what packets will pass and what packets will be
dropped
This drop decision is based on limitations, so if there
are no limits there are no need to drop anything, so
priority have no effect
Priority doesn't affect CIR traffic โ€“ it just passes
through QoS (even if parent's don't have such
amount of traffic)
ยฉ MikroTik 2011 29
HTB โ€“ limit-at of the Parent
ยฉ MikroTik 2011 30
HTB โ€“ limit-at > parent's max-limit
ยฉ MikroTik 2011 31
QoS Myth Buster
QoS can't control the amount of received traffic
that you see on your interfaces.
In Packet Flow diagram global-in is way after Input
interface where statistic is registered
Effect of traffic slowing down most probably is effect
of TCP protocol behaviour
If clients PC was able to send out traffic it have to
arrive somewhere it can't just disappear
Only way to see QoS in action is to monitor TX of
opposite interface.
ยฉ MikroTik 2011 32
QoS Myth Buster
QoS doesn't know how much actual bandwidth
is available
In Packet Flow diagram all HTB are before output
interface and output interfaces driver is the first one
that might know how much actual bandwidth you
have.
Interface driver knows the maximal hardware
limitation of your interface, IF actual limitation is
smaller, the only way to provide QoS with limitation
information is to specify all limits yourself
ยฉ MikroTik 2011 33
Queue Types
ยฉ MikroTik 2011 34
Default Queue Types
ยฉ MikroTik 2011 35
FIFO
Behaviour:
What comes in first is handled first, what comes
in next waits until the first is finished. Number of
waiting units (Packets or Bytes) is limited by
โ€œqueue sizeโ€ option. If queue โ€œis fullโ€ next units
are dropped
ยฉ MikroTik 2011 36
ยฉ MikroTik 2011 37
ยฉ MikroTik 2011 38
MQ PFIFO
Multi queue packet FIFO queue was designed
multi-core router solutions (RB1100AHx2)
MQ PFIFO should be used as default interface
queue for any Ethernets that have several
RX/TX queues (you can check that in /system
resources IRQ menu)
MQ FIFO is alternative to RPS (receive Packet
Steering) โ€“ so do not use both on same
interface it will result in performance loss.
ยฉ MikroTik 2011 39
RED
Behaviour:
Same as FIFO with an additional feature โ€“
additional drop probability even if queue is not
full.
This probability is based on
comparison of average
queue length over some
period of time to minimal
and maximal threshold โ€“
closer to maximal
threshold the bigger the
chance of a drop.
ยฉ MikroTik 2011 40
ยฉ MikroTik 2011 41
SFQ
Behaviour:
Based on a hash value from the source and
destination address SFQ divides the traffic into
1024 sub-streams
Then the Round Robin
algorithm will distribute
an equal amount of
traffic to each sub-
stream
ยฉ MikroTik 2011 42
ยฉ MikroTik 2011 43
SFQ Example
SFQ should be used for equalizing similar
connections
Usually used to manage information flow to or
from the servers, so it can offer services to
every customer
Ideal for p2p limitation, it is possible to place
strict limitation without dropping connections,
ยฉ MikroTik 2011 44
PCQ
PCQ was introduced to
optimize massive QoS
systems, where most of
the queues are exactly
the same for different
sub-streams
Starting from version
5.0rc5 PCQ have burst
support and IPv6
support
ยฉ MikroTik 2011 45
PCQ Classification (1)
ยฉ MikroTik 2011 46
PCQ Classification (2)
ยฉ MikroTik 2011 47
ยฉ MikroTik 2011 48
PCQ Rate (1)
ยฉ MikroTik 2011 49
PCQ Rate (2)
ยฉ MikroTik 2011 50
Burst
ยฉ MikroTik 2011 51
QoS Feature โ€œBurstโ€
Burst is one of the best ways to increase HTTP
performance
Bursts are used to allow higher data rates for a
short period of time
If an average data rate is less than burst-
threshold, burst could be used( actual data rate
can reach burst-limit)
Average data rate is calculated from the last
burst-time seconds
ยฉ MikroTik 2011 52
Burst - Average Data Rate
Average data rate is calculated as follows:
burst-time is being divided into 16 periods
router calculates the average data rate of each
class over these small periods
Note, that the actual burst period is not equal
to the burst-time. It can be several times shorter
than the burst-time depending on the max-limit,
burst-limit, burst-threshold, and actual data rate
history (see the graph example on the next
slide)
ยฉ MikroTik 2011 53
Burst
ยฉ MikroTik 2011 54
Burst (Part 2)
ยฉ MikroTik 2011 55
Queue Size
ยฉ MikroTik 2011 56
Queue Size
Queue size has a direct impact on the
performance of the queue โ€“ it is a choice
between packet loss and higher latency
In RouterOS queue sizes are common between
the queue types
To understand Queue size's impact on the
traffic we will look at simplified example
We will ignore packet retransmits
We will assume that process that run continuously
can be divided into steps
ยฉ MikroTik 2011 57
There are 25 steps and there are total of 1610
incoming packets over this time frame.
ยฉ MikroTik 2011 58
With this type of limitation only 1250 out of 1610
packets were able to pass the queue (22,4%
packet drop), but all packets arrive without
delay.
ยฉ MikroTik 2011 59
There was no packet loss, but 630 (39,1%)
packets had 1 step delay, and other 170
(10,6%) packets had 2 step delay. (delay =
latency)
ยฉ MikroTik 2011 60
There were 320 (19,9%) packets dropped and
80 (5,0%) packets had 1 step delay.
ยฉ MikroTik 2011 61
There were 190 (11,8%) packets dropped and
400 (24,8%) packets had 1 step delay.
ยฉ MikroTik 2011 62
Simple Queues
Simple queues are ordered - similar to firewall
rules
In order to get to 999th
queue packet will have to be
checked for match to all 998 previous queues
Each simple queue might stand for 3 separate
queues:
One in Global-in (โ€œdirectโ€ part)
One in Global-out (โ€œreverseโ€ part)
One in Global-total (โ€œtotalโ€ part)
ยฉ MikroTik 2011 63
Simple Queues and Mangle
ยฉ MikroTik 2011 64
Queue Tree
Tree queue is one directional only and can be
placed in any of the available HTBs
Queue Tree queues don't have any order โ€“ all
traffic is processed simultaneously
All child queues must have packet marks from
โ€œ/ip firewall mangleโ€ facility assigned to them
If placed in the same HTB, Simple queue will
take all the traffic away from the Queue Tree
queue
ยฉ MikroTik 2011 65
Queue Tree โ€“ Winbox View
ยฉ MikroTik 2011 66
Simple Queue and Queue Tree
(Vegas Style) demonstration
ยฉ MikroTik 2011 67
Good luck!

More Related Content

Similar to Lets talk about QoS by Megis.pdf

Voltaire ufm en_nov10
Voltaire ufm en_nov10Voltaire ufm en_nov10
Voltaire ufm en_nov10sciecomp
ย 
Carrier Strategies for Backbone Traffic Engineering and QoS
Carrier Strategies for Backbone Traffic Engineering and QoSCarrier Strategies for Backbone Traffic Engineering and QoS
Carrier Strategies for Backbone Traffic Engineering and QoSVishal Sharma, Ph.D.
ย 
Aceleracion TCP Mikrotik.pdf
Aceleracion TCP Mikrotik.pdfAceleracion TCP Mikrotik.pdf
Aceleracion TCP Mikrotik.pdfWifiCren
ย 
00769767
0076976700769767
00769767Kevin Huang
ย 
MC0087 Internal Assignment (SMU)
MC0087 Internal Assignment (SMU)MC0087 Internal Assignment (SMU)
MC0087 Internal Assignment (SMU)Krishan Pareek
ย 
ETE405-lec7.pdf
ETE405-lec7.pdfETE405-lec7.pdf
ETE405-lec7.pdfmashiur
ย 
A novel token based approach towards packet loss control
A novel token based approach towards packet loss controlA novel token based approach towards packet loss control
A novel token based approach towards packet loss controleSAT Journals
ย 
A novel token based approach towards packet loss
A novel token based approach towards packet lossA novel token based approach towards packet loss
A novel token based approach towards packet losseSAT Publishing House
ย 
Sky x technology
Sky x technologySky x technology
Sky x technologyHafsa Hayath
ย 
TCP RemoteFX and IPQ
TCP RemoteFX and IPQTCP RemoteFX and IPQ
TCP RemoteFX and IPQIPeak Networks
ย 
Latency considerations in_lte
Latency considerations in_lteLatency considerations in_lte
Latency considerations in_lteMary McEvoy Carroll
ย 
Protocols for IoT
Protocols for IoTProtocols for IoT
Protocols for IoTAravindhan G K
ย 
LREProxy module for Kamailio Presenation
LREProxy module for Kamailio PresenationLREProxy module for Kamailio Presenation
LREProxy module for Kamailio PresenationMojtaba Esfandiari
ย 
Quality of Servise
Quality of ServiseQuality of Servise
Quality of ServiseRaza_Abidi
ย 
Chapter 3. sensors in the network domain
Chapter 3. sensors in the network domainChapter 3. sensors in the network domain
Chapter 3. sensors in the network domainPhu Nguyen
ย 
The Impact of Software-based Virtual Network in the Public Cloud
The Impact of Software-based Virtual Network in the Public CloudThe Impact of Software-based Virtual Network in the Public Cloud
The Impact of Software-based Virtual Network in the Public CloudChunghan Lee
ย 
Improvement of Congestion window and Link utilization of High Speed Protocols...
Improvement of Congestion window and Link utilization of High Speed Protocols...Improvement of Congestion window and Link utilization of High Speed Protocols...
Improvement of Congestion window and Link utilization of High Speed Protocols...IOSR Journals
ย 
Network Telemetry
Network TelemetryNetwork Telemetry
Network TelemetryAalok Shah
ย 

Similar to Lets talk about QoS by Megis.pdf (20)

Voltaire ufm en_nov10
Voltaire ufm en_nov10Voltaire ufm en_nov10
Voltaire ufm en_nov10
ย 
WebRTC DataChannels demystified
WebRTC DataChannels demystifiedWebRTC DataChannels demystified
WebRTC DataChannels demystified
ย 
Carrier Strategies for Backbone Traffic Engineering and QoS
Carrier Strategies for Backbone Traffic Engineering and QoSCarrier Strategies for Backbone Traffic Engineering and QoS
Carrier Strategies for Backbone Traffic Engineering and QoS
ย 
Aceleracion TCP Mikrotik.pdf
Aceleracion TCP Mikrotik.pdfAceleracion TCP Mikrotik.pdf
Aceleracion TCP Mikrotik.pdf
ย 
00769767
0076976700769767
00769767
ย 
MC0087 Internal Assignment (SMU)
MC0087 Internal Assignment (SMU)MC0087 Internal Assignment (SMU)
MC0087 Internal Assignment (SMU)
ย 
ETE405-lec7.pdf
ETE405-lec7.pdfETE405-lec7.pdf
ETE405-lec7.pdf
ย 
A novel token based approach towards packet loss control
A novel token based approach towards packet loss controlA novel token based approach towards packet loss control
A novel token based approach towards packet loss control
ย 
A novel token based approach towards packet loss
A novel token based approach towards packet lossA novel token based approach towards packet loss
A novel token based approach towards packet loss
ย 
Sky x technology
Sky x technologySky x technology
Sky x technology
ย 
TCP RemoteFX and IPQ
TCP RemoteFX and IPQTCP RemoteFX and IPQ
TCP RemoteFX and IPQ
ย 
Latency considerations in_lte
Latency considerations in_lteLatency considerations in_lte
Latency considerations in_lte
ย 
Protocols for IoT
Protocols for IoTProtocols for IoT
Protocols for IoT
ย 
LREProxy module for Kamailio Presenation
LREProxy module for Kamailio PresenationLREProxy module for Kamailio Presenation
LREProxy module for Kamailio Presenation
ย 
Quality of Servise
Quality of ServiseQuality of Servise
Quality of Servise
ย 
Chapter04
Chapter04Chapter04
Chapter04
ย 
Chapter 3. sensors in the network domain
Chapter 3. sensors in the network domainChapter 3. sensors in the network domain
Chapter 3. sensors in the network domain
ย 
The Impact of Software-based Virtual Network in the Public Cloud
The Impact of Software-based Virtual Network in the Public CloudThe Impact of Software-based Virtual Network in the Public Cloud
The Impact of Software-based Virtual Network in the Public Cloud
ย 
Improvement of Congestion window and Link utilization of High Speed Protocols...
Improvement of Congestion window and Link utilization of High Speed Protocols...Improvement of Congestion window and Link utilization of High Speed Protocols...
Improvement of Congestion window and Link utilization of High Speed Protocols...
ย 
Network Telemetry
Network TelemetryNetwork Telemetry
Network Telemetry
ย 

Recently uploaded

VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
ย 
( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...nilamkumrai
ย 
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceReal Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceEscorts Call Girls
ย 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...SUHANI PANDEY
ย 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubaikojalkojal131
ย 
Call Now โ˜Ž 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now โ˜Ž 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now โ˜Ž 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now โ˜Ž 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.soniya singh
ย 
Lucknow โคCALL GIRL 88759*99948 โคCALL GIRLS IN Lucknow ESCORT SERVICEโคCALL GIRL
Lucknow โคCALL GIRL 88759*99948 โคCALL GIRLS IN Lucknow ESCORT SERVICEโคCALL GIRLLucknow โคCALL GIRL 88759*99948 โคCALL GIRLS IN Lucknow ESCORT SERVICEโคCALL GIRL
Lucknow โคCALL GIRL 88759*99948 โคCALL GIRLS IN Lucknow ESCORT SERVICEโคCALL GIRLimonikaupta
ย 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...SUHANI PANDEY
ย 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...SUHANI PANDEY
ย 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...SUHANI PANDEY
ย 
โ‚น5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] ๐Ÿ”|97111...
โ‚น5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] ๐Ÿ”|97111...โ‚น5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] ๐Ÿ”|97111...
โ‚น5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] ๐Ÿ”|97111...Diya Sharma
ย 
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort ServiceCall Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...SUHANI PANDEY
ย 
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...SUHANI PANDEY
ย 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...SUHANI PANDEY
ย 
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...SUHANI PANDEY
ย 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC
ย 
Busty DesiโšกCall Girls in Vasundhara Ghaziabad >เผ’8448380779 Escort Service
Busty DesiโšกCall Girls in Vasundhara Ghaziabad >เผ’8448380779 Escort ServiceBusty DesiโšกCall Girls in Vasundhara Ghaziabad >เผ’8448380779 Escort Service
Busty DesiโšกCall Girls in Vasundhara Ghaziabad >เผ’8448380779 Escort ServiceDelhi Call girls
ย 

Recently uploaded (20)

VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
ย 
( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...
ย 
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐ŸฅตLow Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
ย 
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceReal Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
ย 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
ย 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
ย 
Call Now โ˜Ž 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now โ˜Ž 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now โ˜Ž 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now โ˜Ž 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
ย 
Lucknow โคCALL GIRL 88759*99948 โคCALL GIRLS IN Lucknow ESCORT SERVICEโคCALL GIRL
Lucknow โคCALL GIRL 88759*99948 โคCALL GIRLS IN Lucknow ESCORT SERVICEโคCALL GIRLLucknow โคCALL GIRL 88759*99948 โคCALL GIRLS IN Lucknow ESCORT SERVICEโคCALL GIRL
Lucknow โคCALL GIRL 88759*99948 โคCALL GIRLS IN Lucknow ESCORT SERVICEโคCALL GIRL
ย 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
ย 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
ย 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
ย 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
ย 
โ‚น5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] ๐Ÿ”|97111...
โ‚น5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] ๐Ÿ”|97111...โ‚น5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] ๐Ÿ”|97111...
โ‚น5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] ๐Ÿ”|97111...
ย 
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort ServiceCall Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
ย 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
ย 
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
ย 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
ย 
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
ย 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
ย 
Busty DesiโšกCall Girls in Vasundhara Ghaziabad >เผ’8448380779 Escort Service
Busty DesiโšกCall Girls in Vasundhara Ghaziabad >เผ’8448380779 Escort ServiceBusty DesiโšกCall Girls in Vasundhara Ghaziabad >เผ’8448380779 Escort Service
Busty DesiโšกCall Girls in Vasundhara Ghaziabad >เผ’8448380779 Escort Service
ย 

Lets talk about QoS by Megis.pdf

  • 1. ยฉ MikroTik 2011 MikroTik RouterOS Workshop Lets talk about QoS Las Vegas MUM USA 2011
  • 2. ยฉ MikroTik 2011 2 About Me Jฤnis Meฤฃis, MikroTik Jฤnis (Tehnical, Trainer, NOT Sales) Support & Training Engineer for almost 7 years Specialization: QoS, PPP, Firewall, Routing Teaching MikroTik RouterOS classes since 2005
  • 3. ยฉ MikroTik 2011 3 Workshop Plan Packet Flow Diagram HTB Queue Types (PCQ, multi-queue-fifo) Burst Queue Size Queue tree and Simple queues
  • 4. ยฉ MikroTik 2011 4 Packet Flow Diagram
  • 5. ยฉ MikroTik 2011 5 Packet Flow Diagram Packet flow diagram is โ€œThe Big Pictureโ€ of RouterOS It is impossible to properly manage and maintain complex configurations without the knowledge - what happens when and why? Packet flow Diagram consist of 2 parts Bridging or Layer-2 (MAC) where Routing part is simplified to one "Layer-3" box Routing or Layer-3 (IP) where Bridging part is simplified to one "Bridging" box
  • 6. ยฉ MikroTik 2011 6 Bridging or Layer-2 (MAC)
  • 7. ยฉ MikroTik 2011 7 Routing or Layer-3 (IP)
  • 8. ยฉ MikroTik 2011 8 Diagram Abbreviations
  • 9. ยฉ MikroTik 2011 9 Simple Routing
  • 10. ยฉ MikroTik 2011 10 Bridging with IP firewall
  • 11. ยฉ MikroTik 2011 11 Bridge-to-Bridge Routing (part1)
  • 12. ยฉ MikroTik 2011 12 Bridge-to-Bridge Routing (part2)
  • 13. ยฉ MikroTik 2011 13 IPSec Encryption
  • 14. ยฉ MikroTik 2011 14 IPSec Decryption
  • 15. ยฉ MikroTik 2011 15 Hierarchical Token Bucket
  • 16. ยฉ MikroTik 2011 16 Lets Simplify! QoS Packet Flow Diagram
  • 17. ยฉ MikroTik 2011 17 Global-Out or Interface HTB? There are two fundamental differences In case of SRC-NAT (masquerade) Global-Out will be aware of private client addresses, but Interface HTB will not โ€“ Interface HTB is after SRC-NAT Each Interface HTB only receives traffic that will be leaving through a particular interface โ€“ there is no need for to separate upload and download in mangle
  • 18. ยฉ MikroTik 2011 18 Mangle The mangle facility allows you to mark IP packets with special marks. These marks are used by other router facilities like routing and bandwidth management to identify the packets. Additionally, the mangle facility is used to modify some fields in the IP header, like TOS (DSCP) and TTL fields.
  • 19. ยฉ MikroTik 2011 19 Hierarchical Token Bucket All bandwidth management implementation in RouterOS is based on Hierarchical Token Bucket (HTB) HTB allows you to create hierarchical queue structure and determine relations between queues RouterOS supports 3 virtual HTBs (global-in, global-total, global-out) and one more just before every output interface
  • 20. ยฉ MikroTik 2011 20 HTB (cont.) When packet travels through the router, it passes all 4 HTB trees When packet travels to the router, it passes only global-in and global-total HTB. When packet travels from the router, it passes global-out, global-total and interface HTB.
  • 21. ยฉ MikroTik 2011 21 HTB Features - Structure As soon as queue have at least one child it become parent queue All child queues (don't matter how many levels of parents they have) are on the same bottom level of HTB Child queues make actual traffic consumption, parent queues are responsible only for traffic distribution Child queues will get limit-at first and then rest of the traffic will distributed by parents
  • 22. ยฉ MikroTik 2011 22 HTB Features - Structure
  • 23. ยฉ MikroTik 2011 23 HTB Features โ€“ Dual Limitation HTB has two rate limits: CIR (Committed Information Rate) โ€“ (limit-at in RouterOS) worst case scenario, flow will get this amount of traffic no matter what (assuming we can actually send so much data) MIR (Maximal Information Rate) โ€“ (max-limit in RouterOS) best case scenario, rate that flow can get up to, if there queue's parent has spare bandwidth At first HTB will try to satisfy every child queue's limit-at โ€“ only then it will try to reach max-limit
  • 24. ยฉ MikroTik 2011 24 Dual Limitation Maximal rate of the parent should be equal or bigger than sum of committed rates of the children MIR (parent) โ‰ฅ CIR(child1) +...+ CIR(childN) Maximal rate of any child should be less or equal to maximal rate of the parent MIR (parent) โ‰ฅ MIR(child1) MIR (parent) โ‰ฅ MIR(child2) MIR (parent) โ‰ฅ MIR(childN)
  • 25. ยฉ MikroTik 2011 25 HTB - limit-at
  • 26. ยฉ MikroTik 2011 26 HTB - max-limit
  • 27. ยฉ MikroTik 2011 27 HTB Features - Priority Work only for child queues to arrange them 8 is the lowest priority, 1 is the highest Queue with higher priority will get chance to satisfy its max-limit before other queues Actual traffic prioritization will work only if limits are specified. Queue without limits will not prioritize anything
  • 28. ยฉ MikroTik 2011 28 QoS Myth buster HTB priority doesn't rearrange packet sequence โ€“ it doesn't put some packets before others In HTB โ€œPriorityโ€ is an option that helps to decide what packets will pass and what packets will be dropped This drop decision is based on limitations, so if there are no limits there are no need to drop anything, so priority have no effect Priority doesn't affect CIR traffic โ€“ it just passes through QoS (even if parent's don't have such amount of traffic)
  • 29. ยฉ MikroTik 2011 29 HTB โ€“ limit-at of the Parent
  • 30. ยฉ MikroTik 2011 30 HTB โ€“ limit-at > parent's max-limit
  • 31. ยฉ MikroTik 2011 31 QoS Myth Buster QoS can't control the amount of received traffic that you see on your interfaces. In Packet Flow diagram global-in is way after Input interface where statistic is registered Effect of traffic slowing down most probably is effect of TCP protocol behaviour If clients PC was able to send out traffic it have to arrive somewhere it can't just disappear Only way to see QoS in action is to monitor TX of opposite interface.
  • 32. ยฉ MikroTik 2011 32 QoS Myth Buster QoS doesn't know how much actual bandwidth is available In Packet Flow diagram all HTB are before output interface and output interfaces driver is the first one that might know how much actual bandwidth you have. Interface driver knows the maximal hardware limitation of your interface, IF actual limitation is smaller, the only way to provide QoS with limitation information is to specify all limits yourself
  • 33. ยฉ MikroTik 2011 33 Queue Types
  • 34. ยฉ MikroTik 2011 34 Default Queue Types
  • 35. ยฉ MikroTik 2011 35 FIFO Behaviour: What comes in first is handled first, what comes in next waits until the first is finished. Number of waiting units (Packets or Bytes) is limited by โ€œqueue sizeโ€ option. If queue โ€œis fullโ€ next units are dropped
  • 38. ยฉ MikroTik 2011 38 MQ PFIFO Multi queue packet FIFO queue was designed multi-core router solutions (RB1100AHx2) MQ PFIFO should be used as default interface queue for any Ethernets that have several RX/TX queues (you can check that in /system resources IRQ menu) MQ FIFO is alternative to RPS (receive Packet Steering) โ€“ so do not use both on same interface it will result in performance loss.
  • 39. ยฉ MikroTik 2011 39 RED Behaviour: Same as FIFO with an additional feature โ€“ additional drop probability even if queue is not full. This probability is based on comparison of average queue length over some period of time to minimal and maximal threshold โ€“ closer to maximal threshold the bigger the chance of a drop.
  • 41. ยฉ MikroTik 2011 41 SFQ Behaviour: Based on a hash value from the source and destination address SFQ divides the traffic into 1024 sub-streams Then the Round Robin algorithm will distribute an equal amount of traffic to each sub- stream
  • 43. ยฉ MikroTik 2011 43 SFQ Example SFQ should be used for equalizing similar connections Usually used to manage information flow to or from the servers, so it can offer services to every customer Ideal for p2p limitation, it is possible to place strict limitation without dropping connections,
  • 44. ยฉ MikroTik 2011 44 PCQ PCQ was introduced to optimize massive QoS systems, where most of the queues are exactly the same for different sub-streams Starting from version 5.0rc5 PCQ have burst support and IPv6 support
  • 45. ยฉ MikroTik 2011 45 PCQ Classification (1)
  • 46. ยฉ MikroTik 2011 46 PCQ Classification (2)
  • 48. ยฉ MikroTik 2011 48 PCQ Rate (1)
  • 49. ยฉ MikroTik 2011 49 PCQ Rate (2)
  • 51. ยฉ MikroTik 2011 51 QoS Feature โ€œBurstโ€ Burst is one of the best ways to increase HTTP performance Bursts are used to allow higher data rates for a short period of time If an average data rate is less than burst- threshold, burst could be used( actual data rate can reach burst-limit) Average data rate is calculated from the last burst-time seconds
  • 52. ยฉ MikroTik 2011 52 Burst - Average Data Rate Average data rate is calculated as follows: burst-time is being divided into 16 periods router calculates the average data rate of each class over these small periods Note, that the actual burst period is not equal to the burst-time. It can be several times shorter than the burst-time depending on the max-limit, burst-limit, burst-threshold, and actual data rate history (see the graph example on the next slide)
  • 54. ยฉ MikroTik 2011 54 Burst (Part 2)
  • 55. ยฉ MikroTik 2011 55 Queue Size
  • 56. ยฉ MikroTik 2011 56 Queue Size Queue size has a direct impact on the performance of the queue โ€“ it is a choice between packet loss and higher latency In RouterOS queue sizes are common between the queue types To understand Queue size's impact on the traffic we will look at simplified example We will ignore packet retransmits We will assume that process that run continuously can be divided into steps
  • 57. ยฉ MikroTik 2011 57 There are 25 steps and there are total of 1610 incoming packets over this time frame.
  • 58. ยฉ MikroTik 2011 58 With this type of limitation only 1250 out of 1610 packets were able to pass the queue (22,4% packet drop), but all packets arrive without delay.
  • 59. ยฉ MikroTik 2011 59 There was no packet loss, but 630 (39,1%) packets had 1 step delay, and other 170 (10,6%) packets had 2 step delay. (delay = latency)
  • 60. ยฉ MikroTik 2011 60 There were 320 (19,9%) packets dropped and 80 (5,0%) packets had 1 step delay.
  • 61. ยฉ MikroTik 2011 61 There were 190 (11,8%) packets dropped and 400 (24,8%) packets had 1 step delay.
  • 62. ยฉ MikroTik 2011 62 Simple Queues Simple queues are ordered - similar to firewall rules In order to get to 999th queue packet will have to be checked for match to all 998 previous queues Each simple queue might stand for 3 separate queues: One in Global-in (โ€œdirectโ€ part) One in Global-out (โ€œreverseโ€ part) One in Global-total (โ€œtotalโ€ part)
  • 63. ยฉ MikroTik 2011 63 Simple Queues and Mangle
  • 64. ยฉ MikroTik 2011 64 Queue Tree Tree queue is one directional only and can be placed in any of the available HTBs Queue Tree queues don't have any order โ€“ all traffic is processed simultaneously All child queues must have packet marks from โ€œ/ip firewall mangleโ€ facility assigned to them If placed in the same HTB, Simple queue will take all the traffic away from the Queue Tree queue
  • 65. ยฉ MikroTik 2011 65 Queue Tree โ€“ Winbox View
  • 66. ยฉ MikroTik 2011 66 Simple Queue and Queue Tree (Vegas Style) demonstration
  • 67. ยฉ MikroTik 2011 67 Good luck!