You are on page 1of 40

MUM-­‐EU-­‐2013

 
@Zagreb,  Croa8a  

QoS  
RouterOS  v6  

Valens  Riyadi  (Citraweb)  


info@mikro8k.co.id  
About  Me  
Valens  Riyadi,  Citraweb  (ID)  
MikroTik  Cer8fied  Engineer  
(MTCNA,  MTCWE,  MTCRE,  MTCTCE,  MTCUME,  MTCINE)  
MikroTik  Cer8fied  Trainer  &  Consultant  
MikroTik  Academy  Coordinator  
Citra.net.id  WISP  CEO  
Manager  for  IDNIC  (Indonesia  Na8onal  
Internet  Registry)  
IT  Expert  on  Disaster  Relief  

Qos  pada  RouterOS  v6   2  


www.mikro8k.co.id  

distributor  

Qos  pada  RouterOS  v6   3  


Qos  pada  RouterOS  v6   4  
MikroTik  Training  Center  
•  The  first  MikroTik  Training  Center  in  Asia  
Pasific,  has  taught  at  least  1600  par8cipants  
(94  classes).  
•  Mikro8k  Academy  Coordinator.  

Qos  pada  RouterOS  v6   5  


RouterOS  v6  Full  Release  
almost  ready!  
 
now  v6rc11/12  

Qos  pada  RouterOS  v6   6  


QoS  
 
Some  fundamental  change    
on  RoS  v6  

Qos  pada  RouterOS  v6   7  


QoS  di  v5  
•  Simple  Queue  
–  queue  will  be  done  in  global-­‐in,  global-­‐out  or  
global-­‐total  
•  Queue  Tree  
–  queue  on  interface,  or  
–  in  global-­‐in,  global-­‐out  or  global-­‐total  

Qos  pada  RouterOS  v6   8  


Packet  Flow!  

CHAIN     CHAIN     CHAIN    


PREROUTING   FORWARD   POSTROUTING  

CHAIN     CHAIN    
INPUT   OUTPUT  

INPUT   OUTPUT  
LOCAL  PROCESS  
INTERFACE   INTERFACE  

Qos  pada  RouterOS  v6   9  


Packet  Flow  and  QoS  v5  
global  in   global  out  
CHAIN     CHAIN     CHAIN    
PREROUTING   FORWARD   POSTROUTING  

HTB  
CHAIN     CHAIN     interface  
INPUT   OUTPUT  

INPUT   OUTPUT  
LOCAL  PROCESS  
INTERFACE   INTERFACE  

Qos  pada  RouterOS  v6   10  


QoS  Problem  in  RoS  v5  
•  No  specific  queue  for  traffic  to  the  
router,  global-­‐in  will  process  the  traffic  
into  the  router  and  the  traffic  through  
the  router  
•  Two  8mes  queue  processing  (Global  in  
and  global  out)  for  traffic  through  the  
router.  

Qos  pada  RouterOS  v6   11  


QoS  Problem  in  RoS  v5  
•  Queue  tree  –  PCQ  on  parent  interface  -­‐  naged  
network,  queue  for  uplink  traffic  does  not  
work  perfectly,  because  PCQ  done  aher  src-­‐
nat    
–  src-­‐address  already  changed  to  router  ip  address  
in  src-­‐nat.  
–  pcq  see  only  one  src-­‐address    

Qos  pada  RouterOS  v6   12  


QoS  RoS  v6  
No  more  global-­‐in  and  global-­‐out,  
replaced  by  a  "global"  located  aher  
the  "input"  and  at  global-­‐out  posi8on.  
 
Simple  queue  is  a  specific  process,  
located  aher  “global”.  

Qos  pada  RouterOS  v6   13  


Packet  Flow  and  QoS  v6  

CHAIN     CHAIN     CHAIN    


PREROUTING   FORWARD   POSTROUTING  

global  HTB  

simple  
CHAIN     CHAIN     queue  
INPUT   OUTPUT  
global  HTB  
HTB  
simple   interface  
queue  
INPUT   OUTPUT  
LOCAL  PROCESS  
INTERFACE   INTERFACE  

Qos  pada  RouterOS  v6   14  


Queue  Tree  v5  dan  v6  

RoS  v5   RoS  v6  


Qos  pada  RouterOS  v6   15  
 

Simple  Packet  Flow  v5    


 
FORWARD
 
ROUTING   MANGLE     FILTER  
DECISION   FORWARD     FORWARD   POST
PRE
ROUTING OUTPUT
  ROUTING
 
 
QUEUE   ROUTING    
MANGLE  
     
GLOBAL-­‐IN   ADJUSMENT    
POSTROUTING  
       
   
FILTER    
QUEUE  
 
DST-­‐NAT      
OUTPUT    
GLOBAL-­‐OUT  
    INPUT    
     
MANGLE   MANGLE   MANGLE    
      SRC-­‐NAT  
PREROUTING   INPUT   OUTPUT    
       
     
CONNECTION  
  FILTER  
  CONNECTION   HTB  
 
TRACKING   INPUT  
  TRACKING   INTERFACE  
 
INPUT        
LOCAL   ROUTING   OUTPUT    
INTERFACE   PROCESS   DECISION   INTERFACE  
Qos  pada  RouterOS  v6   16  
 

Simple  Packet  Flow  v6    


 
FORWARD
 
ROUTING   MANGLE     FILTER  
DECISION   FORWARD     FORWARD   POST
  ROUTING
OUTPUT
INPUT
   
MANGLE  
MANGLE   ROUTING      
    POSTROUTING  
PRE
INPUT   ADJUSMENT    
ROUTING      
   
    SRC-­‐NAT  
  FILTER   FILTER    
DST-­‐NAT      
  INPUT   OUTPUT    
    GLOBAL  
    HTB  
   
 
MANGLE   GLOBAL  HTB   MANGLE    
   
 
PREROUTING   OUTPUT     QUEUE  
SIMPLE  
   
   
   
 
CONNECTION   SIMPLE  QUEUE   CONNECTION  
    HTB  
 
TRACKING   TRACKING  
INTERFACE  
 
INPUT     LOCAL     ROUTING   OUTPUT    
INTERFACE   PROCESS   DECISION   INTERFACE  
Qos  pada  RouterOS  v6   17  
Mangle  –  Queue  RoSv6  
•  Traffic  to  the  router  
–  we  can  do  mangle  (packet-­‐mark)  specifically  on  
chain=input  
–  queue  tree  with  parent=global  and  packet  mark  
•  Contoh  
/ip  firewall  mangle  add  src-­‐address=10.1.1.1  
chain=input  ac8on=mark-­‐packet  mark-­‐packet=p1  
/queue  tree  add  packet-­‐mark=p1  parent=global  
max-­‐limit=1m  

Qos  pada  RouterOS  v6   18  


 

Traffic  to  the  router    


 
FORWARD
 
ROUTING   MANGLE     FILTER  
DECISION   FORWARD     FORWARD   POST
  ROUTING
OUTPUT
INPUT
   
MANGLE  
MANGLE   ROUTING      
    POSTROUTING  
PRE
INPUT   ADJUSMENT    
ROUTING      
   
    SRC-­‐NAT  
  FILTER   FILTER    
DST-­‐NAT      
  INPUT   OUTPUT    
    GLOBAL  
    HTB  
   
 
MANGLE   GLOBAL  HTB   MANGLE    
   
 
PREROUTING   OUTPUT     QUEUE  
SIMPLE  
   
   
   
 
CONNECTION   SIMPLE  QUEUE   CONNECTION  
    HTB  
 
TRACKING   TRACKING  
INTERFACE  
 
INPUT     LOCAL     ROUTING   OUTPUT    
INTERFACE   PROCESS   DECISION   INTERFACE  
Qos  pada  RouterOS  v6   19  
Mangle  -­‐  Queue  
•  Traffic  from  the  router  
–  same  as  previous  version  
•  Traffic  through  the  router  
–  mangle  can  be  done  specifically  at  chain=forward    

Qos  pada  RouterOS  v6   20  


 

Traffic  through  the  router    


 
FORWARD
 
ROUTING   MANGLE     FILTER  
DECISION   FORWARD     FORWARD   POST
  ROUTING
OUTPUT
INPUT
   
MANGLE  
MANGLE   ROUTING      
    POSTROUTING  
PRE
INPUT   ADJUSMENT    
ROUTING      
   
    SRC-­‐NAT  
  FILTER   FILTER    
DST-­‐NAT      
  INPUT   OUTPUT    
    GLOBAL  
    HTB  
   
 
MANGLE   GLOBAL  HTB   MANGLE    
   
 
PREROUTING   OUTPUT     QUEUE  
SIMPLE  
   
   
   
 
CONNECTION   SIMPLE  QUEUE   CONNECTION  
    HTB  
 
TRACKING   TRACKING  
INTERFACE  
 
INPUT     LOCAL     ROUTING   OUTPUT    
INTERFACE   PROCESS   DECISION   INTERFACE  
Qos  pada  RouterOS  v6   21  
Simple  Queue  di  RoSv5  

Qos  pada  RouterOS  v6   22  


Simple  Queue  RoSv5  
•  There  are  2  type  of  target:  target  address  and  
interface  
•  Des8na8on  use  only  IP  address  (not  interface)  
•  Same  priority  parameter  for  downlink  and  
uplink  

Qos  pada  RouterOS  v6   23  


Simple  Queue  at  RoSv6  

Qos  pada  RouterOS  v6   24  


Simple  Queue  v6  
•  Target  address  and  interface  combined  to  
“target”  
•  dst-­‐address  changed  to  “dst”,  can  take  IP  
address  and  also  interface  

Qos  pada  RouterOS  v6   25  


Simple  Queue  in  ROSv6  
•  Completely  new  algorithm,  build  in  kernel,  
faster  
•  S8ll  in  sequen8al  processing  
•  Target  parameter  is  mandatory  
•  If  target=0/0  in  the  first  rule,  no  traffic  for  
others  queue  

Qos  pada  RouterOS  v6   26  


0  simple  queue,  100  mbps,  RB750G  
v5.21  

Qos  pada  RouterOS  v6   27  


1000  simple  queue,  100  mbps,  RB750G  
v5.21  

Qos  pada  RouterOS  v6   28  


1000  simple  queue,  100  mbps,  RB750G  
v6rc2  

Qos  pada  RouterOS  v6   29  


Faster  at  ROS  6.0rc12  

Simple  queue  on  mul8ple  


processors  router  will  9  8mes  
faster  if  there  are  at  least  32  
simple  queue  parents.  

Qos  pada  RouterOS  v6   30  


Upgrade  from  RoSv5  

Queue  tree  with  global-­‐in,  global-­‐out,  


and  global-­‐total  as  parent  at  RoS  v5.  
Qos  pada  RouterOS  v6   31  
Upgrade  from  RoSv5  

Queue  tree  with  global-­‐in,  global-­‐out,  


and  global-­‐total  as  parent  at  RoS  v5  
become  invalid  at  Rosv6.  
Qos  pada  RouterOS  v6   32  
Simple  queue  upgrade  

Qos  pada  RouterOS  v6   33  


Simple  queue  upgrade  

(Rosv5)  Means:  traffic  for  src-­‐address  


192.168.0.1  AND  on  interface  bridge-­‐
local  
Qos  pada  RouterOS  v6   34  
Simple  queue  upgrade  

(Rosv6)  Means:  traffic  for  src-­‐address  


192.168.0.1  OR  on  interface  bridge-­‐
local  
Qos  pada  RouterOS  v6   35  
PCQ  
•  PCQ  was  introduced  to  op8mize  massive  QoS  
systems,  where  most  of  the  queues  are  
exactly  the  same  for  different  sub-­‐streams.  

Qos  pada  RouterOS  v6   36  


PCQ   Algoritma
pcq-clasifier Round
src-address sub-queue Robin
SRC-ADDRESS=10.0.0.1

SRC-ADDRESS=10.0.0.2

SRC-ADDRESS=10.0.0.3
Flow 1 to
Flow 2 SRC-ADDRESS=10.0.0.4 interface
Flow 3
SRC-ADDRESS=10.0.0.5

Flow 4
SRC-ADDRESS=10.0.0.6

SRC-ADDRESS=10.0.0.7

MTCTCE  
Qos  -­‐  Spys-­‐DataCom  
ada  RouterOS  
-­‐  Cvitraweb  
6   37  
PCQ  in  ROS  v6  
•  Take  sub-­‐stream  parameter  from  Connec8on  
Tracking  data.  
•  It  is  strongly  advised  to  enable  Connec8on  
Tracking.  
•  If  connec8on  tracking  disabled,  PCQ  will  
calculate  sub-­‐stream  in  old  way  

Qos  pada  RouterOS  v6   38  


Double  QoS  
•  Is  QoS  method  to  do  priori8za8on  and  
client  limita8on  in  1  ROS  
hgp://mum.mikro8k.com/presenta8ons/CZ09/QoS_Megis.pdf  

•  On  RoS  v6,  we  can  not  do  double  QoS  


with  (both)  queue  tree  any  more.  
•  But,  we  s8ll  can  do:  
– priori8za8on  :  queue  tree  &  mangle  forward  
– client  limita8on  :  simple  queue  with  target  
ip  address  
 

Qos  pada  RouterOS  v6   39  


Thank  you  
•  Comments  and  sugges8ons:  
–  Valens  Riyadi  (valens@mikro8k.co.id)  
 
This  presenta8on  was  developed  and  sourced  from  RouterOSv6  
Presenta8on  by  Janis  Megis  (MUM-­‐USA-­‐2012).  

This  license  lets  others  remix,  tweak,  and  build  upon  your  work  even  for  commercial  purposes,  as  long  
as  they  credit  you  and  license  their  new  crea8ons  under  the  iden8cal  terms.  This  license  is  ohen  
compared  to  “copyleh”  free  and  open  source  sohware  licenses.  All  new  works  based  on  yours  will  carry  
the  same  license,  so  any  deriva8ves  will  also  allow  commercial  use.  

Qos  pada  RouterOS  v6   40  

You might also like