When it comes to analyzing network problems, debugging client / server communication or just monitoring network traffic, a protocol analyzer (packet sniffer) is king.
There are a number of packet sniffers out there, two of the most popular are Wireshark (formerly Ethereal) and tcpdump. Tshark is the console (command line) version of Wireshark.