Community discussions

MikroTik App
 
ChrisVanMeer
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 59
Joined: Sun Jul 03, 2016 2:29 pm
Location: The Netherlands

QoS question

Sat Jul 30, 2016 8:55 pm

Hi guys,

Does anyone know how to convert this Cisco entry
mls qos trust dscp
for Mikrotik? I basically want the Mikrotik to honor the incoming DSCP values.
I can't find it in the Wiki.

Thanks!

Chris
 
IntrusDave
Forum Guru
Forum Guru
Posts: 1286
Joined: Fri May 09, 2014 4:36 am
Location: Rancho Cucamonga, CA

Re: QoS question

Sat Jul 30, 2016 9:04 pm

Use this topic:
http://forum.mikrotik.com/viewtopic.php?f=9&t=110717

you can use that to get started. setup the WAN first - setting the wan interface name (i use "wan0" and "wan1"). Make sure you set the correct upload speed.
You can do the same for your LAN. Though the script will duplicate your Mangle rules, so you will have to remove the duplicate set.
 
IntrusDave
Forum Guru
Forum Guru
Posts: 1286
Joined: Fri May 09, 2014 4:36 am
Location: Rancho Cucamonga, CA

Re: QoS question

Sat Jul 30, 2016 9:14 pm

Honestly - you only need this on your WAN.  QoS only helps when you are going from a high-speed to a low-speed link. 
In other words, if you have a 100M internet connection, and a 1G LAN - you will NEVER fill the queue, so you are just making
the CPU work harder without any change. If you have 100M WAN and 100M LAN, then it may help. 

I have 120M download and 8M upload, do i use it on my WAN.  My LAN is all gigabit, so it doesn't do anything on the router.
My switch also honors DSCP. That helps when saturating the links to my NAS during backups.
 
ChrisVanMeer
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 59
Joined: Sun Jul 03, 2016 2:29 pm
Location: The Netherlands

Re: QoS question

Sun Jul 31, 2016 8:56 am

I now have 2 Cisco 3750's that are situated in our datacenter to provide connectivity to our office site through a L2 eVPN connection.
The site-to-site connections are 50Mbit. In the 3750's, I have this on the "WAN" side (Branch office with VoIP phones --> Datacenter).

I'm still relatively new to Mikrotik, so I can't really understand what your script is doing...could you explain it to me in more detail?
To be honest, I thought it would be a single command to enter to make the Mikrotik honor the DSCP values passed through from the Branch office --> Datacenter.
 
IntrusDave
Forum Guru
Forum Guru
Posts: 1286
Joined: Fri May 09, 2014 4:36 am
Location: Rancho Cucamonga, CA

Re: QoS question

Sun Jul 31, 2016 9:51 am

Mikrtik RouterOS isn't really a "one command" system. The design of it makes it (in my option) the most flexible and powerful routers available. That said...

The script is fairly simple - though it looks complicated. 
First you have some basic definitions. You tell it the name of your WAN interface (mine are wan0 and wan1). Then you tell it what the upload bandwidth of that connection is. (mine is 4M or 4200k) From there it starts working - First thing is it creates the mangle rules. These rules look at each packet, find the DSCP value, and then mark that packet with a tag that RouterOS understands. Next it creates the queue tree. Here is where the "work" gets done. It creates the Interface queue, then 8 child queues for each of the 8 DSCP classifications. Then it creates 8 child queues for each of those 8 classification queues. Each of those are assigned a DSCP code from 0 to 64. Those queues will look for the packet marks and drop the packet into the correct queue.

I'm sure MikroTik could have made it a simple "turn on DSCP", but then you would have half of the users complaining that they took away functionality and the other half saying they did it wrong. :) For me, I'm find with this way, because I have a lot more control over things. 

In the other thread, you can see another option, which is to just use the "3 more significant bits" of DSCP. This simplifies the mangle rules and queue tree and more closely resembles how HP handles QoS on their 19xx switches. It gives you 8 queues instead of 64 - leaving you with just the DSCP classification. it works, and is probably better on low end hardware, but you lose the fine-grained control. In other words, the router would not see a difference between dscp 0 and dscp 7. But, you have a lower CPU load.

Something to remember with MikroTik - when you use the FastTrack function in the firewall, connections that are "fast tracked" will NOT pass through the queues. 
 
ChrisVanMeer
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 59
Joined: Sun Jul 03, 2016 2:29 pm
Location: The Netherlands

Re: QoS question

Sun Jul 31, 2016 10:01 am

Thanks David for clarifying.
Actually, we use HP 3600 switches at the Branch office, where all the IP phones are connected to, so I think there are just 8 levels used.

I was thinking of replacing the Cisco 3750's (WS-C3750G-24TS-1U) with 2 RB3011's.
In my opinion, the RB3011 in hardware specs is much heavier than the Cisco 3750's.

I'll won't be using fasttrack, since I have some negative experiences with that (certain sites that couldn't be reached anymore after a few days after applying the fasttrack rule. Disabling the fasttrack made the sites work again, so not going there for a while.
 
ChrisVanMeer
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 59
Joined: Sun Jul 03, 2016 2:29 pm
Location: The Netherlands

Re: QoS question

Sun Jul 31, 2016 10:07 am

Oh and how did you choose the uploadBandwidth?
In your script it says it's 4200k, but is this a number that is known to be good with VoIP?

Or does this number correlate with the WAN speed?
If so, what number should I choose for a 50Mbit WAN uplink speed?
 
IntrusDave
Forum Guru
Forum Guru
Posts: 1286
Joined: Fri May 09, 2014 4:36 am
Location: Rancho Cucamonga, CA

Re: QoS question

Sun Jul 31, 2016 10:09 am

Out of the 37 MikroTik's that I have in use, I only have one 3011 - my home unit. (Availability has been an issue) It handles the queues and rules without ever going over 5~10% CPU load. The CPU (IPQ-8064) should be able to handle 5gpbs raw throughput, and can most certainly deal with the 50M vpn without breaking a sweat. 
 
ChrisVanMeer
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 59
Joined: Sun Jul 03, 2016 2:29 pm
Location: The Netherlands

Re: QoS question

Sun Jul 31, 2016 10:16 am

That's good to know :) Hope I can get my hands on two of them quite quickly.

So, regarding to the uploadBandwidth, should I keep that at 4200k, or amp it up to a larger number?
 
IntrusDave
Forum Guru
Forum Guru
Posts: 1286
Joined: Fri May 09, 2014 4:36 am
Location: Rancho Cucamonga, CA

Re: QoS question

Sun Jul 31, 2016 10:44 am

it needs to match your true upload bandwidth. 4200k (4.2Mbps) is what my home cable averages. If you have 50M and it's a constant 50M, then you should set it to "50M". You can also leave yourself a little "safety" room and set it to "45M", that will reserve you 5Mbps for line conditions. 
 
ChrisVanMeer
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 59
Joined: Sun Jul 03, 2016 2:29 pm
Location: The Netherlands

Re: QoS question

Sun Jul 31, 2016 11:09 am

Thanks!
 
pe1chl
Forum Guru
Forum Guru
Posts: 10568
Joined: Mon Jun 08, 2015 12:09 pm

Re: QoS question

Sun Jul 31, 2016 11:13 am

To be honest, I thought it would be a single command to enter to make the Mikrotik honor the DSCP values passed through from the Branch office --> Datacenter.
You should understand that that single Cisco command that you gave, also does not do much.
It only tells the switch that it should take the DSCP value as an indicator of QoS on that port, instead of a fixed value or the 802.11q priority.
However, this does not suddenly make the switch assign traffic priorities, for that you need a lot of other mls qos commands.
The equivalent of the command you gave is in the MikroTik something like:
/ip firewall mangle
add action=set-priority chain=prerouting new-priority=from-dscp-high-3-bits
However, in itself this will not do very much either.

QoS handling in a network is quite complicated and requires several settings including the traffic priority marking, but also the
setup of multiple queues with a relative priority, and (depending on the network structure) some shaping to ensure that the
router knows what rate it can feed to the next hop, when that is not the full line rate.
 
ChrisVanMeer
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 59
Joined: Sun Jul 03, 2016 2:29 pm
Location: The Netherlands

Re: QoS question

Sun Jul 31, 2016 12:49 pm

Thanks for the explanation, pe1chl.
So maybe the current config of the 3750's aren't even handling QoS as effectively as possible.
However, I have no complaints from the people who use the phones.

I will use the provided script to create the mangle rules and the queue tree entries.
 
ChrisVanMeer
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 59
Joined: Sun Jul 03, 2016 2:29 pm
Location: The Netherlands

Re: QoS question

Wed Sep 07, 2016 6:47 pm

Just wanted to let you guys know that I have succesfully replaced the Cisco 3750's with RB3011's.
The processor utilization never raises above 7% and all the QoS is handled perfectly.
Thanks for all the help.