When one computer wants to send a packet to another computer connected to the internet, cumbersome operations are executed including establishing the connection between sender and receiver.
These operations are governed by the set of rules called protocol.
The services provided by these protocols are of two types- Connection-oriented and connectionless services.
Through this article, you will get an answer to all the questions related to the Connection-Oriented and Connectionless protocol services.
Table of Content:
Before finding the difference between connection-Oriented and Connectionless Services, let’s see some of the basic networking notation we are using in this article.
The computer sending data is called as a sender and the computer receiving data is called as a receiver. The data message is also referred as a packet.
In between sending a packet from the sender to receiver, there are cumbersome operations involved.
Is destination alive and reachable? What path should be followed by the packet to reach the destination? Is destination agree with the accepting the packet? What common format should be used by the packets so that it will be easily understood by both the sender and receiver?
Getting the answer to all the questions is the first priority before sending the packet over the network. How these services are addressed depends on the connection-oriented and connectionless service provided by the networking protocol.
Let’s see…
Protocol Characteristics | Connection Oriented Protocol Sevices | Connectionless Protocol Sevices |
---|---|---|
1) Definition | It is the communication service in which virtual connection is created before sending the packet over the internet. | In this communication service, packets are sent without creating any virtual connection over the internet. |
2) Authentication | It needs authentication of the destination node before transferring data. | It transfers the data message without authenticating destination. |
3) Reliability | This is a more reliable connection as it makes the virtual connection before sending packets and ensures delivery of the packet to the destination. | This connection does not ensure reliability on packet transmission. |
4) Handshaking | The handshaking is carried out to ensure both sender and receiver agree with this connection. | There is no handshaking happens while sending a packet over the network. |
5) Delay | It is slower than the connectionless service. Before sending a packet, the virtual connection is created in the connection-oriented protocol which adds extra delay. | It is faster than connection-oriented protocol service. |
6) Overhead | Sending packet in connection-oriented service requires more parameters in the header of the packet to ensure the reliable transmission. | It has less overhead and smaller packet header size. |
7) Routing | Route is finalized and decided at the time of handshaking before sending the actual packet. | The route is not finalized and decided on the way while transferring data packet based on the network congestion. |
8) Packet Travel | All the packets between sender and destination follows the same path. | Not necessary all the packets transmitting between sender and receiver follows the same path. |
9) Protocol Example | TCP is connection-oriented protocol. | UDP is connectionless protocol. |
If you look at the image below, TCP opens the connection and complete all the handshaking formalities before transferring the message to another node. Here client and server are two nodes.
As UDP is connectionless protocol, it does not require creating a connection. And the message is transferred without handshaking.
This is one of the main differences between UDP and TCP networking protocol.
There are certain advantages and disadvantages of both connection-orientated and connectionless services.
Advantages:
Disadvantages:
Advantages:
If you need reliable communication between sender and receiver, connection-oriented services are more useful.
Example: We use email for communication. If we are sending an email to another recipient, it should be delivered. In this case, the connection-oriented protocol is more reliable to use.
If we are more concern about the packet transmission speed than reliability, connectionless service is more useful.
Example: If we are developing video streaming website, we need a faster connection to stream without buffer delay. In this case, the connectionless protocol is more useful.
Domain name server (DNS) uses connectionless service protocol (UDP) for the domain and IP resolution.
Wrapping Up…
This is all about the difference between connection-oriented and connectionless services and protocols. I have explained it with the TCP and UDP example.
Moreover, each node (receiver and sender) have a hierarchy of networking layers. At each node, each layer filters and parses the message before sending it to next node. For more detail and to know how does it work, you can read 7 Layers of OSI Model in Networking.
If you have any doubt or any point to discuss, let’s see you in the comment.
Very nice and well written.
It is really easy to learn these networking concepts by comparing.
Thanks, Vidit!
You are right.
Help me learn coding, where can I look or what can I do first?
Sure.
Which programming languages do you want to learn? Or why do you want to learn to programme, Stella?
Hi there, I want to develop a website that teaches. something like that of coursera.
Give me your social media handles so I can add you.
Hey, can you please help me with the basis for state machine diagrams and state tables?
Do you have any specific question about State machine diagram that I can answer?
Does a connectionless connection have a physical connection between the sender and the receiver? why?
Two systems are connected means they can transfer network package between them. It is not necessary to connect them physically (wire). Two systems also can be connected using a wireless medium.
Thanks a lot! It has been very simply explained. But this is what the question, how is the transport layer to management connection? How will he know in which case to use the connectionless transfer (UDP) or connection-oriented transfer (TCP)?
Thanks so much for this!
You’re welcome!
Is it possible to have both in two adjacent layers?
Yes. You can design both connection types in the same layer but only one will be used at a time.
Hi, when did you publish this?
This is very helpful, thank you.
Diego, I keep adding new articles and programming tutorials. Hope you enjoy going through other articles as well. Thanks
> All the packets between sender and destination follows the same path.
This is completely false.
> Route is finalized and decided at the time of handshaking before sending the actual packet.
This is false as well. If this is true, what if a router in the path goes down ? Is the connection abandoned. No. Packets are just retransmitted using a different route.
This is true in case of retranmission.