Computer network-The IP protocol is unreliable and connectionless, so why didn't it be designed to be reliable in the first place?

Preface   

    Today I saw such a problem on Zhihu, and I found it more interesting. The IP protocol is unreliable and connectionless, so why didn't it be designed to be reliable in the first place? For this issue, let’s talk about some of my thoughts today.

 

Make an analogy

    We all know that the IP protocol is connectionless and the transmission is unreliable. Then why design this seemingly "chicken rib" agreement?

    Before starting the analysis, let me explain it with an analogy. We should have all sent letters. There are two types of letters in the post office: ordinary letters and registered letters . Ordinary messages are much like connectionless IP datagrams . Each ordinary letter will pass through a different site, and ordinary letters do not guarantee that the letter will not be lost. In the event of loss of regular mail, the post office is irresponsible. If you want to ensure that you will not lose it, you must send a registered letter. However, everyone will not all mail it by registered mail, because ordinary mail is not so easy to lose, or if this ordinary letter is lost, there will be no big loss. Moreover, the cost of registered mail is high, and you may have to line up to send the letter. In short, although ordinary mail may be lost, many people still use this method. Because it's cheap and convenient.

    I think after reading the above analogy, I should have a sense of the answer to this question.

 

history

If you want to really answer this question, you have to start talking about it in 1969.

    Since there is a telephone, the function of the telephone is communication. The main purpose of the traditional telecommunications network is for telephone communication. Ordinary telephones are very simple and have no intelligence. Therefore, telecommunications companies have to design their telecommunications networks very well. This telecommunications network can guarantee the communication quality of users during calls. This is very convenient for users who use very simple telephones. However, telecommunications companies have paid a huge price in order to build a telecommunications network that can ensure transmission quality .

    The transmission of data obviously must be very reliable. In 1969, the U.S. Department of Defense had an important discussion when designing ARPANET: "Who should be responsible for the reliability of data transmission?" At this time, two opposing opinions appeared. One opinion is that, like a telecommunication network, the communication network should be responsible for the reliability of data transmission (because the development history of the telecommunication network and its technical level have proven that people can design the network to be quite reliable).

But another opinion insists that the user's host is responsible for the reliability of data transmission. The most important reason here is: this can make the computer network cheap and flexible, and it can also meet various special military needs.

 

Let's use a simple example to illustrate this problem.

Suppose host A transmits files to host B via the Internet (as shown in the figure below). How can we achieve reliable transmission of file data?

 

According to the thinking of the telecommunication network, it is to try (which will cost a lot of money) to turn the unreliable Internet into a reliable Internet. But those who design computer networks use another way of thinking, that is, trying to achieve end-to-end reliable transmission.

 

    Those who put forward this idea believe that a major difference between computer networks and telecommunications networks is that the performance of terminal equipment is very different. The terminal of the telecommunications network is a very simple telephone without any intelligence. Therefore, the unreliability of the telecommunications network will inevitably seriously affect people's communications by telephone. However, the terminal of a computer network has many intelligent hosts. This makes two important differences between computer networks and telecommunications networks. First, even if the Internet that transmits data has some defects (such as causing bit errors or packet loss), terminal hosts with many intelligences still have ways to achieve reliable data transmission (for example, they can detect errors in time and notify the sender to retransmit just now). Error data) . Second, even if the network can achieve 100% error-free transmission, errors may still occur in end-to-end data transmission.

 

analysis

To illustrate this point, we can use a simple example to illustrate this problem. This is the case when host A sends a file to host B.

Files are stored on the hard disk of host A through a file system. Host B also has a file system to receive and store the files sent from A. The application program used by the application layer is now the file transfer program. Part of this program runs on host A and the other part runs on host B.

Now discuss the general steps of file transfer:

(1) The file transfer program of host A calls the file system to read the file from the hard disk. The file system then passes the file to the file transfer program.

(2) Host A requests the data communication system to transfer the file to Host B. This includes using some communication protocols and dividing the data file into appropriately sized packets.

(3) The communication network transmits these data packets to the host B one by one.

(4) On host B, the data communication protocol transfers the received data to the part of the file transfer application running on host B.

(5) On host B, the file transfer program requests the file system of host B to write the received data to the hard disk of host B.

 

In the above steps, there are some factors that make the data damaged. E.g:

(1) Although the file was originally written correctly on the hard disk of host A, errors may occur after reading it out (such as a hardware failure in the disk storage system).

(2) The software of the file system, file transfer program or data communication system may fail in the process of buffering or copying the data in the file.

(3) The hardware processor or memory of host A or B may also fail during the process of data caching or copying of host A or B.

(4) When the communication system transmits data packets, it is possible to generate undetectable bit errors or even lose some packets.

(5) Host A or B may suddenly crash during data processing.

    It can be seen that even for such a simple file transfer task, just making the communication network very reliable does not guarantee that the file transfer from the hard disk of host A to the hard disk of host B is reliable. In other words, spending a lot of money to make the communication network very reliable is not worth the loss for transmitting computer data. Since the current terminal equipment is intelligent, the network should be designed to be simpler, and the intelligent terminal should be used to complete the task of "making the transmission reliable".

    Therefore, the designers of computer networks adopted a strategy, which is "end-to-end reliable transmission." More specifically, the connection-oriented TCP protocol is used at the transport layer, which can ensure reliable end-to-end transmission. As long as the TCP of host B finds an error in the data transmission, it tells host A to retransmit the part of the data that has the error until this part of the data is correctly transmitted to host B. However, the probability that TCP cannot detect data errors is very small. Adopting such a network construction strategy can not only make the network part cheap, flexible and reliable, but also ensure end-to-end reliable transmission.

    In this way, we can imagine that the scope of the Internet is slightly expanded, that is, to the transport layer in the host. Since the transport layer uses the TCP protocol, the end-to-end data transmission becomes reliable, so the expanded range of the Internet becomes a reliable network.

    Therefore, both statements of "data transmission provided by the Internet are unreliable" or "data transmission provided by the Internet are reliable" can be found in the literature. The question is how to define the scope of the Internet. If the data transmission provided by the Internet is unreliable, then the Internet here refers to a network that does not include the host (only the lower three layers). To say that the data transmission provided by the Internet is reliable, it shows that the scope of the Internet has expanded to the transport layer of the host.

Let's go back to the example of sending an ordinary letter through the post office. After we send a regular letter, we can wait for the recipient's confirmation (through his reply). If there is no reply after some days, we can send the letter again. This is an example of applying the principle of "end-to-end reliable transmission" to sending letters, which is what we often call TCP. The way to send ordinary mail is UDP.

The material of the article comes from "Computer Network"

Preface   

    Today I saw such a problem on Zhihu, and I found it more interesting. The IP protocol is unreliable and connectionless, so why didn't it be designed to be reliable in the first place? For this issue, let’s talk about some of my thoughts today.

 

Make an analogy

    We all know that the IP protocol is connectionless and the transmission is unreliable. Then why design this seemingly "chicken rib" agreement?

    Before starting the analysis, let me explain it with an analogy. We should have all sent letters. There are two types of letters in the post office: ordinary letters and registered letters . Ordinary messages are much like connectionless IP datagrams . Each ordinary letter will pass through a different site, and ordinary letters do not guarantee that the letter will not be lost. In the event of loss of regular mail, the post office is irresponsible. If you want to ensure that you will not lose it, you must send a registered letter. However, everyone will not all mail it by registered mail, because ordinary mail is not so easy to lose, or if this ordinary letter is lost, there will be no big loss. Moreover, the cost of registered mail is high, and you may have to line up to send the letter. In short, although ordinary mail may be lost, many people still use this method. Because it's cheap and convenient.

    I think after reading the above analogy, I should have a sense of the answer to this question.

 

history

If you want to really answer this question, you have to start talking about it in 1969.

    Since there is a telephone, the function of the telephone is communication. The main purpose of the traditional telecommunications network is for telephone communication. Ordinary telephones are very simple and have no intelligence. Therefore, telecommunications companies have to design their telecommunications networks very well. This telecommunications network can guarantee the communication quality of users during calls. This is very convenient for users who use very simple telephones. However, telecommunications companies have paid a huge price in order to build a telecommunications network that can ensure transmission quality .

    The transmission of data obviously must be very reliable. In 1969, the U.S. Department of Defense had an important discussion when designing ARPANET: "Who should be responsible for the reliability of data transmission?" At this time, two opposing opinions appeared. One opinion is that, like a telecommunication network, the communication network should be responsible for the reliability of data transmission (because the development history of the telecommunication network and its technical level have proven that people can design the network to be quite reliable).

But another opinion insists that the user's host is responsible for the reliability of data transmission. The most important reason here is: this can make the computer network cheap and flexible, and it can also meet various special military needs.

 

Let's use a simple example to illustrate this problem.

Suppose host A transmits files to host B via the Internet (as shown in the figure below). How can we achieve reliable transmission of file data?

 

According to the thinking of the telecommunication network, it is to try (which will cost a lot of money) to turn the unreliable Internet into a reliable Internet. But those who design computer networks use another way of thinking, that is, trying to achieve end-to-end reliable transmission.

 

    Those who put forward this idea believe that a major difference between computer networks and telecommunications networks is that the performance of terminal equipment is very different. The terminal of the telecommunications network is a very simple telephone without any intelligence. Therefore, the unreliability of the telecommunications network will inevitably seriously affect people's communications by telephone. However, the terminal of a computer network has many intelligent hosts. This makes two important differences between computer networks and telecommunications networks. First, even if the Internet that transmits data has some defects (such as causing bit errors or packet loss), terminal hosts with many intelligences still have ways to achieve reliable data transmission (for example, they can detect errors in time and notify the sender to retransmit just now). Error data) . Second, even if the network can achieve 100% error-free transmission, errors may still occur in end-to-end data transmission.

 

analysis

To illustrate this point, we can use a simple example to illustrate this problem. This is the case when host A sends a file to host B.

Files are stored on the hard disk of host A through a file system. Host B also has a file system to receive and store the files sent from A. The application program used by the application layer is now the file transfer program. Part of this program runs on host A and the other part runs on host B.

Now discuss the general steps of file transfer:

(1) The file transfer program of host A calls the file system to read the file from the hard disk. The file system then passes the file to the file transfer program.

(2) Host A requests the data communication system to transfer the file to Host B. This includes using some communication protocols and dividing the data file into appropriately sized packets.

(3) The communication network transmits these data packets to the host B one by one.

(4) On host B, the data communication protocol transfers the received data to the part of the file transfer application running on host B.

(5) On host B, the file transfer program requests the file system of host B to write the received data to the hard disk of host B.

 

In the above steps, there are some factors that make the data damaged. E.g:

(1) Although the file was originally written correctly on the hard disk of host A, errors may occur after reading it out (such as a hardware failure in the disk storage system).

(2) The software of the file system, file transfer program or data communication system may fail in the process of buffering or copying the data in the file.

(3) The hardware processor or memory of host A or B may also fail during the process of data caching or copying of host A or B.

(4) When the communication system transmits data packets, it is possible to generate undetectable bit errors or even lose some packets.

(5) Host A or B may suddenly crash during data processing.

    It can be seen that even for such a simple file transfer task, just making the communication network very reliable does not guarantee that the file transfer from the hard disk of host A to the hard disk of host B is reliable. In other words, spending a lot of money to make the communication network very reliable is not worth the loss for transmitting computer data. Since the current terminal equipment is intelligent, the network should be designed to be simpler, and the intelligent terminal should be used to complete the task of "making the transmission reliable".

    Therefore, the designers of computer networks adopted a strategy, which is "end-to-end reliable transmission." More specifically, the connection-oriented TCP protocol is used at the transport layer, which can ensure reliable end-to-end transmission. As long as the TCP of host B finds an error in the data transmission, it tells host A to retransmit the part of the data that has the error until this part of the data is correctly transmitted to host B. However, the probability that TCP cannot detect data errors is very small. Adopting such a network construction strategy can not only make the network part cheap, flexible and reliable, but also ensure end-to-end reliable transmission.

    In this way, we can imagine that the scope of the Internet is slightly expanded, that is, to the transport layer in the host. Since the transport layer uses the TCP protocol, the end-to-end data transmission becomes reliable, so the expanded range of the Internet becomes a reliable network.

    Therefore, both statements of "data transmission provided by the Internet are unreliable" or "data transmission provided by the Internet are reliable" can be found in the literature. The question is how to define the scope of the Internet. If the data transmission provided by the Internet is unreliable, then the Internet here refers to a network that does not include the host (only the lower three layers). To say that the data transmission provided by the Internet is reliable, it shows that the scope of the Internet has expanded to the transport layer of the host.

Let's go back to the example of sending an ordinary letter through the post office. After we send a regular letter, we can wait for the recipient's confirmation (through his reply). If there is no reply after some days, we can send the letter again. This is an example of applying the principle of "end-to-end reliable transmission" to sending letters, which is what we often call TCP. The way to send ordinary mail is UDP.

The material of the article comes from "Computer Network"

Guess you like

Origin blog.csdn.net/pary__for/article/details/114830610