> For the complete documentation index, see [llms.txt](https://valineliu.gitbook.io/deuterium-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://valineliu.gitbook.io/deuterium-wiki/reading/cs-jing-dian-shu-ji/tcpv1/ch02-link-layer.md).

# ch02: Link Layer

## MindMap

![Link Layer](https://tva1.sinaimg.cn/large/007S8ZIlly1gfnesa2s34j30u00utgu1.jpg)

## Ethernet封装

Ethernet封装用到的最多。

![image-20200610192520780](https://tva1.sinaimg.cn/large/007S8ZIlly1gfnf0spm42j30w70u0wk4.jpg)

其中type有三种：

* 0800：IP datagram
* 0806：ARP request/reply
* 0835：RARP request/reply

## Loopback Interface

Loopback网卡处理数据的流程：

![image-20200610194051190](https://tva1.sinaimg.cn/large/007S8ZIlly1gfnfgxc4aej30zs0u0jwd.jpg)

需要注意的有：

1. 所有发送到127.0.0.1的数据都作为IP输入；
2. 如果数据包的目的地址是多播或广播地址，那么数据会被复制一份到127.0.0.1；
3. 所有发送到本地主机的其中之一一个地址都会被发送到loopback；
4. （3）中的数据包不会进入到对应的网络层中。

## MTU & Path MTU

* 相同网络下MTU重要；
* 不同网络下最小的MTU重要；
* 这个就是Path MTU；
* Path MTU是动态变化的，因为每次选取的路径不一样。
