-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
127 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
layout: post | ||
catalog: true | ||
tags: | ||
- 计算机网络 | ||
--- | ||
|
||
进行网络通信时,我们经常需要判断一台主机是否活跃。 | ||
|
||
A主机跟 B主机 进行通信之前,可以先 _ping_ 一下他的 _IP_ 地址,看主机是否有应答 | ||
|
||
那么,_ping_ 命令是如何工作的呢?掌握 _ICMP_ 协议后,我们可以着手研究 _ping_ 的通信过程了 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
layout: post | ||
catalog: true | ||
tags: | ||
- 计算机网络 | ||
--- | ||
|
||
# 1. 物理层 | ||
|
||
## 1.1. 通讯模型 | ||
![697a2f1f97f5f09cff4390c5b5458241.png](https://blog0912pic.oss-cn-beijing.aliyuncs.com/blog/202409141636474.png) | ||
想在两台主机间传输数据,该怎么办呢?用一根电缆将两台主机连接起来 | ||
|
||
![90c371e185fc7cdde7718d2059e7789e.png](https://blog0912pic.oss-cn-beijing.aliyuncs.com/blog/202409141637982.png) | ||
|
||
|
||
## 1.2. 冲突仲裁 | ||
|
||
如果两台服务器同时向信道发送数据,会发生什么事情呢,肯定冲突了嘛!有什么办法可以解决冲突吗? | ||
|
||
**方法一** | ||
|
||
引入一根新电缆,组成双电缆结构,每根电缆只负责一个方向的传输。这样一来,两个方向的传输保持独立,互不干扰,可以同时进行。这样的传输模式在通讯领域称为 **全双工模式** | ||
|
||
**方法二** | ||
|
||
在硬件层面实现一种仲裁机制:当检测到多台主机同时传输数据时,及时叫停,并协商哪一方先发。这样一来,信道同样支持双向通讯,但不可同时进行。这种传输模式则称为 **半双工模式** | ||
## 1.3. 常见物理介质 | ||
|
||
- 电信号,例如电缆,网线就是电缆中的一种; | ||
- 光信号,例如光纤; | ||
- 电磁波,例如 _WiFi_ ,无线网卡,蓝牙等; | ||
|
||
|
||
# 2. 数据链路层 | ||
|
||
第一节我们以两台主机为例,讨论了一个理想化的物理层模型。 现在,我们将问题进一步延伸:多台主机如何实现两两通讯呢?我们以三台主机为例进行讨论 | ||
![b5b564016c666f6ccfe37ca00839df33 (1).png](https://blog0912pic.oss-cn-beijing.aliyuncs.com/blog/202409141652678.png) | ||
## 2.1. 主机寻址 | ||
|
||
|
||
|
||
## 2.2. 信道复用 |