# OSI七层协议模型与TCP/IP四层模型

## **OSI七层和TCP/IP四层的关系**

1. OSI引入了服务、接口、协议、分层的概念，TCP/IP借鉴了OSI的这些概念建立TCP/IP模型。
2. OSI先有模型，后有协议，先有标准，后进行实践；而TCP/IP则相反，先有协议和应用再提出了模型，且是参照的OSI模型。
3. OSI是一种理论下的模型，而TCP/IP已被广泛使用，成为网络互联事实上的标准。&#x20;

TCP：transmission control protocol 传输控制协议

UDP：user data protocol 用户数据报协议

![](/files/-LfnTGQX-6Ng5uUJjHm7)

## **OSI七层协议模型**

## ![](/files/-LfnTGQZJJ2iW6BSxt9K)

## TCP/IP四层模型

应用层：对应OSI中的应用层、表示层、会话层

物理链路层：对应OSI中的数据链路层、物理层（也有叫网络接口层）![](/files/-LfnTGQaA9e93_jPHQG4)**层与协议**

每一层都是为了完成一种功能。为了实现这些功能，就需要大家都遵守共同的规则。大家都遵守这规则，就叫做“协议”（protocol）。

网络的每一层，都定义了很多协议。这些协议的总称，叫“TCP/IP协议”。它是Internet最基本的协议、Internet国际互联网络的基础，由网络层的IP协议和传输层的TCP协议组成。这里需要注意，TCP/IP协议是一个大家族，不仅仅只有TCP和IP协议，它还包括其它的协议，如下图：

![](/files/-LfnTGQcfrB1xZZqAX2A)


---

# 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://xiaoxiami.gitbook.io/linux-server/tcp-ip/osiqi-ceng-xie-yi-mo-xing-yu-tcp-ip-si-ceng-mo-xing.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.
