1. Definition: OSI (Open System Interconnection), an Open System Interconnection Reference Model, which logically divides the network protocol into seven layers. Each layer has related and corresponding physical devices. For example, a conventional router is a layer-3 switching device and a conventional switch is a layer-2 switching device. The OSI Layer-7 model is a framework design method. The main purpose of establishing a layer-7 model is to solve compatibility problems encountered during the interconnection of heterogeneous networks, its main function is to help different types of hosts implement data transmission. Its
BenefitsThe three concepts of services, interfaces, and Protocols are clearly separated, and reliable communication is achieved between different networks of different systems through seven hierarchical structure models. 2. OSI model:
Figure 1: OSI model Basic Knowledge Overview
3. Data encapsulation process in the OSI reference model
Figure 3 Data encapsulation process in the OSI reference model
3. In the OSI reference model, when a host needs to transmit user data, the data first enters the application layer through the application layer interface. At the application layer, user data is added with the application header (AH) to form an Application Layer Protocol Data Unit (PDU) and then submitted to the next layer-presentation layer.
The presentation layer does not "care" about the data format at the upper layer-the application layer. Instead, it encapsulates the data packets submitted at the entire application layer, that is, the presentation layer header (ph) is added ). Then, submit it to the lower-layer Session Layer.
Similarly, the Session Layer, transmission layer, network layer, and data link layer must add their own headers to the data submitted by the upper layer. They are session header (SH), Transport Header (th), network header (NH), and data link header (Data Link header, DH ). The data link layer also adds data link termination (DT) to the data submitted by the network layer to form the final frame of data.
When a frame of data is transmitted to the physical layer of the target host through the physical layer, the physical layer of the host submits the data to the upper-data link layer. The data link layer is responsible for removing the DH and end DT of the frame header of the data frame (data verification is also performed ). If no data error occurs, it is submitted to the upper-layer-network layer.
Similarly, the network layer, transmission layer, Session Layer, presentation layer, and application layer also need to do similar work. Finally, the raw data is submitted to the specific application of the target host.
4. Layer 7 structure of OSI Layer 1: Physical Layer (physicallayer)
Specifies the mechanical, electrical, functional, and process characteristics of communication equipment for establishing, maintaining, and removing physical link connections. Specifically, the mechanical characteristics specify the specifications, sizes, number of pins, and arrangement of connectors required for network connection; the electrical characteristic specifies the signal level, impedance matching, and transmission speed limit on the line when the bit stream is transmitted on the physical connection. The function characteristic refers to assigning the exact signal meaning to each signal first, that is, the function of each line between DTE and DCE is defined. The process feature defines a set of Operation Procedures for bit stream transmission using signal lines, it refers to the action series of the DTE and DCE on each circuit when the physical connection is established, maintained, and information is exchanged.
At this layer, the unit of data is bit ).
Representative of typical specifications defined by the physical layer include: EIA/TIA RS-232, EIA/TIA RS-449, V.35, RJ-45, etc.
Main features of the physical layer:
Provides a data transmission path for a data device. A data path can be a physical media, or multiple physical media connections. A complete data transfer, including activating a physical connection, transferring data, and terminating a physical connection. activation means that no matter how many physical media are involved, the two data terminal devices in the communication must be connected to form a channel.
Transmit data. the physical layer must form entities suitable for data transmission and serve data transmission. first, ensure that the data can pass through the data correctly, and second, provide sufficient bandwidth (bandwidth refers to the number of BITs that can pass each second ), to reduce channel congestion. the data transmission method can meet the requirements of point-to-point, point-to-point, serial or parallel, half-duplex or full-duplex, synchronous or asynchronous transmission.
Completes some management of the physical layer.
Main devices of the physical layer: Relay and hub.
Product representatives:
TP-LINK TL-HP8MU Hub
Layer 2: Data Link Layer)
Based on the bit stream service provided by the physical layer, data links between adjacent nodes are established, and data frames (frames) are transmitted without errors on the channel through error control, and action series on each circuit are carried out.
The data link layer provides reliable transmission on unreliable physical media. The role of this layer includes physical address addressing, data frame formation, traffic control, data error detection, and re-transmission.
At this layer, the unit of data is frame ).
Data link layer protocols include SDLC, HDLc, PPP, STP, and frame relay.
Main functions of the Link Layer:
The link layer provides the data transmission service for the network layer, which relies on the features of this layer. The link layer should have the following functions:
Establish, remove, and separate link connections.
Frame demarcation and frame synchronization. The data transmission unit at the link layer is a frame. The protocol is different, and the frame length and interface are also different. However, frames must be bounded in any case.
Sequential Control refers to the control of the sending and receiving sequence of frames.
Error Detection and recovery. There are also link identification and traffic control. error Detection uses square matrix code verification and cyclic code verification to detect the error codes of data on the channel, while Frame loss uses serial number detection. recovery of various errors often relies on feedback and resend technology.
Main data link layer devices: L2 switches and bridges
Product representatives:
D-Link DES-1024D
Layer 3: Network Layer)
The two computers that communicate in the computer network may go through many data links or through many communication subnets. The task at the network layer is to select an appropriate inter-network route and exchange node to ensure timely data transmission. The Network Layer encapsulates the frames provided by the data link layer into a data packet. The packet contains a network packet header, which contains the logical address information-the network address of the source site and the destination site.
If you are talking about an IP address, you are dealing with layer-7 problems. This is a "packet" problem, not a "frame" of layer-7 ". IP addresses are part of Layer 2 issues. In addition, there are some routing protocols and IP Address Resolution protocols (ARP ). Everything about routing is handled at Layer 3rd. Address Resolution and routing are the important purposes of Layer 3. The network layer can also implement congestion control, Internet interconnection, and other functions.
At this layer, the unit of data is called packet ).
Network Layer Protocols include IP, IPX, Rip, and OSPF.
Main functions of the network layer:
To establish a network connection and provide services for the upper layer, the network layer should have the following main functions:
Route Selection and relay
Activate and terminate Network Connections
Multiple network connections are reused on a data link, and time-sharing technology is adopted.
Error Detection and recovery
Sorting and Traffic Control
Service Selection
Network Management
Introduction to network layer standards
Main Network-layer devices: Routers
Product representatives:
TP-LINK TL-R4148
Layer 4: Transport Layer)
The data unit at Layer 3 is also called packets ). However, when you talk about specific protocols such as TCP, there is a special name. TCP data units are called segments, while UDP data units are called "datagram Rams )". This layer is responsible for obtaining all information. Therefore, it must track data unit fragments, unordered data packets, and other possible risks during transmission. Layer 3 provides an end-to-end (end user to end user) transparent and reliable data transmission service for the upper layer. Transparent transmission means that the transmission layer shields the details of the communication transmission system from the upper layer during the communication process.
The Transport Layer Protocol includes TCP, UDP, and SPX.
The transport layer is the first end-to-end Layer for data communication between two computers over the network. When the network layer service quality does not meet the requirements, it improves the Service to meet the requirements of the senior level. When the network layer service quality is good, it only uses a small amount of work. The transport layer can also be reused, that is, multiple logical connections can be created on a network connection. The transport layer is also called the transport layer. the transport layer only exists in the end-to-end open system. It is a layer between the low-Layer 3 Communication Subnet system and the high-Layer 3, but a very important layer. it is the last layer from the source to the target to control data transmission.
There is a fact that the performance of various communication subnets in the world is very different. for example, Communication subnets such as the telephone exchange network, group exchange network, Public Data Exchange Network, and LAN can be interconnected, but the throughput, transmission rate, and data delay communication fees are different. for the session layer, a constant performance interface is required. the Transport Layer undertakes this function. it uses the shunting/confluence, multiplexing/multiplexing technology to adjust the differences between the above communication subnets, so that the Session Layer does not feel it.
In addition, the transport layer also provides error recovery, traffic control, and other functions to shield the Session Layer from the details and differences of the Communication Subnet in these aspects. the Data Object facing the transport layer is no longer the network address and host address, but the interface port of the Session Layer. the final purpose of the above functions is to provide reliable and error-free data transmission for sessions. A service at the transport layer generally goes through the transmission connection establishment phase, the data transmission phase, and the transmission connection release phase to complete a complete service process. in the data transmission stage, there are two types of data transmission: general data transmission and accelerated data transmission. The transport layer service is divided into five types to meet the different requirements of transmission quality, transmission speed, and transmission cost.
Product representatives:
NetGear gs748ts
Layer 5: Session Layer)
This layer can also be called the meeting layer or dialogue layer. In the Session Layer and above, the data transmission unit is no longer named separately, collectively referred to as a message. The Session Layer does not participate in specific transmission. It provides a mechanism to establish and maintain communications between applications, including access authentication and session management. For example, the Session Layer completes the authentication of user logon on the server.
The Session Layer provides services that allow applications to establish and maintain sessions and synchronize sessions. The Session Layer uses the verification point to resume communication from the verification point when the communication fails. This capability is extremely important for transferring large files. The Session Layer, presentation layer, and application layer constitute the three high layers of the open system. They provide distributed processing, conversation management, information representation, and recovery of final Errors for application processes. the Session Layer is also responsible for the application process service requirements, but the transport layer cannot complete that part of the work, the transport layer function gap to make up. the main functions are dialog management, data stream synchronization, and re-synchronization. To complete these functions, a large number of service unit functions need to be combined. Dozens of functional units have been developed. The main functions of the Session Layer are described as follows.
Establishes a connection between session entities. To establish a session connection for two peer-to-peer session service users, you should do the following:
Map session addresses to shipping addresses
Select the required transport service quality parameters (QOS)
Negotiate session parameters
Recognize Session connections
Transmit limited transparent user data
Data Transmission Phase
In this phase, the two session users implement organized and synchronized data transmission. the user data unit is ssdu, and the protocol data unit is spdu. the data transfer process between session users is to convert ssdu into spdu.
Connection release
Connection release releases Session connections through "ordered release", "obsolete", "limited transparent user data transmission", and other functional units. the Session Layer standard defines 12 functional units in order to enable functional negotiation during the session connection establishment phase and to facilitate reference and reference of other international standards. each system can select other functional units to form a reasonable session service subset based on its own situation and needs. the main criteria for the Session Layer are "dis8236: Session Service Definition" and "dis8237: Session Protocol Specification ".
Layer 6: Presentation Layer)
This layer mainly solves the syntax expression problem of user information. It converts the data to be exchanged from an abstract syntax suitable for a user to a transfer syntax suitable for internal use within the OSI system. It provides formatted data representation and Conversion Services. The presentation layer is responsible for data compression, decompression, encryption, and decryption. The display of the sample image format is supported by the Protocol in the presentation layer.
Layer 7: Application Layer)
The application layer provides interfaces for operating systems or network applications to access network services.
Application layer protocols include telnet, FTP, HTTP, and SNMP.
Through the OSI Layer, information can be transmitted from a computer's software application to another application. For example, if an application on computer A sends information to an application on computer B, the application on computer A needs to first send the information to its application layer (Layer 7 ), this layer then sends the information to the presentation layer (layer 6), which transfers the data to the Session Layer (layer 5) until the physical layer (Layer 1 ). At the physical layer, data is stored in the physical network medium and sent to computer B. The physical layer of computer B receives data from physical media and sends the information to the data link layer (Layer 2). The data link layer then forwards the information to the network layer until the information reaches the application layer of computer B. Finally, the application layer of computer B transmits information to the application receiver to complete the communication process. The following figure shows the process.
Layer 7 of OSI uses various control information to communicate with the corresponding layers of other computer systems. These control information contains special requests and descriptions that are exchanged between the corresponding OSI layers. The header and tail of each layer of data are two basic forms of carrying control information.
For the data transmitted from the previous layer, the control information appended to the previous layer is called the header, and the control information appended to the previous layer is called the tail. However, adding protocol headers and Protocol tails to data from the previous layer is not necessary for an OSI layer.
When data is transmitted between layers, each layer can add headers and tails to the data, and the data already contains the headers and tails added to the previous layer. The protocol header contains the communication information between the layer and the layer. Headers, tails, and data are associated. They depend on the protocol layer of the analysis information unit. For example, the transport layer header contains information that can only be seen by the transport layer. Other layers under the transport layer only transmit this header as part of the data. For the network layer, an information unit consists of the header and data of the third layer. For the data link layer, the layer-3 header and data are considered as data. In other words, in a given OSI layer, the data part of an information unit includes the header, tail, and data of all upper layers. This is called encapsulation.
For example, if computer A wants to send data from an application to computer B, the data is first transmitted to the application layer. The application layer of computer A communicates with the application layer of computer B by adding a protocol header to the data. The information unit consists of the protocol header, data, and Protocol tail. It is sent to the presentation layer and then added as the protocol header of the control information understood by the presentation layer of computer B. The size of information units increases with the addition of each layer of protocol header and Protocol tail. These protocol headers and Protocol tails contain the control information to be used by the corresponding layer of computer B. On the physical layer, the entire Information Unit is transmitted through network media.
The physical layer in computer B receives information units and sends them to the data link layer. Then, the data link layer in computer B reads the control information in the protocol header added to the data link layer of computer; remove the protocol header and end, and the rest is sent to the network layer. Each layer performs the same action: Read and remove the protocol header and end from the corresponding layer, and then send the remaining information to the first layer. After these actions are performed on the application layer, the data is transmitted to the application program in computer B, which is exactly the same as that sent by the application program in computer.
The communication between one OSI Layer and the other layer is completed using the services provided by the second layer. The services provided by the adjacent layer help one OSI layer to communicate with the corresponding layer of another computer system. A specific layer of an OSI model is usually associated with the other three OSI layers: directly adjacent to the upper and lower layers, as well as the corresponding layers of the target networked computer system. For example, the data link layer of computer A should communicate with its network layer, physical layer, and data link layer of computer B.
5. Advantages of OSI layering
1) people can easily discuss and learn the normative details of protocols.
(2) The standard interface between layers facilitates modular engineering.
(3) creating a better interconnection environment.
(4) Reduced Complexity, made the program easier to modify, and made product development faster.
(5) Each layer makes it easier to remember the functions of each layer by taking advantage of the adjacent lower-layer services.
OSI is a well-defined set of protocol specifications and has many optional parts for similar tasks.
It defines the hierarchies of an open system, the relationships between hierarchies, and the possible tasks included in each layer. It is a framework to coordinate and organize the services provided by each layer.
The OSI reference model does not provide an implementation method, but describes some concepts used to coordinate the establishment of inter-process communication standards. That is to say, the OSI reference model is not a standard, but a conceptual framework used in the standard.
6. Comparison Between OSI model and TCP/IP Model
The TCP/IP model is actually a concentrated version of the OSI model. It has only four layers:
1. Application Layer
2. Transport Layer
3. Internet Layer
4. Network Interface Layer
Compared with OSI:
The application layer corresponds to the Session Layer of the OSI application layer.
The transport layer corresponds to the OSI transport layer.
The Internet layer corresponds to the OSI network layer
The network interface layer corresponds to the OSI data link layer and physical layer.
Note: Reference Material: OSI Layer 7 basics, OSI Layer 7 full analysis