什么是网桥
引言
为什么会有这种疑惑呢?因为在学习计算机网络基础的时候总会看到相关的网络设备介绍,但似乎搜不到网桥这种设备有零售。同时网桥这种字眼在一些Linux
操作系统中又很常见,比如OpenWrt
。遂使用中文搜索,点进了知乎的一个提问越看越迷糊,包括常见的问答社区 Super User 中的一篇帖子也有回答错误连篇。以至于前期甚至混淆了虚拟机软件 VirtualBox 中提供的网络适配器类型桥接适配器(Bridged Adapter)
与网桥的概念,遂决定多查找资料搞清楚网桥到底是个什么玩意。
定义
什么是网桥?可以用 TCP/IP Illustrated,Volume 1 The Protocols 中的一句话概括:
TCP/IP Illustrated,Volume 1 The Protocols
3.4 Bridges and Switches
The IEEE 802.1d standard specifies the operation of bridges, and thus switches, which are essentially high-performance bridges.
IEEE 802.1d 标准规定了网桥的操作,交换机本质上是高性能的网桥。
翻一翻 IEEE 802.1d 标准的文档,网桥被定义为一个网络桥接设备。符合其定义并具有相应功能的都可以被称为网桥,该标准定义的网桥要求至少拥有两个端口,而交换机则是一种多端口网桥(Multiport Bridge)设备。虽然在好几个地方看到说网桥和交换机可以作为同义替换的术语,但主观感受是交换机这个名字已经近乎替代了网桥。
IEEE Std 802.1D-2004, IEEE Standard for Local and metropolitan area networks: Media Access Control (MAC) Bridges
7.1 Bridge operation
The principal elements of Bridge operation are as follows:
- Relay and filtering of frames.
- Maintenance of the information required to make frame filtering and relaying decisions.
- Management of the above.
发展历史
如果说作为实体设备,网桥和交换机是一种东西,为什么还要给他再起个名字呢?这得从他的发展历史说起,参照维基百科贴的内容,在80年代现代意义上的MAC网桥被发明之后出现了多端口网桥,到了90年代 Kalpana, Inc. 给自家采用了直通交换技术(cut-through forwarding)的次世代网桥起了个名字 EtherSwitch ,因为该技术相较于传统的存储转发技术(Store and forward)引入的延迟更低,之后随着产品推广交换机这个名字就逐渐被广泛使用了。
The first MAC Bridge[3][4][5] was invented[6] in 1983 by Mark Kempf, an engineer in the Networking Advanced Development group of Digital Equipment Corporation. The first 2 port Bridge product (LANBridge 100) was introduced by that company shortly after. The company subsequently produced multi-port switches for both Ethernet and FDDI such as GigaSwitch. Digital decided to license its MAC Bridge patent in a royalty-free, non-discriminatory basis that allowed IEEE standardization. This permitted a number of other companies to produce multi-port switches, including Kalpana.[7]
In 1989 and 1990, Kalpana introduced the first multiport Ethernet switch, its seven-port EtherSwitch.[5] The invention of Ethernet switching made Ethernet networks faster, cheaper, and easier to manage. Multi-port network switches became common, gradually replacing Ethernet hubs for almost all applications, and enabled an easy transition to 100-megabit Fast Ethernet and later Gigabit Ethernet.[6][7]
杂记
搜索的过程中还看到了一些有意义的资料,简单记录下
关于 Linux Bridge
关于 VirtualBox 的各种网络适配器
关于各种网络设备
IEEE 802.3 中关于 Repeater 的描述
IEEE Std 802.3-2018, IEEE Standard for Ethernet
29.1.2 Repeater usage
Repeaters are the means used to connect segments of a network medium together into a single collision domain. Different signaling systems (i.e., 100BASE-T2, 100BASE-T4, 100BASE-TX, 100BASE-FX) can be joined into a common collision domain using repeaters. Bridges can also be used to connect different signaling systems; however, if a bridge is so used, each system connected to the bridge will be a separate collision domain.
Data Communications and Networking 中关于 Hub 的描述
Data Communications and Networking with TCP/IP Protocol Suite
6.1.1 Hubs
A hub is a device that operates only in the physical layer. Signals that carry information within a network can travel a fixed distance before attenuation endangers the integrity of the data. A repeater receives a signal and, before itbecomes too weak or corrupted, regenerates and retimes the original bit pattern. The repeater then sends the refreshed signal. In the past, when Ethernet LANs were using bus topology, a repeater was used to connect two segments of a LAN to overcome the length restriction of the coaxial cable. Today, however, Ethernet LANs use star topology. In a star topology, a repeater is a multiport device, often called a hub, that can be used to serve as the connecting point and at the same time function as a repeater.
注:上面的描述最后一句指的应该是在星形拓扑的以太网中中继设备(repeater)通常为多口,被称为 hub 。实际上对于 hub 来说,其物理拓扑为星形但逻辑拓扑仍为总线型,参考如下。
《计算机网络(第7版)》
3.3.3 使用集线器的星形拓扑
集线器的一些特点如下:
(1)从表面上看,使用集线器的局域网在物理上是一个星形网,但由于集线器使用电子器件来模拟实际电缆线的工作,因此整个系统仍像一个传统以太网那样运行。也就是说,使用这个集线器的以太网在逻辑上仍是一个总线网,各站共享逻辑上的总线,使用的还是 CSMA/CD 协议(更具体些说,是各站中的适配器执行 CSMA/CD 协议)。网络中的各站必须竞争对传输媒体的控制,并且在同一时刻至多只允许一个站发送数据。
Network Devices (Hub, Repeater, Bridge, Switch, Router, Gateways and Brouter)