Monitor Network Traffic per Process with Nethogs
Yesterday I wrote about using 3G on Raspberry Pi board, and one of the commenter mentioned higher traffic than expected when connecting to 3G to just send a few bytes before disconnecting. One of the reasons are the extra data needed if you transmit data over a secure connection, for example establishing a PPP connection, connect to the board over SSH, and disconnect, results in the transmission & reception of a few kilobytes on my board:
1 2 |
Connect time 1.9 minutes. Sent 5815 bytes, received 6972 bytes. |
But if you get much more traffic than that, you may want to investigate if another package may transfer data when it detects the connection is up. To analyze traffic, tcpdump and Wireshark are good options, especially if you want to look into the packets data, however such tools do not tell you which process is sending or receiving the data. So I searched whether I could find a program that would do […]