LAN — Local Area Networks

Deep dive into LAN topologies, Ethernet frames, WiFi standards, and LAN security threats.

Easy 40m 4 tasks
Prerequisites: What Is a Network?

Learning Objectives

  • Compare Star, Bus, and Ring topologies with security trade-offs
  • Read the structure of an Ethernet frame
  • Identify WiFi 802.11 standards and their differences
  • Recognise passive sniffing, ARP spoofing and MAC flooding

A Local Area Network (LAN) is a group of devices connected together within a limited geographic area — a home, office, school, or data centre floor. Everything you do on the internet first crosses your LAN before reaching the wider world.

Understanding LANs is foundational for security work because most internal attacks happen at Layer 2 — the Ethernet/WiFi layer — before any IP packet is even inspected.


LAN Topologies

A topology describes how devices are physically and logically connected. Topology choice affects performance, fault tolerance, and security exposure.

Star Topology

   Device A
      |
   [Switch]──── Device B
      |
   Device C
  • Every device connects directly to a central switch.
  • Advantage: One cable failure isolates only that device.
  • Disadvantage: The switch is a single point of failure — if it goes down, the whole network goes down.
  • Security implication: Traffic between two devices passes through the switch, which filters frames by MAC address. Passive sniffing from another port is prevented unless the attacker uses ARP spoofing or MAC flooding.

Bus Topology

Device A ── Device B ── Device C ── Device D
            (shared backbone)
  • All devices share a single cable (the bus/backbone).
  • Legacy — mostly replaced by star topology.
  • Security risk: Every device sees every packet. A compromised device can passively capture all LAN traffic without sending a single packet — completely invisible to detection.

Ring Topology

Device A ──► Device B
  ▲                ▼
Device D ◄── Device C
  • Data travels in one direction around a loop using token passing — only the device holding the token can transmit.
  • Advantage: No collisions.
  • Disadvantage: One failure breaks the ring unless dual-ring redundancy (FDDI) is used.
  • Security implication: Token capture could theoretically deny others the ability to transmit.

Mesh Topology

  • Every device connects directly to every other device.
  • Full mesh: Maximum redundancy, extreme cabling cost.
  • Partial mesh: Used in backbone networks (e.g. between routers).
  • Security benefit: No single point of failure.
Topology Fault Tolerance Cost Security Risk
Star Medium (switch SPOF) Medium ARP spoofing, MAC flooding
Bus Low (backbone SPOF) Low Passive sniffing
Ring Low (single loop) Medium Token hijacking
Mesh High High Minimal topology risk

Ethernet Frames

Ethernet is the Layer 2 protocol that carries data across a LAN. Every packet on a wired LAN is wrapped in an Ethernet frame.

Frame Structure

┌──────────────┬──────────────┬──────┬──────────────────────┬─────┐
 Dest MAC (6)  Src MAC (6)   Type  Payload (461500 B)   FCS 
    bytes         bytes      (2B)                        (4B)
└──────────────┴──────────────┴──────┴──────────────────────┴─────┘
Field Size Purpose
Destination MAC 6 bytes Who should receive this frame
Source MAC 6 bytes Who sent it
EtherType 2 bytes What's inside (0x0800 = IPv4, 0x0806 = ARP, 0x86DD = IPv6)
Payload 46–1500 bytes The actual data (IP packet)
FCS 4 bytes CRC checksum for error detection

MAC Addresses

A MAC (Media Access Control) address is a 48-bit hardware identifier burned into every NIC.

00:1A:2B:3C:4D:5E
└──────┘ └────────┘
 OUI       Device ID
(vendor)
  • The first 3 bytes identify the manufacturer (OUI — Organisationally Unique Identifier).
  • You can look up any OUI at ieee.org/regauth.
  • MAC addresses operate at Layer 2 and are not routed across networks.
  • Attackers can spoof MAC addresses in software — they are not a reliable authentication mechanism.

How a Switch Learns MACs

1. Device A sends a frame
2. Switch records: Port 1  MAC of Device A  (learning)
3. Switch looks up destination MAC in CAM table
4. If found  forward only to that port  (unicast forwarding)
5. If not found  flood to all ports     (unknown unicast flood)

The CAM table (Content Addressable Memory) is the switch's MAC-to-port lookup table. Understanding it is essential for understanding MAC flooding attacks.


WiFi — 802.11 Standards

WiFi is the wireless extension of Ethernet at Layer 2. The 802.11 standard family defines how wireless devices communicate.

Standards Overview

Standard WiFi Name Max Speed Frequency Release
802.11a 54 Mbps 5 GHz 1999
802.11b WiFi 1 11 Mbps 2.4 GHz 1999
802.11g WiFi 3 54 Mbps 2.4 GHz 2003
802.11n WiFi 4 600 Mbps 2.4/5 GHz 2009
802.11ac WiFi 5 3.5 Gbps 5 GHz 2013
802.11ax WiFi 6/6E 9.6 Gbps 2.4/5/6 GHz 2019

Frequency Bands

2.4 GHz:
- Longer range, better wall penetration.
- Only 3 non-overlapping channels (1, 6, 11).
- Crowded — used by microwaves, Bluetooth, baby monitors.
- Higher interference risk.

5 GHz:
- Shorter range, faster speeds.
- 23 non-overlapping channels.
- Less congested.

6 GHz (WiFi 6E):
- New band, fewest devices, lowest interference.
- Best performance in dense environments.

WiFi Security Protocols

Protocol Year Encryption Status
WEP 1997 RC4 (weak) Broken — never use
WPA 2003 TKIP Deprecated
WPA2 2004 AES-CCMP Current standard
WPA3 2018 AES-GCMP + SAE Recommended

WEP can be cracked in minutes with aircrack-ng — it is cryptographically broken.
WPA2 with a weak passphrase is vulnerable to offline dictionary attacks after capturing a 4-way handshake.
WPA3 uses SAE (Simultaneous Authentication of Equals) — resistant to offline dictionary attacks.


LAN Security Threats

ARP Spoofing (ARP Poisoning)

ARP has no authentication — any device can send a fake ARP reply.

Attack flow:
1. Attacker sends fake ARP reply: "192.168.1.1 is at MY-MAC"
2. Victim updates ARP cache: 192.168.1.1 → Attacker MAC
3. All traffic to 192.168.1.1 now goes to attacker first
4. Attacker forwards it on → Man-in-the-Middle (MitM)

Tool: arpspoof, ettercap, bettercap

Defence:
- Dynamic ARP Inspection (DAI) on managed switches.
- Static ARP entries for critical hosts.
- Network monitoring for duplicate MAC addresses.

MAC Flooding

Attack flow:
1. Attacker floods switch with frames using random fake MACs
2. CAM table fills up (runs out of memory)
3. Switch fails open  behaves like a hub
4. All frames broadcast to all ports
5. Attacker captures all LAN traffic passively

Tool: macof (part of dsniff)

Defence:
- Port security — limit MAC addresses per switch port.
- 802.1X authentication — require authentication before a port activates.

Passive Sniffing

On a hub or bus network (or after a MAC flood), an attacker captures all traffic without transmitting a single packet.

# Capture all frames on interface eth0
tcpdump -i eth0 -nn
wireshark -i eth0

Defence: Use switches (not hubs), encrypt all traffic (TLS/VPN), use 802.1X.

Evil Twin (Rogue Access Point)

An attacker sets up a WiFi AP with the same SSID as a legitimate network. Devices auto-connect to the strongest signal.

Legitimate AP: "OfficeWifi" ──── Internet
Evil Twin AP:  "OfficeWifi" ──── Attacker's machine ──── Internet (inspected)

Defence: Certificate-based authentication (802.1X with EAP-TLS), monitor for rogue APs.


Key Takeaways

  • LAN topology determines attack surface — bus networks are trivially sniffable.
  • Ethernet frames carry MAC addresses that can be spoofed; never rely on MAC for authentication.
  • Switches are smarter than hubs but the CAM table is exploitable via MAC flooding.
  • WEP is dead — always use WPA2 or WPA3.
  • ARP has no security built in — DAI and monitoring are essential on managed networks.
  • Layer 2 attacks are stealthy — they operate below IP, making detection harder.

"Most enterprise breaches start on the LAN. A compromised workstation on the same switch as a server is extremely dangerous." — Common pentester observation.

A topology defines the physical layout of how devices connect on a LAN. The choice of topology affects speed, resilience, cost, and security.

⭐ Star Topology — the modern standard
Star Topology

Every device connects individually to a central switch. If one cable breaks, only that device is affected — the rest of the network keeps running.

✓ Advantages
  • One cable failure = only 1 device down
  • Easy to add or remove devices
  • Centralised troubleshooting
✗ Disadvantages
  • Switch is single point of failure
  • Most cabling — one run per device
  • Higher cost
⚠ Security: A compromised switch sees all frames on the LAN. Attacker with switch access can capture or redirect any traffic.
🚌 Bus Topology — legacy
Bus Topology

All devices share a single backbone cable. Every packet is broadcast to all devices — they must all check if the packet is addressed to them.

✓ Advantages
  • Cheapest cabling
  • Simple to set up for small labs
✗ Disadvantages
  • Single cable break = full network down
  • Collisions increase under load
  • Hard to diagnose faults
⚠ Security: Completely passive to sniff — any device can capture every packet with no configuration.
💜 Ring Topology — predictable but fragile
Ring Topology

Devices form a closed loop. A token circulates around the ring — only the device holding the token may transmit. This prevents collisions.

✓ Advantages
  • No collisions (token control)
  • Predictable, deterministic latency
  • Works well under heavy load
✗ Disadvantages
  • One break stops the whole ring
  • Adding a device interrupts the ring
  • Rarely used in modern networks
⚠ Security: Each node sees all frames as they pass through. A compromised node is a silent sniffer.
✦ Answer the questions to complete this task

In a Star topology, what happens if the central switch fails?

Which topology uses token passing to avoid collisions?

Why is a Bus topology a security risk?

Ethernet is the dominant Layer 2 protocol for wired LANs. Data is wrapped in frames before travelling the wire. Understanding frame structure is key for packet analysis.

Ethernet II Frame Structure
FieldSizePurpose
Destination MAC6 bytesWho should receive this frame
Source MAC6 bytesWho sent this frame
EtherType2 bytesProtocol inside (0x0800=IPv4, 0x0806=ARP, 0x86DD=IPv6)
Payload (Data)46–1500 bytesIP packet (or ARP, etc.)
FCS / CRC4 bytesError detection checksum
The Maximum Transmission Unit (MTU) for standard Ethernet is 1500 bytes of payload. Larger packets are fragmented at the IP layer.
# Capture raw Ethernet frames (requires root) sudo tcpdump -e -i eth0 # Decode an ARP frame # EtherType 0x0806 = ARP # Wireshark filter: show only ARP arp
✦ Answer the questions to complete this task

What is the maximum payload size in a standard Ethernet frame?

An EtherType value of 0x0800 means the payload contains:

What does the FCS field in an Ethernet frame provide?

WiFi is the wireless extension of a LAN. Devices connect to an Access Point (AP) which bridges the wireless segment to the wired switch.

WiFi Access Point Coverage
802.11 Standard Comparison
StandardAliasMax SpeedBandRange
802.11bWiFi 111 Mbps2.4 GHz~35 m indoor
802.11gWiFi 254 Mbps2.4 GHz~38 m indoor
802.11nWiFi 4600 Mbps2.4/5 GHz~70 m indoor
802.11acWiFi 53.5 Gbps5 GHz~35 m indoor
802.11axWiFi 69.6 Gbps2.4/5/6 GHz~30 m indoor
📡 2.4 GHz
  • Better range through walls
  • Only 3 non-overlapping channels
  • More interference (microwaves, Bluetooth)
  • Slower maximum speeds
📡 5 GHz
  • Much higher speeds
  • 23 non-overlapping channels
  • Less interference
  • Shorter range, poor wall penetration
⚠ Security: Open WiFi networks (no password) transmit all data in the clear. WPA2/WPA3 encrypts over-the-air traffic, but ARP spoofing attacks still work inside the LAN.
✦ Answer the questions to complete this task

Which WiFi standard is also known as WiFi 6?

The 2.4 GHz band has how many non-overlapping channels?

Even a private LAN is exposed to internal attacks. These threats require no internet access — an attacker on the same network segment can cause serious damage.

🎭 ARP Spoofing → Man-in-the-Middle

Attacker broadcasts fake ARP replies to poison victims' ARP caches. Victim's frames now route through the attacker's machine before reaching the gateway.

# Attacker runs arpspoof (Kali Linux) sudo arpspoof -i eth0 -t 192.168.1.10 192.168.1.1 # → Victim now sends all traffic through attacker

💥 MAC Flooding → CAM Table Overflow

Attacker sends thousands of frames with random fake MAC addresses, filling the switch's CAM table. The switch runs out of space and starts broadcasting all frames to all ports — like a hub.

# Tool: macof (sends ~155,000 fake MACs/min) sudo macof -i eth0 # → Switch overflows → all traffic visible to attacker

👂 Passive Sniffing

On a hub network or after MAC flooding, any device can read every packet. Tools like Wireshark or tcpdump capture all frames in promiscuous mode.

# Capture everything on the LAN sudo tcpdump -i eth0 -w capture.pcap # Open in Wireshark to analyse
Defences
ThreatDefence
ARP SpoofingDynamic ARP Inspection (DAI) on managed switches
MAC FloodingPort security — limit MACs per port (e.g. max 5)
Passive SniffingUse encrypted protocols (HTTPS, SSH, TLS)
All LAN attacksNetwork segmentation with VLANs
✦ Answer the questions to complete this task

MAC Flooding attacks the switch's:

After a successful MAC flood, the switch behaves like a:

Dynamic ARP Inspection (DAI) defends against:

💪 Exercises & Challenges

📝 MCQ Easy +25 XP

LAN Concepts Quiz

Test your understanding of LAN topologies, Ethernet frames, WiFi standards, and LAN security threats.

Start →
⚙️ Practical Easy +25 XP

Analyse Your LAN

Use command-line tools to inspect your local network topology, discover neighbours, and read Ethernet frame data.

Start →
🚩 Challenge Medium +50 XP

LAN Threat Identification Challenge

Analyse a network capture log and identify the attack type, then submit the correct flag.

Start →