Briefly describe the OSI seven-layer network model and the TCP/IP protocol four-layer network model

Because the latest work will involve the knowledge of the network, so I will review the basic content of the network. The previous studies in school were so-so, so I will review these basic contents again, and then combine the actual work experience, hoping to make myself in the network. The basic knowledge model is established on this piece. This article is mainly a summary after reading the basics of computer networks. Because these knowledge points have been mentioned in the previous interview process, so simply make a record.

1. OSI seven-layer network model
OSI is the abbreviation of Open System Interconnection, which means open system interconnection. The International Organization for Standardization (ISO) developed the OSI model, which defines the standards for interconnecting different computers and is the basic framework for designing and describing computer network communications. The OSI model divides the work of network communication into seven layers, namely physical layer, data link layer, network layer, transport layer, session layer, presentation layer and application layer.
Because it is engaged in development work, it is sorted from top to bottom.

For programmers

1. Application layer The
application layer refers to applications that can generate network traffic and interact with users. There is actually nothing to say about this layer. Just like WeChat, QQ, and the company's Link are all user-oriented application products. From the perspective of the computer network layered structure, these applications belong to the application layer. Users access the network through these products. information exchange.

2. Presentation layer
Presentation layer refers to the process of encrypting and compressing communication data. This process is mainly for programmers, which reminds me that in the process of development, we often need to control the front-end and back-end communication data. For example, the front-end and back-end communication formats use json, use nginx or customize http The request header compresses the http request message, and uses Google Chrome to monitor the ajax request. It should be done on the presentation layer. The data of the presentation layer is not directly oriented to the user. For example, json cannot be displayed directly. The layer thing is the presentation layer.

3. Session layer The
session layer refers to the level of the session established between the server and the client. In fact, at the very beginning, I was thinking whether this session is the concept of the session on the web side. After thinking about it, I think it should not be. The session is based on cookies, and the transmission of cookies is implemented in the http request header. Then this should be something of the presentation layer. After reading the explanation later, it is said that the server and the client establish a session, which should be what we usually see in netstate and ss. This session should refer to the session established by TCP or UDP, not the http protocol, but It is more low-level and more abstract, but in the actual business, the problems of the HTTP protocol are always easy to troubleshoot, and the problems of the underlying TCP/UDP are difficult to locate. It is easy to think of the crawler program developed before, because The exception problem was not handled properly, resulting in a large number of time_waits in the computer.

Network Engineer

4. Transport layer (typical equipment: gateway)
The transport layer refers to the control of reliable transmission and unreliable transmission, as well as the problem of flow control. After watching the video, in fact, the main core of this layer is the tcp, udp protocol, because learning The course is not described in detail in this one, and the quality effect is not good, so I plan to consolidate the knowledge content of this layer through two books in the later stage, and set up a flag

"TCP/IP Protocol Volume 1": Among the three volumes, Volume 1 is about basic theory, Volume 2 is about implementation, and Volume 3 is about affairs. For me, I think Volume 1 should be enough. Volume The second is written in C/C++, and I can't understand
"Illustrated TCP/IP": I have read "Illustrated HTTP", this series of books is relatively easy for readers to accept, because there are many diagrams, and they can understand the obscure knowledge. Explain with pictures

Although we don't know much about this layer, at least we must remember a few knowledge points:
What is the difference between TCP and UDP?
TCP is a reliable transmission, which is carried out in the form of a session. Both parties need to participate in the communication. During communication, it is necessary to constantly confirm that the data segment will be received by the other party. If it cannot be received, it needs to be retransmitted. Protocols, etc. are all unreliable transmissions, and data links do not provide reliability guarantees, only copy transmissions. It can be said that most of the protocols of the application are based on the TCP protocol. There is a sentence in the tutorial that roughly says that the protocol of the application layer is constructed based on the TCP protocol + application + port. Then I should understand that, in fact, the application Layers are specialized TCP protocols.
UDP is a one-time transmission, unreliable transmission. I take it to mean that I send you a package, and whether you receive it or not has nothing to do with me, just send it and you’re done.

Summary of TCP socket state changes -> understandable and difficult to recite

5. Network layer (typical equipment: routers, bridge routers)
The network layer refers to IP address addressing, selecting the best path, etc., here has been involved in the router aspect, how to find in the computer network communication Computer, I have to deepen my understanding of this content. After reading the tutorial, I know that the core of this layer is the IP protocol. Regarding the IP protocol tutorial, the main thing to remember is the following structure

IP Protocol ICMP Protocol ICMP Protocol
- - - - - - - -
ARP Protocol Reverse ARP Protocol

I am too lazy to draw a picture, so what does it mean to express it directly with such a representation method? That is to say, the basis of the IP protocol is the ARP protocol and the reverse ARP protocol, which covers the ICMP protocol and the ICMP protocol in the scope of the IP protocol.

ARP protocol: address resolution protocol, we all communicate through IP in the Internet, but IP does not uniquely identify a computer! So we need a protocol to resolve IP into MAC address. MAC address is the only address in the world that marks your calculation. It is marked when your network card is produced. Just like your ID card, hardware manufacturers will be Strictly assign an address header, so we can also see the network card manufacturer through the mac address. The IP needs to be converted to a MAC address before it can be forwarded by the next layer.

Reverse ARP protocol: It is very simple, that is, the reverse of the ARP protocol, that is, the MAC address is converted into an IP address, and then forwarded by the router.

ICMP protocol: Internet Control Message Protocol, theoretically I don’t know how to describe it. To put it bluntly, you can know whether your network can reach the other party’s network through an ICMP datagram. The ping command knows? The ping command tells you whether you can communicate through the packets of this protocol. This protocol is also based on the IP protocol.

IGMP protocol: It is a protocol used for multicast or broadcast. Sometimes broadcast is also required on the Internet. For example, a broadcast is sent to let the computers in the network segment feedback the IP address, etc.

IP protocol: To put it bluntly, it is to forward the data frame of the next layer through IP. IP is limited in the Internet... I really don't know how to describe it, but I still read the tutorial. Sometimes I really feel that knowledge is difficult to say a few words. Just record it....

In the learning of the network layer, I learned a lot about the
class A network: 1~128.0.0.0 The
class B network: 129~191.0.0 The
class C network: 192~223.0.0

Know that some network segments can only be used in the
intranet . The address range of the LAN is divided into three categories:
Class C: 192.168.0.0-192.168.255.255
Class B: 172.16.0.0-172.31.255.255
Class A: 10.0.0.0-10.255. 255.255
These three types of addresses cannot appear in the wide area network, but only spread in the local area network

In addition, there are some special IP addresses
such as : 169.254.xx: When the window machine cannot obtain the IP, it will automatically display this IP. This problem is encountered at work. When connected to the wifi, the IP address shows this, indicating that the wifi has question

There is also the method of dividing the subnet, what is the subnet mask, the role of the gateway, etc. What can be used immediately in actual work is this:
usually at work at the same time, it is
necessary to connect
to the external network (connect the computer through a network cable) Linking the customer's intranet network (via a special mobile phone hotspot)
used to be that when two networks were linked, either the external network or the intranet could not be connected. Now I can configure the routing method to let my machine go to the same time. Two networks, to put it bluntly, are through routing. If I go to a network segment of an intranet, I will go to the gateway of the mobile phone hotspot. If I go to the Internet, I will go to the gateway of the external network.

6. Data link layer (typical equipment: switches, bridges, network cards)
The data link layer is mainly for data subassembly, adding physical layer addresses, MAC addresses, etc. This layer has been reading the knowledge points for a long time, probably also I don’t remember very much. As a software engineer, I actually think that the requirements for understanding are relatively low. It mainly mentions some transmission error checking methods, such as the redundancy method, and some linked protocols such as the point-to-point protocol (Point-to-Point Protocol). Protocol)

hardware

7. The physical layer
mainly refers to voltage, interface standards, etc.

2. TCP/IP four-layer network model

The four-layer network model of TCP/IP is the application layer, the transport layer, the network layer, and the network access layer. It is a simplification of the OSI seven-layer network model.

Application layer -> OSI application layer, presentation layer, session layer

Transport Layer -> OSI Transport Layer

Network Layer -> OSI Network Layer

Network interface layer -> OSI data link layer, physical layer

3. Summary
In fact, from this brief description, it can be seen that I only have a simple understanding of the content of the session layer, but I often encounter difficulties in this area in actual business, and I don't have enough knowledge to deal with them.
There is almost no understanding of the transport layer, the network layer, and the data link layer. Although it is a problem that network engineers need to solve here, understanding this level of things will also be of great help to the maintenance of the server in the future.
In terms of the physical layer, the requirements for oneself are to be able to simply understand and speak out.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325980070&siteId=291194637