当前位置:网站首页>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
边栏推荐
- Embedded development: tips and tricks -- clean jump from boot loader to application code
- Concurrency of heap memory allocation
- Relationnet++: a representation of fusion of multiple detection targets based on transformer | neurips 2020
- Introduction, installation and use of postman tool
- SAP interface debug setting external breakpoints
- Data center basic network platform
- Technology inventory: Technology Evolution and Future Trend Outlook of cloud native Middleware
- 堆内存分配的并发问题
- Ideal L9, new trend of intelligent cockpit
- 干货丨产品的可行性分析要从哪几个方面入手?
猜你喜欢

Envoy obtain the real IP address of the client

In the era of full programming, should I give up this road?

Main steps of system test

Genesis公链与美国一众加密投资者齐聚Consensus 2022

【个人实验报告】

Introduction, installation and use of postman tool

NIO、BIO、AIO

ThreadLocal内存泄漏问题

Use of selector for NiO multiplexing

YGG 近期游戏合作伙伴一览
随机推荐
Short video mall system, how does scroll view adapt to the remaining height of the page
HTTP的缓存控制
无心剑汉英双语诗003. 《书海》
【軟件工程】期末重點
堆內存分配的並發問題
Basic principles of spanning tree protocol
interrupt、interrupted 、isInterrupted 区别
Development of live broadcast software app, and automatic left-right sliding rotation chart advertising
网上立案流程
Unable to use the bean introduced into the jar package
Certificate photo processing
Raspberry pie preliminary use
First order model realizes photo moving (with tool code) | machine learning
EasyBypass
Ideal L9, new trend of intelligent cockpit
04A中断的配置
L2 元年,Arbitrum Nitro 升级带来更兼容高效的开发体验
Valueerror: cannot take a larger sample than population when 'replace=false‘
Publicity of the second batch of shortlisted enterprises! Annual Top100 smart network supplier selection
解决dataframe报错ValueError: Cannot take a larger sample than population when ‘replace=False‘