Configuring SQM QoS with DS-Lite

Hello,

I'm trying to find good settings for my SQM QoS profile; looking at the doc and info all over Internet (including this forum) but I still have some questions. I hope someone can help me!

Some background information about my environment:

I used to connect with PPPoE (username/password) but recently I've been upgraded to IPoE (not totally sure if this mean I'm not using PPPoE anymore? Anyway I don't need to enter my username and password anymore).

To connect with IPoE, I am using DS-Lite with a peer address given by my ISP. My connection is VDSL (max 100Mb/s but fortunately I often have around 80Mb/s).

The current DS-Lite settings is shown below:

config interface 'wan'
        option proto 'dslite'
        option encaplimit 'ignore'
        option peeraddr '[redacted]'
        option ipv6 '1'
        option metric '10'

config interface 'wan6'
        option ifname 'eth0'
        option proto 'dhcpv6'
        option reqaddress 'try'
        option reqprefix 'auto'

As for SQM QoS, I've settled on the settings below:

config queue 'eth1'
        option qdisc_advanced '0'
        option debug_logging '0'
        option qdisc 'cake'
        option script 'piece_of_cake.qos'
        option enabled '1'
        option download '52400'
        option upload '79800'
        option verbosity '10'
        option interface 'eth1'
        option linklayer 'ethernet'
        option overhead '26'

Here are my questions:

  1. I am using eth1 (wan) but this interface is only a bridge for DS-Lite; when using DS-Lite, should I change it to eth0 or should I create a second setting for eth0?

  2. Which value should I use for "Per Packet Overhead"?

According to OpenWrt docs, it says "[...] 34 (or 26 if you know you are not using PPPoE)" which I think I am not using (anymore) since I am using IPoE. On the other hand, the SQM Details docs also states "[...] ipv4 provided over ipv6 in the DS-Lite scheme (where ipv4 packets experience a 40 byte ipv6 header overhead)".

I'm not sure I understand this last sentence: is the 40 byte in addition to my setting or is it the setting I should be using?

Here are more detailed information about my box and settings:

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 mq 0: dev eth0 root 
 Sent 3775902814 bytes 10443846 pkt (dropped 3, overlimits 0 requeues 34632) 
 backlog 0b 0p requeues 34632
qdisc fq_codel 0: dev eth0 parent :8 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :7 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :6 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :5 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :4 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :3 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :1 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 3775902814 bytes 10443846 pkt (dropped 3, overlimits 0 requeues 34632) 
 backlog 0b 0p requeues 34632
  maxpacket 69368 drop_overlimit 0 new_flow_count 68732 ecn_mark 0
  new_flows_len 0 old_flows_len 1
qdisc cake 8019: dev eth1 root refcnt 9 bandwidth 79833Kbit besteffort triple-isolate nonat nowash no-ack-filter split-gso rtt 100.0ms noatm overhead 26 
 Sent 6126294969 bytes 6059955 pkt (dropped 1, overlimits 3023390 requeues 21) 
 backlog 0b 0p requeues 21
 memory used: 61824b of 4Mb
 capacity estimate: 79833Kbit
 min/max network layer size:            6 /    1500
 min/max overhead-adjusted size:       32 /    1526
 average network hdr offset:           22

                  Tin 0
  thresh      79833Kbit
  target          5.0ms
  interval      100.0ms
  pk_delay         46us
  av_delay         18us
  sp_delay          6us
  backlog            0b
  pkts          6059956
  bytes      6126296491
  way_inds       538137
  way_miss         2591
  way_cols            0
  drops               1
  marks               0
  ack_drop            0
  sp_flows            1
  bk_flows            1
  un_flows            0
  max_len         12176
  quantum          1514

qdisc ingress ffff: dev eth1 parent ffff:fff1 ---------------- 
 Sent 371417454 bytes 4406908 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 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 noqueue 0: dev br-guest_turris root refcnt 2 
 Sent 0 bytes 0 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 noqueue 0: dev ds-wan root refcnt 2 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
qdisc cake 801a: dev ifb4eth1 root refcnt 2 bandwidth 52418Kbit besteffort triple-isolate nonat wash no-ack-filter split-gso rtt 100.0ms noatm overhead 26 
 Sent 433112644 bytes 4406907 pkt (dropped 1, overlimits 218175 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 69120b of 4Mb
 capacity estimate: 52418Kbit
 min/max network layer size:           54 /    1508
 min/max overhead-adjusted size:       80 /    1534
 average network hdr offset:           14

                  Tin 0
  thresh      52418Kbit
  target          5.0ms
  interval      100.0ms
  pk_delay        389us
  av_delay         67us
  sp_delay          7us
  backlog            0b
  pkts          4406908
  bytes       433114166
  way_inds            0
  way_miss            1
  way_cols            0
  drops               1
  marks               0
  ack_drop            0
  sp_flows            0
  bk_flows            1
  un_flows            0
  max_len          1522
  quantum          1514

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 mq 0: dev wlan1 root 
 Sent 51180865 bytes 46156 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
qdisc fq_codel 0: dev wlan1 parent :4 limit 10240p flows 1024 quantum 1614 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 6163 bytes 36 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev wlan1 parent :3 limit 10240p flows 1024 quantum 1614 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 1109985 bytes 1164 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev wlan1 parent :2 limit 10240p flows 1024 quantum 1614 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 50064717 bytes 44956 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 91 drop_overlimit 0 new_flow_count 2 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev wlan1 parent :1 limit 10240p flows 1024 quantum 1614 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc noqueue 0: dev guest_turris_0 root refcnt 2 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0

tc -d qdisc

qdisc noqueue 0: dev lo root refcnt 2 
qdisc mq 0: dev eth0 root 
qdisc fq_codel 0: dev eth0 parent :8 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
qdisc fq_codel 0: dev eth0 parent :7 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
qdisc fq_codel 0: dev eth0 parent :6 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
qdisc fq_codel 0: dev eth0 parent :5 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
qdisc fq_codel 0: dev eth0 parent :4 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
qdisc fq_codel 0: dev eth0 parent :3 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
qdisc fq_codel 0: dev eth0 parent :2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
qdisc fq_codel 0: dev eth0 parent :1 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
qdisc cake 8019: dev eth1 root refcnt 9 bandwidth 79833Kbit besteffort triple-isolate nonat nowash no-ack-filter split-gso rtt 100.0ms noatm overhead 26 
qdisc ingress ffff: dev eth1 parent ffff:fff1 ---------------- 
qdisc noqueue 0: dev lan1 root refcnt 2 
qdisc noqueue 0: dev lan2 root refcnt 2 
qdisc noqueue 0: dev lan3 root refcnt 2 
qdisc noqueue 0: dev lan4 root refcnt 2 
qdisc noqueue 0: dev br-guest_turris root refcnt 2 
qdisc noqueue 0: dev br-lan root refcnt 2 
qdisc noqueue 0: dev ds-wan root refcnt 2 
qdisc cake 801a: dev ifb4eth1 root refcnt 2 bandwidth 52418Kbit besteffort triple-isolate nonat wash no-ack-filter split-gso rtt 100.0ms noatm overhead 26 
qdisc noqueue 0: dev wlan0 root refcnt 2 
qdisc mq 0: dev wlan1 root 
qdisc fq_codel 0: dev wlan1 parent :4 limit 10240p flows 1024 quantum 1614 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
qdisc fq_codel 0: dev wlan1 parent :3 limit 10240p flows 1024 quantum 1614 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
qdisc fq_codel 0: dev wlan1 parent :2 limit 10240p flows 1024 quantum 1614 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
qdisc fq_codel 0: dev wlan1 parent :1 limit 10240p flows 1024 quantum 1614 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
qdisc noqueue 0: dev guest_turris_0 root refcnt 2

ifstatus wan

{
	"up": true,
	"pending": false,
	"available": true,
	"autostart": true,
	"dynamic": false,
	"uptime": 118982,
	"l3_device": "ds-wan",
	"proto": "dslite",
	"updated": [
		"addresses",
		"routes",
		"data"
	],
	"metric": 10,
	"dns_metric": 0,
	"delegation": true,
	"ipv4-address": [
		{
			"address": "192.0.0.2",
			"mask": 32,
			"ptpaddress": "192.0.0.1"
		}
	],
	"ipv6-address": [
		
	],
	"ipv6-prefix": [
		
	],
	"ipv6-prefix-assignment": [
		
	],
	"route": [
		{
			"target": "0.0.0.0",
			"mask": 0,
			"nexthop": "0.0.0.0",
			"source": "0.0.0.0/0"
		}
	],
	"dns-server": [
		
	],
	"dns-search": [
		
	],
	"neighbors": [
		
	],
	"inactive": {
		"ipv4-address": [
			
		],
		"ipv6-address": [
			
		],
		"route": [
			
		],
		"dns-server": [
			
		],
		"dns-search": [
			
		],
		"neighbors": [
			
		]
	},
	"data": {
		"firewall": [
			{
				"type": "nat",
				"target": "ACCEPT"
			}
		]
	}
}

ifstatus wan6


	"up": true,
	"pending": false,
	"available": true,
	"autostart": true,
	"dynamic": false,
	"uptime": 119025,
	"l3_device": "eth0",
	"proto": "dhcpv6",
	"device": "eth0",
	"metric": 0,
	"dns_metric": 0,
	"delegation": true,
	"ipv4-address": [
		
	],
	"ipv6-address": [
		{
			"address": "[redacted]",
			"mask": 64,
			"preferred": 604757,
			"valid": 2591957
		}
	],
	"ipv6-prefix": [
		
	],
	"ipv6-prefix-assignment": [
		
	],
	"route": [
		{
			"target": "[redacted]",
			"mask": 64,
			"nexthop": "::",
			"metric": 256,
			"valid": 2591957,
			"source": "::/0"
		},
		{
			"target": "::",
			"mask": 0,
			"nexthop": "[redacted]",
			"metric": 512,
			"valid": 1757,
			"source": "[redacted]"
		}
	],
	"dns-server": [
		"[redacted]",
		"[redacted]"
	],
	"dns-search": [
		"[redacted]",
		"[redacted]"
	],
	"neighbors": [
		
	],
	"inactive": {
		"ipv4-address": [
			
		],
		"ipv6-address": [
			
		],
		"route": [
			
		],
		"dns-server": [
			
		],
		"dns-search": [
			
		],
		"neighbors": [
			
		]
	},
	"data": {
		"passthru": "[redacted]"
	}
}

Thank you for your help!

Sorry to revive an old post but anyone knowledgeable about SQM QoS have an idea?

DSlite adds an additional 40bytes so you probably want around 74 bytes total +-

Thank you for your answer! I'll try 74.

Do you happen to know if you need two SQM settings with DS-Lite or if only one is enough?

Hello, i have a quick question.

Will the mpu value for vdsl (mpu 68) stay the same if i have to set my overhead to 74 ?

VDSL +22 bytes
VLAN-TAG +4 bytes
PPPoE +8 bytes
DS-LITE +40 bytes
= 74 bytes overhead

honestly I don't know, but I doubt very much that it matters. mpu is about dealing with very small packets. unless you're flooding your network with tiny packets it really doesn't matter much. I'd say you're ok to set mpu to 74 and call it a day.

Yes it should stay the same. The concept of MPU means that if for what ever reason the size of a packet appears smaller than the MPU the kernel assumes a packet to be of size MPU. As an example an ethernet frame between destination MAC and frame check sequence is at least 46 bytes (if there is less data the payload will be zero? padded). So if the data happens to be smaller the kernel will account for that.
See the cake_calc_overhead() function starting at line 1417 of https://github.com/dtaht/sch_cake/blob/master/sch_cake.c for what cake does:

static u32 cake_calc_overhead(struct cake_sched_data *q, u32 len, u32 off)
{
	if (q->rate_flags & CAKE_FLAG_OVERHEAD)
		len -= off;

	if (q->max_netlen < len)
		q->max_netlen = len;
	if (q->min_netlen > len)
		q->min_netlen = len;

	len += q->rate_overhead;

	if (len < q->rate_mpu)
		len = q->rate_mpu;

	if (q->atm_mode == CAKE_ATM_ATM) {
		len += 47;
		len /= 48;
		len *= 53;
	} else if (q->atm_mode == CAKE_ATM_PTM) {
		/* Add one byte per 64 bytes or part thereof.
		 * This is conservative and easier to calculate than the
		 * precise value.
		 */
		len += (len + 63) / 64;
	}

	if (q->max_adjlen < len)
		q->max_adjlen = len;
	if (q->min_adjlen > len)
		q->min_adjlen = len;

	return len;
}

the relevant part is:

	len += q->rate_overhead;

	if (len < q->rate_mpu)
		len = q->rate_mpu;

It first adds the configured per-packet-overhead to the L3 size and if the sum is smaller than the mpu it adjusts its internal size to mpu.
The known case where this triggers seems to be pure ACK packets on DOCSIS/cable networks.

1 Like