Sub topic 1
What a Network Switch Reads from an Ethernet Frame
Prerequisites
Assume you know that a MAC address identifies a network interface on a local Ethernet network. You should also know that an Ethernet frame carries a destination MAC address, a source MAC address, and an EtherType field.
Reading the Frame
A switch examines the frame's Layer 2 header. The destination MAC address tells it where the frame should go. The source MAC address tells it which device sent the frame. The switch also uses the frame's VLAN context, if VLANs are configured.
The port where a frame enters is the ingress port. The switch can record the source MAC address together with this port. It then uses the destination address to choose an outgoing port.
Unicast, Broadcast, and Multicast
A unicast MAC address identifies one interface. A broadcast destination, ff:ff:ff:ff:ff:ff, means all interfaces in the local broadcast domain should receive the frame. A multicast address identifies a group of interfaces.
Switches usually flood broadcast and multicast frames. They also flood an unknown unicast frame because they do not yet know which port contains its destination.
Why Switches Replaced Hubs
A hub repeats every incoming signal out of every other port. All connected devices share one collision domain, so simultaneous transmissions can interfere.
A switch makes a forwarding decision for each frame. Known unicast traffic goes only to the required port. This reduces unnecessary traffic and gives each switch port its own collision domain.
> callout note > A switch does not initially know where every device is. Its first action is often flooding, followed by learning from the returning source addresses.
The MAC Address Table
A MAC address table, also called a forwarding table or CAM table, stores learned locations.
| Field | Meaning |
|---|---|
| VLAN | The local Layer 2 segment |
| MAC address | The learned device address |
| Port | The interface where the address was seen |
| Age | How recently the address was refreshed |
Learning from the Source
For each incoming frame, the switch records the source MAC on the ingress port. If the same address later appears on another port, the switch updates the entry. This supports host movement but repeated changes can indicate MAC flapping.
Exercise
A frame enters port 2 with source MAC A and destination MAC B, which is absent from the table. What does the switch do?
Show answer
It learns A on port 2 and floods the frame out the other eligible ports.