QoS weirdness : HTB accuracy
Subsystems (2)
Hello folks,
I observe unused bandwidth on my QoS policy that I cannot explain. Conditions are: I have a HTB tree with 8 classes and a total rate of 768kbits. I use the ATM option so I assume the real rate to be something close to 675kbits (about 88% of the ethernet rate).
The sum of my 8 rates is exactly 768kbits. Some have ceil values up to 768kbits.
When class 20 "tcp_acks" starts borrowing, TC reduces the total bandwidth down to 595kbits/S (minus 79kbits/s). And I can't explain why....
The attached graph "tc_htb_weirdness.png" shows the result: there are 'holes' in the sending rate.
I tried to play with burst sizes, r2q value and hysteresis mode, but the results are the same.
System is debian squeeze, kernel version is 2.6.26, iproute2 version is 2.6.26 - 07/25/2008.
I have attached two files:
- "tcrules.txt" : the traffic control rules
- "tc_htb_weirdness.png" : the rrdtool graph, resolution is 1 second.
And here: http://jve.linuxwall.info/ressources/code/tc_hole_analysis.html
a sheet with some of the measures values. I used it to calculate the size of one of the hole. The last table (with green and red cells) shows that, when class 20 "tcp_acks" starts sending at unixtime 1265496813, there is a lot of bandwidth left over (last column is all green). During the 95 seconds while class 20 is sending, 3880776 bits could be sent but are not. That's about 40kbits/s on average.
Does anybody observess the same behavior? Any logical explanation to this or is it a bug ?
Julien
#root
tc qdisc add dev eth0 root handle 1: htb default 99 r2q 100
#main branch
tc class add dev eth0 parent 1:0 classid 1:1 htb rate 768kbit ceil 768kbit linklayer atm overhead 5
# class 10 "interactive" tc class add dev eth0 parent 1:1 classid 1:10 htb rate 128kbit ceil 200kbit burst 5k prio 1 linklayer atm overhead 5 tc qdisc add dev eth0 parent 1:10 handle 110: pfifo limit 1000 tc filter add dev eth0 parent 1:0 protocol ip prio 1 handle 10 fw flowid 1:10
# class 20 "tcp_acks" tc class add dev eth0 parent 1:1 classid 1:20 htb rate 64kbit ceil 768kbit burst 3k prio 2 linklayer atm overhead 5 tc qdisc add dev eth0 parent 1:20 handle 120: pfifo limit 1000 tc filter add dev eth0 parent 1:0 protocol ip prio 2 handle 20 fw flowid 1:20
# class 30 "ssh" tc class add dev eth0 parent 1:1 classid 1:30 htb rate 64kbit ceil 300kbit burst 2k prio 3 linklayer atm overhead 5 tc qdisc add dev eth0 parent 1:30 handle 130: sfq perturb 10 tc filter add dev eth0 parent 1:0 protocol ip prio 3 handle 30 fw flowid 1:30
# class 40 "main web" tc class add dev eth0 parent 1:1 classid 1:40 htb rate 256kbit ceil 768kbit burst 20k prio 4 linklayer atm overhead 5
# class 41 "sub web 1" tc class add dev eth0 parent 1:40 classid 1:41 htb rate 100kbit ceil 768kbit burst 20k prio 4 linklayer atm overhead 5 tc qdisc add dev eth0 parent 1:41 handle 141: sfq perturb 10 tc filter add dev eth0 parent 1:0 protocol ip prio 4 handle 41 fw flowid 1:41
# class 42 "sub web 2" tc class add dev eth0 parent 1:40 classid 1:42 htb rate 100kbit ceil 768kbit burst 20k prio 4 linklayer atm overhead 5 tc qdisc add dev eth0 parent 1:42 handle 142: sfq perturb 10 tc filter add dev eth0 parent 1:0 protocol ip prio 5 handle 42 fw flowid 1:42
# class 49 "sub web gen" tc class add dev eth0 parent 1:40 classid 1:49 htb rate 56kbit ceil 768kbit burst 20k prio 4 linklayer atm overhead 5 tc qdisc add dev eth0 parent 1:49 handle 149: sfq perturb 10 tc filter add dev eth0 parent 1:0 protocol ip prio 6 handle 49 fw flowid 1:49
# class 50 "torrent" tc class add dev eth0 parent 1:1 classid 1:50 htb rate 128kbit ceil 768kbit burst 2k prio 5 linklayer atm overhead 5 tc qdisc add dev eth0 parent 1:50 handle 150: sfq perturb 10 tc filter add dev eth0 parent 1:0 protocol ip prio 7 handle 50 fw flowid 1:50
# class 99 "default" tc class add dev eth0 parent 1:1 classid 1:99 htb rate 128kbit ceil 768kbit burst 2k prio 5 linklayer atm overhead 5 mtu 1500 tc qdisc add dev eth0 parent 1:99 handle 199: sfq perturb 10 tc filter add dev eth0 parent 1:0 protocol ip prio 99 handle 99 fw flowid 1:99
Quoted 1 line
Hello folks,
Hi,
Quoted 4 lines
I observe unused bandwidth on my QoS policy that I cannot explain. Conditions are: I have a HTB tree with 8 classes and a total rate of 768kbits. I use the ATM option so I assume the real rate to be something close to 675kbits (about 88% of the ethernet rate).
Try adding p/bfifo or sfq qdisc under the classes. See if it chances things. Don't ask me why. It just solved some problems in my case. W/o qdisc I could sometimes see stalls like yours.
Best regards,
Marek
Quoted 4 lines · Marek Kierdelewicz
Quoted 1 line
Hello folks,
Hi,
Quoted 8 lines
Quoted 4 lines
I observe unused bandwidth on my QoS policy that I cannot explain. Conditions are: I have a HTB tree with 8 classes and a total rate of 768kbits. I use the ATM option so I assume the real rate to be something close to 675kbits (about 88% of the ethernet rate).
Try adding p/bfifo or sfq qdisc under the classes. See if it chances things. Don't ask me why. It just solved some problems in my case. W/o qdisc I could sometimes see stalls like yours.
I have pfifo under class 10 and 20 and SFQ under the others.
From my point of view, it looks like class 20 is borrowing, so the other classes are not authorized to borrow whatever is left.
Quoted 7 lines
Best regards,
Marek
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi,
From my point of view, it looks like class 20 is borrowing, so the
Quoted 1 line
other classes are not authorized to borrow whatever is left.
How do you measure the bandwidth consumed by each fraction of traffic that you visualise on image? Are values gathered from iptables rule counters?
Best regards,
Marek
This seems to be correct, my initial calculation didn't take into account the 8 bytes AAL5 tail (which I didn't know about).
So, if this reduction effect is due to the AAL5 tail, how come it only shows on tcp acks packets ?
The rest of the time, I have an average rate that's around 680kbits/s, which is the expected rate if I only take into account the 5 bytes overhead from ATM without the 8 bytes overhead from the AAL5 packets.
Julien
Quoted 6 lines · Nikolay Rybalov
ATM option accounts for ATM overhead. Single TCP ACK is a 64 byte long, which is 2 ATM cells (5 byte header each)+ 2 AAL5 tails (8 octets each). So
single ack is has 16 bytes overhead, or 40%. With 200k ack peaks, HTB accounts for additional 80k of overhead
Quoted 12 lines
--------------------------------------------------
From: "Julien Vehent" <[email protected]>
Sent: Thursday, March 25, 2010 9:06 PM
To: "Netdev" <[email protected]>; "netfilter" <[email protected]>
Subject: QoS weirdness : HTB accuracyQuoted 5 lines
Hello folks,
I observe unused bandwidth on my QoS policy that I cannot explain. Conditions are: I have a HTB tree with 8 classes and a total rate of 768kbits. I use the ATM option so I assume the real rate to be
something
Quoted 6 lines
Quoted 6 lines
close to 675kbits (about 88% of the ethernet rate).
The sum of my 8 rates is exactly 768kbits. Some have ceil values up to 768kbits.
When class 20 "
tcp_acks" starts borrowing, TC reduces the total
bandwidth
Quoted 6 lines
Quoted 6 lines
down to 595kbits/S (minus 79kbits/s). And I can't explain why....
The attached graph "tc_htb_weirdness.png" shows the result: there are 'holes' in the sending rate.
I tried to play with burst sizes, r2q value and hysteresis mode, but
the
Quoted 10 lines
Quoted 10 lines
results are the same.
System is debian squeeze, kernel version is 2.6.26, iproute2 version is 2.6.26 - 07/25/2008.
I have attached two files:
- "tcrules.txt" : the traffic control rules
- "tc_htb_weirdness.png" : the rrdtool graph, resolution is 1 second.And here:
http://jve.linuxwall.info/ressources/code/tc_hole_analysis.html
Quoted 1 line
Quoted 1 line
a sheet with some of the measures values. I used it to calculate the
size
Quoted 1 line
Quoted 1 line
of one of the hole. The last table (with green and red cells) shows
that,
Quoted 1 line
Quoted 1 line
when class 20 "
tcp_acks" starts sending at unixtime 1265496813, there
is
Quoted 7 lines
Quoted 7 lines
a
lot of bandwidth left over (last column is all green). During the 95 seconds while class 20 is sending, 3880776 bits could be sent but are not.
That's about 40kbits/s on average.Does anybody observess the same behavior? Any logical explanation to
this
Quoted 4 lines
Quoted 4 lines
or is it a bug ?
Julien
Quoted 8 lines · Marek Kierdelewicz
Hi,
Quoted 2 lines
From my point of view, it looks like class 20 is borrowing, so the other classes are not authorized to borrow whatever is left.
How do you measure the bandwidth consumed by each fraction of traffic that you visualise on image? Are values gathered from iptables rule counters?
Nope, I parse tc command line output with a perl script, get the 'rate' value for each classe, multiply it by 8 to have it in bits and not bytes, and insert it into a RRD database.
script is somewhat similar to this
http://jve.linuxwall.info/ressources/code/tcparsestat.pl
Julien
Well, I'm currently testing this setup on a vmware player installation, locally, on my ethernet network. So there is no real modem involved... yet..
I intend to put this configuration on the server that's connected to the modem as soon as I figure out this little details :)
Quoted 3 lines · Nikolay Rybalov
Nah, sorry. I am wrong. ATM opt accounts only for ATM overhead, 5 bytes per
40 byte tcp ack. You also add 5 bytes overhead, so total overhead per
ack
Quoted 2 lines
is
10 bytes, or 25%. I think this saturates physical ADSL link, which
causes
Quoted 9 lines
drops on modem's hwsar and affects all outgoing traffic. PPPoE (I presume) needs 44 bytes of overhead if you ratelimit ppp interface, and modem uses AAL5/SNAP encap:
8 bytes SNAP +18 bytes Ethernet + 6 bytes PPPoE + 4 bytes PPP + 8 bytes AAL5Can you check your modem's HWSAR counters? Are there any drops?
Quoted 8 lines
--------------------------------------------------
From: "Julien Vehent" <[email protected]>
Sent: Friday, March 26, 2010 12:49 AM
To: "Nikolay Rybalov" <[email protected]>
Cc: "netfilter" <[email protected]>
Subject: Re: QoS weirdness : HTB accuracyQuoted 1 line
This seems to be correct, my initial calculation didn't take into
account
Quoted 11 lines
Quoted 11 lines
the 8 bytes AAL5 tail (which I didn't know about).
So, if this reduction effect is due to the AAL5 tail, how come it only shows on tcp acks packets ?
The rest of the time, I have an average rate that's around 680kbits/s, which is the expected rate if I only take into account the 5 bytes overhead
from ATM without the 8 bytes overhead from the AAL5 packets.
Quoted 5 lines
Quoted 5 lines
Julien
Quoted 1 line · Nikolay Rybalov
ATM option accounts for ATM overhead. Single TCP ACK is a 64 byte
long,
Quoted 1 line
Quoted 1 line
Quoted 1 line
which is 2 ATM cells (5 byte header each)+ 2 AAL5 tails (8 octets
each).
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
So
single ack is has 16 bytes overhead, or 40%. With 200k ack peaks, HTB accounts for additional 80k of overhead--------------------------------------------------
From: "Julien Vehent" <[email protected]>
Sent: Thursday, March 25, 2010 9:06 PM
To: "Netdev" <[email protected]>; "netfilter" <[email protected]>
Subject: QoS weirdness : HTB accuracyQuoted 2 lines
Hello folks,
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
I observe unused bandwidth on my QoS policy that I cannot explain. Conditions are: I have a HTB tree with 8 classes and a total rate of 768kbits. I use the ATM option so I assume the real rate to be
something
Quoted 3 lines
Quoted 3 lines
close to 675kbits (about 88% of the ethernet rate).
The sum of my 8 rates is exactly 768kbits. Some have ceil values up
to
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
768kbits.
When class 20 "
tcp_acks" starts borrowing, TC reduces the totalbandwidth
Quoted 2 lines
Quoted 2 lines
down to 595kbits/S (minus 79kbits/s). And I can't explain why....
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
The attached graph "tc_htb_weirdness.png" shows the result: there are 'holes' in the sending rate.
I tried to play with burst sizes, r2q value and hysteresis mode, but
the
Quoted 3 lines
Quoted 3 lines
results are the same.
System is debian squeeze, kernel version is 2.6.26, iproute2 version
is
Quoted 27 lines
Quoted 27 lines
Quoted 7 lines
Quoted 7 lines
2.6.26 - 07/25/2008.
I have attached two files:
- "tcrules.txt" : the traffic control rules
- "tc_htb_weirdness.png" : the rrdtool graph, resolution is 1 second.And here:
http://jve.linuxwall.info/ressources/code/tc_hole_analysis.html
Quoted 1 line
Quoted 1 line
a sheet with some of the measures values. I used it to calculate the
size
Quoted 1 line
Quoted 1 line
of one of the hole. The last table (with green and red cells) shows
that,
Quoted 1 line
Quoted 1 line
when class 20 "
tcp_acks" starts sending at unixtime 1265496813, thereis
Quoted 7 lines
Quoted 7 lines
a
lot of bandwidth left over (last column is all green). During the 95 seconds while class 20 is sending, 3880776 bits could be sent but are not.
That's about 40kbits/s on average.Does anybody observess the same behavior? Any logical explanation to
this
Quoted 4 lines
Quoted 4 lines
or is it a bug ?
Julien
Quoted 34 lines · Julien Vehent
Hello folks,
I observe unused bandwidth on my QoS policy that I cannot explain. Conditions are: I have a HTB tree with 8 classes and a total rate of 768kbits. I use the ATM option so I assume the real rate to be something close to 675kbits (about 88% of the ethernet rate).
The sum of my 8 rates is exactly 768kbits. Some have ceil values up to 768kbits.
When class 20 "
tcp_acks" starts borrowing, TC reduces the total bandwidth down to 595kbits/S (minus 79kbits/s). And I can't explain why....The attached graph "tc_htb_weirdness.png" shows the result: there are 'holes' in the sending rate.
I tried to play with burst sizes, r2q value and hysteresis mode, but the results are the same.
System is debian squeeze, kernel version is 2.6.26, iproute2 version is 2.6.26 - 07/25/2008.
I have attached two files:
- "tcrules.txt" : the traffic control rules
- "tc_htb_weirdness.png" : the rrdtool graph, resolution is 1 second.And here: http://jve.linuxwall.info/ressources/code/tc_hole_analysis.html
a sheet with some of the measures values. I used it to calculate the size of one of the hole. The last table (with green and red cells) shows that, when class 20 "tcp_acks" starts sending at unixtime 1265496813, there is a lot of bandwidth left over (last column is all green). During the 95 seconds while class 20 is sending, 3880776 bits could be sent but are not. That's about 40kbits/s on average.
Quoted 5 lines
Does anybody observess the same behavior? Any logical explanation to this or is it a bug ?
Julien
Sorry for the late response: could this be an "aliasing" issue caused by sampling intervals (granularity)?
-Philip
Quoted 5 lines · Philip A. Prindeville
Sorry for the late response: could this be an "aliasing" issue caused by sampling intervals (granularity)?
-Philip
I was, in fact, an error in my ruleset. I had put the 'linklayer atm' at both the branch and leaf levels, so the overhead was computed twice, creating those holes in the bandwidth.
Julien
Quoted 7 lines
Quoted 3 lines
Sorry for the late response: could this be an "aliasing" issue caused by sampling intervals (granularity)?
I was, in fact, an error in my ruleset. I had put the 'linklayer atm' at both the branch and leaf levels, so the overhead was computed twice, creating those holes in the bandwidth.
I am seeing similar behaviour with my setup. Am I making the same mistake? A subset of my rules is as follows:
tc qdisc add dev ppp0 root handle 1: htb r2q 1
tc class add dev ppp0 parent 1: classid 1:1 htb \
rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit \
overhead $overhead linklayer atm <------- Here
tc class add dev ppp0 parent 1:1 classid 1:10 htb \
rate 612kbit ceil 612kbit prio 0 \
overhead $overhead linklayer atm <------- And here
tc qdisc add dev ppp0 parent 1:10 handle 4210: \
sfq perturb 10 limit 50
tc filter add dev ppp0 parent 1:0 protocol ip \
prio 10 handle 10 fw flowid 1:10
Thanks,
Andy
Quoted 18 lines
Quoted 3 lines
I was, in fact, an error in my ruleset. I had put the 'linklayer atm' at both the branch and leaf levels, so the overhead was computed twice, creating those holes in the bandwidth.
I am seeing similar behaviour with my setup. Am I making the same mistake? A subset of my rules is as follows:
tc qdisc add dev ppp0 root handle 1: htb r2q 1
tc class add dev ppp0 parent 1: classid 1:1 htb \
rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit \
overhead $overhead linklayer atm <------- Heretc class add dev ppp0 parent 1:1 classid 1:10 htb \
rate 612kbit ceil 612kbit prio 0 \
overhead $overhead linklayer atm <------- And here
Quoted 5 lines
tc qdisc add dev ppp0 parent 1:10 handle 4210: \
sfq perturb 10 limit 50tc filter add dev ppp0 parent 1:0 protocol ip \
prio 10 handle 10 fw flowid 1:10
I removed the overhead option on the first leaf, and the speeds change to what I expect. However, the rules above are taken straight from the ADSL Optimizer project, which was the source of the original overhead patch for tc. So is the ADSL Optimizer project wrong?
Andy
Quoted 10 lines · Julien Vehent <julien <at> linuxwall.info> writes:
I observe unused bandwidth on my QoS policy that I cannot explain. Conditions are: I have a HTB tree with 8 classes and a total rate of 768kbits. I use the ATM option so I assume the real rate to be something close to 675kbits (about 88% of the ethernet rate).
The sum of my 8 rates is exactly 768kbits. Some have ceil values up to 768kbits.
When class 20 "
tcp_acks" starts borrowing, TC reduces the total bandwidth down to 595kbits/S (minus 79kbits/s). And I can't explain why....
Fortunately, I can explain why. This is actually the expected/correct behavior. The "tcp_acks" class only receives small packets, and small packets have a significantly higher overhead than larger packets.
The simple explanation is that small packets will (almost) always result in two ATM frames being transmittet, thus resulting in 106 bytes (2x 53 bytes) being used on the link.
Quoted 2 lines
The attached graph "tc_htb_weirdness.png" shows the result: there are 'holes' in the sending rate.
This is as explained above the behavior I expected to see. As the small packets eats/consumes more bandwidth on the physical link, and your observations are based upon what happens on the Ethernet layer.
Signature · 7 lines
Best regards Jesper Brouer ComX Networks A/S Linux Network Kernel Developer Cand. Scient Datalog / MSc.CS Author of http://adsl-optimizer.dk LinkedIn: http://www.linkedin.com/in/brouer
Quoted 11 lines · Julien Vehent <julien <at> linuxwall.info> writes:
Quoted 5 lines · On Tue, 18 May 2010 18:07:12 -0600, "Philip A. Prindeville" <philipp_subx <at>…
Sorry for the late response: could this be an "aliasing" issue caused by sampling intervals (granularity)?
-Philip
I was, in fact, an error in my ruleset. I had put the 'linklayer atm' at both the branch and leaf levels, so the overhead was computed twice, creating those holes in the bandwidth.
I have checked the HTB kernel code, and my understanding is that, you must set it on both the leaf and the root, for the shaping to be correct.
It is the expected behavior that small packets cause a significant reduction in the available bandwidth on the ATM link. See my answer to your original post.
Signature · 7 lines
Med venlig hilsen / Best regards Jesper Brouer ComX Networks A/S Linux Network Kernel Developer Cand. Scient Datalog / MSc.CS Author of http://adsl-optimizer.dk LinkedIn: http://www.linkedin.com/in/brouer
Quoted 20 lines · Andrew Beverley
Quoted 20 lines
Quoted 3 lines
I was, in fact, an error in my ruleset. I had put the 'linklayer atm' at both the branch and leaf levels, so the overhead was computed twice, creating those holes in the bandwidth.
I am seeing similar behaviour with my setup. Am I making the same mistake? A subset of my rules is as follows:
tc qdisc add dev ppp0 root handle 1: htb r2q 1
tc class add dev ppp0 parent 1: classid 1:1 htb \
rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit \
overhead $overhead linklayer atm <------- Heretc class add dev ppp0 parent 1:1 classid 1:10 htb \
rate 612kbit ceil 612kbit prio 0 \
overhead $overhead linklayer atm <------- And heretc qdisc add dev ppp0 parent 1:10 handle 4210: \
sfq perturb 10 limit 50
Quoted 7 lines
Quoted 2 lines
tc filter add dev ppp0 parent 1:0 protocol ip \
prio 10 handle 10 fw flowid 1:10I removed the overhead option on the first leaf, and the speeds change to what I expect. However, the rules above are taken straight from the ADSL Optimizer project, which was the source of the original overhead patch for tc. So is the ADSL Optimizer project wrong?
After looking at the HTB kernel code I believe that the ADSL Optimizer project is NOT wrong. You should/must set the linklayer option on both the root class and leaf (else you would be charging the root/parent node too little).
It is the expected behavior that small packets cause a significant
reduction in the available bandwidth on the ATM link. Small packets will (almost) always cause 2 ATM packets (being send) using 106 bytes, thus eg. sending a 40 bytes TCP ACK packet result in approx 62% overhead.
Cheers,
Jesper Brouer
--
-------------------------------------------------------------------
MSc. Master of Computer Science
Dept. of Computer Science, University of Copenhagen Author of http://www.adsl-optimizer.dk
-------------------------------------------------------------------
Quoting "Jesper Dangaard Brouer" <[email protected]>:
Quoted 31 lines · Andrew Beverley
Quoted 21 lines
Quoted 21 lines
Quoted 4 lines
I was, in fact, an error in my ruleset. I had put the 'linklayer atm' at both the branch and leaf levels, so the overhead was computed twice, creating those holes in the bandwidth.
I am seeing similar behaviour with my setup. Am I making the same mistake? A subset of my rules is as follows:
tc qdisc add dev ppp0 root handle 1: htb r2q 1
tc class add dev ppp0 parent 1: classid 1:1 htb \
rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit \
overhead $overhead linklayer atm <------- Heretc class add dev ppp0 parent 1:1 classid 1:10 htb \
rate 612kbit ceil 612kbit prio 0 \
overhead $overhead linklayer atm <------- And heretc qdisc add dev ppp0 parent 1:10 handle 4210: \
sfq perturb 10 limit 50Quoted 7 lines
Quoted 2 lines
tc filter add dev ppp0 parent 1:0 protocol ip \
prio 10 handle 10 fw flowid 1:10I removed the overhead option on the first leaf, and the speeds change to what I expect. However, the rules above are taken straight from the ADSL Optimizer project, which was the source of the original overhead patch for tc. So is the ADSL Optimizer project wrong?
Quoted 5 lines
After looking at the HTB kernel code I believe that the ADSL Optimizer project is NOT wrong. You should/must set the linklayer option on both the root class and leaf (else you would be charging the root/parent node too little).
It's been while I looked at the linklayer/size-table code, but if I remember right overhead is calculated with first linklayer packet sees in qdisc. So when packet goes to leaf with 'linklayer atm', packet get packet size with overhead for ATM and root linklayer is not used for that packet. Because of this you can have leafs with different overheads (pppoe, ipv6-tunnel, etc, with ) and all get right overhead... ..
..
...Uh oh...
HTB still has linklayer/overhead of its own, I was talking about the generic linklayer code that can be used with all qdiscs. Never mind, sorry.
-Jussi
Quoted 35 lines · Jesper Dangaard Brouer
Quoted 20 lines · Andrew Beverley
Quoted 20 lines
Quoted 3 lines
I was, in fact, an error in my ruleset. I had put the 'linklayer atm' at both the branch and leaf levels, so the overhead was computed twice, creating those holes in the bandwidth.
I am seeing similar behaviour with my setup. Am I making the same mistake? A subset of my rules is as follows:
tc qdisc add dev ppp0 root handle 1: htb r2q 1
tc class add dev ppp0 parent 1: classid 1:1 htb \
rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit \
overhead $overhead linklayer atm <------- Heretc class add dev ppp0 parent 1:1 classid 1:10 htb \
rate 612kbit ceil 612kbit prio 0 \
overhead $overhead linklayer atm <------- And heretc qdisc add dev ppp0 parent 1:10 handle 4210: \
sfq perturb 10 limit 50Quoted 7 lines
Quoted 2 lines
tc filter add dev ppp0 parent 1:0 protocol ip \
prio 10 handle 10 fw flowid 1:10I removed the overhead option on the first leaf, and the speeds change to what I expect. However, the rules above are taken straight from the ADSL Optimizer project, which was the source of the original overhead patch for tc. So is the ADSL Optimizer project wrong?
After looking at the HTB kernel code I believe that the ADSL Optimizer project is NOT wrong. You should/must set the linklayer option on both the root class and leaf (else you would be charging the root/parent node too little).
Quoted 4 lines
It is the expected behavior that small packets cause a significant reduction in the available bandwidth on the ATM link. Small packets will (almost) always cause 2 ATM packets (being send) using 106 bytes, thus eg. sending a 40 bytes TCP ACK packet result in approx 62% overhead.
[sorry for the late reply]
Maybe I am using the linklayer atm option wrong:
1. I am using it with a PCI ADSL modem. As the kernel "knows" that it's dealing with an ATM device, is there any need to even specify the option in the first place?
2. My methodology for calculating the overall speed limit for the device is to download several large files and see what throughput I get. I then use this figure in the rules above. However, as soon as I add a linklayer option, the maximum throughout of the device obviously drops, but means that I never get the throughput that I know the line is capable of. Assuming that I should even be using the linklayer atm option, should I be specifying the line speed higher than that which I physically observe during line speed tests?
For example, if I observe an ADSL line speed of 4000kbit/s, I then specify 3600kbit/s for the root of the HTB class, but with the linklayer atm option I only get about 3200kbit/s. Should I be specifying a higher value in order to get the most out of the connection?
Andy
Quoted 42 lines · Jussi Kivilinna
Quoted 28 lines
Quoted 20 lines
Quoted 20 lines
Quoted 3 lines
I was, in fact, an error in my ruleset. I had put the 'linklayer atm' at both the branch and leaf levels, so the overhead was computed twice, creating those holes in the bandwidth.
I am seeing similar behaviour with my setup. Am I making the same mistake? A subset of my rules is as follows:
tc qdisc add dev ppp0 root handle 1: htb r2q 1
tc class add dev ppp0 parent 1: classid 1:1 htb \
rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit \
overhead $overhead linklayer atm <------- Heretc class add dev ppp0 parent 1:1 classid 1:10 htb \
rate 612kbit ceil 612kbit prio 0 \
overhead $overhead linklayer atm <------- And heretc qdisc add dev ppp0 parent 1:10 handle 4210: \
sfq perturb 10 limit 50Quoted 7 lines
Quoted 2 lines
tc filter add dev ppp0 parent 1:0 protocol ip \
prio 10 handle 10 fw flowid 1:10I removed the overhead option on the first leaf, and the speeds change to what I expect. However, the rules above are taken straight from the ADSL Optimizer project, which was the source of the original overhead patch for tc. So is the ADSL Optimizer project wrong?
Quoted 5 lines
After looking at the HTB kernel code I believe that the ADSL Optimizer project is NOT wrong. You should/must set the linklayer option on both the root class and leaf (else you would be charging the root/parent node too little).
It's been while I looked at the linklayer/size-table code, but if I remember right overhead is calculated with first linklayer packet sees in qdisc. So when packet goes to leaf with 'linklayer atm', packet get packet size with overhead for ATM and root linklayer is not used for that packet. Because of this you can have leafs with different overheads (pppoe, ipv6-tunnel, etc, with ) and all get right overhead... ..
Quoted 7 lines
..
...Uh oh...
HTB still has linklayer/overhead of its own, I was talking about the generic linklayer code that can be used with all qdiscs. Never mind, sorry.
Ah, I hadn't come across the tc-stab functionality until now. So that does exactly the same for all qdiscs as the original ATM patch does for HTB? But they work slightly differently as you have alluded to above?
Andy
Quoting "Andrew Beverley" <[email protected]>:
Quoted 48 lines · Jussi Kivilinna
Quoted 47 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
I was, in fact, an error in my ruleset. I had put the
'linklayer atm' at
Quoted 27 lines
Quoted 19 lines
Quoted 19 lines
Quoted 2 lines
both the branch and leaf levels, so the overhead was computed twice, creating those holes in the bandwidth.
I am seeing similar behaviour with my setup. Am I making the same mistake? A subset of my rules is as follows:
tc qdisc add dev ppp0 root handle 1: htb r2q 1
tc class add dev ppp0 parent 1: classid 1:1 htb \
rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit \
overhead $overhead linklayer atm <------- Heretc class add dev ppp0 parent 1:1 classid 1:10 htb \
rate 612kbit ceil 612kbit prio 0 \
overhead $overhead linklayer atm <------- And heretc qdisc add dev ppp0 parent 1:10 handle 4210: \
sfq perturb 10 limit 50Quoted 7 lines
Quoted 2 lines
tc filter add dev ppp0 parent 1:0 protocol ip \
prio 10 handle 10 fw flowid 1:10I removed the overhead option on the first leaf, and the speeds change to what I expect. However, the rules above are taken straight from the ADSL Optimizer project, which was the source of the original overhead patch for tc. So is the ADSL Optimizer project wrong?
Quoted 5 lines
After looking at the HTB kernel code I believe that the ADSL Optimizer project is NOT wrong. You should/must set the linklayer option on both the root class and leaf (else you would be charging the root/parent node too little).
It's been while I looked at the linklayer/size-table code, but if I remember right overhead is calculated with first linklayer packet sees in qdisc. So when packet goes to leaf with 'linklayer atm', packet get packet size with overhead for ATM and root linklayer is not used for that packet. Because of this you can have leafs with different overheads (pppoe, ipv6-tunnel, etc, with ) and all get right overhead... ..
..
...Uh oh...
Quoted 8 lines
Quoted 3 lines
HTB still has linklayer/overhead of its own, I was talking about the generic linklayer code that can be used with all qdiscs. Never mind, sorry.
Ah, I hadn't come across the tc-stab functionality until now. So that does exactly the same for all qdiscs as the original ATM patch does for HTB? But they work slightly differently as you have alluded to above?
Yes, tc-stab works with all qdiscs. Packet size is calculated everytime when qdisc_enqueue() is called and qdisc has size-table set. When none of qdiscs has size-table, packet size ends up being same as skb->len. So if leaf has size-table, that takes preference over earlier parent size-tables.
-Jussi