A switch starts life knowing nothing. It has no map of the room and no list of what is plugged into it. It learns by reading the source address of every frame that arrives and writing down which port that frame came in on. The address table it works from is built entirely out of return addresses.
With that table in hand it does three things. It forwards a frame out of the single port where it has learned the destination lives. It floods the frame out of every other port when it has not learned the destination yet. And it filters, declining to send a frame back out of the port it arrived on. Because an Ethernet frame carries no hop counter to expire it, a loop in the cabling has nothing to stop it, which is why switched networks need a protocol to break loops.
Three things to remember
- A switch builds its forwarding table from the source addresses of the frames it receives.
- Forward, flood, filter: known destinations are forwarded, unknown ones are flooded.
- Ethernet frames have no time-to-live, so a physical loop needs loop prevention to stop it.
Related explanations
- Why Won’t These Two Computers Talk? (For Once, It’s Not DNS)
- What Does 255.255.255.0 Actually Do? (It’s Been Hiding in Plain Sight for Years)
New explanations go up on the channel first.
Like the drawings? Stick Figure Internet merch.