Statistics collection broken in "new" dummynet

Luigi Rizzo rizzo at iet.unipi.it
Tue Aug 23 02:02:45 UTC 2011


On Tue, Aug 23, 2011 at 09:07:51AM +1000, Peter Jeremy wrote:
> I have been using dummynet(4) to do traffic shaping for simulated WANs
> for over a decade now and it has been very effective - thanks Luigi.
> 
> I am currently looking at migrating the network simulator from 7.1 to
> 8.2 and have noticed that the statistics reported are now meaningless.
> Instead of reporting cumulative statistics, it now appears to reset
> them regularly - apparently whenever the pipe is empty.
...
it's not that the stats are reset, it is that pipes and queues
are deleted when they carry no useful state (which is different
from "empty" -- but the timescale for changes from empty to
useless is normally too short for humans.

Deleting entries saves memory and speeds up lookups in the data
structures, but is extremely annoying if you want to collect per-flow
statistics.

If i remember well there is a knob to enable/disable removal of
useless pipes/queues but i am not sure if there is a sysctl or
timer or other mechanism to control it. If you have the time to
look at the source there might be some documentation.

cheers
luigi

> Sample results from 7.1 (currently inactive):
> 00224:   2.000 Mbit/s    9 ms  64 KB 1 queues (1 buckets) droptail
>     mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000
> BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
>   0 udp  192.168.224.183/0     192.168.216.179/0     5404902 598099622  0    0   0
> 
> Sample results from 8.2 (currently active simulator):
> 00224:   2.000 Mbit/s   18 ms burst 0 
> q131296 64 KB 0 flows (1 buckets) sched 65760 weight 0 lmax 0 pri 0 droptail
>  sched 65760 type FIFO flags 0x0 0 buckets 1 active
>   0 ip           0.0.0.0/0             0.0.0.0/0        2     1785  0    0   0
> (and most of the time, the last line doesn't appear).
> 
> I have checked a recent 9.0-BETA1 and it is still broken.  Looking at
> the dummynet.txt file, I cannot see this mentioned.  I have looked
> through the source and it does appear that scheduler instances are
> marked inactive in serve_sched() once they have no packets queued and
> are then garbage-collected via drain_scheduler_cb().  Is this the
> intent?  If so, how can statistics be collected?
> 
> -- 
> Peter Jeremy




More information about the freebsd-net mailing list