If you want to create something like this: visit this tutorial by NICO HEID from united-coders.
tcpdump and ngrep are my favorite network sniffer programs. I found a very simple yet interesting tutorial about tcpdump here: http://danielmiessler.com/study/tcpdump/