当前位置:网站首页>Tcp/ip explanation (version 2) notes / 3 link layer / 3.4 bridge and switch
Tcp/ip explanation (version 2) notes / 3 link layer / 3.4 bridge and switch
2022-06-23 06:02:00 【M rookie M】
3.4 Bridges and switches
IEEE 802.1d The standard specifies the operation of the bridge , It also specifies the operation of the switch ( In essence, a switch is a high-performance bridge )
Bridges or switches are used to connect multiple physical link layer networks ( Such as : A pair of physical Ethernet segments ) Or multiple site groups
The most basic setup involves connecting two switches to form an extended LAN , Pictured 3-8 Shown

chart 3-8
Simple extended Ethernet LAN with two switches
Each switch port has a reference number , Each site ( Including switches ) All have their own MAC Address
The switch in the figure A and B Already connected to each other , An extended LAN is formed
In this example , The client system is connected to the switch A, The server is connected to the switch B, And the ports are numbered for reference
Please note that , Each network element , Including switches , All have their own MAC Address
as time goes on , Every bridge will “ Study ” Non local MAC Address , Each switch eventually knows which port it needs to pass to reach each site
This information is provided on a per port basis ( It may also be based on each VLAN) Tables stored in each switch ( be called Filter database (filtering databases)) in
After each switch knows the location of each site , These databases will contain as shown in Figure 3-9 Information shown

chart 3-9
chart 3-8 Switches in A and B Filter database on , It's over time , Created by observing the source address on the frame seen on the switch port (“ Study of the ”)
When a switch ( bridge ) The first time you open it , Its database is empty , So it doesn't know the location of any site except itself
Whenever the switch ( bridge ) When a frame sent to a station other than itself is received , It makes a copy of each port, not the port where the frame arrives , And send a copy of the frame from each port
If the switch ( bridge ) Never know where the site is , Then each frame will be transmitted on each network segment , This leads to unnecessary overhead
Learning ability is a standard function of switches and bridges , It can significantly reduce the cost
Now , Most operating systems support the ability to bridge between network interfaces , This means that a standard computer with multiple interfaces can be used as a bridge
For example, in Windows in , You can access the network connection menu from the control panel , Select the interface to bridge , Right click the mouse and select bridge connection to bridge the interfaces together
After completion , A new icon will appear , Used to represent the bridge itself , Most of the common network attributes on the interface have disappeared , These properties will appear on the bridge device ( See the picture 3-10)

chart 3-10
stay Windows in , The network bridge device selects the network interface to be bridged 、 Right click and select “ Bridge network interface ” Function to create
Once the bridge is established , The bridge equipment needs to be further modified
chart 3-10 It shows Windows 7 Internet bridge virtual device “ attribute ” panel
The properties of bridge devices include the list of underlying devices to be bridged and the set of services running on the bridge ( Such as :Microsoft Network client 、 File and printer sharing, etc )
Linux The system uses command line parameters , Work in a similar way

chart 3-11
In this simple topology , be based on Linux Of PC Is configured as a bridge , Used to connect two Ethernet network segments
As a learning bridge , It will gradually accumulate a table , This table is used to record which port should be used to connect to a system on the extended LAN
chart 3-11 The simple network in uses a Linux With two Ethernet ports PC As a bridge
port 2 Connected to a single site , port 1 Connecting the rest of the network
The following command can open the bridge :
Linux# brctl addbr br0
Linux# brctl addif br0 eth0
Linux# brctl addif br0 eth1
Linux# ifconfig eth0 up
Linux# ifconfig eth1 up
Linux# ifconfig br0 up
These commands create a bridge device br0 And interface eth0 and eth1 Add to bridge
It can be used brctl delif Command delete interface
After the interface is established , have access to brctl showmacs Command to view the filter database ( stay Linux It's called in the term forwarding databases or fdbs):
Linux# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.0007e914a9c1 no eth0 eth1
Linux# brctl showmacs br0
port no mac addr is local? ageing timer
1 00:04:5a:9f:9e:80 no 0.79
2 00:07:e9:14:a9:c1 yes 0.00
1 00:08:74:93:c8:3c yes 0.00
2 00:14:22:f4:19:5f no 0.81
1 00:17:f2:e7:6d:91 no 2.53
1 00:90:f8:00:90:b7 no 17.13
Because the site may move 、 Replace the network card 、 change MAC Address or other change , So when the bridge finds that it can access a through a port MAC Address time , You cannot assume that this information will never change
To solve this problem , After learning an address each time , Will start a timer for it ( The general default is 5 minute )
stay Linux in , A fixed time associated with the bridge is applied to each learned item
If at specified ageing The address in the entry is not seen again within the time , Delete the entry :
Linux# brctl setageing br0 1
Linux# brctl showmacs br0
port no mac addr is local? ageing timer
1 00:04:5a:9f:9e:80 no 0.76
2 00:07:e9:14:a9:c1 yes 0.00
1 00:08:74:93:c8:3c yes 0.00
2 00:14:22:f4:19:5f no 0.78
1 00:17:f2:e7:6d:91 no 0.00
Here's a demonstration , take ageing The value of is set lower
When an entry is deleted due to expiration
Subsequent frames of the deleted destination will be sent again from each port except the receiving port ( be called flooding (flooding)), The entry is then re added to the filter database
Using filtering databases and learning capabilities is just a performance optimization , Even if the database table is empty, it will not affect the normal operation of the network , But there will be more expenses
Next, we will study the interconnection of more than two bridges through redundant links
under these circumstances , Frame flooding may cause flooding “ disaster ”, The frame will loop indefinitely
边栏推荐
- Digital collections - new investment opportunities
- Pat class B 1016 C language
- APP SHA1获取程序 百度地图 高德地图获取SHA1值的简单程序
- matplotlib savefig多个图片叠加问题
- 【Cocos2d-x】截图分享功能
- Analysis on the problems and causes of digital transformation of manufacturing industry
- Pit filling for abandoned openssl-1.0.2 (.A to.So)
- Centos7 installation of postgresql8.2.15 and creation of stored procedures
- 内存分析与内存泄漏检测
- Visdom draws multiple dynamic loss curves
猜你喜欢

Digital collections - new investment opportunities

Adnroid activity截屏 保存显示到相册 View显示图片 动画消失

Arctime makes Chinese and English subtitle video

jvm-03.jvm内存模型

Android handler memory leak kotlin memory leak handling

The construction of digital factory can be divided into three aspects

Centos7 deploy radius service -freeradius-3.0.13-15 EL7 integrating MySQL

Memory analysis and memory leak detection

MDM data cleaning function development description

ant使用总结(三):批量打包apk
随机推荐
【Cocos2d-x】自定义环形菜单
PAT 乙等 1016 C语言
Pat class B 1021 digit statistics
Real MySQL interview question (23) -- pinduoduo ball game analysis
Advanced Mathematics (Seventh Edition) Tongji University exercises 1-8 personal solutions
PAT 乙等 1015 C语言
【Cocos2d-x】截图分享功能
The official artifact of station B has cracked itself!
Operating mongodb in node
Redis cache penetration solution - bloom filter
内存分析与内存泄漏检测
数字藏品——新的投资机遇
ssm项目搭建
数字藏品如何赋能经济实体?
Centos7 deploy radius service -freeradius-3.0.13-15 EL7 integrating MySQL
The construction of digital factory can be divided into three aspects
TCP/IP 详解(第 2 版) 笔记 / 3 链路层 / 3.3 全双工, 节能, 自动协商机制, 802.1X 流控制 / 3.3.3 链路层流量控制
What benefits have digital collections enabled the real industry to release?
PAT 乙等 1025 反转链表
Adnroid activity截屏 保存显示到相册 View显示图片 动画消失