typora/note/计算机网络/以太网数据帧格式.md
2024-12-12 10:48:55 +08:00

32 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

### 一、前导码
- 以太网帧前端的一部分
- 有0和1数字交替组成表示一个以太网帧的开始
- 前导码最后两个比特位为`11`也叫SFDStart Frame Delimiter在这之后的数据就是以太网帧的本体
- 前导码与SFD加起来占8个字节64比特
![image-20230707170933511](https://blog-heysq-1255479807.cos.ap-beijing.myqcloud.com/blog/note/image-20230707170933511.png)
### 二、以太网帧本体
- 以太网的首部
- 占14个字节分别是6个字节的源mac地址和6个字节的目的mac地址以及两个字节的上层协议类型
- 以太网帧最大携带数据范围是**46-1500**字节
- 帧尾部有一个占用4个字节的`FCSFrame Check Sequence`
- IEEE802.3帧格式中协议类型被放在`SNAP`字段中
![image-20230707171542895](https://blog-heysq-1255479807.cos.ap-beijing.myqcloud.com/blog/note/image-20230707171542895.png)
### 三、以太网帧类型
- 和数据一起传送占用2个字节
- 包含用来标识以太网上一层使用协议的编号
![image-20230707171715988](https://blog-heysq-1255479807.cos.ap-beijing.myqcloud.com/blog/note/image-20230707171715988.png)
### 四、带有VLAN的以太网数据帧
![image-20230707172526881](https://blog-heysq-1255479807.cos.ap-beijing.myqcloud.com/blog/note/image-20230707172526881.png)