Connection-oriented and connectionless communication
There are two types of network connection: connection type and connectionless type. When learning TCP/IP, it is enough to remember that TCP is connection-oriented, and IP and UDP are connectionless.
A simple explanation of connection type and connectionless type is as follows.
● Connection-type: A method of communicating with the other party regarding connection
● Connectionless-type: A method of not negotiating data exchange between the source and destination
First, let's talk briefly about connection-oriented connections.
A connection-oriented connection is a method of establishing a connection and communicating while exchanging various control information.
What are the advantages of connection-oriented?
Imagine the Internet.
The Internet is a mesh network with various network devices. In other words, there are multiple routes on the network. If there is only one path from the source to the destination, packets can be reliably delivered to the other party in the order in which they were sent unless the path is cut.
But what if you have multiple routes?
Each packet may take different routes to reach its destination, or it may get lost. Also, since it will pass through various devices, it may be discarded by those devices.
In connection-oriented communication, although a variety of devices are connected and pass through multiple networks, the two computers performing communication appear as if they were connected by a single line.
However, although connection-oriented communication is more reliable, it has the drawback of having a larger overhead than connectionless communication because it involves various procedures.
Next, let's talk briefly about connectionless connections.
In order to explain connection-oriented communication in an easy-to-understand manner, we will use mail as an example.
To send a letter, first write the address and name of the recipient on the front of the postcard, then write what you want to say on the back of the postcard.
Then mail it to the nearest postbox.
You don't know how the postcard you posted was delivered and whether it reached the recipient.
Japan's postal service is highly reliable, so I don't know if it will arrive tomorrow or a week later, but it is almost certain that it will arrive.
However, although the probability is not high, an accident may occur and it may not reach the other party.
What if what you are sending is an important document?
You'll be in trouble if you lose it!
Therefore, when sending important documents, we pay an additional fee and send them by simple registered mail that records acceptance and delivery.
How to send ordinary letters ・・・ Communication method by IP (connectionless type)
How to send a letter using simple registered mail (delivery record) ・・・ Communication by IP + TCP (connection type)
can be compared.
With the postal situation in Japan, it may be enough to send a normal letter, but what if it's a country where it's normal for letters to get lost? If you don't have a system like simple registered mail, you can't deliver a letter to the other party!
Considering that, isn't it better to send a letter using simple registered mail?
You may think that
Connectionless communication sacrifices reliability to some extent, but on the other hand, there is no negotiation overhead associated with work, so processing is light.
However, the reliability of network equipment and the quality of lines have also improved, so reliability has also increased.
Depending on the type of communication, connection-oriented communication is not necessarily superior.
Therefore, depending on your application, you may choose to communicate connection-oriented or connectionless. Applications such as FTP that must reliably deliver data to the other party perform connection-oriented communication using TCP.
TCP/IP networks use a connection-oriented protocol called TCP to increase network reliability. However, communication reliability is not guaranteed 100%.
The same applies not only to network reliability, but also to computer system availability and security.
The figure below is a graphical representation of the relationship between reliability, availability, security and cost.
High reliability, uptime, and security are the best, but you need to consider the trade-off with cost. It is important to consider cost-effectiveness and achieve the purpose.