Packet sniffers
Packet sniffers are designed to capture all the network traffic that enters and leaves a computer, allowing us to see the full, raw contents of all packets that our programs send and receive, and all the headers and payloads of all the protocols on the stack.
We're going to take a quick look at one of these applications. It not only provides us with a very useful debugging tool for network programming, it also gives you a direct view of the structure of network traffic and gives you a better feel for the concepts of layering and encapsulation.
A small word of caution before we begin though; if you're using a computer on a network you do not own, such as at your place of work or study, you should get permission from your network administrator before running a packet sniffer. On networks that use network hubs rather than switches, sniffers may capture data destined for computers other than your own. Also, running a packet sniffer may be against your network's...