August 9, 2012

tcpdump on OSX

http://java.dzone.com/articles/tcpdump-learning-how-read-udp

Above page shows use of tcpdump:
$ tcpdump -i lo udp port 8125 -vv -X
$ echo -n "blah:36|c" | nc -w 1 -u -4 localhost 8125

On Mac, install it using mac port (sudo port install tcpdump) and run as below:
$ sudo tcpdump -vv -X -i lo0 udp port 8125
$ echo -n "blah:36|c" | nc -w 1 -u -4 localhost 8125