Networking Basics ยท 6
๐ Switching & MAC Addresses
How data finds the right device inside your networkโฑ ~2 min
๐ขThe smart office receptionist
Imagine an office where a receptionist sits at the front desk. The first time someone asks for 'Alice in Accounting,' the receptionist announces it over the intercom. But after Alice walks past, the receptionist remembers: 'Alice is at desk 14.' Next time, they send the visitor directly there โ no intercom needed. A network switch works exactly the same way, learning which device is on which port and delivering frames directly.
MAC Addresses โ the hardware fingerprint
- โขEvery network card (wired or wireless) has a MAC address assigned by the manufacturer โ stored in firmware, not truly 'burned in' (it can be changed in software, which is called MAC spoofing)
- โขFormat: 6 pairs of hex digits โ AA:BB:CC:DD:EE:FF
- โขFirst 3 bytes (OUI) = manufacturer. Last 3 bytes = unique device ID
- โขAA:BB:CC = made by, say, Intel. DD:EE:FF = the specific card number
- โขUnlike IP addresses, MACs don't change when you move networks (usually)
How a Switch Learns (MAC Table)
- 1.Device A sends a frame from port 1 โ switch records 'A's MAC = port 1'
- 2.Switch looks up destination MAC in its table
- 3.Known destination โ delivers directly to that port only
- 4.Unknown destination โ floods all ports (except where it came from)
- 5.Over time, switch builds a complete table โ no more flooding needed
Hub (old, avoid!)
- โขSends every packet to EVERY port
- โขEvery device sees all traffic
- โขA hacker on one port sees everything
- โขCreates massive collision domains
- โขAlmost never used today
Switch (modern)
- โขSends frames only to destination port
- โขDevices only see their own traffic
- โขMuch harder for attackers to sniff
- โขSeparate collision domain per port
- โขThe standard in all modern networks
VLANs โ virtual separation on one physical switch
- โขVLAN 10 = Students, VLAN 20 = Teachers โ logically separated even on the same switch
- โขTraffic between VLANs must go through a router (inter-VLAN routing)
- โขA student on VLAN 10 cannot reach a server on VLAN 20 without a router allowing it
- โขHuge security tool โ isolates printers, cameras, guest WiFi, critical servers
๐ SecurityMAC Flooding Attack: An attacker floods the switch with thousands of fake MAC addresses, filling up the MAC table. When the table is full, the switch panics and starts acting like a hub โ sending every frame to every port. Now the attacker can capture all traffic. Defense: enable port security to limit MACs per port.
๐ง Quick Checkfirst try = +5 XP
A switch receives a frame destined for MAC address FF:FF:FF:FF:FF:FF. What does it do?
๐ฎ Practice what you learned
โญ 0 XP๐ฅ 0 days