以太网 Ethernet

1.Ethernet

Ethernet位于OSI模型的物理层和数据链路层中,它是目前使用最广泛的LAN技术, 同时也是电气电子工程师学会的IEEE 802.3标准。

Ethernet定义了:

  • 进入媒介的方法

  • 帧的传输形式

  • 信号的电压

  • 电缆的特性

2.介质访问控制 MAC (Medium Access Control 或 Media Access Control) 子层

简称MAC子层,位于数据链路层的下层部分。数据链路层的上层部分是逻辑链路控制 (Logical Link Control) 层,以后会讲解。

MAC子层的管理:

  • 帧的格式

  • 物理地址

  • 多媒体传输的方法 (Ethernet 或 CSMA/CD 以太网协议 或 载波帧听多路访问/冲突检测协议)

3.两个版本的Ethernet标准

  • Ethernet DIX (最通用)

  • IEEE 802.3 和 IEEE802.2

1) Ethernet DIX标准的帧的格式:

2) EtherType 的作用:

指出数据所要使用的哪些高层次协议 。Indique le protocole de couche supérieure (IPv4 IPv6, ARP etc) au quel les donnés sont destinées

4.Ethernet 的历史

1)集线器 Le concentrateur (Hub)

集线器只对信号进行整形、放大后再重发以扩大网络的传输距离,而且不进行编码,所以是物理层的设备。但采用了CSMA/CD协议,CSMA/CD为MAC子层的协议,所以集线器也含有数据链路层的内容。

  • 共享带宽(BP partagé),比如一个10Mbit/s 的带宽分为两个端口用,当一个端口占用了大部分带宽

后,另外的端口就会显得很慢。

  • 半双工(half duplex),就如对讲机一样,你说话的同时对方不能说话。

  • 冲突(collision),若两个端口同时发送数据,会发生冲突,同时数据作废。

  • 广播(broadcast),所有已连接的端口(除发送方的端口)会收到数据。

集线器的简化图:

2)交换机 Le commutateur (switch)

交换机工作于数据链路层中,它能在帧中找出MAC地址。

交换机的功能:

  • 全双工(full duplex)

  • 独享带宽

  • 缓冲区(des mémoires tampons en entrée et en sortie)

  • 交换机和每个机器进行端到端的连接,所以信息无共享,也无冲突

它提供了一个MAC表 (une table de commutation), 一开始是空的。随后每次一条帧的到来,它会通过读取帧的MAC src地址和src端口来填充这个表,若新数据与表中某条记录重复,则会更新该记录的TTL(Time To Live);然后它会查看帧里的MAC det地址和det端口是否与表中的某条记录相同:

  • 若相同,则交换机转发该帧到相应端口,记为forwarding 帧

  • 若不相同,则交换机转发该帧给所有已连接的端口(除发出该帧的端口),记为flooding 帧

PS. cisco 的交换机除了可以forwarding和flooding外,还可以filtering。

有一篇英文博客介绍了交换机的原理,我截取一些部分:

Flooding :-

Flooding is performed when the switch has no entry for the frame's destination MAC address. When a frame is flooded, it is sent out every single port on the swtich except the one it came in one. Unknown unicast frames are always flooded.

Forwarding :-

Forwarding is performed when the switch does have an entry for the frame's destination MAC address. Forwarding a frame means the frame is being sent out only one port on the switch.

Filtering :-

Filtering is performed when the switch has an entry for both the source and destination MAC address, and the MAC table indiacates that both addresses are found off the same port.

Broadcasting :-

There is one other frame type that is sent out every port on the switch except the one that received it, and that's a broadcast frmae, Broadcast frames are intended for all hosts, and the MAC broadcast address is ff-ff-ff-ff-ff-ff ( or FF-FF-FF-FF-FF-FF, as a MAC address's case does not matter. )

有个一个不变的规律: 交换机永远不会将帧发回到它所在的同一端口。

Last updated

Was this helpful?