A Network Switch Learns Where to Send the Next Frame
A network switch connects devices and directs data between them. On an Ethernet network, it does that by learning which device addresses can be reached through which connections. The switch builds its delivery table from the traffic passing through it.
Ethernet is a family of wired-network standards. Its data travels in units called frames, each carrying a source address and a destination address along with its contents. Those local delivery addresses are MAC addresses, short for media access control addresses.
A switch has connection points called ports. To forward a frame, it matches the destination MAC address to a port in its table. The table fills as traffic arrives.
- Keep work, guest and smart-home gear apart with up to 32 VLANs on one small switch.
- Copy any port's traffic to your laptop with port mirroring and see what is on the wire.
- Set it up from a web page instead of learning a command line.
The return address teaches the switch
Imagine a computer and a printer connected to different ports. The computer sends a frame toward the printer. As that frame arrives, the switch reads its source address and learns that the computer can be reached through the arrival port.
Next, the switch looks up the printer's destination address. If it already has an entry, it sends the frame toward the corresponding port. That port may lead directly to the printer or farther into the local network.
When the printer sends a reply, the same process works in reverse. Its source address teaches the switch where the printer is. The computer's address is already in the table, giving the reply a known direction.
Cisco's explanation of Ethernet switching describes this learning and forwarding process. The switch doesn't need to understand the document being printed to deliver its frames.
An unknown address gets a wider audience
What if the switch hasn't yet learned where the printer is?
It sends the frame through the other ports in the same local broadcast group, excluding the port where the frame arrived. This is called flooding. A broadcast frame, addressed to the group rather than one device, also receives that broader treatment.
Switches can divide ports into virtual local area networks, or VLANs. Each VLAN forms a separate broadcast group, so flooding within one group doesn't automatically include every port on the whole switch.
That exception changes a common description of switching. A switch can choose a particular output for a known destination; it doesn't promise that every frame goes to just one receiver.
A traditional Ethernet hub behaves differently. It repeats incoming signals toward its other ports instead of learning addresses and choosing an output from a table.
Hub, Switch or Router: What's the Difference?
Delivery and permission are different jobs
Local forwarding also differs from routing, which moves data between networks using the Internet Protocol, or IP. An IP address helps identify a destination at that wider level; a router chooses the next step toward it. Some equipment performs both routing and switching, even when its name emphasizes one job.
An address-table entry records the port through which an address can be reached. It doesn't establish who controls the device or whether that device should be allowed to reach a particular service.
Network Bridges: How Devices Share a Local Network

MAC Addresses: Getting Data to the Next Device

Store-and-Forward: Receive the Whole Thing, Then Send It On

QUOTE:
"Amateurs hack systems, professionals hack people."
