osi模型
Open System Interconnection Model (OSI Model) is a 7 layered architecture structure to transmit the data from one point to another point.
开放系统互连模型(OSI模型)是7层体系结构,用于将数据从一个点传输到另一点。
It is basically a reference model that interprets how the data from one application get passed to another application via a physical medium.
它基本上是一个参考模型,用于解释一个应用程序中的数据如何通过物理介质传递给另一个应用程序。
Every layer of the model is independent of the other tasks of each layer can be performed independently.
模型的每一层都独立于每一层的其他任务,可以独立执行。
Thus, this model interprets the functionalities of data transfer and networking.
因此,该模型解释了数据传输和联网的功能。
OSI模型的分类 (Classification of the OSI Model)
The OSI Model is classified into 7 layers as mentioned below:
OSI模型分为以下7个层:
- Physical layer 物理层
- Data Link layer 数据链路层
- Network layer 网络层
- Transport layer 传输层
- Session layer 会话层
- Presentation layer 表示层
- Application layer 应用层
1.物理层(第1层) (1. Physical Layer (Layer 1))
![Data Transmission Data Link And Physical Layer](https://i-blog.csdnimg.cn/blog_migrate/c1e23ae41b40d6993b9b30c2d88b9ead.png)
The layer on the OSI model, responsible for the real-time connection between devices is the Physical Layer. It transmits the information in the form of bits
from one node point to another. This layer defines the connectors, cables, and all the physical networking equipment.
OSI模型上负责设备之间实时连接的层是物理层。 它以bits
的形式将信息从一个节点指向另一个节点。 该层定义了连接器,电缆和所有物理网络设备。
The physical medium acts as a platform or medium to transfer the bits from one node to another. Basically, it establishes the connection and transfers the bits and then the connection is deactivated. Further, the received signals get converted in the form of 0’s and 1’s and are passed as input to the Data Link Layer.
物理介质充当将位从一个节点传输到另一个节点的平台或介质。 基本上,它建立连接并传输位,然后停用连接。 此外,接收到的信号以0和1的形式转换,并作为输入传递到数据链路层。
物理层的特征 (Features of the Physical layer)
- It determines the path for the connection of two or more devices in general. 通常,它确定两个或多个设备的连接路径 。
- The Physical layer defines the mode of signal for the purpose of transmission of bits. 物理层定义了用于比特传输的信号模式。
- This layer enables Bit Synchronization by providing a clock which controls the sender and the receiver. 该层通过提供控制发送器和接收器的时钟来启用位同步 。
- Controls the rate of bit transmission. 控制位传输速率。
- It defines the topology of the connected nodes/devices. 它定义了连接的节点/设备的拓扑 。
与物理层关联的设备 (Devices associated with Physical Layer)
- Repeater 直放站
- Hub 枢纽
- Modem 调制解调器
- Cables 电缆线
2.数据链路层(第2层) (2. Data Link Layer (Layer 2))
![Data Transmission Data Link Layer](https://cdn.journaldev.com/wp-content/uploads/2020/02/Data-transmission-Data-Link-Layer.png)
The Data Link layer receives the input from the Physical layer in the form of 0’s and 1’s. Further, the Data Link layer on the OSI model is responsible for the error-free transfer of data from one node to another node.
数据链路层以0和1的形式接收来自Physical层的输入。 此外,OSI模型上的数据链路层负责从一个节点到另一节点的无错误数据传输。
Most importantly, the Data Link layer provides a unique identification address to every device in the local network.
最重要的是,数据链路层为局域网中的每个设备提供了唯一的标识地址。
了解框架的结构 (Understanding the structure of Frame)
In this layer, the raw data(bit stream)
received from the Physical layer gets converted into packets
, also known as Frames
. Then, a header and a trailer are added to the frame which contains the source and destination address of the frame.
在此层中,将从物理层接收的raw data(bit stream)
转换为packets
,也称为Frames
。 然后,将标题和尾部添加到包含该帧的源地址和目标地址的帧中。
![Frame](https://i-blog.csdnimg.cn/blog_migrate/3f7870e6c653f324d0efa24799f2efe2.png)
Data Link layer is divided into two sub-layers:
数据链路层分为两个子层:
- Logical Link Control layer: It transfers the packets to the Network layer of the receiving application. 逻辑链路控制层 :它将数据包传输到接收应用程序的网络层。
- Media Access Control layer: It serves as a link between the Logical Link Control layer and the physical layer of the receiving network. 媒体访问控制层 :它用作逻辑链路控制层和接收网络的物理层之间的链接。
Moreover, the Data Link layer is responsible for forwarding the frames to the Network layer.
此外,数据链路层负责将帧转发到网络层。
数据链接层的功能 (Features of Data Link layer)
- Physical Addressing: To send the packet to the right system, the Data Link layer provides the physical address i.e. MAC address of the sender and the receiver system in the header bit of the frames created. 物理寻址 :为了将数据包发送到正确的系统,数据链路层在创建的帧的标头位中提供物理地址,即发送方和接收方系统的MAC地址。
- Flow Control: It controls the quantity of data being sent to the receiver. 流控制 :它控制发送到接收器的数据量。
- Error Control: This mechanism helps detect the errors in the frame and re-transmits the loss of damaged frames ahead. 错误控制 :此机制有助于检测帧中的错误,并重新传输前面损坏帧的丢失。
- Access Control: This mechanism is responsible for determining the device which has control over a particular channel at that point of time. 访问控制 :此机制负责确定在那个时间点上可以控制特定信道的设备。
与数据链路层关联的设备 (Devices associated with the Data Link layer)
- Bridge 桥
- Switch 开关
- Network Cards 网卡
3.网络层(第3层) (3. Network Layer (Layer 3))
![Network Layer](https://i-blog.csdnimg.cn/blog_migrate/b21b792943e9e2c091eb49be5a1363d7.png)
The Network Layer transmits the data from one network to another network. It creates a logical connection between devices.
网络层将数据从一个网络传输到另一网络 。 它在设备之间创建逻辑连接。
It is responsible for determining the best suitable path for the transfer of data. The Network layer in the OSI model receives the data from the upper layers and converts them into packets
. Further, routes the packets through the best optimal path.
它负责确定最合适的数据传输路径。 OSI模型中的网络层从高层接收数据并将其转换为packets
。 此外,通过最佳最佳路径路由数据包。
网络层的特征 (Features of Network Layer)
- Routing of packets: It finds the best route through multiple paths and transfers the packets over the network. 数据包路由 :它通过多个路径找到最佳路由,并通过网络传输数据包。
- IPv4 and IPv6 network protocols are used to manage network traffic. IPv4和IPv6网络协议用于管理网络流量。
- Logical Addressing: The logical address i.e.
IP address
of the sender and the receiver is placed in the header of the packet to determine each device in the network. 逻辑地址 :将逻辑地址,即发送方和接收方的IP address
放在数据包的标头中,以确定网络中的每个设备。
与网络层关联的设备 (Devices associated with Network Layer)
- Router 路由器
- Bridges 桥梁
4.传输层(第4层) (4. Transport Layer (Layer 4))
![Transport Layer](https://cdn.journaldev.com/wp-content/uploads/2020/02/Transport-Layer.png)
The Transport layer accepts the packets from the Network layer and sends it to the session layer. It is responsible for the end-to-end delivery of the data. The packets received from the Network layer are here referred to as Segments.
传输层接受来自网络层的数据包,并将其发送到会话层。 它负责数据的端到端传递。 从网络层接收的分组在此称为段 。
In the Transport Layer, the acknowledgment of the data transfer is provided. It encapsulates the sender’s and receiver’s port number to header of the Segmented data and forwards it to the Network layer.
在传输层中,提供了数据传输的确认。 它将发送方和接收方的端口号封装到分段数据的标头中,并将其转发到网络层。
传输层提供的服务: (Services provided by Transport layer:)
- Connection-oriented Service: It is a reliable source of communication between the devices. In this service, the data transfer takes place in three phases: Establishment of connection, Data transfer, and Termination of the connection. Further, after the data transfer, it sends an acknowledgment to the sender regarding the successful data transfer. 面向连接的服务 :这是设备之间可靠的通信来源。 在此服务中,数据传输分为三个阶段: 建立连接 , 数据传输和连接终止 。 此外,在数据传输之后,它会向发送方发送有关成功数据传输的确认 。
- Connection-less oriented Service: It is the fastest mode of data transfer service. Here, the data transfer happens directly. No acknowledgment is sent to the sender regarding the transfer of the packets. 面向无连接的服务 :这是最快的数据传输服务模式。 在这里,数据传输直接发生。 没有有关发送数据包的确认信息发送给发送方。
传输层的功能 (Functions of Transport Layer)
- Segmentation and Assembling of data: At the sender’s end, it accepts the data from the session layer and divides it into small units. The transport layer of the receiver is responsible for assembling the units together. 数据的分段和组合 :在发送方端,它从会话层接受数据并将其分成小单元。 接收器的传输层负责将这些单元组装在一起。
- Service – Point Addressing of data: In the Transport layer, the port number of the sender and the receiver added to the header of the Segment helps to transfer the data to the correct process. 服务–数据的点寻址 :在传输层中,添加到网段头中的发送方和接收方的端口号有助于将数据传输到正确的过程。
- Connection Control: In this layer, the data is transferred either in a connection-oriented or connection-less format. 连接控制 :在此层中,数据以面向 连接或无连接的格式传输。
- Flow Control from end-to-end of the system application. 系统应用程序端到端的流控制 。
- Error Control from end-to-end of the system application. 从系统应用程序的端到端进行错误控制 。
与传输层相关的协议 (Protocols associated with Transport layer)
- Transmission Control Protocol (TCP): If the data is sent using the TCP protocol, then it divided into smaller units called segments. The segments follow multiple routes to reach the receiver’s end. At the receiver’s end, the TCP protocol reassembles the segments. It is more reliable, since, it establishes, maintains and terminates the connection between the sender and the receiver. 传输控制协议(TCP) :如果使用TCP协议发送数据,则将数据分成称为段的较小单元。 这些段遵循多条路线到达接收者的末端。 在接收方的末端,TCP协议重新组合了这些段。 这是更可靠的,因为它建立,维护和终止了发送方和接收方之间的连接。
- User Datagram Protocol (UDP): In this protocol, the data transfer takes place without any acknowledgment. Thus, it happens to be an unreliable protocol. 用户数据报协议(UDP) :在此协议中,数据传输是在没有任何确认的情况下进行的 。 因此,它恰巧是不可靠的协议 。
5.会话层(第5层) (5. Session Layer (Layer 5))
![Session Layer](https://i-blog.csdnimg.cn/blog_migrate/f8a507bf346191c9851084ac0c72d04e.png)
The Session layer ensures secure connection
at a particular platform/application system.
会话层确保在特定平台/应用程序系统上的secure connection
。
It enables us to establish
a connection and maintains a particular session of the user. It also authenticates the user for security among the communicating devices.
它使我们能够establish
连接并维护用户的特定会话。 它还可以验证用户的通信设备之间的安全性。
会话层的功能 (Functions of Session Layer)
- Synchronization: While transmitting data between devices, the Session layer adds checkpoints between them. If an error raises during the transmission of data, then the transmission re-starts again from that particular checkpoint. 同步 :在设备之间传输数据时,会话层在它们之间添加检查点。 如果在数据传输过程中出现错误,则传输将从该特定检查点重新开始。
- Dialogue Control: It creates a dialogue box between two processes and thus builds communication between the communicating devices. 对话控制 :它在两个进程之间创建一个对话框,从而在通信设备之间建立通信。
会话层协议 (Protocols of the Session Layer)
- DNS – Domain Name Server DNS –域名服务器
- LDAP – Lightweight Directory Access Protocol LDAP –轻型目录访问协议
- NetBIOS – Network Basic Input/Output System NetBIOS –网络基本输入/输出系统
6.表示层(第6层) (6. Presentation Layer (Layer 6))
![Presentation Layer](https://cdn.journaldev.com/wp-content/uploads/2020/02/Presentation-Layer-1-1024x683.png)
The Presentation Layer takes the input or sends decoded output from and to the Application Layer. It manipulates
the data according to the necessary format and then forwards the data over the network.
表示层从应用层接收输入或将解码的输出发送到应用层。 它根据必要的格式manipulates
数据,然后通过网络转发数据。
Thus, it is also known as the Data Translator layer. The Presentation Layer mainly focuses on the syntax
and semantics
of the transmitting data.
因此,它也被称为数据转换器层 。 表示层主要集中在传输数据的syntax
和semantics
上。
表示层的功能 (Functions of the Presentation Layer)
- Encryption/Decryption: This mechanism is needed to serve the purpose of the security of data.
Encryption
translates the data from the readable format to another form and forwards it over the network. At the receiver’s end, the encrypted data is then again converted into the readable form, known asDecryption
. 加密/解密 :需要这种机制来达到数据安全性的目的。Encryption
将数据从可读格式转换为另一种形式,并通过网络转发。 然后,在接收者端,加密后的数据再次转换为可读形式,称为Decryption
。 - Data Compression: The Presentation layer is responsible for compressing the data i.e. it reduces and compresses the data thus, reducing the number of bits to be transferred across the networking devices. 数据压缩 :表示层负责压缩数据,即它减少并压缩数据,从而减少要在网络设备之间传输的位数。
- Translation: This layer is responsible for the conversion of data from one format to another. 转换 :此层负责将数据从一种格式转换为另一种格式。
7.应用层(第7层) (7. Application Layer (Layer 7))
![Application Layer](https://cdn.journaldev.com/wp-content/uploads/2020/02/Application-Layer.png)
The Application layer serves as a platform for the user or operating system to interact with the data on a high level. It produces the data to be forwarded onto the network and acts as a window for the applications to produce and display the data over the network.
应用层充当用户或操作系统与数据进行高层交互的平台。 它产生要转发到网络上的数据,并充当应用程序在网络上产生和显示 数据的窗口 。
应用层的功能 (Functions of Application Layer)
- E-mail Services: This layer provides the platform for the transfer of mail over the network. 电子邮件服务 :此层提供了用于通过网络传输邮件的平台。
- File transfer and management of data: It enables the user to access and retrieve the files from the remote devices. 文件传输和数据管理 :它使用户可以从远程设备访问和检索文件。
与应用层相关的应用 (Applications associated with the Application layer)
- Browsers 浏览器
- Any desktop or mobile application such as Facebook, Skype, etc. 任何桌面或移动应用程序,例如Facebook,Skype等。
结论 (Conclusion)
Thus, in this article, we have covered the OSI Model’s 7 layers and have dived into the working and role of each layer in the transfer of data right from the data manipulation at the remote system to the conversion of data into bits.
因此,在本文中,我们涵盖了OSI模型的7层,并深入探讨了数据层从远程系统的数据操作到数据到位的转换的工作和角色。
osi模型