Purpose of TCP connections

620 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

Which 7 you mean?

First, there’s the 3-way handshake process. So explained simply:

1. Client -> reddit.com: SYN — Hey, reddit.com, are you there?
2. reddit.com -> Client: SYN + ACK — Yup, I am!
3. Client -> reddit.com: ACK — Ok, let’s talk then!

Then sending data:

1. Client -> reddit.com — Here’s some data
2. reddit.com -> Client: ACK — I got your data

This can be repeated as much as necessary. Also, ACKs are very small, and there’s the sliding window mechanism which means you don’t wait for a confirmation every time you send something. Instead you send data and keep track of whether the destination sends all the required receipts promptly enough.

Then connection termination:

1. Client -> reddit.com: FIN — I’m done here
2. reddit.com -> Client: ACK — Got your termination request
3. (optionally) reddit.com -> Client: (any data that was still pending to send)
4. reddit.com -> Client: FIN — I’m done here too
5. Client -> reddit.com: ACK — Bye

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