~ / archivo / stackoverflow / 44287833
Tools to measure TCP connection latency
-
I want to measure the time it takes to finish TCP three-way handshake. I want to measure this on my Linux server. What are best practices for this? Notice that I want to measure this latency on server side and for all connections that are being accepted.
- Maxim Egorushkin 2017-05-31 17:47 Is it the time between the server sent
SYN+ACKand the client responded withACK? - gst 2017-05-31 17:48 The time between the first SYN from client and time when server sends SYN+ACK.
- Maxim Egorushkin 2017-05-31 18:35 When measuring on the server the time when the client sent
SYNis unavailable. The available time is when client'sSYNhas arrived.
- Maxim Egorushkin 2017-05-31 17:47 Is it the time between the server sent
-
Sorry, you're right I misunderstood the question.
I think you could achieve this using 'tcpdump' which is a really complete tool to see all the events in tcp traffic.
By your comment I see you want to measure the time between SYNC to the ACK packet.
With tcpdump you can filter the connections and specific packages:
tcpdump -r <interface> "tcp[tcpflags] & (tcp-syn|tcp-ack) != 0"And by default the time will be displayed in the first column of tcpdump results.
Check this, I think it could help.
I don't know if it's the best practice. Also If you want to manipulate that data, you can pipe the results and use awk or something similar.
EDIT: By searching in google I also found this resource which is really interesting.
- gst 2017-05-31 17:43 Your method can only be used in client side and can not measure latency of all incoming requests to a server. Please read the question carefully.
- Maxim Egorushkin 2017-05-31 17:45 Having connected,
telnetcommand then waits for user input.