Local networks

How switches forward frames

Follow a frame through an Ethernet switch and understand learning, forwarding, flooding, and broadcast.

8 minute lesson

~~~

An Ethernet switch connects devices on a local network. Each device plugs into a port, and the switch’s job is to deliver frames only where they need to go.

It does this by learning. As frames arrive, the switch reads the source MAC address of each one and remembers which port it came from. Over time it builds a table like this:

MAC address         Port
3c:22:fb:9a:12:40   1     (your laptop)
9c:53:22:aa:04:1e   4     (the router)
b8:27:eb:44:c1:09   7     (a Raspberry Pi)

For a known destination MAC address, the switch forwards the frame only through the matching port. Your laptop’s traffic to the router goes out port 4 and nowhere else. Other devices never see it.

For an unknown destination, it initially floods the frame through the other relevant ports. Whichever device answers reveals its port, the switch learns the mapping, and flooding stops for that address.

Broadcast reaches everyone

A broadcast destination — ff:ff:ff:ff:ff:ff — is delivered throughout the broadcast domain: every port on the switch, and every switch connected to it. ARP requests are a familiar example. You can watch them arrive at your own machine:

sudo tcpdump -ni eth0 -c 3 broadcast
ARP, Request who-has 192.168.1.42 tell 192.168.1.1
ARP, Request who-has 192.168.1.17 tell 192.168.1.20

Your machine receives these even though none are addressed to it. That’s broadcast: the switch copies the frame to every port. On a busy LAN you’ll see a steady trickle of them.

Routers normally separate broadcast domains instead of forwarding Ethernet broadcasts between networks. That’s why an ARP request in your home never reaches your neighbor’s LAN, and why broadcast-heavy protocols stay local.

What a switch does not do

A switch makes local forwarding decisions based on MAC addresses. It does not read IP addresses and it does not replace the IP routing decision made by the sending host or a router.

This distinction matters when you debug. If two devices on the same switch can’t talk, the problem is link-level: cabling, the switch itself, or the MAC table. If a device can reach its neighbors but not the Internet, the switch is doing its job fine — look at routing instead.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →