The seven layers of OSI are briefly introduced through the communication process between two machines: Requirement 1: The first problem scientists needed to solve was how to communicate between two pieces of hardware. Specifically, one device sends some bit streams, and the other device receives them. So scientists invented the physical layer: It mainly defines physical equipment standards, such as the interface type of network cables, the interface type of optical fibers, the transmission rate of various transmission media, etc. Its main function is to transmit bit streams (that is, converting 1 and 0 into electric current strength for transmission, and then converting them into 1 and 0 after reaching the destination, which is what we often call digital-to-analog conversion and analog-to-digital conversion). The data at this level is called bits. Requirement 2: Now that data streams can be sent through wires, we still want to transmit them through radio waves or other media. Then we also need to ensure that the transmitted bit stream is correct and have an error correction function. Therefore, the data link layer was invented: Defines how data is formatted for transmission and how access to the physical medium is controlled. This layer also typically provides error detection and correction to ensure reliable transmission of data. Requirement 3: Now we can send the correct bit stream data to another computer, but when sending a large amount of data, it may take a long time, for example, a video format, the network will be interrupted many times (in fact, even with the physical layer and data link layer, the network is often interrupted, but the interruption time is in milliseconds). So, it is also necessary to ensure the accuracy of transmitting a large number of files. Therefore, the data to be sent must be encapsulated. Just like sending express, one by one. Therefore, the transport layer was invented first (the transport layer is above the network layer in the OSI model): For example, TCP is used to send large amounts of data. If 10,000 packets are sent out, the other computer will tell whether it has received all 10,000 packets. If 3 packets are missing, it will tell that the 1001st, 234th, and 8888th packets are lost, and then send them again. In this way, it can be guaranteed that the other party has received the video completely. For example, UDP is used to send small amounts of data. If you send 20 packets, there will generally be no packet loss, so no matter how many you receive. In multiplayer interactive games, UDP is often used because they are generally simple messages and there is a need for broadcasting. If you use TCP, the efficiency will be very low because it will keep telling the host that it has received 20 packets, or 18 packets, and then send two more! If 10,000 computers do this at the same time, then using TCP will reduce efficiency. It is better to use UDP. The host sends it out, and if a few packets are lost, you will get stuck. Forget it, and send the packet next time and update it. The TCP protocol is a protocol that binds IP and ports. The IP protocol will be introduced below. Requirement 4: The transport layer only solves the packaging problem. But if there are multiple computers, how to find the one to send to? Or, if A wants to send information to F, it has to go through B, C, D, and E, but there are many nodes in the middle, such as KJZY. How to choose the best path? This is what routing does. So, the network layer, that is, the router, was invented: the functions implemented by the exchange price devices with addressing functions, this layer defines the IP address, and addressing is done through the IP address. So the IP protocol was born. Requirement 5: Now it is guaranteed that the correct encapsulated information is sent to the correct computer. But how about the user-level experience? Do I have to call TCP to package it every time, and then call IP protocol to find the route and send it myself? Of course not, so we need to establish a function of automatic packet sending and receiving and automatic addressing. Therefore, the session layer was invented: the role of the session layer is to establish and manage the communication between applications. Requirement 6: Now we can ensure that applications can automatically send and receive packets and address. However, when sending packets from Linux to Windows, the syntax of the two systems is inconsistent. Just like the installation package, exe cannot be used in Linux, and shell cannot be run directly in Windows. So the presentation layer was invented to solve the communication syntax problem between different systems. Requirement 7: OK, now all the necessary conditions are ready, you can write an Android program or a web program to meet your needs. |
<<: The ultimate form of 5G and its ferryman
>>: Talk about IPv6 and Happy Eyeballs
Double Eleven coincides with the fourth anniversa...
[[441504]] 5G remote ultrasonic robot diagnostic ...
01 Overview [[274853]] As for the ping command, I...
Fourth quarter results for fiscal year 2022: Sale...
At the 3GPP SA2#118 meeting held in Reno, the Uni...
[51CTO.com original article] On December 21, 2018...
Yes, you read that right. With the exposure of th...
CUBECLOUD (Magic Cube Cloud) recently launched a ...
I have a friend, Xiao Long, who confided in me: H...
[[394922]] This article is reprinted from the WeC...
What is DNS? Each IP address can have a host name...
The tribe shared news about FantomNetworks twice ...
During the interview process, HTTP is often asked...
April 26 is the 17th World Intellectual Property ...
The Wi-Fi at home is stuck again. Who is using it...