StatisticsPer-flow queueing can be useful for a variety of purposes. A very simple one is counting traffic:ipfw add pipe 1 tcp from any to anyipfw add pipe 1 udp from any to anyipfw add pipe 1 ip from any to anyipfw pipe 1 config mask allThe above set of rules will create queues (and collect statistics) for all traffic. Because the pipes have no limitations, the only effect is collecting statistics. Note that we need 3 rules, not just the last one, because when ipfw tries to match IP packets it will not consider ports, so we would not see connections on separate ports as different ones.
q10006 50 sl. 1 flows (1 buckets) sched 10001 weight 50 lmax 1500 pri 0 AQM CoDel target 5ms interval 100ms NoECNBKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp 0 ip 0.0.0.0/0 0.0.0.0/0 8 1528 0 0 0q10007 50 sl. 0 flows (1 buckets) sched 10000 weight 50 lmax 1500 pri 0 AQM CoDel target 5ms interval 100ms NoECNq10004 50 sl. 1 flows (1 buckets) sched 10000 weight 99 lmax 1500 pri 0 AQM CoDel target 5ms interval 100ms NoECN 0 ip 0.0.0.0/0 0.0.0.0/0 2863 2857626 0 0 167q10005 50 sl. 1 flows (1 buckets) sched 10001 weight 95 lmax 1500 pri 0 AQM CoDel target 5ms interval 100ms NoECN 0 ip 0.0.0.0/0 0.0.0.0/0 2 1300 0 0 0q10002 50 sl. 1 flows (1 buckets) sched 10000 weight 80 lmax 1500 pri 0 AQM CoDel target 5ms interval 500ms NoECN 0 ip 0.0.0.0/0 0.0.0.0/0 6 960 0 0 0q10003 50 sl. 0 flows (1 buckets) sched 10000 weight 75 lmax 1500 pri 0 AQM CoDel target 5ms interval 100ms NoECNq10000 50 sl. 0 flows (1 buckets) sched 10000 weight 20 lmax 1500 pri 0 AQM CoDel target 5ms interval 100ms NoECNq10001 50 sl. 0 flows (1 buckets) sched 10000 weight 70 lmax 1500 pri 0 AQM CoDel target 5ms interval 100ms NoECNq10008 50 sl. 0 flows (1 buckets) sched 10001 weight 60 lmax 1500 pri 0 AQM CoDel target 5ms interval 500ms NoECNq10009 50 sl. 0 flows (1 buckets) sched 10001 weight 20 lmax 1500 pri 0 AQM CoDel target 5ms interval 100ms NoECN
60001 327 58676 queue 10000 ip from 192.168.1.50 to any out via igb060002 0 0 queue 10000 ip from 192.168.1.51 to any out via igb060003 0 0 queue 10000 ip from 192.168.1.55 to any out via igb060004 4527 380654 queue 10000 ip from 192.168.1.90 to any out via igb060005 220 82560 queue 10003 ip from any to 192.168.1.50 in via igb060006 0 0 queue 10003 ip from any to 192.168.1.51 in via igb060007 0 0 queue 10003 ip from any to 192.168.1.55 in via igb060008 2875 234802 queue 10003 ip from any to 192.168.1.90 in via igb060009 0 0 queue 10002 ip from 192.168.1.31 to any out via igb060010 0 0 queue 10002 ip from 192.168.1.30 to any dst-port 563 out via igb060011 0 0 queue 10005 ip from any to 192.168.1.31 in via igb060012 0 0 queue 10005 ip from any to 192.168.1.30 src-port 563 in via igb060013 19640439 19770716224 queue 10001 ip from any to any out via igb060014 33918821 42581595638 queue 10004 ip from any to any in via igb0