From cable to switch: media, optics, frames, MAC learning and flooding
Select copper or fibre cabling, matching optical transceivers and PoE budgets from link requirements, diagnose physical-layer CRC errors, and explain how switches build MAC tables, flood unknown unicast and isolate broadcast domains.
Contentsand lesson path
On this page
- Why it matters
- Choosing copper vs fibre media, transceivers and PoE budgets
- How switches learn MAC addresses, flood frames and bound broadcasts
- Check your understanding
- Apply it
- Review prompt
Lessons of Ethernet Switching & VLANs
- From cable to switch: media, optics, frames, MAC learning and flooding Concept · 25 min
- Lab: a Linux-bridge switch in Containerlab and its forwarding table Lab · 25 min
- VLANs and trunks: tagging, the native VLAN and inter-VLAN routing Concept · 20 min
- Lab: two VLANs, one trunk and a router-on-a-stick Lab · 30 min
- Redundancy without loops: STP/RSTP, edge-port protection and LACP Concept · 25 min
- Check: diagnose four broken layer-2 topologies Knowledge check · 10 questions
What you will learn
- Explain Ethernet framing, MAC learning, flooding and forwarding, and broadcast domains, and read a switch's forwarding table.
- Choose copper or fiber media, transceivers and PoE for a link from distance, speed and power needs, and identify physical-layer faults (CRC errors, link flaps, wrong optics) from interface counters and transceiver diagnostics.
01. Why it matters
Suppose two teams deploy new infrastructure in the same week: one strings twisted-pair copper 350 m across a parking lot between two buildings and sees zero link light, while the other plugs a 25 W Wi-Fi access point into an old closet switch and watches it reboot every few minutes with power-denied logs. Meanwhile, a quiet access switch logs 40 different MAC addresses on a single port.
Every switched network starts with Layer 1 physics and Layer 2 framing (reviewed alongside IP delivery in CIDR blocks and default gateways). Choosing the right copper, fibre, optical transceiver, and Power over Ethernet (PoE) budget prevents physical outages before cables are pulled, and understanding how switches learn MAC addresses keeps normal uplinks from being mistaken for attacks.
02. Choosing copper vs fibre media, transceivers and PoE budgets
Every physical Ethernet link must satisfy three constraints: distance, speed, and electrical environment. Walk through the choice in four steps:
- Distance and electrical environment (copper vs fibre): Under TIA-568 structured cabling, twisted-pair copper (Cat5e, Cat6, and Cat6a) is limited to 100 metres total (typically up to 90 m of solid horizontal cable terminating at a patch panel plus up to 10 m of patch cords). At 10 Gb/s (
10GBASE-T), Cat6 covers up to 55 m in dense bundles while Cat6a covers the full 100 m. Avoid running standard copper between separate buildings: besides the 100 m limit, ground-potential differences and lightning surges can damage switch ports, so optical fibre is the default inter-building medium (outdoor-rated shielded copper with surge protection at both entries is a rare short-span exception). - Fibre core and matching optics: Optical fibre carries light pulses immune to electromagnetic interference. Multimode fibre (MMF) with short-reach
10GBASE-SRoptics (850 nm wavelength) reaches 300–400 m on OM3/OM4 glass inside a building, whereas single-mode fibre (SMF) with long-reach10GBASE-LRoptics (1310 nm) reaches up to 10 km across campuses. Both ends must match standard, wavelength, and fibre core type—anSRoptic cannot link with anLRoptic, and launching one into the wrong glass causes severe signal loss or no carrier. Worked example: connecting a branch closet 280 m away in another building at 10 Gb/s calls for single-mode OS2 fibre and10GBASE-LRoptics at both ends, whereas a 40 m closet-to-desk run inside one building uses Cat6a copper. - Speed, duplex, and auto-negotiation: Twisted-pair interfaces exchange Fast Link Pulses at link-up to agree on speed and duplex.
1000BASE-Tand10GBASE-Tin practice run full duplex and rely on auto-negotiation (IEEE 802.3 Clause 40 still defines a 1000BASE-T half-duplex mode, though modern switches leave it unused). On legacy 10/100 Mb/s links, forcingfull duplexon one side disables negotiation and leaves the partner inhalf duplex. - Power over Ethernet (PoE) per-port and chassis budgets: Cat5e and better carry DC power alongside gigabit and multi-gigabit data. IEEE 802.3af (PoE) supplies up to 15.4 W at the switch port (~12.95 W at the device), 802.3at (PoE+) supplies up to 30 W (~25.5 W at the device), and 802.3bt supplies up to 60–90 W. Check both the per-port standard and the switch's total PoE chassis budget: using a simplified actual-draw budget model, a 24-port PoE+ switch with a 195 W chassis budget powers ten 18 W cameras (
180 W) and denies the eleventh (198 W > 195 W). Note that many switches budget by PoE class instead (for example reserving 30 W per Class 4 port plus cable loss), admitting fewer devices on the same 195 W chassis.
Diagnosing Layer 1 faults from interface counters and DOM diagnostics: When troubleshooting physical links, compare carrier stability (carrier_changes in Linux /sys/class/net/<iface>/carrier_changes or link-transition syslog entries) against error counters (ip -s link, ethtool -S) and Digital Optical Monitoring (DOM) readings (ethtool -m or switch show interfaces transceiver):
- Rising CRC/FCS input errors with stable carrier (
carrier_changesnot increasing): Frames arrive corrupted on an unbroken path—check for damaged copper pairs, dirty or bent fibre patch cords, or a duplex mismatch rather than a VLAN or MAC-table issue. - Link flaps (rising
carrier_changesandcarrier_down_count): The link repeatedly drops and recovers. Common causes include marginal opticalrx_powerhovering near the receiver sensitivity floor, a loose RJ45 tab or failing copper pair, auto-negotiation instability, PoE brown-outs under load, or switch port err-disable triggers. - Receiver overload vs sensitivity floor vs wrong optics: Check
rx_poweragainst both limits on the transceiver. Anrx_powernear or below the sensitivity floor (such as-14.2 dBmagainst a-14.4 dBmfloor) points to dirty connectors, tight bends, or excessive span loss. Conversely, plugging a high-power long-haul optic such as10GBASE-ER(40 km, 1550 nm) across a 2 m rack patch cord can driverx_powerabove the receiver overload ceiling (for example+2.6 dBmvs-1.0 dBmmax), saturating the photodiode and causing flaps or packet loss unless you add an attenuator or swap to a lower-power optic such as10GBASE-LR(orSRover a multimode patch). Finally, installing a wrong optic—such as10GBASE-SR(850 nm MMF) inOS2single-mode fibre orSRoppositeLR—typically showsNO-CARRIER, near-zerorx_power, and mismatched wavelengths in diagnostics.
# Port A (eth1): broken path stays up -> CRC errors climb, carrier stays stable
carrier_changes: 1 rx_crc_errors: 482 (check cable/patch or duplex mismatch)
# Port B (sfp2, 10GBASE-LR): link flapping -> marginal RX near sensitivity floor
carrier_changes: 19 carrier_down_count: 9 tx_power: -2.1 dBm rx_power: -14.2 dBm
(sensitivity floor: -14.4 dBm -> clean fibre ends, inspect bend radius/splices)
# Port C (sfp3, 10GBASE-ER on 2 m patch): RX above overload ceiling -> flaps/drops
carrier_changes: 11 tx_power: +3.0 dBm rx_power: +2.6 dBm
(max RX overload: -1.0 dBm -> swap to SR/LR or add an attenuator)03. How switches learn MAC addresses, flood frames and bound broadcasts
Once bits arrive cleanly across Layer 1, an Ethernet switch forwards frames at Layer 2 (IEEE 802.1Q). An Ethernet II frame carries a 6-byte destination MAC, a 6-byte source MAC, a 2-byte EtherType (0x0800 IPv4, 0x86dd IPv6, 0x0806 ARP), the payload, and a 4-byte Frame Check Sequence (FCS) trailer. Each 48-bit MAC address starts with a 3-byte vendor OUI and ends with a 3-byte NIC identifier; bit 0 of the first byte marks unicast (0) vs multicast/broadcast (1, as in ff:ff:ff:ff:ff:ff), and bit 1 marks factory-burned addresses (0) vs locally administered addresses (1, such as 02:00:00:... in lab tests).
Early repeaters and hubs echoed every electrical signal out every port, placing all hosts in one shared collision domain. Modern full-duplex switches give every port its own point-to-point collision domain—eliminating CSMA/CD collisions—and maintain a MAC address table (Forwarding Database, or FDB) in three deterministic steps:
- Learn on ingress only: When a frame enters port
P, the switch records(source MAC, VLAN, port P)and resets that entry's aging timer (typically 300 seconds). Switches never learn from destination MACs or transmitted frames. - Forward known unicast: If the destination MAC is already mapped to port
Qin the same VLAN, the switch forwards the frame only out portQ(or drops it ifQ == P). - Flood unknown unicast and broadcasts: If the destination MAC is absent—after boot, or after a silent host's entry ages out—or is
ff:ff:ff:ff:ff:ff, the switch floods the frame out every other port in that VLAN. As soon as the target sends a frame back, the switch learns its port and stops flooding. Notice a classic consequence of aging: routers often keep ARP entries far longer than a switch keeps MAC entries (minutes to hours, against a typical 300-second MAC aging time). If asymmetric routing sends frames to a host through Switch S1 while frames from that host take another path, S1 rarely sees the host's source MAC, so its entry expires after 300 seconds even though the router still holds the ARP mapping—forcing S1 to flood every unicast frame toward that host until either symmetry is restored or FDB aging exceeds the ARP timeout.
Why 40 MAC addresses on one port is usually normal: An uplink port to another switch, a wireless access point, or a VM hypervisor carries frames sourced by dozens of downstream hosts, so seeing 40 MACs on that uplink reflects normal aggregation rather than a MAC-flooding attack.
Broadcast domains follow VLANs, not switches: Each VLAN is one isolated Layer 2 broadcast domain, and routers never forward Layer 2 broadcasts between subnets. Two 24-port switches each hosting two distinct local VLANs (four VLANs total) create four separate broadcast domains, because broadcast scope follows VLAN boundaries rather than physical chassis or port counts.
Frame arrives on Port 1: [Dst: MAC_B | Src: MAC_A | ...]
1) Learn: FDB[MAC_A] = Port 1 (reset aging timer)
2) Lookup MAC_B in FDB (within same VLAN):
+-- Found on Port 5 --> Forward ONLY out Port 5
+-- Unknown or bcast --> Flood out all OTHER ports in VLANWhen not to keep a flat Layer 2 domain: Leaving an entire site in one switch broadcast domain works in a small lab, but fails as headcount grows: every ARP and mDNS broadcast wakes every host, and one misbehaving NIC or loop saturates every closet. Segment networks into VLANs and routed subnets once host counts, broadcast noise, or trust boundaries require isolation.
04. Check your understanding
05. Apply it
You must link a branch switch 280 m away in a separate building at 10 Gb/s and power six 22 W PoE+ access points inside that branch switch. Specify the inter-building medium and optic type, pick the PoE standard and minimum total PoE budget with 20% headroom (and note how class-based 30 W reservation changes the chassis calculation), and explain how you would separate rising rx_crc_errors, climbing carrier_changes, and rx_power overload in ethtool diagnostics.
Next, build a real software switch in the Linux bridge lab to observe MAC learning and unknown-unicast flooding directly on the wire.
06. Review prompt
Explain why standard copper fails between buildings even below 100 m, how carrier_changes, rx_crc_errors, and DOM rx_power distinguish dirty connectors from link flaps and receiver overload, why asymmetric routing causes unicast flooding when FDB aging is shorter than ARP lifetimes, and why broadcast domains follow VLAN boundaries.
References
Your progress
Reading state
Sign in to save that you finished reading this lesson.
Prove this skill
10 questions · about 8 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.