OpenWrt Forum Archive

Topic: Prioritize VoIP adapter with SQM-QoS

The content of this topic has been archived on 29 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I used to have custom rules with QoS that worked well for my usage --

high priority DNS
high priority VoIP mac address
medium priority HTTP/S
low priority bulk data / all other

and it worked fairly well except for buffer bloat when heavily congested.

I switched to SQM-QoS and it fixed the buffer bloat but now introduced latency to the VoIP sad

How can I prioritize all traffic to the VoIP adapter?

encore2097 wrote:

I used to have custom rules with QoS that worked well for my usage --

high priority DNS
high priority VoIP mac address
medium priority HTTP/S
low priority bulk data / all other

and it worked fairly well except for buffer bloat when heavily congested.

I switched to SQM-QoS and it fixed the buffer bloat but now introduced latency to the VoIP sad

How can I prioritize all traffic to the VoIP adapter?

Pick layer_cake.qos and make sure your VoIP application/phone uses the appropriate DSCP markings for VoIP. (Cake supports a number of diffserv profiles that all attempt to do the right thing with packets marked as latency sensitive according to the relevant RFCs (see e.g. https://www.ietf.org/rfc/rfc4594.txt), with the exception of the "besteffort" profile). The challenge typically is to make sure incoing packets are marked appropriately, as ISPs are free to re-ap the DSCP field of packets during transfer for their own traffic management purposes. (DSCP markings are unfortunately not guaranteed to be end2end, even though a number of ISPs seem to leave them alone).
TL;DR. Try layer_cake.qos instead of piece_of_cake.qos and look at https://lede-project.org/docs/howto/sqm for detailed configuration information to make sqm-scripts/cake sign and dance...

Here a little help for your VoIP device software the value you need for it.
RTP Traffic / Voice
EF DiffServ decimal: 184
EF DiffServ hexadecimal: 0xb8
EF DiffServ binary: 10111000
EF DSCP decimal: 46
EF DSCP hexadecimal: 0x2e
EF DSCP binary: 101110
For SIP: calling
VA DiffServ decimal: 176
VA DiffServ hexadecimal: 0xb0
VA DiffServ binary: 10110000
VA DSCP decimal: 44
VA DSCP hexadecimal: 0x2C
VA DSCP binary: 101100

moeller0 wrote:

make sure your VoIP application/phone uses the appropriate DSCP markings for VoIP.

Its a phone ATA, which I can only plug in -- no UI of any sort. There are no firmware updates which add DSCP feature.



moeller0 wrote:

(DSCP markings are unfortunately not guaranteed to be end2end, even though a number of ISPs seem to leave them alone).

The ISP will do their own QoS sad 
I can only control what happens in my network.





moeller0 wrote:

TL;DR. Try layer_cake.qos instead of piece_of_cake.qos and look at https://lede-project.org/docs/howto/sqm for detailed configuration information to make sqm-scripts/cake sign and dance...

I read this, are you referring to Per-Host-Isolation? This enables equal bandwidth for each host. It doesn't prioritize one stream over the other, which is what I need for VoIP calls to be smooth when there is medium-high usage on the connection.




trismo wrote:

Here a little help for your VoIP device software the value you need for it.
RTP Traffic / Voice
EF DiffServ decimal: 184
EF DiffServ hexadecimal: 0xb8
EF DiffServ binary: 10111000
EF DSCP decimal: 46
EF DSCP hexadecimal: 0x2e
EF DSCP binary: 101110
For SIP: calling
VA DiffServ decimal: 176
VA DiffServ hexadecimal: 0xb0
VA DiffServ binary: 10110000
VA DSCP decimal: 44
VA DSCP hexadecimal: 0x2C
VA DSCP binary: 101100

I have no where to put this but thanks. Hopefully it will help someone.




It looks like this is not possible with SQM-QoS, I will stick to the old QoS package.

(Last edited by encore2097 on 2 Jun 2017, 05:58)

encore2097 wrote:
moeller0 wrote:

make sure your VoIP application/phone uses the appropriate DSCP markings for VoIP.

Its a phone ATA, which I can only plug in -- no UI of any sort. There are no firmware updates which add DSCP feature.

        Many VoIP applications (whether pure software, or packaged with their own hardware as ATA) will by default use the RFC-conform DSCP markings out of the box. You can test this by running a packet capture on your router while initiating, performing, and shutting-down a call from your phone, that should allow you to easily confirm whether your ATA uses diffserv markings or not. For example mine marks all outgoing packets EF and my ISP lets the incoming EF marks intact (which is not so unexpected giving that I connect to my ISP's VoIP servers).

encore2097 wrote:

moeller0 wrote:

(DSCP markings are unfortunately not guaranteed to be end2end, even though a number of ISPs seem to leave them alone).

The ISP will do their own QoS sad 
I can only control what happens in my network.

        I guess they will use their own QoS and that is the reason why the DSCP field can not simply be trusted without checking actual traffic first. That said, a at least my ISP mostly ignores the DSCP fields, as on the last mile they use a VLAN and use that VLANs PCP for their prioritization needs while their backbone currently seems to use MPLS, allowing them to simply ignore the DSCP field.

encore2097 wrote:


moeller0 wrote:

TL;DR. Try layer_cake.qos instead of piece_of_cake.qos and look at https://lede-project.org/docs/howto/sqm for detailed configuration information to make sqm-scripts/cake sign and dance...

I read this, are you referring to Per-Host-Isolation? This enables equal bandwidth for each host. It doesn't prioritize one stream over the other, which is what I need for VoIP calls to be smooth when there is medium-high usage on the connection.

        Well, mainly my advice boils down to "test layer_cake.qos" and see whether it solves your issue, if yes no need for further actions. And assuming your ATA has its own IP address, per-host-isolation will already help that say your torrent host will have a harder time crowding the VoIP packets out; remember the default is per-flow fairness, so that might be >20 torrent flows versus a single VoIP flow (I assume you only have one concurrent VoIP stream planned). But again the proof is in the pudding, if you test it and it does not work you might have wasted say 15 minutes at worst.

encore2097 wrote:

trismo wrote:

Here a little help for your VoIP device software the value you need for it.
RTP Traffic / Voice
EF DiffServ decimal: 184
EF DiffServ hexadecimal: 0xb8
EF DiffServ binary: 10111000
EF DSCP decimal: 46
EF DSCP hexadecimal: 0x2e
EF DSCP binary: 101110
For SIP: calling
VA DiffServ decimal: 176
VA DiffServ hexadecimal: 0xb0
VA DiffServ binary: 10110000
VA DSCP decimal: 44
VA DSCP hexadecimal: 0x2C
VA DSCP binary: 101100

I have no where to put this but thanks. Hopefully it will help someone.




It looks like this is not possible with SQM-QoS, I will stick to the old QoS package.


Sure, nothing bad with that, and for the level of detailed control you seem to want, pretty much the only/right thing (also I like your simple 3 tier scheme, have a look at cake's diffserv3 mode, with the correct DSCPs you should be able to get similar results). One of sqm-script's goal is to be the "AQM/QoS system for the rest of us" that should do the right thing out of the box without in-depth tweaking required.

Best Regards

The discussion might have continued from here.