当前位置:网站首页>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
边栏推荐
- Ansible basic configuration
- Find the maximum value in each tree row [extension of one of the hierarchical traversals]
- Concurrency of heap memory allocation
- Relationnet++: a representation of fusion of multiple detection targets based on transformer | neurips 2020
- The logic of "Ali health" has long changed
- Docker installs MySQL 8.0. Detailed steps
- KT6368A蓝牙芯片的主从机之前透传功能说明,2.4G跳频自动连接
- NIO、BIO、AIO
- 如何比较两个或多个分布:从可视化到统计检验的方法总结
- 使用Aggregated APIServer扩展你的kubernetes API
猜你喜欢

How to extract dates from web pages?

YGG recent game partners list

Selection and comparison of message oriented middleware MQ

Idea global search replace shortcut key

如何提取网页中的日期?
![leetcode:45. Jumping game II [classic greed]](/img/69/ac5ac8fe22dbb8ab719d09efda4a54.png)
leetcode:45. Jumping game II [classic greed]

Fanuc robot_ Introduction to Karel programming (1)

波卡生态发展不设限的奥义——多维解读平行链

Idea close global search box

Raspberry pie preliminary use
随机推荐
系统测试主要步骤
Huada 4a0gpio settings
软件设计的七大原则
理想L9,智能座舱新潮流
Idea global search replace shortcut key
img2pdf
揭秘B站,程序员穿女装敲代码,效率更高是真的吗?
Creating files, recursively creating directories
Redis hop table
Relationnet++: a representation of fusion of multiple detection targets based on transformer | neurips 2020
seven
CDN principle
Cross border e-commerce, early entry and early benefit
如何比较两个或多个分布:从可视化到统计检验的方法总结
Description of transparent transmission function before master and slave of kt6368a Bluetooth chip, 2.4G frequency hopping automatic connection
ThreadLocal内存泄漏问题
Zero code can apply data visualization to enterprise management
Ideal L9, new trend of intelligent cockpit
Technology inventory: past, present and future of Message Oriented Middleware
socket(2)