DSCPCLASSIFY in Main repo?

its seems like its working fine right now, i run a torrent dl and a twitch stream and i was playing csgo at the same time and the ping was stable even with this slow adsl line that i have...

root@OpenWrt:~# tc -s qdisc
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 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 9947925017 bytes 12004930 pkt (dropped 0, overlimits 0 requeues 7756)
 backlog 0b 0p requeues 7756
  maxpacket 1514 drop_overlimit 0 new_flow_count 6395 ecn_mark 0
  new_flows_len 0 old_flows_len 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 noqueue 0: dev eth0.1 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 801d: dev eth0.2 root refcnt 2 bandwidth 700Kbit diffserv8 dual-srchost nat nowash ack-filter split-gso rtt 100ms atm overhead 32
 Sent 18287841 bytes 142719 pkt (dropped 61535, overlimits 305127 requeues 0)
 backlog 8238b 81p requeues 0
 memory used: 980Kb of 4Mb
 capacity estimate: 700Kbit
 min/max network layer size:           28 /    1492
 min/max overhead-adjusted size:      106 /    1696
 average network hdr offset:           14

                  Tin 0        Tin 1        Tin 2        Tin 3        Tin 4        Tin 5        Tin 6        Tin 7
  thresh        700Kbit    612496bit    535928bit    468936bit    410312bit    359016bit    314136bit    274864bit
  target           26ms       29.7ms         34ms       38.8ms       44.4ms       50.7ms         58ms       66.3ms
  interval        121ms        125ms        129ms        134ms        139ms        146ms        153ms        161ms
  pk_delay        274ms          0us       25.6ms          0us          0us          0us       9.43ms       2.93ms
  av_delay         83ms          0us       3.79ms          0us          0us          0us       1.91ms         94us
  sp_delay       14.3ms          0us        502us          0us          0us          0us        350us         90us
  backlog         8096b           0b          88b           0b           0b           0b           0b           0b
  pkts            12139            0       145016            0            0            0        47158           22
  bytes         1269328            0     13113877            0            0            0      9238861          924
  way_inds          486            0          124            0            0            0            0            0
  way_miss          127            0         1357            0            0            0          117            1
  way_cols            0            0            0            0            0            0            0            0
  drops            5497            0          950            0            0            0            0            0
  marks               0            0           13            0            0            0            0            0
  ack_drop            0            0        55088            0            0            0            0            0
  sp_flows           16            0           13            0            0            0            2            1
  bk_flows           12            0            0            0            0            0            0            0
  un_flows            0            0            0            0            0            0            0            0
  max_len          1506            0         7788            0            0            0          586           42
  quantum           300          300          300          300          300          300          300          300

qdisc ingress ffff: dev eth0.2 parent ffff:fff1 ----------------
 Sent 276072510 bytes 240548 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev wlan0 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 801e: dev ifb4eth0.2 root refcnt 2 bandwidth 12Mbit diffserv8 dual-dsthost nat nowash ingress no-ack-filter split-gso rtt 100ms atm overhead 32
 Sent 264388063 bytes 230380 pkt (dropped 10134, overlimits 387333 requeues 0)
 backlog 46606b 34p requeues 0
 memory used: 378560b of 4Mb
 capacity estimate: 12Mbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:      106 /    1696
 average network hdr offset:           14

                  Tin 0        Tin 1        Tin 2        Tin 3        Tin 4        Tin 5        Tin 6        Tin 7
  thresh         12Mbit    10500Kbit     9187Kbit     8039Kbit     7034Kbit     6154Kbit     5385Kbit     4712Kbit
  target            5ms          5ms          5ms          5ms          5ms          5ms          5ms          5ms
  interval        100ms        100ms        100ms        100ms        100ms        100ms        100ms        100ms
  pk_delay        101ms        4.8ms         27ms          0us          0us          0us       1.21ms       1.33ms
  av_delay       27.8ms        234us       5.07ms          0us          0us          0us        497us        127us
  sp_delay       5.36ms        108us        1.1ms          0us          0us          0us         80us         83us
  backlog        22728b           0b       23878b           0b           0b           0b           0b           0b
  pkts            12562           57       174340            0            0            0        53490           99
  bytes         8903321         5634    254770473            0            0            0     15758228        14046
  way_inds           11            0            6            0            0            0            0            0
  way_miss          170           16          796            0            0            0          116            7
  way_cols            0            0            0            0            0            0            0            0
  drops             446            0         9688            0            0            0            0            0
  marks               0            0            1            0            0            0            0            0
  ack_drop            0            0            0            0            0            0            0            0
  sp_flows            6            1            4            0            0            0            1            1
  bk_flows            7            0            5            0            0            0            0            0
  un_flows            0            0            0            0            0            0            0            0
  max_len          1514          185         3016            0            0            0         1242          174
  quantum           366          320          300          300          300          300          300          300

root@OpenWrt:~#

1 Like

why you use diffserv8 ?

can you share like say amteza

nft list chain inet dscpclassify static_classify

thanks

and share config dscpclassify is simply for the moment

config global 'global'
	option class_bulk 'le'
	option class_high_throughput 'af13'
	option client_hints '1'
	option threaded_client_min_bytes '10000'
	option threaded_service_min_bytes '1000000'
	option wmm '0'

config rule
        option name 'Consoles ps5'
        option proto 'udp'
        list src_ip '192.168.2.160'
	list dest_port '!80'
	list dest_port '!443'
	option class 'cs4'
        option family 'ipv4'
	option counter '1'

config rule
	option name 'twitch1'
	option proto 'tcp'
	list dest_port '1935'
	option class 'cs3'
	list src_ip '192.168.2.160'
	option family 'ipv4'
	option counter '1'

in not sure why but diffserv4 never worked for me maybe because the voice tin gives me little upload bandwith for my game which causes my ping to spike
i might give it a shot again and see how it goes but now im fine with diffserv8 since it works

1 Like

yes I see you have a standard adsl that is bound to disappear in the next few years ...

nft list chain inet dscpclassify static_classify
table inet dscpclassify {
        chain static_classify {
                meta l4proto { tcp, udp } th dport { 53, 853, 5353 } goto ct_set_cs5 comment "DNS"
                udp dport { 67, 68 } goto ct_set_cs5 comment "BOOTP/DHCP"
                udp dport 123 goto ct_set_cs0 comment "NTP"
                tcp dport 22 goto ct_set_cs2 comment "SSH"
                ip saddr 192.168.2.244 udp sport 27000-27500 goto ct_set_ef comment "CSGO"
                udp dport 3478-3481 udp sport 50020-50039 goto ct_set_af41 comment "Teams video"
                ip dscp != { cs0, cs6, cs7 } iifname != { "eth0.2" } (@nh,8,8 & 0xfc) >> 2 vmap @dscp_ct
                ip6 dscp != { cs0, cs6, cs7 } iifname != { "eth0.2" } (@nh,0,16 & 0xfc0) >> 6 vmap @dscp_ct
                meta l4proto != { tcp, udp } goto ct_set_cs0
                ct mark set ct mark & 0xffffff80 | 0x00000080
        }
}

my config

config global 'global'
	option class_bulk 'le'
	option class_high_throughput 'af13'
	option client_hints '1'
	option threaded_client_min_bytes '10000'
	option threaded_service_min_bytes '1000000'
	option wmm '0'

config rule
	option name 'DNS'
	list proto 'tcp'
	list proto 'udp'
	list dest_port '53'
	list dest_port '853'
	list dest_port '5353'
	option class 'cs5'

config rule
	option name 'BOOTP/DHCP'
	option proto 'udp'
	list dest_port '67'
	list dest_port '68'
	option class 'cs5'

config rule
	option name 'NTP'
	option proto 'udp'
	option dest_port '123'
	option class 'cs0'

config rule
	option name 'SSH'
	option proto 'tcp'
	option dest_port '22'
	option class 'cs2'

config rule
        option name 'CSGO'
        option proto 'udp'
        option src_port '27000-27500'
        option class 'EF'
        option src_ip '192.168.2.244'
        option dst_port '27000-27500'
        option enabled '1'

config rule
	option name 'Teams video'
	option proto 'udp'
	option src_port '50020-50039'
	option dest_port '3478-3481'
	option class 'af41'


config rule
	option name 'ICMP'
	option proto 'icmp'
	option class 'cs5'
	option enabled '0'


1 Like

nah not in my country or at least where i live...

ok do you has a traffic like me look

put in
root

root@OpenWrt1er-router:~# nft list ruleset

chain static_classify {
            ip saddr 192.168.2.160 udp dport != { 80, 443 } counter packets 109 bytes 9284 goto ct_set_cs4 comment "Consoles ps5"
            ip saddr 192.168.2.160 tcp dport 1935 counter packets 1 bytes 60 goto ct_set_cs3 comment "twitch1"
            ip dscp != { cs0, cs6, cs7 } iifname != { "wan" } (@nh,8,8 & 0xfc) >> 2 vmap @dscp_ct
            ip6 dscp != { cs0, cs6, cs7 } iifname != { "wan" } (@nh,0,16 & 0xfc0) >> 6 vmap @dscp_ct
            meta l4proto != { tcp, udp } goto ct_set_cs0
            ct mark set ct mark & 0xffffff80 | 0x00000080
verify is counter work

how can i do that ?

just tape nft list ruleset

nft list ruleset

i did but it doesn't show me the bytes counter

chain static_classify {
                meta l4proto { tcp, udp } th dport { 53, 853, 5353 } goto ct_set                                                                                                                                                             _cs5 comment "DNS"
                udp dport { 67, 68 } goto ct_set_cs5 comment "BOOTP/DHCP"
                udp dport 123 goto ct_set_cs0 comment "NTP"
                tcp dport 22 goto ct_set_cs2 comment "SSH"
                ip saddr 192.168.2.244 udp sport 27000-27500 goto ct_set_ef comm                                                                                                                                                             ent "CSGO"
                udp dport 3478-3481 udp sport 50020-50039 goto ct_set_af41 comme                                                                                                                                                             nt "Teams video"
                ip dscp != { cs0, cs6, cs7 } iifname != { "eth0.2" } (@nh,8,8 &                                                                                                                                                              0xfc) >> 2 vmap @dscp_ct
                ip6 dscp != { cs0, cs6, cs7 } iifname != { "eth0.2" } (@nh,0,16                                                                                                                                                              & 0xfc0) >> 6 vmap @dscp_ct
                meta l4proto != { tcp, udp } goto ct_set_cs0
                ct mark set ct mark & 0xffffff80 | 0x00000080
        }

You have to update the file located in etc/init.d/dscpclassify with the updates pushed by amteza and than include counter option under your rules like:

config rule
	option name 'GSMA VoWi-Fi'
	option proto 'udp'
	option dest_ip '@optusnet'
	list dest_port '500'
	list dest_port '4500'
	option class 'ef'
	option family 'ipv4'
	option counter '1'

Remember to restart the service with /etc/init.d/dscpclassify restart

3 Likes

@xato_coslada you should be install dscpclassify
if you play cod is a best script for connexion

:zap::muscle::+1:

yes you can restart in luci startup toi you can sée dscpclassify

and sqm instaled

mypacket work nice

Summary


you can sée mypacket withouth stream and with

1 Like

This thread seems to devolve into a support/configuration howto thread and I am not even sure if it still discusses the dscpclassify package mentioned by the thread starter.

Being in the feature request section, threads should be concise, actionable and focused on a single topic.

Maybe @moderators can split out the unrelated parts into the community project or general discussion sections.

2 Likes

I've been with this script since the first post, it works pretty well and is easy to understand, thanks to @amteza who helped me set it up. I still have several things to try but I have to say that it works quite well.

1 Like

good News hear that

:pray::+1::ok_hand:

I'm not 100% sure, but most certain about it. The log errors can be what you say, yes.

1 Like

Agreed. Please, accept my apologies, mate.

2 Likes

Back from my Christmas break now, I hadn't spotted this thread! - Really pleased to see people are getting good use out of the scripts.

@Hudra seeing your git issue I added the counters functionality before I spotted this forum topic😅,
I'll take a look at @ldir's/@amteza's commits and merge/tweak.

I definitely intend to get this set up as a proper maintained package, very keen to see it help more people.

@jow I'll look to create an official thread in Community Builds Projects Packages with some how to steps and information that I can update as the scripts evolve.

Edit, thread link:

8 Likes

Thanks for your reply, really appreciate it. I guess i can mark the topic as solved as i now have all the information i asked for and the conversation already got a little bit out of hand. At least it got some people to try your awesome tool.

Very good news! Sounds very promising.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.