Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stab setting to better Accurate. #3

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

yutayu
Copy link

@yutayu yutayu commented Aug 2, 2019

I forgot this script. Sorry.
I cannot write script.I ask to shape new script you.

@yutayu
Copy link
Author

yutayu commented Aug 2, 2019

stab setting to better Accurate
All stab setting is necessary for accurate calculation.
For example, atm overhead is 5bytes per 53bytes.
ethenet overhead is 14bytes per each packet.

@yutayu yutayu closed this Aug 2, 2019
@yutayu yutayu reopened this Aug 2, 2019
@robinsmidsrod
Copy link
Owner

@yutayu I have no idea what you're trying to achieve with this PR. I understand that the stab qdisc does something related to table sizing depending on your link layer, but I don't see what it actually improves. Please explain more in detail, in better English.

@yutayu
Copy link
Author

yutayu commented Aug 2, 2019

Since tc normally only calculates the size of an IP packet, the upper limit of the bandwidth must be set as low as 20% to allow for overhead, otherwise the actual link speed will be exceeded.
But there is a way to calculate the overhead exactly.
Since the stab setting is calculated in consideration of the overhead in advance, the speed of the link may be set as the upper limit of the bandwidth.

@yutayu
Copy link
Author

yutayu commented Aug 3, 2019

Did you understand in my English? lol
A bandwidth limit without a stub configuration cannot use all the bandwidth.
Stub configuration avoids wasted bandwidth.

@yutayu
Copy link
Author

yutayu commented Aug 3, 2019

If you set the linklayer in the stab setting to atm, a packet of 1500 bytes will be calculated at 1696 bytes plus the overhead and will use all of the configured bandwidth.
If you leave it at 1500 bytes, you will need about 20% more than the configured bandwidth.

@yutayu
Copy link
Author

yutayu commented Aug 4, 2019

I will try to persuade you for a better script.
What's New
This script also allows you to configure the stab feature so that you don't have to worry about overhead when setting the bandwidth limit.
For example, you can set 8 Mbit to use the 10 Mbit band. Otherwise the modem will cause buffer bloat.
Using the stab function, you only need to set about 9.5 Mbit, and you can calculate the queue correctly.

@yutayu
Copy link
Author

yutayu commented Aug 4, 2019

Using the stab configuration, the ack packet size is calculated to be 106 bytes in qdisc instead of 40 bytes.
40 + overhead = (48 bytes + 5 bytes overhead) * 2
Adjustment is required.

@robinsmidsrod
Copy link
Owner

@yutayu If you intend to have all of the variables in the script, then you should use them to calculate the correct values in the $stab variable based on the type of link layer, according to the recommendations in the tc-stab man page, which you can read here: http://linuxcommandlibrary.com/man/tc-stab.html

You should use Bash math to actually calculate the the values, and I think the typical PPPoE ADSL/VDSL over ATM (which I think is one of the most common ways to connect using copper) connection should be the default in the script.

Also, can you squash your git commits into a single one and add some descriptive comments (with proper English grammar) that describes briefly how to calculate the stab values and points to the tc-stab man page for more details?

@yutayu
Copy link
Author

yutayu commented Aug 4, 2019

I will try except bash calc.

@yutayu
Copy link
Author

yutayu commented Aug 4, 2019

Please see newest.

supershaper.init Outdated
# Stab setting
# Configure a stab to calculate a more accurate queue size and avoid wasting bandwidth.
# PPPoE ADSL/VDSL over ATM
STAB="stab linklayer ethernet overhead 40"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yutayu This number 40 is what I call a "magic number". You should include (in a comment) how it was calculated. Same for the number 10 below.

supershaper.init Outdated
@@ -118,7 +126,9 @@ UPLINK=$((UPLINK_PERCENT*UPLINK_BW/100))
# Which qdisc to use for HFSC leaves
# Turns out that the old sfq seems to work better than fq_codel in
# conjunction with HFSC Try out both and decide for yourself
LEAF_QDISC="sfq divisor 65536 headdrop"
# Quantum must be greater than or equal to MTU. Also, on ATM lines, Quantum should be a multiple of (48 + 5) = 53.
# If MTU = 1500 , 1500 + 40 < 48 * 33 = 1584 , 33 * ( 48 + 5 ) = 1749.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yutayu If you intend the SFQ quantum to be changed by the user, it should be a variable above line 119.

That calculation in the comment contains too many magic numbers. Please explain what those numbers are, like IP header, ATM header, PPP header, etc.

@yutayu
Copy link
Author

yutayu commented Aug 6, 2019

How?

@robinsmidsrod
Copy link
Owner

How?

How what? What was this a reference to? If you're referring to "squash commits", then I'm talking about using git rebase to change all of the different commits on this branch into a single commit. Also rewrite the commit message into something that is consistent with earlier commit messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants