March 30, 2010

How to capture and count pktgen packets ?

Hi there,

I'm a newbi in the linux world and I need some help. Well this is my question.

I need to capture and count the packets generated with linux packets generator (pktgen). I managed to activate pktgen and send packets with it (from A to B). However i need to capture or count those packets ( on B). I'm following the "pktgen the linux packet generator" paper from Robert Olsson (ftp://robur.slu.se/pub/Linux/net-development/pktgen-testing/pktgen_paper...) and he mention a patchlet for the ip_input.c file in order to drop and count the packets. I would like to know how to apply this patchlet to the ip_input.c file and how can i display the results (counts).

Alvaro

u can do it with iptables assume that A ip is 10.0.0.1 and B ip is 10.0.0.2...

u can do it with iptables
assume that A ip is 10.0.0.1 and B ip is 10.0.0.2
ur pkgen sends packets to udp port number 15000

add rule to the input chain of the B machine

#iptables -A INPUT -p udp --dport 15000 -s 10.0.0.1
and u can list accounting data with

#iptables -L INPUT -v

more information in
http://www.faqs.org/docs/linux_network/x-087-2-accounting.kernel.config....
http://www.frozentux.net/iptables-tutorial/iptables-tutorial.html

Like  (0 likes)
Click Here!