I am getting confused between TCP being Connection oriented and UDP being connectionless so please somebody clarify this.
Every communication between two computers whether its TCP or UDP is via packets. There is no hard wire connection between two peers whether its TCP or UDP. Then why TCP is said to be connection oriented just because it retransmits the packets if no acknowledgement is received or it embeds sequence number inside the packets ?
Whats the actual meaning of connection ? Does the routers along the path between two communicating peers booked for some time to accept packets for that particular connection ?
EDIT
Thanks
A connection is simply a virtual pathway between two endpoints. With TCP, you open up the connection and start sending data through. It's guaranteed to arrive at the other end in order (assuming the network doesn't fail). Then you close down the connection.
For the duration of the connection, the two ends talk to each other, acknowledging receipt of packets, to ensure there's no loss or duplication.
With UDP, it's slightly different. You basically just throw a packet out there with a destination address and it may or may not arrive - that's the U in UDP (unreliable).
You shouldn't be lulled into thinking the connection of TCP results in all packets taking the same physical path. They will be routed around problem areas if necessary.
As for your update, the connection is established after the following has happened:
SYN
packet has been sent from the initiator.SYN-ACK
packet.ACK
packet.This is the session establishment protocol for TCP. The packets themselves are normal packets with the SYN
and/or ACK
flags set in the header.
The seminal book on TCP (and other protocols) is Stevens, get yourself a copy of this if you want a dead-tree version - I've had this for ages. Or, of course, there's the Wikipedia stuff. Both of these are pretty heavy going for the casual enquirer, but well worth it if you're at all interested in going deeper - my own preference would be for the book, it ranks up there with Knuth on my bookshelf.
Yes, TCP embeds sequence numbers, and does a whole lot of other processing to "simulate" a dedicated point-to-point connection over a packet-oriented, connection-less network.
UDP does not; each datagram is delivered totally independently of any other datagrams.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With