Linux – (linux) tool to monitor “quality” of tcp connection

latencylinuxpingtcp

I am looking for a tool to monitor the quality of a TCP connection. I am trying to describe what I mean:

It should be a tool with a client and a server part. The client sends, say, 1kB of data per second to the server, and the server monitors how fast the packets get delivered.

Or, put otherwise: I am looking for something similar to the "ping" command, except that I can test a TCP connection, and with quite a higher bandwidth (i. e. more packets), e. g. 1kB/s.

I am not interested in maximum throughput, but in constant fast delivery. Like, say, I would stream a 128kps MP3 file over a connection with maximum throughput of also 128kps, but low latency. And I would like to playback that file instantly (or, say, with 1 second buffer).

The goal is to monitor real life usabilty of a network (internet) connection. (And no, I am not interested in something complex to set up and complicated to use like nagios.)

Thank you very much!

Best Answer

How do you define "how fast the packets get delivered" ? If you want to know how much time it takes for a packet to reach point B from point A, then I think it can't be done without sub-millisecond accurate clock synchronization.

What I would try is to capture some real traffic (ie. while actually using your application), and analyze it with WireShark, looking for the delay between some data sent and the corresponding ACK packet. That gives you the round trip time (RTT) for your traffic.

update:

The TCP stack has to keep track of the RTT for each connection. (it's used to optimize packet transmission and manage window size). If you're using Linux, and it's your own application, you can use the getsockopt(fd,.. ,TCP_INFO,...) the data returned includes all this internal parameters. You could peek at this data every second and pipe to a display app.

Related Question