当前位置:网站首页>Basic principles of layer 2 switching
Basic principles of layer 2 switching
2022-06-24 22:33:00 【Zhuge iron and steel cloud】
Basic principles of layer 2 switching
Learn from the Ethernet layer 2 source through the Ethernet layer 2 switch MAC To maintain the MAC The correspondence between address and port ( preservation MAC The table corresponding to the port is called MAC surface ), Through its purpose MAC Search for MAC Vote on which port to forward , The basic process is as follows :
(1) The layer 2 switch receives the Ethernet frame , The source MAC Write the corresponding relationship with the receiving port MAC surface , As the basis for layer 2 Forwarding in the future . If MAC The same entry already exists in the table , Then refresh the aging time of the table item .MAC Certain aging and updating mechanism shall be adopted for table items , Items that have not been refreshed within the aging time will be deleted ;
(2) According to the purpose of Ethernet frame MAC Go find MAC surface , If no matching table entry is found , Then forward to all ports ( Except for receiving port ); If the purpose MAC It's a broadcast address , Then forward to all ports ( Except for receiving port ); If you can find a matching table entry , Forward to the corresponding port shown in the table entry , However, if the port shown in the table item is the same as the port receiving the Ethernet frame , Then discard the frame .
As can be seen from the above process , Layer 2 switching is maintained through MAC Table and according to the purpose MAC Table lookup forwarding , Effective use of network bandwidth , Improved network performance .
chart 4 Is an example of layer 2 switching
chart 4 Example of layer 2 switching
Layer 2 switch MAC Address aging and refreshing are usually done directly by the hardware ASIC Chip to complete , General software implementation of network bridge . By the way, here is a brief introduction to the mechanism it usually adopts :
(1) Every dynamically added... Stored in the chip MAC Each address table entry has a 1 bit Aging mark of length , At the same time, the chip has an aging timer to control address aging ;
(2) For the newly learned MAC Address table entry , Its aging mark position 1; For what has been learned MAC Table item , If there is a message source in the follow-up MAC Same as table item , Then refresh its aging flag bit to 1;
(3) Whenever the chip aging timer times out , take MAC The aging flag bit in the address table is equal to 1 Project , Modify its aging flag bit to be equal to 0; about MAC The aging flag bit in the address table is equal to 0 Project , Delete directly .
Under such an aging and updating mechanism ,MAC The actual aging time of the address is not accurate , It's a range :1~2 Times the aging timer time .
Although the layer-2 switch can isolate the conflict domain , But it can not effectively divide the broadcast domain . As can be seen from the forwarding process of the layer-2 switch described above , Broadcast message and purpose MAC If the search fails, the message will be forwarded to all ports , When the number of hosts in the network increases , This situation will consume a lot of network bandwidth , And it also brings a series of problems in terms of security . Of course , One way to isolate broadcast domains is through routers , However, due to the high cost and low forwarding performance of routers, the application of this method is limited . Based on these situations , In layer 2 switching VLAN technology .
————————————————
Copyright notice : This paper is about CSDN Blogger 「SalaWang」 The original article of , follow CC 4.0 BY-SA Copyright agreement , For reprint, please attach the original source link and this statement .
Link to the original text :https://blog.csdn.net/erwangshi/article/details/45038837
Ethernet layer 2 switching foundation
https://www.doc88.com/p-5791211246520.html?r=1
https://blog.csdn.net/erwangshi/article/details/45038837
https://zhuanlan.zhihu.com/p/339326516
边栏推荐
- Use of selector for NiO multiplexing
- How to automatically remove all . orig files in Mercurial working tree?
- img2pdf
- Resolving the conflict problem of the flutter Library
- Interrupt, interrupted, isinterrupted differences
- seven
- Web攻击之CSRF和SSRF
- Power system | IEEE paper submission process
- Data center basic network platform
- Detailed explanation of agency mode
猜你喜欢

VRRP skills topic

Future development of education industry of e-commerce Express

Chapter 10 project stakeholder management

How to automatically remove all . orig files in Mercurial working tree?
CA Zhouji - the first lesson in 2022 rust

SAP interface debug setting external breakpoints

Embedded development: tips and tricks -- clean jump from boot loader to application code

NIO、BIO、AIO
![Find the maximum value in each tree row [extension of one of the hierarchical traversals]](/img/5b/81ff20b61c0719ceb6873e44878859.png)
Find the maximum value in each tree row [extension of one of the hierarchical traversals]

EasyBypass
随机推荐
Raspberry pie preliminary use
零代码即可将数据可视化应用到企业管理中
Power system | IEEE paper submission process
KT6368A蓝牙芯片的主从机之前透传功能说明,2.4G跳频自动连接
AQS源码分析
Huada 04A operating mode / low power consumption mode
Certificate photo processing
How to grab the mobile phone bag for analysis? Fiddler artifact may help you!
Redis hop table
Ansible basic configuration
Data center basic network platform
Filtered data analysis
NIO 零拷贝
电力系统| IEEE论文投稿流程
NIO、BIO、AIO
Description of transparent transmission function before master and slave of kt6368a Bluetooth chip, 2.4G frequency hopping automatic connection
Zero code can apply data visualization to enterprise management
A pit in try with resources
Online filing process
Selection and comparison of message oriented middleware MQ