Delusion of TCP "connection"

Migo·2025년 1월 11일

network

목록 보기
4/4

TCP is commonly referred to as Connection-Oriented Protocols. But against the backdrop of distributed nature of network, what does connection mean?

To understand that, let's take a look at how TCP header is structured:

Port

First of all, quite intuitively, we have source and target port which accounts for 16 bits for each. As you may have already known, this is exactly mapped to the number of sockets, for example, you can open on your computer.

Sequence & Acknowledgement Number

Taking up 32bits for each, which is translated to about 2^32 that is the same as 4GB, they play a key role in making "connection."

To understand how connection establishment is achieved, we have to look into three-way handshake:

Threeway handshake

When a client is connecting to server by specifying their destination, it sends:

  • sequence number, which in this picture, x.

The server has to acknowledge the fact that they've received the SYN request by sending:

  • ACK with the sequence number they got + 1 which is in this case x+1.
  • SYN with their own sequence number to the client(`y).

Finally, the client should respond back to server by sending:

  • ACK with y+1

Threeway handshake is process of exchanging communcation policies

Sequence numbers are not only information that's exchanged during threeway handshake.

These are the rest of information exchanged.

  • Maximum Segment Size.
  • Congestion control policy such as selective acknowledgement(SACK)

What if, for example, then MSS on client side is 1400 and server side is 1460? it's just dumped down.

What is "connection" by the way?

Now we learned "how" we make connection. But seriously, when you say you are connected to your friend on the phone, for example, what does that mean? What provide the rational for you to decide that connection is established between you and your friend?

Say, conversation goes:

  • Tim : Hi!
  • Jack : Hey!

Tim recognizes Jack voice and he's sure it is Jack. But:

  • What if it is not the case?
  • What if somebody just picked up the phone and acted like Jack?

Yes, with the remote nature of connection, there is no guarantee that the person you are talking to is 100% Jack. And the same thing happens in network connection.

TCP itself does NOT guarantee the security. Acheiving security means that you satisfies the followings:

  • Confidentiality
  • Integrity
  • Availability

Without end-to-end encryption, you didn't satisfy confidentiality for sure.

The word connection is in this respect somewhat delusional as it doesn't gurantee both ends being the intended participants.

profile
Dude with existential crisis

0개의 댓글