How to measure TCP connection time in Linux

performancetcp

I want to measure the overhead in creating a TCP connection.

I know of many tools like hping and netperf, but they seem oriented at measuring latency.

I want to know how long the 3-way handshake takes, and allocating any buffers, etc., and then closing it. So I want to open a real, legitimate TCP connection, and then close it.

Are there any tools that will do that and help me measure performance?

Best Answer

I think what you're asking is some way of measuring the time it takes from the first SYN packet to the first non-zero payload packet on a TCP connection?

Tcpdump is a useful tool in this regard and Theo Schlossnagle has written how this can be achieved. I've used the technique he described to good effect.