I'm trying to write a collector which listens to incoming Netflow v9 packets on a UDP port and unpacks the records and calculates the total number of bytes.
I have a sample collection of data (which I recorded with nfcapd
): When I analyse this data with nfdump
then it comes to 8.2GB.
nfdump -r netflowv9.201911081650
When I transmit this data (locally) using nfreplay
, my Python code finds only about half the data compared to nfdump
, and that's even when I set nfreplay
to replay the netflow really really slowly.
nfreplay -r netflowv9.201911081650 -v 9 -d 10000
And then also some of the time I get just bad data and my Python script seems to report several petabytes.
Any hints?
My code: https://pastebin.com/hubPJ6tA (Just run it before the nfreplay
as above. I'm using pypy
3.6)
My sample data: http://edward.filegooi.co.za/get2/f207e55ec37428e82d8ce91952fda85b/netflowv9.201911081650