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:

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.
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:

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+1Sequence numbers are not only information that's exchanged during threeway handshake.
These are the rest of information exchanged.
selective acknowledgement(SACK)What if, for example, then
MSSon client side is 1400 and server side is 1460? it's just dumped down.
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 recognizes Jack voice and he's sure it is Jack. But:
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:
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.