TCP Connection Establishment 3 Way Handshake Duration => Relation to Ping times

networkingtcp

according to: http://upload.wikimedia.org/wikipedia/commons/thumb/9/98/Tcp-handshake.svg/250px-Tcp-handshake.svg.png

1.) There is a 3 way TCP Establishment Handshake. Given I have a Ping-Time of 100 Millisecons, can I use the Ping-Time to calculate (in average) how long it will take to establish a TCP Connection?

2.) Given I have a Ping Time of 100 Millisecons, is it correct that it will require at least 150 Milliseconds? Or will it be 100 Milliseconds + one Microsecond (the microsecond is for sending the third ACK)? OR can the ACK even already contain data?

3.) What I do not understand is ( in the grafic above) when the Client know that his third ACK succeeded and he can now start sending regular data. I fully understand the SYN (1) then SYN ACK (2) and then ACK (3), but how does the Client know that the third ACK has been seent to the server and the client can start sending further information? Or is it as assumed above, that the third ACK can already contain data?

Thank you very much!
Jens

Best Answer

Answer to your first question.

Yes ping time can give you an idea about the time taken to establish the TCP connect.

Second question. You are right. With a 100milisecond latency your connection time would be around 300ms. Here is the math for that

  1. Client(SYN)-->Server = 50ms
  2. Server(SYN+ACK)--->client = 50ms
  3. Client(ACK+data)--->Server = 50ms

In the third question. Usually the ACK sent by the client includes data in it too. The TCP has a timeout value associated with it. If within that time the client doesn't receive any ACK from the server it will retransmit the data. The second case is when the client is during an ongoing transmission. Suppose the client sent packets from 1-10 but only received ACK for packets from 1-7 then the client will start retransmitting from the 8th packet onwards.

Second question. Should be answer by the first question