Purpose of TCP connections

619 views

There are 7 messages in total sent between the client and server, just to reliably send 1 packet of data. What is the use of each of these messages? Are they all necessary?

In: Technology

4 Answers

Anonymous 0 Comments

Instead of looking at sending 1 packet look at how it works if you send hundreds or thousands of packet in a network where packets randomly can be dropped. There is not 7 packet of extra stuff if you send a lot of packets. There is packet to set up the connection and to close it down and occasionally reply to say do have received the data or for retransmission.

Typical TCP has 1500 bytes packet and 1460 bytes of data. A 100 MB file is 100*1024*1024/1460=71820 packet. So if you use a few packets in overhead that’s not relevant

Dropping packet is not an error in a network but a feature because that is how you control the speed to match the slower part of the connection between the computer.

If you do not what to set up a connection like that where the network stack handles the reliably delivery of data then do not use TCP. UDP has no overhead so you can just send a single packet. The problem is how do you know that is have reached the destination. That is now your problem to solve.

For this reason when UDP is used when delayed packet are closed to worthless so in games and direct voice or video communication you set it up with TCP because it is simple and transfers the data as UDP. You then have the best of both worlds.

You are viewing 1 out of 4 answers, click here to view all answers.