You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-15
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
# What is DSCP Classify?
2
-
DSCP Classify is an nftables based service for applying DSCP classifications to connections, compatible with OpenWrt's firewall4 for dynamically setting DSCP packet marks (this only works in OpenWrt 22.03 and above).
2
+
DSCP Classify is an nftables based service for applying DSCP class to connections (this only works in OpenWrt 22.03 and above).
3
3
4
4
This should be used in conjunction with layer-cake SQM queue with ctinfo configured to restore DSCP on the device ingress.
5
5
The dscpclassify service uses the last 8 bits of the conntrack mark (0x000000ff).
@@ -14,13 +14,13 @@ These follow a similar syntax to the OpenWrt firewall config and can match upon
14
14
15
15
The rules support the use of nft sets, which could be dynamically updated from external sources such as dnsmasq.
16
16
17
-
### 2. Client DSCP hinting
17
+
### 2. Client class hinting
18
18
The service can be configured to apply the DSCP mark supplied by a non WAN originating client.
19
19
20
20
This function ignores CS6 and CS7 classes to avoid abuse from inappropriately configed LAN clients such as IoT devices.
21
21
22
-
### 3. Dynamic classification
23
-
Connections that do not match a user rule or client hint will be dynamically classified by the service to reduce their priority.
22
+
### 3. Automatic classification
23
+
Connections that do not match a user rule or client class hint will be automatically classified by the service to set their priority.
24
24
25
25
#### Multi-connection client port detection for detecting P2P traffic
26
26
These connections are classified as **Low Effort (LE**) by default and therefore prioritised **below Best Effort** traffic when using the layer-cake qdisc.
The user rules in '/etc/config/dscpclassify' use the same syntax as OpenWrt's firewall config, the 'class' option is used to specified the desired DSCP.
69
-
70
-
A working default configuration is provided with the service which should work for most users.
67
+
# Configuration
68
+
The service configuration is located in '/etc/config/dscpclassify'.
71
69
72
-
### The service supports the following configuration options
70
+
### A working default configuration is provided with the service which should work for most users.
73
71
74
-
|Config option | Description | Type | Default|
72
+
#### Global options
73
+
|Option | Description | Type | Default|
75
74
|--- | --- | --- | ---|
76
75
|class_bulk | The class applied to threaded bulk clients | string | le|
77
76
|class_high_throughput | The class applied to threaded high-throughput services | string | af13|
78
77
|client_hints | Adopt the DSCP class supplied by a non-WAN client (this exludes CS6 and CS7 classes to avoid abuse) | boolean | 1|
79
-
|threaded_client_min_bytes | The total bytes before a threaded client port (i.e. P2P) is classified as bulk | uint | 10000|
80
-
|threaded_client_min_connections | The number of established connections for a client port to be considered threaded | uint | 10|
81
-
|threaded_service_min_bytes | The total bytes before a threaded service's connection is classed as high-throughput | uint | 1000000|
82
-
|threaded_service_min_connections | The number of established connections for a service to be considered threaded | uint | 3|
78
+
|threaded_client_detection | Automatically and classify threaded client connections (i.e. P2P) as bulk | boolean | 1|
79
+
|threaded_service_detection | Automatically and classify threaded service connections (i.e. Windows Update/Steam downloads) as bulk | boolean | 1|
83
80
|lan_device | Manually specify devices that the service should treat as LAN | list: string ||
84
81
|lan_zone | Manually specify firewall zones that the service should treat as LAN | list: string | lan|
85
82
|wan_device | Manually specify devices that the service should treat as WAN | list: string ||
86
83
|wan_zone | Manually specify firewall zones that the service should treat as WAN | list: string | wan|
87
84
|wmm | When enabled the service will mark LAN bound packets with DSCP values respective of WMM (RFC-8325) | boolean | 0|
88
85
86
+
#### Advanced global options (not recommended for most users)
87
+
|Option | Description | Type | Default|
88
+
|--- | --- | --- | ---|
89
+
|threaded_client_min_bytes | The total bytes before a threaded client port (i.e. P2P) is classified as bulk | uint | 10000|
90
+
|threaded_client_min_connections | The number of established connections for a client port to be considered threaded | uint | 10|
91
+
|threaded_service_min_bytes | The total bytes before a threaded service's connection is classed as high-throughput | uint | 1000000|
92
+
|threaded_service_min_connections | The number of established connections for a service to be considered threaded | uint | 3|
93
+
94
+
# User rules
95
+
The user rules in '/etc/config/dscpclassify' use the same syntax as OpenWrt's firewall config, the 'class' option is used to specified the desired DSCP.
96
+
The OpenWrt firewall syntax is outlined [here](https://openwrt.org/docs/guide-user/firewall/firewall_configuration).
97
+
89
98
### Example user rule
90
99
91
100
```
@@ -100,7 +109,6 @@ config rule
100
109
option counter '0'
101
110
```
102
111
The counter option can be enabled to count the number of matched connections for a rule.
103
-
The OpenWrt firewall syntax is outlined [here](https://openwrt.org/docs/guide-user/firewall/firewall_configuration).
0 commit comments