Community discussions

MikroTik App
 
mojbuk
just joined
Topic Author
Posts: 19
Joined: Sun Mar 08, 2015 7:13 pm

Traffic Priority for Facebook, Messenger and Viber

Sat Dec 12, 2020 10:16 pm

Does anyone have an example of how to set up a Traffic Priority on client device for Facebook, Messenger and Viber?
 
Moba
Member Candidate
Member Candidate
Posts: 213
Joined: Sun Sep 27, 2020 6:15 pm

Re: Traffic Priority for Facebook, Messenger and Viber

Sat Dec 12, 2020 10:44 pm

What is the problem you're having? All these apps use port 80, 443 and many other ports. Usually, it's the VoIP and video conferencing ports that need to be prioritized over UDP. DSCP is the easiest way to insure that time sensitive packets aren't delayed or dropped (if DSCP is respected). You can also prioritize some ports. Finally, you can use L7 and TLS host to filter the traffic, which I do not recommend.

All these options require marking traffic with mangle and then prioritizing the packets via queues. There's a big thread regarding QoS in the forums and many tutorials on YT.
 
mojbuk
just joined
Topic Author
Posts: 19
Joined: Sun Mar 08, 2015 7:13 pm

Re: Traffic Priority for Facebook, Messenger and Viber

Sun Dec 13, 2020 1:42 pm

What is the problem you're having? All these apps use port 80, 443 and many other ports. Usually, it's the VoIP and video conferencing ports that need to be prioritized over UDP. DSCP is the easiest way to insure that time sensitive packets aren't delayed or dropped (if DSCP is respected). You can also prioritize some ports. Finally, you can use L7 and TLS host to filter the traffic, which I do not recommend.

All these options require marking traffic with mangle and then prioritizing the packets via queues. There's a big thread regarding QoS in the forums and many tutorials on YT.
Thank you.
-All web site use 80 and 443, how do you plan to separate viber?
-Standard VOIP ports are not separated when making a viber or messenger call.
-What is DSCP for Viber and Messenger Call?
 
Moba
Member Candidate
Member Candidate
Posts: 213
Joined: Sun Sep 27, 2020 6:15 pm

Re: Traffic Priority for Facebook, Messenger and Viber

Sun Dec 13, 2020 4:17 pm

ROS has no way to identify application data, other than the workarounds I mentioned. The problem is that those workarounds are processor intensive and fiddly to setup even with tutorials.

So port based QoS is usually recommended as the easiest way to avoid congestion for critical applications. This is obviously not perfect, because many applications share the same ports (80, 443, 3478-3482, etc.). Someone kindly took a lot of time to post a very lengthy tutorial in the forums if you take the time to search for QoS. While I am not a fan of prioritizing everything because it degrades performance, it will get you started.

As for DSCP, you can search Google to learn about how it is used in packet headers for QoS with apps that support it. This is the easiest way to insure that proper priorities are respected.
 
mojbuk
just joined
Topic Author
Posts: 19
Joined: Sun Mar 08, 2015 7:13 pm

Re: Traffic Priority for Facebook, Messenger and Viber

Sun Dec 13, 2020 5:58 pm

ROS has no way to identify application data, other than the workarounds I mentioned. The problem is that those workarounds are processor intensive and fiddly to setup even with tutorials.

So port based QoS is usually recommended as the easiest way to avoid congestion for critical applications. This is obviously not perfect, because many applications share the same ports (80, 443, 3478-3482, etc.). Someone kindly took a lot of time to post a very lengthy tutorial in the forums if you take the time to search for QoS. While I am not a fan of prioritizing everything because it degrades performance, it will get you started.

As for DSCP, you can search Google to learn about how it is used in packet headers for QoS with apps that support it. This is the easiest way to insure that proper priorities are respected.
Thank you.
Is it possible to do priority per port without setting a max-limit?
 
DarkNate
Forum Guru
Forum Guru
Posts: 1065
Joined: Fri Jun 26, 2020 4:37 pm

Re: Traffic Priority for Facebook, Messenger and Viber

Sun Dec 13, 2020 6:27 pm

I ended up ditching Queue Tree/Advanced QoS like viewtopic.php?f=23&t=73214 completely.

I use Simple queues like the following:
/queue simple
add bucket-size=0.01/0.01 burst-time=1s/1s dst=pppoe-out1 max-limit=205M/205M name=ISP1-QoS priority=1/1 queue=default/default target=""
End result is, I can download with 30 threads, watch 8K videos, call, game all simultaneously without any buffering/packet loss.

Borrowed the following from the above guide though:
# default queue behavior
set default kind=sfq
 
Moba
Member Candidate
Member Candidate
Posts: 213
Joined: Sun Sep 27, 2020 6:15 pm

Re: Traffic Priority for Facebook, Messenger and Viber

Sun Dec 13, 2020 6:59 pm

A limit must be set globally somewhere for congestion in the queue structure to have control on which packets are prioritized, which are delayed, which are dropped first and to minimize bufferbloat. It's a trade-off for effective traffic shaping. If you do not set a limit, your ISP decides how to handle those extra packets once you max out your allotted bandwidth. But no, you don't need to set one for each port range or queue within a tree.

As Nate posted while I was typing, you can also use a single SFQ queue to provide a good user experience to all users. Fair queuing can also be mixed with traffic priorities and fasttrack. If one solution doesn't work for your needs, you try something else. However, there's no free lunch: Everything you add requires processing time, so less is always more.
 
mojbuk
just joined
Topic Author
Posts: 19
Joined: Sun Mar 08, 2015 7:13 pm

Re: Traffic Priority for Facebook, Messenger and Viber

Sun Dec 13, 2020 7:29 pm

A limit must be set globally somewhere for congestion in the queue structure to have control on which packets are prioritized, which are delayed, which are dropped first and to minimize bufferbloat. It's a trade-off for effective traffic shaping. If you do not set a limit, your ISP decides how to handle those extra packets once you max out your allotted bandwidth. But no, you don't need to set one for each port range or queue within a tree.

As Nate posted while I was typing, you can also use a single SFQ queue to provide a good user experience to all users. Fair queuing can also be mixed with traffic priorities and fasttrack. If one solution doesn't work for your needs, you try something else. However, there's no free lunch: Everything you add requires processing time, so less is always more.
Thank you.
I am trying to create priorities for a client device, SXT associated with a pppoe connection. The speed is dynamically defined, I would not want to enter the max-limit manually for each client after changing the package.
 
Moba
Member Candidate
Member Candidate
Posts: 213
Joined: Sun Sep 27, 2020 6:15 pm

Re: Traffic Priority for Facebook, Messenger and Viber

Mon Dec 14, 2020 6:41 am

Dynamic speed for each client? Schedulers and queues must have a limit somewhere that is smaller than the physical limit of the connection for QoS. If the connection is never congested (limitless bandwidth), then QoS is not required because any number of packets can be sent or received at the same time i.e. no packet will ever require priority as there are no delayed or dropped packets.
 
mojbuk
just joined
Topic Author
Posts: 19
Joined: Sun Mar 08, 2015 7:13 pm

Re: Traffic Priority for Facebook, Messenger and Viber

Mon Dec 14, 2020 5:02 pm

Dynamic speed for each client? Schedulers and queues must have a limit somewhere that is smaller than the physical limit of the connection for QoS. If the connection is never congested (limitless bandwidth), then QoS is not required because any number of packets can be sent or received at the same time i.e. no packet will ever require priority as there are no delayed or dropped packets.
Users are connected by a pppoe connection and have a changed speed when their package is replaced. I wouldn’t want to type a manual speed limit on every client device to create a QoS Tree.
Do you have any idea how to create on pppoe server?
 
Moba
Member Candidate
Member Candidate
Posts: 213
Joined: Sun Sep 27, 2020 6:15 pm

Re: Traffic Priority for Facebook, Messenger and Viber

Tue Dec 15, 2020 4:08 pm

AFAIK, you can create a simple pcq queue on the interface that covers the address pool or a queue tree for each package on the server. There's even a tutorial on YT on how to use a script to create a QoS tree for each pppoe user automatically (it polls for new clients at a set interval). All of these need to be tested in a lab before deployment. I am still learning MT, so I would get a consultant if I had such a requirement. I'll add that using scripts from unknown sources that you can't debug yourself isn't the best idea.

Here are a few examples: The last one seems to be exactly what you're asking about since it could be modified to prioritize by any method possible on MT.

https://gregsowell.com/?p=3700
https://under-linux.org/showthread.php?t=187371
 
suzylee2955
just joined
Posts: 1
Joined: Thu Jan 09, 2025 4:13 am

Re: Traffic Priority for Facebook, Messenger and Viber

Thu Jan 09, 2025 9:51 am

I ended up ditching Queue Tree/Advanced QoS like viewtopic.php?f=23&t=73214 completely.

I use Simple queues like the following:
/queue simple
add bucket-size=0.01/0.01 burst-time=1s/1s dst=pppoe-out1 max-limit=205M/205M name=ISP1-QoS priority=1/1 queue=default/default target=""
End result is, I can download with 30 threads, watch 8K videos, call, game all simultaneously without any buffering/packet loss.

Borrowed the following from the above guide though:
# default queue behavior
set default kind=sfq
Do you still use this simple queue, or is there any updated script for the optimal QoS? I got headache with that QoS tutorial, and my VoiP still suck.

Who is online

Users browsing this forum: eltikpad and 20 guests