# 1.OSI/TCP/IP五层协议

![img](https://images2018.cnblogs.com/blog/1169376/201807/1169376-20180710111640278-854664480.png)![img](https://images2018.cnblogs.com/blog/1169376/201807/1169376-20180710150252263-1051710920.png)

**OSI分层 （7层）**：物理层、数据链路层、网络层、传输层、会话层、表示层、应用层。

**TCP/IP分层（4层）**：网络接口层、 网际层、运输层、 应用层。

**五层协议 （5层）**：物理层、数据链路层、网络层、运输层、 应用层。

**每一层的协议如下：**

物理层：RJ45、CLOCK、IEEE802.3 （中继器，集线器，网关）

数据链路：PPP、FR、HDLC、VLAN、MAC （网桥，交换机）

网络层：IP、ICMP、ARP、RARP、OSPF、IPX、RIP、IGRP、 （路由器）

传输层：TCP、UDP、SPX

会话层：NFS、SQL、NETBIOS、RPC

表示层：JPEG、MPEG、ASII

应用层：FTP、DNS、Telnet、SMTP、HTTP、WWW、NFS

**每一层的作用如下：**

**物理层：**&#x901A;过媒介传输比特,确定机械及电气规范（比特Bit）

**数据链路层**：将比特组装成帧和点到点的传递（帧Frame）

**网络层**：负责数据包从源到宿的传递和网际互连（包PackeT）

**传输层**：提供端到端的可靠报文传递和错误恢复（段Segment）

**会话层**：建立、管理和终止会话（会话协议数据单元SPDU）

**表示层**：对数据进行翻译、加密和压缩（表示协议数据单元PPDU）

**应用层**：允许访问OSI环境的手段（应用协议数据单元APDU）


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://im-qianuxn.gitbook.io/pytorch/ji-suan-ji/interview/1-6.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
