In the Ethernet networking protocol, switches are important link layer hardware devices that connect to different hubs or client machines. Switches take an active role. They function to store and forward Ethernet frames, by:
- Examining the destination MAC address in the frame.
- Selectively forwarding the frame only to the specific port(s) where the destination device is connected.
- If a frame needs to go out on a particular segment, the switch uses CD to access that segment. This is really only in shared media or in half-duplex operation, since links are full duplex and operate separately.
So the main important part is that it selectively forwards frames. Hubs instead blindly broadcast frames to all nodes. So switches are able to send frames only where they go, by maintaining a MAC address table.

Host connection
Hosts are unaware of the presence of switches. They each have dedicated, direct connections to the switch. Switches will buffer packets.
A separate Ethernet protocol is used on each incoming link, so there are no collisions and the link is full duplex, i.e., separate concurrent transmissions with different destinations won’t collide. Each link is its own collision domain, i.e., switches can isolate collision domains (including ones owned by hubs). Note that concurrent transmissions with the same destination can collide. But this is mitigated with a store-and-forward mechanism.
Each switch maintains a switch table with the MAC address of each host and the interface to reach it. It’s much like a routing table. The table is populated via a self-learning mechanism. When a frame is received, the switch learns the location of the sender and records it in the table.

See also
- Router, which functions in the network layer
- Switching fabric, a function in routers