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