Ethernet Switch - How does it work?
Let's start with an ethernet hub. You can think of a hub as a half-duplex double adapter for an ethernet network - it simply provides more connection ports. A hub however is 'dumb' - it simply distributes everything it receives at one a port to every other port (called flooding) whether the destination is at that port or not. A copy of the message ends up at the destination, but duplicate copies are sent to all other hosts as well, reducing overall network performance.
An ethernet switch is more advanced, and has the following differences to a hub:
- Switch ports generally operate in Full-Duplex (though can be set for half-duplex).
- When a switch receives an ethernet frame, it wants to distribute it only to the port where the destination host is connected. It achieves this by referring to its 'Learned Address Table' (LAT), a list of entries that matches the network host MAC addresses to the switch's ports.The LAT is also called the Forwarding DataBase (FDB).
- This LAT is populated by monitoring network traffic, and most commonly 'ARP' request messages issued by network hosts, and the replies they receive. In doing so, the switch 'learns' what devices are connected to each of its ports.
- Switches can be of the 'managed' type in which case the provide a number of inbuilt functions can be configured to manage how the network behaves.
To ensure that changes in network topology can be accommodated, (such as when you remove your computer from one port and connect it to a different port), the LAT has an aging timer for each address - typically just 30 seconds for a managed switch and 5 minutes for an unmanaged switch. Once an address has been unused for the period of the aging timer, the address is classified as unused. When the same period elapses again without use, the entry is deleted from the LAT.
For diagnostic purposes, some switches can have this learning function disabled, making the switch behave like a hub so that network traffic may be monitored by a 'packet sniffer'.
If this has been of interest, Daanet run hands-on industrial ethernet training courses for electricians, technicians and engineers