Community discussions

MikroTik App
 
ubikrotik
Member Candidate
Member Candidate
Topic Author
Posts: 162
Joined: Wed May 25, 2016 3:56 am

VOIP QOS

Tue Aug 23, 2016 9:51 pm

Hi, can someone help me, we are using a ccr1009 and we want to add a QOS rule on our router to help Voip service on our network.

I saw a lot of posts on this but it looks like there are more than one way to achive that.


Step by step solution with explication will help us a lot. Thank you .
 
pe1chl
Forum Guru
Forum Guru
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: VOIP QOS

Tue Aug 23, 2016 11:17 pm

You have seen it correctly: there is more than one way to achieve that, and you will need to make a design
and decide how to do it in your case, then find how to implement that.
It is not like "enter these two commands and you are done", especially not without detailed description of what you want.
 
ubikrotik
Member Candidate
Member Candidate
Topic Author
Posts: 162
Joined: Wed May 25, 2016 3:56 am

Re: VOIP QOS

Wed Aug 24, 2016 6:05 am

thank you for your quick reply.

Yeah i can give you more details, what do you want to know?

The goal for the moment is to make priority on VoIP packets when other clients are using internet BW.
 
loveman
Member
Member
Posts: 348
Joined: Tue Mar 10, 2015 9:32 pm

Re: VOIP QOS

Wed Aug 24, 2016 8:41 am

You can use mangle and simple queue and you can take priority packet
 
pe1chl
Forum Guru
Forum Guru
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: VOIP QOS

Wed Aug 24, 2016 12:29 pm

You need to make a design that identifies how your traffic flows are, where are the bottlenecks,
what is the behaviour of those bottlenecks (fixed speed, speed depending on e.g. WiFi link quality),
and where there are bottlenecks you have no control over (e.g. at the ISP side of the link).

Then you need to decide how you are going to classify your traffic as normal or VoIP. Can be
done using existing DSCP marking of the traffic by the VoIP devices themselves, or you could
put them in a separate subnet/VLAN. Combination of those methods is often used. Using a VLAN
has the advantage that prioritization at ethernet level is possible, but this is seldomly required on
a network that is fast enough (1Gbit is normal today).

Once you have identified how to mark the traffic and where the bottlenecks are, you can setup some
queue mechanism to allocate some reserved bitrate to your VoIP traffic at higher priority than the
normal data, and to give remaining bitrate up to some maximum to the data. It helps when you set
the maximum bitrate just below the actual maximum of your link, but that is difficult when it is not
a fixed maximum rate but it is in fact varying. DSCP marking will still help when you send traffic
over a WiFi link.
 
ubikrotik
Member Candidate
Member Candidate
Topic Author
Posts: 162
Joined: Wed May 25, 2016 3:56 am

Re: VOIP QOS

Wed Jul 12, 2017 4:29 am

Hi,
I made my works.
Here my Mangle rule:
 DSCP_MANGLE
      chain=postrouting action=mark-packet new-packet-mark=voip-1 passthrough=yes dscp=46 log=yes log-prefix="DSCP-VOIP"

Here my Queue Tree for upload part:
 0   ;;; --- Upload ---
     name="UPLOAD" parent=ether1-WAN packet-mark="" limit-at=50M queue=default-small priority=8 max-limit=50M burst-limit=0 burst-threshold=0 burst-time=0s 
     bucket-size=0.1 

 1   name="Voip" parent=UPLOAD packet-mark=voip-1 limit-at=25M queue=default-small priority=1 max-limit=25M burst-limit=0 burst-threshold=0 burst-time=0s 
     bucket-size=0.1 


 2   name="other Upload" parent=UPLOAD packet-mark=no-mark limit-at=30M queue=default-small priority=8 max-limit=30M burst-limit=0 burst-threshold=0 burst-time=0s 
     bucket-size=0.1 

It works, I can guaranteed enought BW for my upload Voip Trafic. Does it make sens?


Now I want Vlan my trafic, what is the best way to do that?

My CCR1009 actualy use Ether2 to ether5 as main data transport using Airfiber to get next towers.

ether2 = airfiber#1
ether3 = airfiber#2
ether4 = airfiber#3
ether5 = airfiber#4

So traffic is comming from 4 ports. all of those airfiber are getting an other part of the network from towers. All of my network is briged, not routed.
So the question is:

How do i set vlans for VOIP data? Should I add Vlan interface on every ethernet port of the CCR1009 thus creat virtual network for any legs of my network, or should I set 1 VLAN for ALL Voip trafic?


Thank you all friends for your help and support.
 
astons2
just joined
Posts: 13
Joined: Thu May 28, 2015 3:47 pm

Re: VOIP QOS

Wed Jul 12, 2017 5:06 pm

It helps when you set
the maximum bitrate just below the actual maximum of your link, but that is difficult when it is not
a fixed maximum rate but it is in fact varying. DSCP marking will still help when you send traffic
over a WiFi link.
Does anyone have idea how to make it work when internet connection speed is not fixed?
 
pe1chl
Forum Guru
Forum Guru
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: VOIP QOS

Wed Jul 12, 2017 5:32 pm

It is actually possible to design a network on which QoS is not really possible and VoIP will never work reliably.
Be careful not to do that!

In the meantime, make sure your VoIP traffic is DSCP EF (46) and all equipment along the link is handling that.
(e.g. enable WiFi multimedia support when required)
 
astons2
just joined
Posts: 13
Joined: Thu May 28, 2015 3:47 pm

Re: VOIP QOS

Wed Jul 12, 2017 6:17 pm

It is actually possible to design a network on which QoS is not really possible and VoIP will never work reliably.
Be careful not to do that!

In the meantime, make sure your VoIP traffic is DSCP EF (46) and all equipment along the link is handling that.
(e.g. enable WiFi multimedia support when required)
Thanks for reply.

Its a bit more complicated, because my internet connection speed is not fixed and if I have massive download, VOIP or IPTV does not work at all. If I set in Queue tree my current internet connection speed in max-limit than its everything is fine but if internet connection speed goes slower, than nothing is working until internet speed goes fast again. Interesting is that limit-at not working at all. I need somehow to force router to work only with limit-at instead of max-limit in order to router queued packets. Any idea?

My internet speed goes 25M-43M, If I set download in Queue tree max-limit to 25M everything is fine.
Any value in limit-at does not work at all.
 
ubikrotik
Member Candidate
Member Candidate
Topic Author
Posts: 162
Joined: Wed May 25, 2016 3:56 am

Re: VOIP QOS

Thu Jul 13, 2017 4:37 am

It is actually possible to design a network on which QoS is not really possible and VoIP will never work reliably.
Be careful not to do that!

In the meantime, make sure your VoIP traffic is DSCP EF (46) and all equipment along the link is handling that.
(e.g. enable WiFi multimedia support when required)

When I use Torch tool, I can see that my voip is actually DSCP 46 and i Also see DSCP 26 data. Need I creat a mangle rule (change TOS) to 46?
 
pe1chl
Forum Guru
Forum Guru
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: VOIP QOS

Thu Jul 13, 2017 11:57 am

No, the DSCP 26 data is connection management data that does not require that realtime behavior that the voice data requires.

Well, it is as I said. It is possible to make VoIP work using QoS on a reasonable network, but it is also certainly possible
to create a network that is too hopeless to get it working.

In a device with variable rate (like a WiFi AP, or an internet modem for a variable-rate line technology, the support for
priority using DSCP should be integrated. In WiFi this is named "wifi multi media" (wmm) and for your Ubiquiti devices this
should be enabled by default. It means that traffic is sorted in 4 different queues depending on DSCP and the VoIP
traffic is sent on the air before the normal data traffic.

You can establish the same thing on a fixed-rate line using a queue tree (1 queue on the interface and 4-8 queues below
that for each priority level), this is adequately described in other topics (search for dscp qos script)
But when your line is not fixed-rate, this does not work optimally and it really has to be handled by the device that knows
about the line rate, probably a DSL or cable modem in your case.

Limit-at and max-limit do work, but maybe not the way you guess. Read the manual carefully.
 
ubikrotik
Member Candidate
Member Candidate
Topic Author
Posts: 162
Joined: Wed May 25, 2016 3:56 am

Re: VOIP QOS

Sat Jul 15, 2017 6:23 am

ok, the higher dscp level, the higher the priority?



packet with 46 value will be sent before dscp 26?


am i right?
 
pe1chl
Forum Guru
Forum Guru
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: VOIP QOS

Sat Jul 15, 2017 11:16 am

By default that is usually true, especially for those higher values. With lower DSCP values it is a bit more complicated but that is not important for VoIP.

What you need to understand is: it is possible to make a well designed network suitable for VoIP with a careful combination of DSCP, setting priorities, queuing, etc.
There is no guarantee that you can make anything that is made available work OK. There are situations where there is no hope. And they are common.
 
ubikrotik
Member Candidate
Member Candidate
Topic Author
Posts: 162
Joined: Wed May 25, 2016 3:56 am

Re: VOIP QOS

Sun Jul 16, 2017 6:26 am

I don't understand, Big carrier in the usa, mobile carrier,big entreprise, hospital etc are able to make Voip work realy good. If I can control all in my network, why should i not be able to make it work good too?
 
pe1chl
Forum Guru
Forum Guru
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: VOIP QOS

Sun Jul 16, 2017 11:59 am

It is as I said: with a well designed network it can work OK. But if you throw enough garbage in the can, there will be problems.
Those big companies do not use connections with an unstable speed and/or they use equipment which handles DSCP at the point where the speed is varying, not at some downstream router.
Also, they are aware that the queuing has to be handled well at both ends of the link, not only at the local end but also at the ISP end.
 
ubikrotik
Member Candidate
Member Candidate
Topic Author
Posts: 162
Joined: Wed May 25, 2016 3:56 am

Re: VOIP QOS

Sun Jul 16, 2017 9:33 pm

I see.


Let say I have a perfect Layer 2 trunk (fiber) from my Voip Provider and my network.

What is the next step to setup my Voip ?

Already Done :

Mangle rule that spot DSCP 46 and mark those packets.
Queue tree wich give enough BW at those marked packets, considering 80k per active lines. And priority set to 1.


Should be done :

Vlan for each Voip device
------------------.
else?
 
pe1chl
Forum Guru
Forum Guru
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: VOIP QOS

Sun Jul 16, 2017 10:26 pm

When you have a separate trunk to your VoIP provider, separate from what you use for generic internet access (downloading),
it will work perfectly. You can also use a separate (low bandwidth) internet connection for that, when you setup the routing
correctly so the traffic to the VoIP provider(s) will use this link and the downloaders don't.
The advantage of this solution is that you fix the problem at the remote end at the same time. Any solution with a shared
internet link will always have problems when you cannot get co-operation from the internet provider to do separate queueing
of the VoIP traffic like you are now doing for the upstream.
 
ubikrotik
Member Candidate
Member Candidate
Topic Author
Posts: 162
Joined: Wed May 25, 2016 3:56 am

Re: VOIP QOS

Mon Jul 17, 2017 2:01 am

Thank you sir for your help.


Do you know how to have a good jitter ? I know it depends about a lot of things, but are VLANs help to prevent hight jitter? Is it true that separate ''generic internet" from VOIP data help for jitter to get low since the moment the packets are treated at the same ''bottle neck'' (router) jitter can be higher.


Thank you again pe1chl.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: VOIP QOS

Mon Jul 17, 2017 10:59 am

Yes that is why I suggest that. Today, many internet providers use equipment that does have too long queues (buffer bloat) and
this causes jitter. You can work around that by trying to keep their queues empty, which is what the queue tree solution does, but
you can do that only on upload. A separate internet connection solves that.
Having a separate VLAN for VoIP can do the same thing on a LAN, but it only has effect when the LAN is very loaded. When there
is only a light load (e.g. when you mostly use it for internet and the LAN is much faster than the internet) there will not be any
improvement from a second VLAN for VoIP.
When you have a fast server and lots of file activity on the LAN, it is good to make a separate VLAN and configure the switches
correctly so they know this is a Voice VLAN and has priority.

Who is online

Users browsing this forum: No registered users and 10 guests