The story about Alice and Bob’s correspondence

Communication and network transmission data and images, are data transmission, so use the analogy of communication, easy to understand and memory.

The application layer

For example, Alice seeks the seed of Teacher Cang and asks the seed website Bob (pull). This type of communication is I ask, you answer, which is HTTP mode.

Another example is that Alice and Bob write letters to each other, and the other receives them. In other words, Alice sends messages to Bob (push), and Bob receives them. This communication mode is SMTP.

The application layer is the interface provided for users and defines the communication mode between users.

The presentation layer

Since it is communication, we need to solve the problem of language. We cannot speak English one and Chinese the other. This is coding.

The presentation layer solves problems such as coding and encryption.

The session layer

Since two people want to communicate, how to start? Passed a period of time, do not want to continue correspondence, how to end? This is all handled by the session layer.

The session layer controls the link between two computers.

The transport layer

When two people communicate, the letter will be cut into segments due to transmission restrictions. What if one of the passages is lost? Do you want to retransmit? Do you want each paragraph to arrive immediately? These are the TCP/UDP differences. The transport layer is used to solve these problems.

The transport layer deals with data transfer between hosts (which can be different networks) and transmission quality.

The network layer

Before communication, the dialog posture is selected (application layer), the transmission content is presented (presentation layer), and the quality of transmission is guaranteed (transport layer).

So how do you identify Bob? The address, of course. For example, room 100-505, XXX Community, XXX City. Namely the village: the number, the village is like the host, the address of the village is IP, the number is the port number.

Given the address, how to choose the path? There are many ways to get from one place to another. For example, shenzhen to Beijing, you can first from Shenzhen – Guangzhou – Beijing, can also be Shenzhen – Zhengzhou – Beijing.

There are far and near, there are fast and slow, which way to go. Routing and subnet traffic control.

The network layer deals with data transmission between different networks.

Data link layer

B: We know. From Shenzhen to Beijing, we can transfer at Guangzhou. But is the message from Beijing to Shenzhen the error detect? How to correct the error? These problems are solved by the data link layer.

Data link layer connection solves the problem of data transmission between two directly connected nodes.

The physical layer

How is the physical hardware connected to the physical hardware? What is a network cable? What are the physical properties of frequency and so on? That’s what the physical layer has to deal with.

reference

OSI 7-Layer Model and the role of each layer

OSI model

The OSI Model’s Seven Layers Defined and Functions Explained

Computer Networking

In colloquial terms, the TCP protocol involves three handshakes and four breakups