Saltar al contenido

~ / archivo / stackoverflow / 44287833

Tools to measure TCP connection latency

StackOverflow · linux, performance, tcp, latency · ayudé
  1. gst pregunta +1 2017-05-31 14:44

    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+ACK and the client responded with ACK?
    • 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 SYN is unavailable. The available time is when client's SYN has arrived.
  2. Miguel Ortiz yo respuesta +1 2017-05-31 16:35

    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, telnet command then waits for user input.

← todos los hilos de StackOverflow