OSI seven-layer model (detailed explanation, it is enough to read this article)

insert image description here

1. What is it?

The full name of the OSI (Open System Interconnect) model is the Open Communication System Interconnection Reference Model, which is a standard framework proposed by the International Organization for Standardization (ISO) that attempts to interconnect various computers into a network worldwide.

OSIThe computer network architecture is divided into seven layers, each layer implements its own functions and protocols, and completes the interface communication with the adjacent layer. That is, each layer plays a fixed role without disturbing each other

Second, the division

OSIIt is mainly divided into seven layers, as shown in the figure below:

insert image description here

application layer

The application layer is located in the seventh layer of the OSI reference model, and its role is to complete specific network applications through the interaction between applications

This layer protocol defines the interaction rules between application processes, and provides services for different network applications through different application layer protocols. Examples include Domain Name System DNS, HTTPprotocols , SMTPprotocols used by e-mail systems, etc.

The data unit exchanged at the application layer is called a message

presentation layer

The role of the presentation layer is to enable the communicating application to interpret the meaning of the exchanged data. It is located in the sixth layer of OSIthe reference model, providing services for the application layer upwards and receiving services from the session layer downwards.

The services provided by this layer mainly include data compression, data encryption, and data description, so that applications do not have to worry about the differences in internal formats represented and stored in each computer

session layer

The session layer is responsible for establishing, managing and terminating communication sessions between presentation layer entities

This layer provides demarcation and synchronization functions for data exchange, including methods for establishing checkpoints and recovery schemes

transport layer

The main task of the transport layer is to provide services for communication between two host processes, to deal with packet errors, packet order, and other key transmission issues

The transport layer shields the upper layer from the details of the lower layer data communication. As such, it is a critical layer in computer communication architecture

Among them, the main transport layer protocols are TCPandUDP

Network layer

When data is transmitted between two computers, there is often more than one communication link, and the transmitted information may even pass through many communication subnets.

The main task of the network layer is to select the appropriate inter-network routing and switching nodes to ensure the successful transmission of data on time

When sending data, the network layer encapsulates the messages or user datagrams generated by the transport layer into packets and packets, and transmits them down to the data link layer

The protocol used at the network layer is the connectionless Internet Protocol (Internet Protocol) and many routing protocols, so we usually refer to this layer simply as the IP layer

data link layer

The data link layer is usually also called the link layer, between the physical layer and the network layer. The data transmission between two hosts is always transmitted on a link of a link, which requires the use of a special link layer protocol

When transmitting data between two adjacent nodes, the data link layer assembles the IPdatagrams , and transmits the frame on the link between two adjacent nodes

The data of each frame can be divided into two parts : header headand data :data

  • head indicates the data sender, receiver, data type, such as MAC address
  • data stores data interacting between computers

Through the control information, we can know the start and end bit position of a frame. In addition, it can also enable the receiving end to detect whether the received frame has any errors. If an error is found, the data link layer can simply discard the frame to avoid continuing to occupy Internet resources

physical layer

As OSIthe lowest layer in the reference model, the role of the physical layer is to realize the transparent transmission of bit streams between computer nodes

The main task of this layer is to determine some characteristics of the interface with the transmission medium (mechanical characteristics, electrical characteristics, functional characteristics, process characteristics)

This layer is mainly related to hardware and has little to do with software

3. Transmission process

The transmission of data between layers is shown in the figure below:

insert image description here

  • Application layer packets are passed to the transport layer
  • In the simplest case, the transport layer receives the message and attaches additional information, which will be used by the transport layer at the receiving end
  • The application layer message and the transport layer header information together constitute the transport layer message segment. Additional information may include: information to allow the receiving transport layer to deliver the message up to the appropriate application, and error detection bit information. This information allows the receiving end to determine whether the bits in the message have been changed en route
  • The transport layer passes the message segment to the network layer, and the network layer adds network layer header information such as source and destination system addresses to generate a network layer datagram
  • The network layer datagram is then passed to the link layer, and the data link layer packet is encapsulated into a data frame after adding the MAC address of the sender and the MAC address of the receiver
  • The data frame at the physical layer is encapsulated into a bit stream, and then transmitted to the peer end through the transmission medium
  • The peer unpacks the package step by step to obtain the transmitted data

references

  • https://zh.wikipedia.org/wiki/OSI%E6%A8%A1%E5%9E%8B
  • https://zhuanlan.zhihu.com/p/32059190
  • https://leetcode-cn.com/leetbook/detail/networks-interview-highlights/
    hihu.com/p/32059190
  • https://leetcode-cn.com/leetbook/detail/networks-interview-highlights/

Guess you like

Origin blog.csdn.net/weixin_46862327/article/details/127836810