I moved into a new apartment a few months ago. There are ethernet jacks all over the place, and hidden in a closet is an Airplay101 8-way ethernet switch that connects all of those jacks. I am wondering what the switch actually does, at a packet level. One end is plugged into my router, another to a PC, and the rest are unused for now. Do all packets sent in get forwarded to all other ports? Does the switch know the IP address of each connected device and forward things only to the correct port (and if so, how is that different from a router)? Or is it something else?

Somebody on another forum (before the question was closed as off-topic) started to explain that an Ethernet switch does frame-level switching, meaning it's based on MAC address, and doesn't care about the embedded IP packets. So does every device hooked up to the switch use ARP to learn IP/MAC mapping, and then add the correct destination MAC address, which gets sorted by the switch?

For reference, my background is in EE, I've been working in chip design for 15 years, and though I never took a networking class in school, I've worked on some networking chips, read some books, and at one point had a decent understanding of what a router does (and I could probably still design an Infiniband HCA with enough time). But I'm not sure what's in a standalone switch.



When an Ethernet switch receives an Ethernet frame on one port, it looks at the destination MAC address on that frame, and if it knows out which port that MAC address can be found, it forwards it out that one port.

If it doesn't know which port connects to the destination MAC address, or if the destination MAC address is a multicast or broadcast MAC address, the switch sends it out all ports (except the one it came in on). This is called "flooding" the frame.

The switch makes a note of the source MAC address of any frames it receives on any given port, and uses that to update its table of which MAC addresses are out which ports. This table is known as a bridge table, or forwarding table, or, for obscure historic technical reasons, the CAM table.

Ethernet is designed to NOT know or care about what higher-layer protocols the Ethernet frames may have in them. So you're right, higher layer protocols like IP have to have their own way to find what MAC address to send a given frame to. IP uses a protocol called ARP to do that. But Ethernet doesn't even really know about ARP.

To fully grok Ethernet it's critical to remember that Ethernet intentionally knows nothing about IP. Even though IP is the most common payload in Ethernet frames, Ethernet is oblivious and gives IP no special considerations.

Ethernet switches can be much more complex than the simple bridging I've described above, with VLANs and loop detection and link aggregation and port authentication and QoS and time sync and too many other things to list. But basic switching (also known as basic 802.1D bridging) is as I described.

|improve this answer|||||
  • As a chip designer, I'd say that the term CAM is not obscure or historical at all. I use that term every day and I'm not even working in networking right now. It's a special kind of on-chip memory used to look up a number based on another number, where the full range is not used. For example, cache hit/miss is determined by a CAM lookup. And so is ethernet switching, which makes sense to me. Thanks for the answer, I guess I need to review some of my textbooks. – Matt Feb 12 '19 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.