LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   tc speed measurement discrepancies (https://www.linuxquestions.org/questions/linux-networking-3/tc-speed-measurement-discrepancies-4175491438/)

psycroptic 01-15-2014 09:28 PM

tc speed measurement discrepancies
 
this has been a tiny issue i've noticed since applying htb rate limits to my router. i'm limiting to slightly under what Comcast is giving me - measured at speedtest.net or using wget downloads, they give me ~105.6-105.8mbit down and 21-21.4mbit up. so i have this subsection ("external" is iface to cable modem, "internal" to LAN) which slows traffic down minutely below these measurements - my intention is to yield 105.4mbit down and 20.5 up:

Code:

tc qdisc add dev external root handle 1: htb default 1
tc class add dev external parent 1: classid 1:1 htb rate 22.45mbit burst 9k

tc qdisc add dev internal root handle 1: htb default 1
tc class add dev internal parent 1: classid 1:1 htb rate 109.2mbit burst 15k

as you can see, i've had to raise the speed numbers considerably from the measured numbers. initially setting the rates to 105.4 on internal and 20.5 on the external gave me measured speeds of ~102 down and ~19.8 up, and i've slowly increased the numbers to get measured results at my desired target speeds.

so is this normal? and what's the reason for the differing of the numbers here?

baldy3105 01-16-2014 04:13 PM

the token bucket is calculated based on a time constant Tc = Bc/Cir

15k/105M = .000143 - down in the nano second range. Cisco, on their traffic shapers recommend a Tc of around .125S so normaly suggest a Bc of 1/8th of Cir. If you leave the burst and therefore Tc too low the effect you get is a lower throughput than you asked for.

So try increasing burst to about 1/8th of rate and see if that helps.

psycroptic 01-16-2014 04:50 PM

1/8th of 105,000,000 is 13,125,000..... so seriously, a burst of 13m??

EDIT: tried that, no change. setting 105mbit with burst 0f 13.125m still gives me measured results of ~102. just to rule out comcast maybe not giving me the full 105, i tried lowering the values - 40mbit with burst of 5m - that yielded 38.59mbit measured. which seems like about the same percentage of difference as my 105mbit/13.125m burst testing

baldy3105 01-17-2014 12:04 PM

Yep, that would be what you would use on a Cisco router, low Burst is such a common problem that it turns up in the exams.

Interesting it made no difference though. Does wget and speedtest take tcp overhead ont account when ,measuring? Maybe thats enough to account for it.

psycroptic 01-17-2014 01:15 PM

Quote:

Originally Posted by baldy3105 (Post 5099829)
Does wget and speedtest take tcp overhead ont account when ,measuring? Maybe thats enough to account for it.


No idea if they do, and very little information came up when I searched for whether either one does. But could tcp overhead really eat up 3-4% of the bandwidth?

I don't necessarily MIND if i have to raise the numbers in my tc script to achieve a certain speed, i just would like to make sure that it's not because i've misconfigured something.


All times are GMT -5. The time now is 02:25 AM.