SQM reconfiguration

Hello everyone...with the previous phone carrier I had a 200/100 connection...but now I have changed operator, I have an 800/400 connection and I need to reconfigure the smart queue management on my WRT1900ACS...can someone help me? These are the parameters of the current configuration with the old phone carrier:

Interface name
eth1.2 (wan,wan6)

Download speed (kbit/s) (ingress) set to 0 to selectively disable ingress shaping:

Upload speed (kbit/s) (egress) set to 0 to selectively disable egress shaping:

Verbosity of SQM's output into the system log.
info (default)

*Queuing disciplines useable on this system. *

Queue setup script

Squash DSCP on inbound packets (ingress):

Ignore DSCP on ingress:

Explicit congestion notification (ECN) status on inbound packets (ingress):
ECN (default)

Explicit congestion notification (ECN) status on outbound packets (egress).
NOECN (default)

Advanced option string to pass to the ingress queueing disciplines; no error checking, use very carefully.
nat dual-dsthost

Advanced option string to pass to the egress queueing disciplines; no error checking, use very carefully.
nat dual-srchost

Which link layer to account for:
Ethernet with overhead: select for e.g. VDSL2.

Per Packet Overhead (byte):

for calculate overhead try this


Are the other parameters identical? Do I need to change only overhead and the speed connection?

Depends on if you have the same type of connection and it's just faster, or it's a different type now. If there's no major change there, yes, it's just a matter of adjusting the speeds.

Follow the SQM doc guides on the main OpenWrt site, and in there is a discussion for packet overhead, and how to figure it, if you need to change that.


Your other issue is, 800/400Mbit is a much higher load. 200Mbit is much easier to SQM. Not familiar with the power of a WRT1900ACS, but almost all off the shelf home wifi/routers will have a hard time handling that speed.

You want to observe whether you run out of CPU or not, and think about lowering the rate till you don't, which might cost you a lot of that total speed. If you are familiar with SSL and command line, you can use the "top" tool to show you the system status, with the important % of idle time left.

If you can't SQM the full speed, there are a few tricks, like lowering the speeds, or even setting the download to 0 (not SQM'ing it at all) and just shaping the upload. That will give a more than half benefit, at least. Still, that's 400Mbit in your case, even that might be a challenge.

Another alternative is, going to some separate router (tiny x86 box, RPi4, etc) that can handle it, and use your current router as an AP. But of course that's more work and $, but the best and most future proof version.

First though, lets see how your router handles that new speed...

1 Like

My router is ok with new internet speed…now I have to configure other parameters, I have fiber to my home then I must to choose Ethernet and put 44 on packet overhead?

Nobody knows :wink: FTTH can be anything from pure ethernet over fiber to GPON, but in all cases the true overhead should be smaller than 44Bytes*, so that is still a decent recommendation.

*) That said, I have a link where the actual per-packet-overhead is 50 bytes, but that an oddity, and not expected to be common enough to bother explaining :wink:

1 Like

I went here https://baturin.org/tools/encapcalc/?protocols=IPv4,GRE,IPv6,TCP but I didn't understand what the overhead I have to consider

Well, the first question is, what physical layer is un use, active (AON/ethernet over fiber) or passive (GPON/XGSPON). And does your ISP use VLAN tags, if yes how many?
Then the next question is, how does your ISP give you an IP address, via DHCP or via a PPPoE tunnel?

Maybe you start by letting us know the name of your ISP and the name of your plan/tarif?

My ISP is Vodafone, I have a flat plan up to 2.5 Gb/s (even if in reality the speed detected is 800/400 download/upload)…this connection gives me a dynamic IP, I therefore believe that it is a PPPoE ... the connection that I would like to do is this: disable everything on the modem provided by the ISP, cascade the linksys with openwrt and on the linksys create a PPPoE connection

Great, in which country? I need to find some information from vodafone's website/FAQ to get an idea how that plan is implemented.

Not necessarily, dhcp for example does not really care what IP-pool an address it assigns/distributes comes from, and it also gives a time-to-live for each address, so is well suited for dynamic addresses (which typically are renewed/changed once per 24 hours or even less often).

Well, if that works, your ISP will use PPPoE for sure :wink:

1 Like

I live in Italy

Look at this, my connection is FTTH

Gracie, so I agree it looks like PPPoE is in use. I still can not figure out whether it is GPON or AON though, but it does use a VLAN tag. So given that GPON likely has a lower per packet overhead than AON, I would configure the overhead as:
Ethernet framing overhead: 38 Bytes
VLAN overhead: 4 Bytes
PPPoE overhead: 8 Bytes
for a total overhead of 38 + 4 + 8 = 50
and I would instantiate SQM on pppoe-wan (assuming you managed to get a PPPoE session started from your router).

For the speed settings, I would run a few speedtests over the course of a day, with SQM disabled and then put the reliably achieved (so the minimum) rates in the speedtests as values for SQM's shaper, the difference between the net goodput returned from the speedtests and SM's interpretation of shaper rates as gross rates, should give you a decent starting point with some safety margin for the ingress shaper to actually work as expected (but this might require more fine-tuning later).

EDIT: according to (one of) vodafone.it's technology partners openfiber.it the technology is GPON (or one of its more recent descendants) so the 50 Bytes recommended above will likely be a bit too large, but not by much...

1 Like

Thank you very much, you were very precise and thorough…yes openfiber is the partner that takes care of my connection

But I didn't understand this point

SQM works by properly managing the queue of packets waiting to be sent out. The trick is to signal looming congestion before the queue gets too large as a large queue will cause a delay for all packets that need to traverse it (now both FQ_Codel and cake also use a flow queueing scheduler that tries to isolate different flows, and will mostly restrict queueing side effects to those flows that cause lots of queueing).

For upload/egress sqm sits in front of the true bottleneck and hence sees the queue relevant for causing or avoiding bufferbloat directly. But for download/ingress the bottleneck typically exists between your home network and your ISP, and your router sits after the bottleneck for incoming packets from the internet. To be able to still control bufferbloat for downloads SQM needs to make sure it sits in front of the slowest link and not after it. So we use a traffic shaper to create an artificial bottleneck, but for this to work we need to set the shaper to a speed smaller than the true bottleneck speed.
Now speedtests report application level throughput, which is just the payload of the data frames being sent, and hence smaller than the true data being sent (as all the protocol and frame headers that are required to get the payload data to the intended receiver, needs to exist and takes up capacity of the link), just like if you sent a packet via mail, the packaging will take up space in the mail carrier's bag as well....
A traffic shaper however typically is configured with a gross rate and the per-packet-overhead so it can avoid admitting more data to a link than intended.
So the speedtest results will be lower than the true gross rate, by about 5% and we want to configure SQM to stay a few percentage points below the true bottleneckrate. As a consequence we can simply put the speedtest results into SQM's configuration to get a first reasonable starting point for shaper rates. It might be necessary to tune these further later on, but they should work reasonably as our first 'guess'.

I hope that clarifies things....

1 Like