Shaper Quantum value

Started by Melroy vd Berg, October 11, 2025, 02:15:47 PM

Previous topic - Next topic
October 11, 2025, 02:15:47 PM Last Edit: October 11, 2025, 02:17:58 PM by Melroy vd Berg
Hi,

After reading the following topic about how-to setup a Shaper to get rid of bufferbloat: https://docs.opnsense.org/manual/how-tos/shaper_bufferbloat.html#quantum

Regarding the correct value for "Quantum" its stated:

QuoteThe proper value of Quantum should be no more or less than is the WAN MTU.

However, while this might sound clear. This is still too ambiguous for me.

I have fiber connection from my ISP using PPPoE, which is 1500 bytes.
However PPPoE has a connection overhead of 8 Bytes, so the WAN interface with VLAN 6 tag has a MTU of 1508.
So I have set 1508 MTU on my WAN interface (Identifier: opt1, device: ppoe0).

But that is not all, I also have a 'WAN RAW' interface configured as well (Identifier: opt6, device: ax0). Which has the overhead of the VLAN of 4 bytes, meaning that MTU setting is 1512.

Meaning "WAN MTU" term is too ambiguous for me. So what value should I use now for quantum; 1500, 1508 or 1512?

I guess 1512 in my case. Right or not? This could be written more clearly.

Thanks in advance!

Kind regards,
Melroy van den Berg

Hardware: DEC3852
Version: OPNsense v25.7.5

Quoteshould be no more or less than is the WAN MTU

This means it should be exact or close enough to the real WAN MTU used by your device on that Interface.

If you check the default value of Quantum >

Quotequantum
Maximum number of bytes to dequeue for transmission at one time. Should be set to the value of Interface MTU. (Default: 1514 bytes, 1500+14B hardware header, max 9000)

Default: 1514 bytes, 1500+14B hardware header this accounts for the Ethernet Frame.

So if you want to use the real value used on WAN add the extra Byte overhead created by an additional header to these 1514 bytes. But usually you don't need to do that and can use the default value, because the ISPs provide usually MTU max to 1500B and any extra header like VLAN TAG is subtracted from the MTU anyway. So in reality your real MTU is less than 1500B due to all the overheads added.

Regards,
S.
Networking is love. You may hate it, but in the end, you always come back to it.

OPNSense HW
APU2D2 - deceased
N5105 - i226-V | Patriot 2x8G 3200 DDR4 | L 790 512G - VM HA(SOON)
N100   - i226-V | Crucial 16G  4800 DDR5 | S 980 500G - PROD

Now I'm actually more confused.. What is your final verdict here?

To which value should I set it, considering all the information I gave you?
Hardware: DEC3852
Version: OPNsense v25.7.5

October 11, 2025, 07:13:10 PM #3 Last Edit: October 11, 2025, 07:43:10 PM by Seimus
In theory It should match your Interface MTU + the overhead.

So in theory;
A. MTU is 1500 but you have an overhead of 8B PPPoE + 14B Ethernet > than set it to 1522
B. MTU is 1500 but you have an overhead of 8B PPPoE + 14B Ethernet + 4B VLAN > than set it to 1526

But the reality is, you can not go over your set 1500B on the Interface, that's the maximum sized packet that can pass not-fragmented. If you are using PPPoE and VLANs you should anyway accommodate your MTU on the Interface, cause if you have PPPoE and VLANs and set MTU to 1500B you already surpassed what is theoretically possible.

https://forum.opnsense.org/index.php?topic=45658.msg228347#msg228347

The "should be no more or less than is the WAN MTU" is vague a bit cause here and there a Byte should not affect FQ_Codel much. Most of the time you don't need to deal with it on a base 1500B MTU sized Interface and just use the default value. I would advice let the default value (blank field) test it and than try to change it if you see undesirable outcomes.

To keep the rule of thumb "have quantum at the same size as is your interface on which you are doing shaping"

Regards,
S.
Networking is love. You may hate it, but in the end, you always come back to it.

OPNSense HW
APU2D2 - deceased
N5105 - i226-V | Patriot 2x8G 3200 DDR4 | L 790 512G - VM HA(SOON)
N100   - i226-V | Crucial 16G  4800 DDR5 | S 980 500G - PROD

1526!  We have 1526!  Do we have 1527?  1527?  Going once at 1526....
Hunsn Intel I3 N305, 6 x 2.5GbE I226-V, 16G DDR5 RAM, 256G SSD