Am Donnerstag, 2. März 2006 20:54 schrieb Adam James: > Hi, > > On Thu, 2006-03-02 at 15:49 +0000, Andy Furniss wrote: > > Russell Stuart wrote: > > > The following patch to tc allows it to perform an exact > > > ATM / ADSL rate calculation. > > > > I probably haven't read the patch properly - but I don't think you > > can do it exactly without patching net/sched/sched_htb.c aswell. > > Specifically you need to add overhead - 1 before htb shifts the > > length to get the slot num (-1 because you need to get 48 and 49 > > payload length to map to different slots 47 and 48 do). The table > > should be filled according to this. > > As Markus mentioned in another post on this thread, Jesper Dangaard > Brouer (http://www.adsl-optimizer.dk) has already written an iproute2 > and Linux kernel patch that implements the above. ATM cell alignment > is done in tc_core.c, and the per packet overhead is passed to the > relevant kernel modules. once again i have thought about this topic and tried to built a rate table with exactly the same behaviour as the htb-overhead patch from Jesper. But now as static patch for iproute's tc, without need for patching htb or other kernel modules. But in all my experiments i can't calculate an equivalent rate table. It differs in behaviour from per packet calculated overhead. But i don't see the difference in mathematics in both calculations. I think it must be possible, but can't see my fault. With a rate table of at least one entry from zero (or 40b) to it is possible. But, is it possible with only 256 rate table entries? I've attached a simple program, which implements three versions of calculations. Two of them use a rate table, at first the static version (without htb-overhead patch), second one with "simulated" kernel patch (like Jesper's one) and at least a "realtime calculation" as a reference value. The second rate table is 100% equivalent to realtime calc. But the static version differs for some ip-length values from it. And i don't understand why. Perhaps someone can point me to the difference? The program is only for testing rate tables calculations. It would be nice to do it without a htb or other qdisc module patch. And i think it should be possible :) -- Markus Schulz