Qosify: new package for DSCP marking + cake

Late to the scene here. Thank you for your sharing your config file. It made it easier to compile a list of sites for gaming, streaming ect. A question about Qosify. I am struggling to see any benefit in terms of latency reduction. I am using the Belkin RT3200 and seeing at least a 20ms difference in latency when the download link is under load. I am also seeing full download speeds when, in fact, I think if cake was active, would probably not be the case?

Here is my config file for Qosify under /etc/qosify/00-defaults.conf

# HTTP/HTTPS/QUIC
tcp:80    browsing
tcp:443   browsing
udp:80    browsing
udp:443   browsing

dns:*.cloudfront.net* 			streaming
dns:*.akamaiedge.net* 			streaming 
dns:*.demonware.net* 			gaming
dns:*.choopa.net* 			gaming
dns:*.activision.com* 			streaming
dns:*.vultrusercontent.com* 		gaming
dns:*.eu-central-1.compute.amazonaws.com* gaming
dns:*.eu-west-3.compute.amazonaws.com* gaming
dns:*.eu-west-3.compute.amazonaws.com* gaming



# Microsoft (Download)
dns:*1drv*                 bulk
dns:*backblaze*            bulk
dns:*backblazeb2*          bulk
dns:*ms-acdc.office*       bulk
dns:*onedrive*             bulk
dns:*sharepoint*           bulk
dns:*update.microsoft*     bulk
dns:*windowsupdate*        bulk

# MEGA (Download)
dns:*mega*                 bulk

# Dropbox (Download)
dns:*dropboxusercontent*   bulk

# Google (Download)
dns:*drive.google*         bulk
dns:*googleusercontent*    bulk

# Steam (Download)
dns:*steamcontent*         bulk

# Epic Games (Download)
dns:*download.epicgames*   bulk
dns:*download2.epicgames*  bulk
dns:*download3.epicgames*  bulk
dns:*download4.epicgames*  bulk
dns:*epicgames-download1*  bulk

# BitTorrent
tcp:6881-7000    bulk
tcp:51413        bulk
udp:6771         bulk
udp:6881-7000    bulk
udp:51413        bulk

# Usenet
tcp:119          bulk
tcp:563          bulk


# YouTube
dns:*googlevideo*   besteffort

# Facebook
dns:*fbcdn*         besteffort

# Twitch
dns:*ttvnw*         besteffort

# TikTok
dns:*tiktok*        besteffort

# Netflix
dns:*nflxvideo*     besteffort

# Amazon Prime Video
dns:*aiv-cdn*       besteffort
dns:*aiv-delivery*  besteffort
dns:*pv-cdn*        besteffort

# Disney Plus
dns:*disney*        besteffort
dns:*dssott*        besteffort

# HBO
dns:*hbo*           besteffort
dns:*hbomaxcdn*     besteffort




# SSH
tcp:22    network_services

# NTP
udp:123   network_services

# DNS
tcp:53    network_services
tcp:5353  network_services
udp:53    network_services
udp:5353  network_services




## 





# Live Streaming to YouTube Live, Twitch, Vimeo and LinkedIn Live
tcp:1935-1936    broadcast_video
tcp:2396         broadcast_video
tcp:2935         broadcast_video



# DNS over TLS (DoT)
tcp:853   multimedia_conferencing
udp:853   multimedia_conferencing

# Zoom, Microsoft Teams, Skype and FaceTime (they use these same ports)
udp:3478-3497    multimedia_conferencing

# Zoom
dns:*zoom*       multimedia_conferencing
tcp:8801-8802    multimedia_conferencing
udp:8801-8810    multimedia_conferencing

# Skype
dns:*skype*      multimedia_conferencing

# FaceTime
udp:16384-16387  multimedia_conferencing
udp:16393-16402  multimedia_conferencing

# GoToMeeting
udp:1853         multimedia_conferencing
udp:8200         multimedia_conferencing

# Webex Meeting
tcp:5004         multimedia_conferencing
udp:9000         multimedia_conferencing

# Jitsi Meet
tcp:5349         multimedia_conferencing
udp:10000        multimedia_conferencing

# Google Meet
udp:19302-19309  multimedia_conferencing

# TeamViewer
tcp:5938         multimedia_conferencing
udp:5938         multimedia_conferencing

# Voice over Internet Protocol (VoIP)
tcp:5060-5061    telephony
udp:5060-5061    telephony

# Voice over WiFi or WiFi Calling (VoWiFi)
udp:500          telephony
udp:4500         telephony

and here is my config file from /etc/config/qosify

config defaults
	list defaults /etc/qosify/*.conf
	option dscp_icmp +besteffort
	option dscp_default_tcp unmarked_traffic
	option dscp_default_udp unmarked_traffic

config class unmarked_traffic
	option ingress CS1
	option egress CS1
	option prio_max_avg_pkt_len 1270
	option dscp_prio CS4
	option bulk_trigger_pps 600
	option bulk_trigger_timeout 10
	option dscp_bulk CS1

config class browsing
	option ingress CS0
	option egress CS0
	option prio_max_avg_pkt_len 575
	option dscp_prio AF31
	option bulk_trigger_pps 1000
	option bulk_trigger_timeout 10
	option dscp_bulk CS1

config class bulk
	option ingress CS1
	option egress CS1

config class besteffort
	option ingress CS0
	option egress CS0

config class network_services
	option ingress CS2
	option egress CS2

config class broadcast_video
	option ingress CS3
	option egress CS3

config class gaming
	option ingress CS4
	option egress CS4

config class multimedia_conferencing
	option ingress AF41
	option egress AF41

config class streaming
	option ingress AF32
	option egress AF32
	option prio_max_avg_pkt_len 575
	option dscp_prio AF31

config class telephony
	option ingress EF
	option egress EF

config interface wan
	option name wan
	option disabled 1
	option bandwidth_up 42mbit
	option bandwidth_down 850mbit
	option overhead_type docsis
	# defaults:
	option ingress 1
	option egress 1
	option mode diffserv4
	option nat 1
	option host_isolate 1
	option autorate_ingress 0
	option ingress_options ""
	option egress_options "wash"
	option options ""

config device wandev
	option disabled 1
	option name wan
	option bandwidth 850mbit

Why do I not see a reduction in latency? I have a GLiNet 1800AX, for comparison, that successfully manages latency to a range of about 4ms between unloaded and loaded downstream scenarios. I am currently running OpenWRT 22.03.0-rc1 build for my Belkin RT3200. Any help would be appreciated.

They are both disabled? Best to turn one one me thinks; interface wan probably.

3 Likes

I feel slightly silly now. Hahaha. Thanks for pointing the obvious out to me.

1 Like

Don't feel silly, happens to most of us occasionally...

Hi moller can you help me ?
I have a Linksys EA8500, my internet is an ADSL line of 10 Megabits downstream and 700k upstream (use PPPoE). I have read your input for SQM I used your ATM overhead detector and followed the instructions to configure SQM, I don't know if I did it right but I leave here the configuration:


config queue 'wan'
        option ingress_ecn 'ECN'
        option egress_ecn 'ECN'
        option debug_logging '0'
        opción verbosity '5'
        opción qdisc 'cake'
        opción qdisc_advanced '1'
        opción qdisc_really_really_advanced '1
        opción squash_dscp '0'
        opción squash_ingress '0'
        opción download '0'
        opción script 'layer_cake.qos'
        opción eqdisc_opts 'diffserv4 nat dual-srchost'
        opción linklayer 'atm'
        opción interfaz 'pppoe-wan'
        opción upload '630'
        opción linklayer_advanced '1'
        opción linklayer_adaptation_mechanism 'default'
        opción tcMPU '96'
        opción enabled '1'
        opción overhead '40'
        opción tcMTU '1540'
        opción tcTSIZE '96'

configurar cola
        opción debug_logging '0'
        opción verbosity '5'
        opción qdisc 'cake'
        opción qdisc_advanced '1'
        opción ingress_ecn 'ECN'
        opción qdisc_really_really_advanced '1'
        opción squash_dscp '0'
        opción squash_ingress '0'
        opción egress_ecn 'ECN'
        opción script 'piece_of_cake.qos'
        opción download '0'
        opción eqdisc_opts 'diffserv4 dual-dsthost ingress nat'
        opción linklayer_advanced '1'
        option linklayer_adaptation_mechanism 'default'
        opción interfaz 'eth1'
        opción linklayer 'atm'
        opción upload '9649'
        opción tcMPU '96'
        opción enabled '1'
        opción overhead '40'
        opción tcMTU '15440'
        opción tcTSIZE '96'

I don't know if this is well done in SQM, but now I am testing QosiFy, I am a total newbie, I leave what I have configured in QoSify and I would like you to help me to correct if I have something wrong and also how to configure QoSify for a 100 Megas symmetrical internet connection of PPPoE authentication.

/etc/config/qosify

config defaults
	list defaults /etc/qosify/*.conf
	option dscp_icmp +besteffort
	option dscp_default_tcp unmarked_traffic
	option dscp_default_udp unmarked_traffic

config class unmarked_traffic
	option ingress CS1
	option egress CS1
	option prio_max_avg_pkt_len 1256
	option dscp_prio CS4
	option bulk_trigger_pps 600
	option bulk_trigger_timeout 4
	option dscp_bulk CS1

config class browsing
	option ingress CS0
	option egress CS0
	option prio_max_avg_pkt_len 575
	option dscp_prio AF31
	option bulk_trigger_pps 1000
	option bulk_trigger_timeout 4
	option dscp_bulk CS1

config class bulk
	option ingress CS1
	option egress CS1
	option prio_max_avg_pkt_len 575
	option dscp_prio CS1
	option bulk_trigger_pps 1000
	option bulk_trigger_timeout 30
 	option dscp_bulk CS0

config class besteffort
	option ingress CS0
	option egress CS0

config class network_services
	option ingress CS2
	option egress CS2

config class broadcast_video
	option ingress CS3
	option egress CS3
	option egress AF32
   	option prio_max_avg_pkt_len 575
	option dscp_prio AF31

config class gaming
	option ingress CS4
	option egress CS4

config class multimedia_conferencing
	option ingress AF41
	option egress AF41

config class streaming
	option ingress AF32
	option egress AF32
	option prio_max_avg_pkt_len 575
	option dscp_prio AF31

config class telephony
	option ingress EF
	option egress EF

config interface wan
    option name wan
    option disabled 0
    option bandwidth_up 637kbit
    option bandwidth_down 9620kbit

config interface GuestWifi
    option name GuestWifi
    option disabled 0
    option bandwidth_up 1024kbit
    option bandwidth_down 300kbit

    # defaults:
    option ingress 1
    option egress 1
    option mode diffserv4
    option nat 1
    option host_isolate 1
    option autorate_ingress 0
    option ingress_options "nat dual-dsthost ingress mpu 88 overhead 40"
    option egress_options "nat dual-srchost mpu 88 overhead 40 wash"
    

#config device wandev
    #option disabled 1
    #option name wan
    #option bandwidth 10230kbit


/etc/qosify/*.conf

# HTTP/HTTPS/QUIC
tcp:80    browsing
tcp:443   browsing
udp:80    browsing
udp:443   browsing

# NTP
udp:123        network_services

# DNS
tcp:53        networtk_services
tcp:5353    networtk_services
udp:53        networtk_services
udp:5353    networtk_services

# DNS over TLS (DoT)
tcp:853        multimedia_conferencing
udp:853        multimedia_conferencing

# HTTP/HTTPS/QUIC
tcp:80        browsing
tcp:443        browsing
udp:80        browsing
udp:443        browsing

# Microsoft (Download)
dns:*1drv*            bulk
dns:*backblaze*            bulk
dns:*backblazeb2*        bulk
dns:*ms-acdc.office*        bulk
dns:*onedrive*            bulk
dns:*sharepoint*        bulk
dns:*update.microsoft*        bulk
dns:*windowsupdate*        bulk

# MEGA (Download)
dns:*mega*            bulk
dns:*zippyshare.com        besteffort

# Dropbox (Download)
dns:*dropboxusercontent*    bulk

# Google (Download)
dns:*drive.google*        bulk
dns:*googleusercontent*        bulk

# YouTube
dns:*googlevideo*    besteffort

# Servicios de Streaming
dns:*nflxvideo*        besteffort
dns:*aiv-cdn*        besteffort
dns:*aiv-delivery*    besteffort
dns:*pv-cdn*        besteffort
dns:*disney*        besteffort
dns:*dssott*        besteffort
dns:*hbo*        besteffort
dns:*hbomaxcdn*        besteffort

# BitTorrent
tcp:6881-7000        bulk
tcp:51413        bulk
udp:6771        bulk
udp:6881-7000        bulk
udp:51413        bulk

# Live Streaming (Servicios IPTV)
tcp:1935-1936        broadcast_video
tcp:2396        broadcast_video
tcp:2935        broadcast_video
tcp:7283        broadcast_video

#########  Video Game Zone add by game or service #########


# pubg mobile 

tcp:49610	gaming
tcp:46602	gaming
tcp:44748	gaming
tcp:20820	gaming
tcp:32651	gaming
tcp:48983	gaming
tcp:64133	gaming
tcp:26857	gaming
tcp:29845	gaming
tcp:37739	gaming
tcp:36750	gaming
tcp:11735	gaming
tcp:7407	gaming
tcp:33253	gaming
tcp:47547	gaming
tcp:9952	gaming
tcp:10167	gaming
tcp:12522	gaming
tcp:52298	gaming
tcp:38289	gaming
tcp:3295	gaming
tcp:61950	gaming
tcp:52354	gaming

dns:*5004-shadow.igamecj*	gaming
dns:*me-du.shadow.igamecj*	gaming
dns:*as-sg.shadow.igamecj*	gaming
dns:*kj-se.shadow.igamecj*	gaming
dns:*3022-shadow.igamecj*	gaming
dns:*as-sg-m.shadow.igamecj* 	gaming
dns:*as-in.shadow.igamecj*	gaming
dns:*as-mb.shadow.igamecj*	gaming
dns:*as-hk.shadow.igamecj*	gaming
dns:*sa-sap.shadow.igamecj*	gaming
dns:*3021-shadow.igamecj*	gaming
dns:*4008-shadow.igamecj*	gaming
dns:*as-hk.shadow.igamecj*	gaming
dns:*4009-shadow.igamecj*	gaming
dns:*4010-shadow.igamecj*	gaming
dns:*4007-shadow.igamecj*	gaming
dns:*4006-shadow.igamecj*	gaming
dns:*sa-sap-m.shadow.igamecj*	gaming
dns:*sa-scl.shadow.igamecj*	gaming
dns:*5005-shadow.igamecj*	gaming
dns:*kj-tk.shadow.igamecj*	gaming
dns:*api.club.gpubgm*	gaming
dns:*us.voice.gcloudcs*	gaming
dns:*naspeed.igamecj*	gaming


# Zoom, Microsoft Teams, Skype y FaceTime
udp:3478-3497        multimedia_conferencing

# Zoom
dns:*zoom*        multimedia_conferencing
tcp:8801-8802        multimedia_conferencing
udp:8801-8810        multimedia_conferencing

# Skype
dns:*skype*        multimedia_conferencing

# FaceTime
udp:16384-16387        multimedia_conferencing
udp:16393-16402        multimedia_conferencing

# GoToMeeting
udp:1853        multimedia_conferencing
udp:8200        multimedia_conferencing

# Google Meet
udp:19302-19309        multimedia_conferencing

# TeamViewer
tcp:5938        multimedia_conferencing
udp:5938        multimedia_conferencing

# Voice over Internet Protocol (VoIP)
tcp:5060-5061        telephony
udp:5060-5061        telephony

# Voice over WiFi or WiFi Calling (VoWiFi)
udp:500            telephony
udp:4500        telephony


I am a total noob and if you think I should read something I would appreciate it if you could tell me what it is.

1 Like

ipq8064 isn't fast enough to handle 610 MBit/s with sqm/ cake, it isn't even fast enough to do that without any kind of sqm. Your limits with sqm would be around 150 MBit/s.

1 Like

I wasn't sure how much bandwidth this Linksys EA8500 could handle, thanks for the clarification, although I did know it wasn't much because it's a dualcore with several years.

Yes, I know but for me it is enough at the moment, my ISP at this moment does not want to install fiber and the maximum that another company offers is 100 MBits/s, as I said, I currently only have ADSL of 10 MBits/s and this router is enough For me, in the future I plan to buy something more powerful and use this Linksys as an AP.

Thanks for the information, I had already read something about it but I am clear that I need something with at least four cores and a good clock speed.

On such a slow link I would recommend:
option egress_ecn 'NOECN'

Leave this at its default of 2047 this does not work as one intuitively assumes, for cake with linklayer_adaptation_mechanism 'default' this is ignored, but I think it is still a good idea to get this right. And the same applies to:

Well test it with something like:
a) flent (the gold-standard) but requires to servers on the internet (maybe @dtaht could help out here?)
b) The waveform on-line speedtest with latency under load/latency under working conditions measurements
c) Ookla's speedtest app for android or ios
If sqm is set well stuff like a speedtest during a VoIP call or a videoconference should work well (but note with your 630 Kbps upload you are in the "manage the pain" territory already)
About the qosify configuration I can not say much (since I am not using qosify myself), but the principle behind prioritization is still quite simple:
For every packet that get processed/transported faster/earlier other packets will need to be transported slower/later, this is going to work reasonably well if only a smallish fraction of packets are actually treated to higher priority (moving stuff to the background priority is less problematic, but that tin has very little guaranteed throughput, so if only put stuff in there you are willing and ready to wait for)...

This should be 96...

Also only use one method to instantiate cak on pppoe-wan, either sqm OR qosify, only one can be active at the same time (the later running one will silently disable the other one I assume).

Let's tackle that in a different thread, after we got the 9/0.6 Mbps version operational, okay?

I am confused, I thought we are talking about a ~10/0.7 ADSL link here :wink:

2 Likes

I obviously misread "700k" as MBit/s (sadly vastly asymmetric WAN speeds aren't uncommon).

4 Likes

Where is this package in the nconfig menu? Cant find it.....

Building from master and not seeing it in any of the available package menu

Qosify DNS feature seems to depend on dnsmasq (looking at the code), I am looking to run only unbound with odhcpd. Any one have idea what does it take to make qosify work with unbound? I am aware that dnsmasq can be run serial to unbound, but its not so great for performance. It will be nice to for qosify to support unbound as well.

1 Like

You must install llvm package in your host OS, then make menuconfig, Advanced configuration options -> BPF toolchain (use host llvm toolchain), and then Base System -> Qosify

2 Likes

Thanks for this, got it working.

@nbd https://git.harting.dev/anonfunc/upload-baker

It would be nice if you can implement something similar. What do you think?

Or like this?

OpenWrt users have put together various solutions that generally work - see here:

Still a work in progress. It's not easy and we'd value your input on that thread if you want to help test and improve (assuming you have a variable rate connection).

4 Likes

Same question

will this package get a luci interface in future?

You can have both installed (SQM and Qosify), but not enabled simultaneously.
If you look at the thread there are a lot of examples of how to make it work, but I think it's not that hard.
First, you need to edit your /etc/config/qosify file with your interface parameters and start it with

/etc/init.d/qosify start

(optional) Enable automatic startup

/etc/init.d/qosify enable

and you can test if everything is ok executing

qosify-status

It should show the interface with the ingress and egress status, if not, check the interface name and that is not disabled, repeat until you can see the ingress and egress status, after that edit the defaults with your own dscp markings:

/etc/qosify/00-defaults.conf

If you want to test if your packets are correctly tagged, a simple way is just to open a streaming service defined in the config file, like netflix (you can find some examples in the thread), capture the traffic in the router using tcpdump, and dump it to a file, open it with wireshark, and you should see the packets tagged as AF41.

image

I'm describing how to run Qosify in a generalized way, there are some parameters not touched here that you must know to make it work efficiently (your bandwidth speed, overhead, etc).

2 Likes

In my case it would be a lte link and unstable docsis connection (vodafone germany :sweat_smile:)

1 Like

I note that aside from giving people fun knobs to twiddle, I remain dubious as to qosify's actual value. Does anyone have a repeatable test demonstrating it to be:

A) doing something measurably useful remarking packets at the ISP link then transiting over wifi?

B) improving VOIP MOS

Etc?