Network reference model related understanding

Computer Network Reference Model

1. Stratified thinking

It is mainly to separate a complex computer network for management, and implement corresponding functions at each layer, which is convenient for management and belongs to the implementation of special standards.
Geng Rong found the problem and solved it in a targeted manner.

2. OSI reference model

(1) OSI seven-layer reference model:

It is the International Organization for Standardization (ISO) that promulgated the Open Systems Interconnection (OSI) reference model in 1984. It is an open architecture that divides the network into seven layers. As shown below
Insert picture description here

(2) Corresponding understanding of the seven layers

Application layer : Human-computer interaction window, input human language into the computer. For example, in the dialog box in WeChat to enter characters and other
presentation layers : the process of translating the received data into a computer language composed of binary numbers, compressing and decompressing the data, and digital encryption and decryption. For example: Here, the characters we input on WeChat are converted into a language that can be recognized by the computer, and compressed and encrypted to be sent to the next layer.
Session layer: Manage whether to allow the establishment of a session connection relationship between users on different machines. For example: WeChat checks whether users of both parties are already friends, there are conditions for sending messages, and both parties are connected to the server to be able to run.
Transport layer : Fragment the data of the upper layer application and add the corresponding port number here, and the destination port number and encapsulate it into a data segment, or realize the user software on different hosts in the network by identifying the port in the message Data communication between processes. For example: add the corresponding port number of WeChat to the data transmitted above, and put the port number of the other party's software in the data header, and encapsulate it into a data segment, and send it to the next layer.
Network layer : The upper layer data plus the logical (IP) addresses of the source and destination are encapsulated into the form of data packets to realize the transmission of data from the source to the destination. For example: here add the source and destination IP addresses to the above data segment, put it in the header and encapsulate it into a data packet again.
Data link layer : The upper layer data plus the physical (MAC) addresses of the source and destination are encapsulated into a data frame. The MAC address is used to identify the physical address of the network card and establish a data link. When a data error is found, the data frame can be retransmitted, or the mistransmitted data frame can be discarded.
For example: here add the source and destination MAC addresses to the data packet from the upper layer and place it in the header to re-encapsulate it into a data frame before continuing to send it.
Physical layer: The message header and upper layer data information are composed of binary numbers, and the physical layer converts the bit stream composed of these binary numbers into electrical or optical signals for transmission on the network. For example: here is to send the data frame sent by the network card to the specific network card in the network through the specific network device.
PS:
router corresponds to the routing table, the routing table has the corresponding IP address segment, the
switch corresponds to the MAC address table, and records the connected devices The
communication at the network layer and below is point-to-point communication (IP address, MAC address)
, and the communication at the transport layer is end-to-end communication (the port number corresponding to the software process)

3.OSI model VS TCP/IP model

In actual production and life, we are more likely to use the TCP/IP model.
Insert picture description here

In the figure, we can see that the first three layers in the OSI 7-layer model correspond to the application layer in the TCP/IP model. It can be seen that TCP/IP pays more attention to network transmission and physical hardware.

4. The composition of the TCP/IP protocol suite:

Insert picture description here

(1) Port numbers related to the transport layer (TCP and UDP)

TCP (Transmission Control Protocol) Protocol application port and its protocol function-transmission is more stable and reliable
Port number:
80 HTTP (Hypertext Transfer Protocol): used for the interaction of requests and responses between the browser and the Web server
21 FTP ( File Transfer Protocol): used to control the connection to the FTP server.
53 DNS (Domain Name System): Used to connect to the DNS server.
25 SMTP (Simple Mail Transfer Protocol): used to send mail
110 POP3 (Post Office Protocol Version 3): used to receive mail
22 ssH (Secure Shell Protocol): used for remote encrypted login
UDP (User Datagram Protocol) between computers Protocol application port and its protocol function-higher transmission efficiency
Port number:
69 TFTP (Simple File Transfer Protocol): used for the transmission of small files
53 DNS (Domain Name System): used to resolve DNS
111 RPC (remote call Protocol): used for remote procedure call
161 SNMP (Simple Network Management Protocol): used for network equipment management
123 NTP (Network Time Protocol): used for network time synchronization

(2) IP (Internet Protocol) protocol and its functions:

ARP (Address Resolution Protocol): used to obtain the physical address based on the IP address in the local area network.
RARP (Reverse Address Resolution Protocol): used to request the IP address based on the physical address through the ARP table in the local area network.
ICMP (Internet Control Message Protocol): used To verify that the network is unblocked
IGMP (Internet Group Management Protocol): used for multicast communication between hosts and multicast routers

5. Data encapsulation process, data protocol unit and equipment correspondence:

Insert picture description here

According to the encapsulation process in the figure, we can see that each layer adds a corresponding data unit to the data header of the upper layer and then encapsulates and sends it down. If it is received, the order is reversed and each layer is sequentially disassembled to verify whether the header is accurate header data. If the order is correct, it will be sent sequentially, and if it is incorrectly discarded. PS: The switch does not have the process of decapsulation, and directly uses the MAC address for hard forwarding. If there is no correct corresponding MAC address, the data packet is directly discarded.

Insert picture description here

The correspondence between the device and the layer is verified and communicated through the protocol between the layers, which will be discussed later.
Insert picture description here

6. Communication between layers:

1. The application layer sends the corresponding data to the transport layer.
2. The transport layer here determines its own port and the port number of the destination (here if the port of the destination is disconnected or communication is not possible at this time, the next step will not be performed because the destination port number cannot be determined). The transport layer here determines the direction of the logical connection.
3. The network layer adds the source and destination IP addresses to the header of the received data segment and encapsulates it into a data packet and sends it to the data link layer.
4. Data link layer After receiving the data packet, add the source and destination MAC addresses to the header and then encapsulate and send it to the physical layer. The physical layer converts the bit stream into an electrical signal and sends it to the physical layer of
our switch . 5. After our switch receives it , Decapsulate directly from the physical layer to the data link layer and forward it directly through the received MAC address. After the MAC address is determined (if the MAC address is not found, it will be discarded), and then forwarded directly to the physical layer. After the physical layer receives Then forward to our router.
6. After receiving the physical layer of our router, it will decapsulate gradually layer by layer until the IP address and the IP address of the other party's route are determined, and then perform the routing function, and then gradually encapsulate to the physical layer to the other party router. Physical layer transmission.
Then, you can receive the steps 1-6 before the reverse direction via the router of the other party.
Insert picture description here

5G wireless protocol stack

Insert picture description here

The encapsulation process of the data packet in the protocol stack
is that after each layer receives the packet of the previous layer, it adds a protocol header before the packet and then sends it out.
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44324367/article/details/109203713