Simple Networking

How does a L2 Switch work

The main task of a switch is to unite devices into a single network. It transmits data received on one of its interfaces to another based on the source and destination MAC address information contained in the transmitted frame.

Their logic is based on the Switching Table. As soon as a new host appears on the network and tries to transmit any information, the switch records that a new MAC address has appeared on one of its interfaces. A switch records this data in the form of a table like this:

 

Interface X – MAC address Y

 

When this newly appeared host tries to access some MAC address, for example, a neighboring host, the switch analyzes the information about the destination MAC address and sees if it is in its switching table. As soon as a match is found, the switch only has to transmit it from one interface to another.

 

If it does not find a match, it will try to send the frame at once through all its interfaces. If the target host is “alive”, it will definitely respond to such a request. And the switch, having seen a response from another MAC address, will enter the data into the switching table and then will simply forward data from one interface to another.

 

The lifetime of data in switching tables is usually 5 minutes. If both devices stop sending and receiving information from each other, then gradually the data about their MAC addresses will disappear from the table. The process will repeat again as soon as the hosts need to transmit something to each other again.

 

Read more articles about networking In Deltaconfig style

 

Visit us on Facebook – Deltaconfig