Traditional Culture Encyclopedia - Traditional festivals - What is the working principle of a Layer 2 switch

What is the working principle of a Layer 2 switch

How it works:

The network of switches and HUBs is a broadcast domain. The network under one interface of a router is a broadcast domain. So the router can isolate the broadcast domain.

Each switch broadcasts the status of its links to its surrounding neighbors to other switches across the network.

In this way, after a router receives routing information sent from other routers in the network, it collocates this link state and eventually generates a topological view of the entire network, which can be used by the shortest-path algorithm to compute the shortest paths from it to other routers.

From the working principle of Layer 2 switches, the following three points can be deduced:

1. As the switch exchanges data on most ports at the same time, which requires a very wide switching bus bandwidth, if the Layer 2 switch has N ports, the bandwidth of each port is M, and the switch bus bandwidth is more than N × M, then this switch can realize wire-speed switching;

Because of the different ASICs used by different manufacturers, the performance of the products is directly affected.

Expanded Information:

Layer 2 switches operate on a single chip. p>Layer 2 switches operate at Layer 2 (data link layer) of the OSI model, hence the name Layer 2 switch.

The development of Layer 2 switching technology has been relatively mature. Layer 2 switches are data link layer devices that can recognize MAC address information in packets, forward them based on the MAC address, and record these MAC addresses and the corresponding ports in an internal address table.

Working process:

1. When a switch receives a packet from a certain port, it first reads the source MAC address in the packet header so that it knows which port the machine with the source MAC address is connected to;

2. It then reads the destination MAC address in the packet header, and looks up the corresponding port in the address table;

3.

3. If there is a port corresponding to this destination MAC address in the table, copy the packet directly to this port;

4. If no corresponding port can be found in the table, broadcast the packet to all ports, and when the destination machine responds to the source machine, the switch can learn which port corresponds to the destination MAC address, and it will no longer need to broadcast to all ports when transmitting data the next time.

Cycling this process over and over again, the switch learns MAC address information for the entire network, which is how a Layer 2 switch builds and maintains its own address table.

Reference:

Baidu's Encyclopedia ------ Layer 2 Switch