Ethernet and Switching
This domain covers how Ethernet frames are built and how switches move them, including VLANs, trunking and Spanning Tree. Expect frame-field and frame-size items, MAC learning behaviour, VLAN tagging details, and root-port versus blocked-port reasoning.
Frame and address rules
- 802.3 frame: preamble/SFD, destination MAC, source MAC, EtherType or Length, payload (46-1500 bytes), FCS (4 bytes).
- Minimum frame 64 bytes; maximum 1518 bytes, or 1522 bytes when an 802.1Q tag is present.
- A MAC address is 48 bits: 24-bit OUI plus 24-bit vendor-assigned value. Broadcast is FF:FF:FF:FF:FF:FF.
- The FCS is CRC-based detection only.
Switch operation
- Learn the source MAC on the ingress port; forward known unicast out the matching port; flood unknown unicast, broadcast and multicast; filter when the destination is on the ingress port; age entries out (typically 300 seconds).
- Each full-duplex switch port is its own collision domain; each VLAN is one broadcast domain.
- 802.1Q inserts a 4-byte tag with a 12-bit VLAN ID (usable 1-4094). Access ports send untagged frames in one VLAN; trunk ports carry many VLANs and leave the native VLAN untagged.
- Inter-VLAN routing needs router subinterfaces or switch virtual interfaces.
Spanning Tree
- Root bridge: lowest bridge priority (default 32768, adjusted in steps of 4096), then lowest MAC.
- Each non-root switch selects one root port by lowest cumulative path cost to the root, then lowest sender bridge ID, then lowest sender port ID.
- Legacy 802.1D costs: 100 Mbps = 19, 1 Gbps = 4, 10 Gbps = 2.
- RSTP (802.1w) converges faster with discarding, learning and forwarding states and alternate/backup roles.
Worked example
SW1 is the root bridge. SW3 can reach it directly over one 1 Gbps link (cost 4) or through SW2 across two 1 Gbps links in series (cost 4 + 4 = 8). SW3 selects the direct link as its root port at cost 4, and the port toward SW2 becomes non-designated and blocks. If the direct link fails, that alternate port transitions to forwarding and connectivity resumes.
Traps
- A native VLAN mismatch on a trunk leaks untagged traffic between VLANs and raises CDP/LLDP warnings.
- Unknown unicast is flooded; only known unicast is filtered to a single port.
- A trunk port is not a member of one VLAN, and native VLAN frames carry no tag.
- A blocking STP port still receives BPDUs; it just does not forward frames.