Home > Industry View > Content

Contact Us

Head Office

6F-B Entrance, Block A, Jiajizhou Building, 71 of Baoan District, Shenzhen, China

Zip: 518100

Phone: +86-755-26511958

Fax: +86-755-26511956-801

Cell: +86-17603067633

Web: www.optic-solutions.com

Email: Jenny@optfocus.com

          optfocus005@optfocus.com

Shenzhen Factory

3F, Block 7, Tangtou 3rd Industrial Zone, Shiyan Street, Baoan District, Shenzhen, China

Zip: 518108

Phone: +86-755-26511956

Fax: +86-755-26511956-801

Cell: +86-17603067633

Web: www.optic-solutions.com

Email: optfocus005@optfocus.com

How does Ethernet Switch work?
Apr 26, 2017

The working basis of Ethernet Switch is Ethernet packet structure. The Ethernet packet is a fixed format, but the length is variable. In the packet header, there are several contents such as destination MAC address, source MAC address, and information length. At present, the use of more Ethernet switches are Layer 2 (OSI second layer) switches, that is, based on the Ethernet MAC address to exchange.


Ethernet switch control circuit receives an Ethernet packet (from a port), immediately find its memory in the address table (MAC port number) to confirm the destination MAC NIC on which port, and then the package Sent to the port, if the destination MAC address is the first time, then broadcast to all ports. The Ethernet switch updates the MAC address-port number table according to the source MAC address in the Ethernet packet. When each computer is turned on, the above NIC periodically sends out the free packet or signal. The Ethernet switch can learn that And the MAC address, the so-called automatic address learning refers to the meaning of the so-called automatic age update (Auto-aging), refers to a certain period of time has not seen the MAC address has issued a package, the MAC address from the "MAC- Port number table ", this MAC address will be treated as a new address when it reappears.


The biggest difference between Ethernet Switch and Ethernet HUB is that the Ethernet switch memorizes what user (that is, what MAC address) hangs on which port, that is, there is an address table on the Switch. Each item in the table is mainly MAC address and port number. When the Switch receives a packet from a port (we will not discuss the broadcast packet), it will perform two actions on the address table: one is to check whether the source MAC address of the packet is in the address table, if not The MAC address is added to the address table, so that the MAC address in the future to know which port; Second, check whether the packet's destination MAC address is in the address table, if the MAC address is in the address table, then The packet is sent to the corresponding port. If the MAC address is not in the address table, the packet is sent to all other ports (except for the source port), which corresponds to the packet being a broadcast packet.


For broadcast packets, Ethernet Switch and Ethernet HUB work is the same, there is no difference.


Switch the process we know that:

① Switch is based on the Ethernet packet received from the port to know which MAC address in which port, if the MAC address has never issued Ethernet packets, the Switch does not know the MAC address in which port.

② because there is an address table on the Switch which MAC address to record in which port, so for non-broadcast packets, Switch and HUB as not the same as the packet sent to all ports, only the packet sent to the corresponding port, thus So that unrelated ports can communicate in parallel, thus providing a higher rate than HUB. HUB is different, whether the packet is a broadcast packet Ye Hao, non-broadcast packets Ye Hao, HUB by broadcast packet processing, so that users can only serial operation, sharing the communication bandwidth.

③ Switch has the function of automatic address learning. It automatically updates the contents of the MAC address table according to the source MAC address of the received Ethernet packet. The longer the Switch takes the time, the more MAC addresses it learns, and the unknown MAC The less the address, so the less the broadcast packet (if the destination MAC address is unknown, then the packet for broadcast packet processing), the faster the speed.

④ Switch is generally an automatic age function, that is, for a MAC address in the address table, if more than a certain period of time did not receive the packet from the MAC address (that is, the address is not contracted), the MAC address from the address When the packet is deleted and the packet with the destination address is the MAC address is encountered, the Switch will process the packet and relearn it.