,

Contents · Ethernet, switching, STP, VLANs


Ethernet framing and PHY

  • Frame fields: dest/src MAC, EtherType/length, payload, FCS (CRC32).
  • Minimum/maximum sizes (64–1518 bytes without VLAN tag; jumbo frames optional).
  • PHY/Media: copper (1000BASE-T), fiber, auto-negotiation, duplex.
[DA][SA][EthType][Payload][FCS]

Switching and MAC learning

  • Bridges learn source MAC → port; forward/filter based on destination MAC.
  • Flood unknown unicast/broadcast; aging to prune stale entries.
  • Multicast handling (IGMP/MLD snooping).
CAM/FIB: MAC 00:11:22:33:44:55 → port 5 (VLAN 10)

Loop prevention: STP/RSTP/MST

  • Spanning Tree builds a loop-free tree: root election, port roles, states.
  • RSTP accelerates convergence; MST groups VLANs into instances.
  • Tuning: portfast/edge, BPDU guard, root guard, uplinkfast.
Root Bridge → Designated/Root/Alternate ports; BPDUs maintain tree

VLANs and trunking (802.1Q)

  • 802.1Q adds a 4-byte tag (TPID 0x8100) with VLAN ID and PCP priority.
  • Access vs trunk ports; native VLAN; QinQ (802.1ad) for provider stacking.
  • Inter-VLAN routing via L3 SVI or router-on-a-stick.
[DA][SA][0x8100][TCI: VID, PCP, DEI][EthType][Payload][FCS]

Link aggregation (LACP), MLAG

  • 802.1AX/LACP bundles links for bandwidth and redundancy.
  • Hashing choices (L2/L3/L4 fields) affect flow distribution.
  • MLAG provides multi-chassis LAG using vendor-specific protocols.

Design tips and troubleshooting

  • Use a clear L2 domain design; avoid accidental loops; monitor STP events.
  • Document VLAN plans; avoid native VLAN mismatches; secure trunks.
  • Tools: LLDP/CDP, spanning-tree show, MAC table, packet captures.

Exercises

  1. Draw a small L2 topology and simulate STP root election and port roles.
  2. Configure VLAN trunking and verify tagging/untagging with a packet capture.
  3. Create an LACP bundle on a lab switch/router and test failover behavior.
Ethernet scales by careful L2 control—use STP, VLANs, and LAGs to build robust, segmented networks.