From: Andy Furniss <andy.furniss@dsl.pipex.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] patch: HTB update for ADSL users
Date: Fri, 18 Jun 2004 21:43:20 +0000 [thread overview]
Message-ID: <40D361F8.3090904@dsl.pipex.com> (raw)
In-Reply-To: <40D2D5CB.2000804@wildgooses.com>
Ed Wildgoose wrote:
> OK, here it is. Near perfect bandwidth calculation for ADSL users.
> Patch iproute2 with the HTB stuff and then this:
>
> It's still a hack (as far as I can tell) because we are patching the
> rates tables, and hence I think it is only loosly coupled with the
> actual calculation of bytes in each bucket.
> However, it works very nicely for me! I have only been lightly testing
> with downloading stuff (hence packet dropping to slow rates), and I can
> set the max download rate to within a few kbyte/sec of the maximum and
> still keep near min ping times. I assume that the remaining sliver of
> bandwidth is taken up passing packets which arrive in a slight cluster,
> and for packets which I later need to drop (since I'm testing on an
> incoming interface and dropped packets don't count for bandwidth used
> calcs). However, I seem to be able to get *extremely* close to the max
> with this patch
>
> Obviously all the numbers are hard coded, but they should be suitable
> for all ATM users. PPoE users will need to do something different (if
> someone can supply the details then I will see what we can do to make a
> more generic patch and use module params.
>
> Note: That this code will probably affect the policer and CBQ modules in
> the same way as HTB, however, I don't have such a setup, so I can't test
> effectiveness (or detriment...). Feedback appreciated
>
> Note also that rates in your scripts will now be expressed in terms of
> the ATM bandwidth, ie you put in something like the bandwidth you paid
> for, but (of course) you get roughly (bw * 48/53) passing through (this
> is normal, it's the overhead of running ATM).
>
>
> --- iproute2-2.4.7.20020116/tc/tc_core.c 2000-04-16
> 18:42:55.000000000 +0100
> +++ iproute2/tc/tc_core.c 2004-06-18 12:20:39.912974518 +0100
> @@ -59,10 +59,19 @@
> while ((mtu>>cell_log) > 255)
> cell_log++;
> }
> +
> + // HACK - UK ATM Params
> + int encaps_cell_sz = 53;
> + int encaps_cell_overhead = 5;
> + int encaps_data_sz = encaps_cell_sz - encaps_cell_overhead;
> + int proto_overhead = 10; // PPP Overhead
> +
> for (i=0; i<256; i++) {
> - unsigned sz = (i<<cell_log);
> - if (sz < mpu)
> - sz = mpu;
> + unsigned sz = ((i+1)<<cell_log)-1;
> + sz = sz + proto_overhead;
> + sz = ( (int)((sz-1)/encaps_data_sz) + 1) * encaps_cell_sz;
> +// if (sz < mpu)
> +// sz = mpu;
> rtab[i] = tc_core_usec2tick(1000000*((double)sz/bps));
> }
> return cell_log;
>
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>
Nice one Ed :-)
After a bit of messing about -
Patch would't apply and I couldn't see why. Then did it by hand and had
to move vars to top of function to get it to compile.
I set my uprate to 280kbit in TC = 286720 bit/s I am synced at 288000 -
as you probably are, in UK, on what BT call 250/500 and isps call
256/512. I left a bit of slack just to let buffer empty if the odd
packet extra slips through. FWIW maxing downlink (576000 for me) will
probably mess up - you need to be slower or you don't get to build up
queues and will often be using your isp's buffer.
I've been maxing uplink with bt for the last couple of hours and it's
working fine -
100 packets transmitted, 100 packets received, 0% packet loss
round-trip min/avg/max/stddev = 15.586/44.518/67.984/13.367 ms
It's just as it should be for my MTU.
When I get some time later I'll start hitting it with lots of small
packets aswell.
Andy.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
next prev parent reply other threads:[~2004-06-18 21:43 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-18 11:45 [LARTC] patch: HTB update for ADSL users Ed Wildgoose
2004-06-18 21:43 ` Andy Furniss [this message]
2004-06-18 23:00 ` Ed Wildgoose
2004-06-19 0:33 ` Andy Furniss
2004-06-19 12:29 ` Ed Wildgoose
2004-06-19 12:54 ` syrius.ml
2004-06-19 13:40 ` Ed Wildgoose
2004-06-20 7:27 ` Jason Boxman
2004-06-20 12:31 ` Andy Furniss
2004-06-20 13:16 ` Ed Wildgoose
2004-06-20 16:46 ` Ed Wildgoose
2004-06-20 17:10 ` Ed Wildgoose
2004-06-21 6:08 ` Jason Boxman
2004-06-21 10:04 ` Ed Wildgoose
2004-06-22 0:38 ` Damion de Soto
2004-06-22 5:15 ` Jason Boxman
2004-06-22 9:54 ` Ed Wildgoose
2004-06-22 10:00 ` Ed Wildgoose
2004-06-22 17:16 ` Jason Boxman
2004-06-22 21:52 ` Jason Boxman
2004-06-23 12:52 ` ThE LinuX_KiD
2004-06-23 14:00 ` Ed Wildgoose
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40D361F8.3090904@dsl.pipex.com \
--to=andy.furniss@dsl.pipex.com \
--cc=lartc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.