Software Development with Linux

Network applications debugging

MON, 01 NOV 2010

While all Linux software developers are used to debugging, not all of them are familiar with the best techniques for debugging networked applications.  If the problem lies in the transmission and/or reception of information, a standard application debugger like gdb (or its various front-end like DDD, Eclipse, etc.) won't help you much.  Fortunately, there's a plethora of other tools available to help you in this area.

The most useful one, the one that everybody should know, is Wireshark.  While it can also be used for USB debugging, it's main purpose if network debugging.  With it, you'll be able to see what's going on the network, what data your application is transmitting, etc.  You'll be able to detect corrupted data, delays, and any other bug from your application, but also inefficiencies in the network usage, whether you are using a standard or custom application protocol.  There's a great and recent Wireshark tutorial available from Linux Magazine.

If you want to be really effective with Wireshark, you'll have to be familiar with the different network protocols used by your application.  As always, RFCs are your friends.  Also, knows that you can open pretty much any network dump in Wireshark.  For example, you can use tcpdump on a headless server, then transfert the output file on your PC to take advantage of all the diagnostic and analytical features of Wireshark.

Beside Wireshark (and tcpdump), what other tools are you using for debugging network applications?

Photo by oskay