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
You can use ping time to monitor basic connectivity and link latency, but I wouldn't correlate ping with TCP connection speed because it uses a different protocol (ICMP). In particular some upstream providers will give higher priority to ICMP packets than TCP to produce favourable ping times.
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
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
Have a look at this page. At the end of the 3-way handshake, both the client and server have received an acknowledgement of the connection. Data exchange can start.