Qosify: new package for DSCP marking + cake

Can you refer to other class inside another class?

Why qosify don't start after each reboot ?

Not for ingress/egress (to avoid circular references), but it works for dscp_bulk/dscp_prio.

2 Likes

What does running qosify-status show after reboot, when it didn't work?

1 Like

Capture d’écran 2021-11-22 à 17.08.40

I just pushed a change that installed the same hotplug script it uses in net/ into iface/ as well. With that in place, it should work at boot time.

3 Likes

ok thanks he will available in the next snapshot ? it's right ?

Sure, once the buildbot gets around to building your target

2 Likes

Or try:

cp /etc/hotplug.d/net/10-qosify /etc/hotplug.d/iface/10-qosify

ok cp or cd ?

cp /etc/hotplug.d/net/10-qosify /etc/hotplug.d/iface/10-qosify

i has not files qosify in hotplug.d/iface/

for me i has add the files next

#!/bin/sh

[ -n "$DEVICE" ] || exit 0
[ "$ACTION" = ifup ] &&  {                                                                            
    echo y | /etc/init.d/qosify reload | start
    logger -t qosify "Reloading qosify due to $ACTION of $INTERFACE ($DEVICE)"
}

with this script files in /etc/hotplug.d/iface/10-qosify he work

The hotplug script from qosify is very simple:

#!/bin/sh
ubus call qosify check_devices

So I was suggesting to copy it from the current location to the new iface directory (it will be the same script in both directories once the updated package is available).

No need to wait if you can copy with cp.

2 Likes

@nbd Not to go off topic but ... Also I really want some hard feedback on this.
I assume people are intrested in this "QOSIFY" graph interface for openwrt ... I know Iam.

To me this looks to be some sort of 'DSCP marking UI' an I've seen quite a few scripts for this here.
If not you can search on the forum i.e. "ULTIMATE DSCP MARK SQM IPTABLE SCRIPT !!!"
Maybe you created this because of the above said scripts. I'm sure you have seen them.

I tried to searched for "QOSIFY" in my openwrt to see what it brings to the table myself but cant find it.
I'm using a x86_64 switch that I heavly modified purely for ethernet cable not wifi with high end hardware.
ATM I'm Running

Firmware Version OpenWrt 21.02.1 r16325-88151b8303 
LuCI openwrt-21.02 branch git-21.314.39479-e1ccb66
Kernel Version	5.4.154

Qosify looks like something I would love to try and test out.
Very curious to see if it has same functions such as the IPTABLE scripts used an I'm currlenty using one.
Now to be clear my ISP is CRAP an these tables are very important for me to wash DSCP from my ISP.
Below here is a example of said script used to wash DSCP from the ISP to proper markings:

#!/bin/bash -x
IPT="iptables"
$IPT -t mangle -F PREROUTING
$IPT -t mangle -A PREROUTING -i eth1 -j DSCP --set-dscp-class CS0
$IPT -t mangle -N dscp_mark > /dev/null 2>&1
$IPT -t mangle -F dscp_mark
$IPT -t mangle -L POSTROUTING -n | grep dscp_mark || $IPT -t mangle -A POSTROUTING -j dscp_mark
	iptmark(){
		$IPT -t mangle -A dscp_mark "$@"
		 }
iptmark -j DSCP --set-dscp-class CS0
iptmark -p udp -m multiport --port 123 -j DSCP --set-dscp-class CS6 -m comment --comment "NTP"
iptmark -p icmp -j DSCP --set-dscp 0x2E -m comment --comment "ICMP"
iptmark -p udp -m multiport --dports 50000:65535 -s 192.168.1.42 -j DSCP --set-dscp 0x2C -m comment --comment "VOIP"
iptmark -p udp -m multiport --ports 53,5353 -j DSCP --set-dscp-class CS4 -m comment --comment "DNS UDP"
iptmark -p tcp -m multiport --ports 53,5353 -j DSCP --set-dscp-class CS4 -m comment --comment "DNS TCP"
iptmark -p tcp --tcp-flags ALL SYN -m length --length :666 -j DSCP --set-dscp-class CS3 -m comment --comment "SYN packet"
iptmark -p tcp --tcp-flags ALL ACK -m length --length :128 -j DSCP --set-dscp-class CS3 -m comment --comment "ACK packet"
iptmark -p tcp -m multiport --ports 80,443 -j DSCP --set-dscp-class CS3 -m comment --comment "TCP Web Browsing"
iptmark -p udp -m multiport --ports 80,443 -j DSCP --set-dscp-class CS3 -m comment --comment "UDP Web Browsing "
2 Likes

hi everybody
I compared qosify without my iptables rules

then with my iptables rules for the game, what do you say, the impression of the game was good in both directions but the result qosify was different I let you watch

witouth rules

root@OpenWrt:~# qosify-status
===== interface wan: active =====
egress status:
qdisc cake 1: root refcnt 2 bandwidth 16Mbit diffserv4 dual-srchost nat nowash no-ack-filter split-gso rtt 100ms noatm overhead 44 mpu 84
 Sent 17066063 bytes 80982 pkt (dropped 25, overlimits 19187 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 343304b of 4Mb
 capacity estimate: 16Mbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       84 /    1544
 average network hdr offset:           14

                   Bulk  Best Effort        Video        Voice
  thresh          1Mbit       16Mbit        8Mbit        4Mbit
  target         18.2ms          5ms          5ms          5ms
  interval        113ms        100ms        100ms        100ms
  pk_delay          0us        196us          2us          7us
  av_delay          0us         38us          0us          1us
  sp_delay          0us          3us          0us          1us
  backlog            0b           0b           0b           0b
  pkts                0        80918            1           88
  bytes               0     17092802           90         3696
  way_inds            0          343            0            0
  way_miss            0         6065            1            1
  way_cols            0            0            0            0
  drops               0           25            0            0
  marks               0            0            0            0
  ack_drop            0            0            0            0
  sp_flows            0            3            1            1
  bk_flows            0            1            0            0
  un_flows            0            0            0            0
  max_len             0         7570           90           42
  quantum           300          488          300          300


ingress status:
qdisc cake 1: root refcnt 2 bandwidth 56Mbit diffserv4 dual-dsthost nat nowash ingress no-ack-filter split-gso rtt 100ms noatm overhead 44 mpu 84
 Sent 52121210 bytes 61354 pkt (dropped 29, overlimits 50032 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 479132b of 4Mb
 capacity estimate: 56Mbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:       90 /    1544
 average network hdr offset:           14

                   Bulk  Best Effort        Video        Voice
  thresh       3500Kbit       56Mbit       28Mbit       14Mbit
  target         5.19ms          5ms          5ms          5ms
  interval        100ms        100ms        100ms        100ms
  pk_delay          0us        203us          4us         33us
  av_delay          0us         44us          0us          2us
  sp_delay          0us          6us          0us          2us
  backlog            0b           0b           0b           0b
  pkts                0        61307            2           74
  bytes               0     52158229          744         4442
  way_inds            0          393            0            0
  way_miss            0         5925            1            9
  way_cols            0            0            0            0
  drops               0           29            0            0
  marks               0            0            0            0
  ack_drop            0            0            0            0
  sp_flows            0            1            1            1
  bk_flows            0            1            0            0
  un_flows            0            0            0            0
  max_len             0         6146          378           62
  quantum           300         1514          854          427


root@OpenWrt:~#

not traffic to the voice

and with my rules

root@OpenWrt:~# qosify-status
===== interface wan: active =====
egress status:
qdisc cake 1: root refcnt 2 bandwidth 16Mbit diffserv4 dual-srchost nat nowash no-ack-filter split-gso rtt 100ms noatm overhead 44 mpu 84
 Sent 6057322 bytes 33312 pkt (dropped 1, overlimits 1061 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 26112b of 4Mb
 capacity estimate: 16Mbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       84 /    1544
 average network hdr offset:           14

                   Bulk  Best Effort        Video        Voice
  thresh          1Mbit       16Mbit        8Mbit        4Mbit
  target         18.2ms          5ms          5ms          5ms
  interval        113ms        100ms        100ms        100ms
  pk_delay          0us       1.31ms          2us         55us
  av_delay          0us        104us          0us          4us
  sp_delay          0us         28us          0us          3us
  backlog            0b           0b           0b           0b
  pkts                0         2914            1        30398
  bytes               0       765917           90      5292829
  way_inds            0           20            0            0
  way_miss            0          372            1            5
  way_cols            0            0            0            0
  drops               0            1            0            0
  marks               0            0            0            0
  ack_drop            0            0            0            0
  sp_flows            0            0            0            1
  bk_flows            0            1            0            0
  un_flows            0            0            0            0
  max_len             0         4482           90         4542
  quantum           300          488          300          300


ingress status:
qdisc cake 1: root refcnt 2 bandwidth 56Mbit diffserv4 dual-dsthost nat nowash ingress no-ack-filter split-gso rtt 100ms noatm overhead 44 mpu 84
 Sent 7578710 bytes 13696 pkt (dropped 1, overlimits 2578 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 52832b of 4Mb
 capacity estimate: 56Mbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:       90 /    1544
 average network hdr offset:           14

                   Bulk  Best Effort        Video        Voice
  thresh       3500Kbit       56Mbit       28Mbit       14Mbit
  target         5.19ms          5ms          5ms          5ms
  interval        100ms        100ms        100ms        100ms
  pk_delay          0us        302us          2us         15us
  av_delay          0us         93us          0us          1us
  sp_delay          0us          3us          0us          1us
  backlog            0b           0b           0b           0b
  pkts                0        13642            2           53
  bytes               0      7576298          744         3182
  way_inds            0           13            0            0
  way_miss            0          297            1            4
  way_cols            0            0            0            0
  drops               0            1            0            0
  marks               0            0            0            0
  ack_drop            0            0            0            0
  sp_flows            0            0            1            1
  bk_flows            0            1            0            0
  un_flows            0            0            0            0
  max_len             0         6056          378           62
  quantum           300         1514          854          427


root@OpenWrt:~#

i can see more voice on egress status

I think the best way to do it for your console gaming is to set the destination ports from 1024 to 65535, as sownloading will use either 80 or 443 port

qosify-defaults.conf


# DNS
tcp:53		CS5
tcp:5353	CS5
udp:53		CS5
udp:5353	CS5

# NTP
udp:123		CS6

# SNMP
udp:161		+CS4

# FTP
tcp:21		+CS3

# SSH
tcp:22		+CS4

# HTTP/SSL
tcp:80		+CS3
tcp:443		+CS3
udp:80		+CS3
udp:443		+CS3

# VoIP SIP
udp:5060 CS6

# RTSP
tcp:554 AF41
udp:554 AF41

# IPTV - RTMP
udp:1935 AF41

# Multicast
udp --src:224.0.0.0/4 AF41
udp --dst:224.0.0.0/4 AF41

# Console Downloading - set to Bulk
tcp --src:192.168.2.160 --dport 80 CS0
tcp --src:192.168.2.160 --dport 80 CS0
udp --src:192.168.2.160 --dport 443 CS0
udp --src:192.168.2.160 --dport 443 CS0

# Console Gaming - Set to highest
udp --src:192.168.2.160 --dport 1024:65535 CS6

Not sure if multiport's works but if so, less to add.

tcp --src:192.168.2.160 -m multiport --ports 80,443 # Set to Bulk Traffic
udp --src:192.168.2.160 -m multiport --ports 80,443 # Set to Bulk Traffic
udp --src:192.168.2.160 --dport 1024:65535 CS6 # Set to Highest Traffic for Gaming
2 Likes

ok great ! have you checked if this was really taken into account?

you played to wifi ? it's right

ys i think is multiport, you are right

i will modified a little bit

No, but looking at this post, it may work but you need to know the Best Efforts class

quote="Dopam-IT_1987, post:276, topic:111789"]
you played to wifi ? it's right
[/quote]
No, My devices are all Wired but Mobile phone and tablets are WiFi.

Not sure if multiport works but let me know.

1 Like

oki will test and keep informed

he doesn"t work because look my tc qdisc after which games

qdisc noqueue 0: dev lo root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 0: dev eth0 root refcnt 2 limit 10240p flows 1024 quantum 1518 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 7339018 bytes 15601 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  maxpacket 1518 drop_overlimit 0 new_flow_count 5 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc noqueue 0: dev lan1 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev lan2 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev lan3 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev lan4 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 1: dev wan root refcnt 2 bandwidth 16Mbit diffserv4 dual-srchost nat nowash no-ack-filter split-gso rtt 100ms noatm overhead 44 mpu 84
 Sent 2311761 bytes 5592 pkt (dropped 1, overlimits 3943 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 117504b of 4Mb
 capacity estimate: 16Mbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       84 /    1544
 average network hdr offset:           14

                   Bulk  Best Effort        Video        Voice
  thresh          1Mbit       16Mbit        8Mbit        4Mbit
  target         18.2ms          5ms          5ms          5ms
  interval        113ms        100ms        100ms        100ms
  pk_delay          0us       2.23ms         23us          4us
  av_delay          0us        280us          1us          0us
  sp_delay          0us          4us          1us          0us
  backlog            0b           0b           0b           0b
  pkts                0         5564           24            5
  bytes               0      2310457         2160          210
  way_inds            0           26            0            0
  way_miss            0          426           24            1
  way_cols            0            0            0            0
  drops               0            1            0            0
  marks               0            0            0            0
  ack_drop            0            0            0            0
  sp_flows            0            1            1            0
  bk_flows            0            1            0            0
  un_flows            0            0            0            0
  max_len             0        10871           90           42
  quantum           300          488          300          300

qdisc ingress ffff: dev wan parent ffff:fff1 ----------------
 Sent 3083077 bytes 5389 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev br-lan root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 1: dev ifb-wan root refcnt 2 bandwidth 56Mbit diffserv4 dual-dsthost nat nowash ingress no-ack-filter split-gso rtt 100ms noatm overhead 44 mpu 84
 Sent 3178585 bytes 5389 pkt (dropped 0, overlimits 2497 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 34936b of 4Mb
 capacity estimate: 56Mbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:       90 /    1544
 average network hdr offset:           14

                   Bulk  Best Effort        Video        Voice
  thresh       3500Kbit       56Mbit       28Mbit       14Mbit
  target         5.19ms          5ms          5ms          5ms
  interval        100ms        100ms        100ms        100ms
  pk_delay          0us        658us          0us         10us
  av_delay          0us        112us          0us          0us
  sp_delay          0us          4us          0us          0us
  backlog            0b           0b           0b           0b
  pkts                0         5371            0           18
  bytes               0      3177314            0         1271
  way_inds            0           51            0            0
  way_miss            0          440            0            7
  way_cols            0            0            0            0
  drops               0            0            0            0
  marks               0            0            0            0
  ack_drop            0            0            0            0
  sp_flows            0            1            0            0
  bk_flows            0            1            0            0
  un_flows            0            0            0            0
  max_len             0         6056            0          175
  quantum           300         1514          854          427

i has put like this

# Console Gaming - Set to highest with CS5
##CALL OF DUTY

udp --dst:192.168.2.160 --sport 30000:45000 --dport 3074 CS5 ## -m comment --comment "Dopam-IT_1987-UDP-1-CALL-OF-DUTY" 
 
udp --src:192.168.2.160 --sport 3074 --dport 30000:45000 CS5 ## -m comment --comment "Dopam-IT_1987-UDP-2-CALL-OF-DUTY" 

you can see now if i remake my rules in firewall

he has a traffic to voice but only on egress

egress status:
qdisc cake 1: root refcnt 2 bandwidth 16Mbit diffserv4 dual-srchost nat nowash no-ack-filter split-gso rtt 100ms noatm overhead 44 mpu 84
 Sent 1106485 bytes 4238 pkt (dropped 0, overlimits 1960 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 39168b of 4Mb
 capacity estimate: 16Mbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       84 /    1544
 average network hdr offset:           14

                   Bulk  Best Effort        Video        Voice
  thresh          1Mbit       16Mbit        8Mbit        4Mbit
  target         18.2ms          5ms          5ms          5ms
  interval        113ms        100ms        100ms        100ms
  pk_delay          0us          1ms         13us        860us
  av_delay          0us        112us          0us         79us
  sp_delay          0us          3us          0us          4us
  backlog            0b           0b           0b           0b
  pkts                0         3256           20          962
  bytes               0       997952         1800       106733
  way_inds            0           22            0            0
  way_miss            0          383           20           61
  way_cols            0            0            0            0
  drops               0            0            0            0
  marks               0            0            0            0
  ack_drop            0            0            0            0
  sp_flows            0            1            0            0
  bk_flows            0            1            0            0
  un_flows            0            0            0            0
  max_len             0         4474           90         4542
  quantum           300          488          300          300


1 Like

Just saying, with roughy 9/10th of your traffic in the Voice tin you might be putting too much stuff into the Voice queue. The way cake works is, if you "oversubscibe a tin" packets will not be dropped, but put into a lower priority tin (if that has still capacity); that is nicer than dropping, but it can turn your intended prioritization on its head.

IMHO the best approach is to leave as much as possible in Best Effort, and only move stuff where completion time does not matter into the Bulk tin and stuff that is essential for your gaming into one of the higher tins (and I would start by moving stuff into Video first, and only use Voice if you run into trouble).

Now it is possible that you simply only had gaming traffic during your tests and hence the "occupation numbers" for the 4 tins is misleading, but my gist is, you can not prioritize all your traffic and expect that this is better than not prioritizing all your traffic :wink:

1 Like

hello yes I only had my pc to connect and a cell phone, suddenly you advise me to replace by which dscp to put in the video an example like AF41 can be :slight_smile:

@moeller i speak for game video

after has changed i has like this now

===== interface wan: active =====
egress status:
qdisc cake 1: root refcnt 2 bandwidth 16Mbit diffserv4 dual-srchost nat nowash no-ack-filter split-gso rtt 100ms noatm overhead 44 mpu 84
 Sent 144792 bytes 576 pkt (dropped 1, overlimits 134 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 26112b of 4Mb
 capacity estimate: 16Mbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       84 /    1544
 average network hdr offset:           13

                   Bulk  Best Effort        Video        Voice
  thresh          1Mbit       16Mbit        8Mbit        4Mbit
  target         18.2ms          5ms          5ms          5ms
  interval        113ms        100ms        100ms        100ms
  pk_delay          0us       1.03ms        2.4ms          0us
  av_delay          0us         75us        113us          0us
  sp_delay          0us          7us          3us          0us
  backlog            0b           0b           0b           0b
  pkts                0          197          379            1
  bytes               0        60443        85613           42
  way_inds            0            0            0            0
  way_miss            0           57            5            1
  way_cols            0            0            0            0
  drops               0            0            1            0
  marks               0            0            0            0
  ack_drop            0            0            0            0
  sp_flows            0            1            0            0
  bk_flows            0            1            1            0
  un_flows            0            0            0            0
  max_len             0         2040         4542           42
  quantum           300          488          300          300

AF41 is bad for me sorry

i really impressed than CS5 is best dscp for me

When testing how well your DSCP tagging works, I suggest to test it during load. So do your gaming and streaming, PLUS a separate device runs something like a speed test or a download of a large file.

If you are testing only with the game traffic, then you expect it should be very good behavior. But it won't tell you how well your gaming works during this other kind of load.

2 Likes