A connection is simply a virtual path between two endpoints. Using TCP, you open a connection and start sending data. It is guaranteed to come to the other end (provided that the network does not work). Then you close the connection.
Throughout the connection, both ends talk to each other, acknowledging receipt of packets to ensure that there is no loss or duplication.
With UDP, this is a little different. You basically just drop the packet with the destination address there, and it may or may not arrive - that U is in UDP (unreliable).
You should not be lulled into thinking about connecting TCP results in all packets that take the same physical path. If necessary, they will be broken down around problem areas.
As for your update, the connection is established after the following has happened:
- a
SYN packet was sent from the initiator. - the defendant sent back the
SYN-ACK packet. - The initiator sent another
ACK packet back.
This is a TCP session establishment protocol. The packets themselves are normal packets with the SYN and / or ACK flags set in the header.
A basic book on Stevens TCP (and other protocols), get yourself a copy of this if you want to have a dead version - I've had it for ages. Or, of course, there is Wikipedia . Both of them are pretty heavy for a random enquirer, but it's worth it, if you're even interested in going deeper โ my own preferences would be for a book, it takes Knut there on my bookshelf.
source share