Martin T | 14 Nov 2011 16:09
Picon

measuring the amount of traffic to specific networks

We'll peer with one company, which will announce us about 100
prefixes(I know the AS-set they will announce us). I made a
"peering.acl" file, which contains lines:

ip access-list standard peer permit I.I.P.P M.A.S.K

..where I.I.P.P is a network address and M.A.S.K is a wildcard mask.
"peering.acl" will end with:

ip access-list standard peer deny any

Once the ACL is ready, I'm able to find the amount of octets
sent/received from the networks in "peering.acl":

$ sum=0; for num in `flow-cat
/usr/local/netflow/dat/ft/router/2011/2011-11/2011-11-14/ft-v05.2011-11-14.100001+0200
| flow-filter -f peering.acl -Dpeer | flow-print | awk '{print $6}' |
egrep "[0-9]{1,}"`; do sum=$(($sum + $num)); done; echo $sum
17436720
$

This oneliner will open "ft-v05.2011-11-14.100001+0200" file, filter
out only those prefixes which are present in "peering.acl" file, print
out the octets column(awk '{print $6}') and finally will sum all the
numbers and print out the total summary.

As a next step I executed similar oneliner, but now I didn't filter
out those network in "peering.acl" file, but instead summarised all
the octets in "ft-v05.2011-11-14.100001+0200" file:

(Continue reading)


Gmane