Network Devices: Repeaters, Hubs, Bridges, Switches, and Routers
Switch: The Modern Layer 2 Workhorse
Read aloud is unavailable in this browser.
The Switch: Foundation of Modern Networks
The network switch represents the triumphant evolution of bridge technology—taking the fundamental concepts of MAC-based forwarding and transforming them into the ubiquitous, high-performance devices that form the backbone of virtually every modern network.
From the smallest home network to the largest data center, switches provide the critical function of connecting devices and forwarding frames at speeds that would have been unimaginable to early network designers. Modern switches handle billions of frames per second, support dozens of ports at multiple speeds, implement sophisticated VLAN architectures, and provide the foundation for enterprise networking—all at price points that have made them commodity devices.
The switch's dominance is so complete that the term has become synonymous with 'Local Area Network device.' Today, whether you're connecting a laptop, a server, or a wireless access point, you're almost certainly connecting to a switch.
This page provides comprehensive coverage of network switches—their internal architecture, hardware forwarding mechanisms, switching fabric designs, full-duplex operation, microsegmentation benefits, VLAN capabilities, management features, and the various types of switches deployed across different network tiers.
Switch Architecture Fundamentals
A network switch is a multi-port Layer 2 device that forwards frames based on MAC addresses—functionally identical to a bridge, but with hardware-optimized performance, higher port density, and advanced features. The key architectural difference from software-based bridges is the use of specialized hardware for real-time forwarding.
Core Switch Components:
┌─────────────────────────────────────────────────────────────────────┐
│ Switch Internal Architecture │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ Port 1 │ │ Port 2 │ │ Port 3 │ │ Port N │ │
│ │ PHY │ │ PHY │ │ PHY │ │ PHY │ Port Interface │
│ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ (Transceivers) │
│ │ │ │ │ │
│ ┌────┴────┐ ┌───┴────┐ ┌───┴────┐ ┌───┴────┐ │
│ │ MAC │ │ MAC │ │ MAC │ │ MAC │ MAC Layer │
│ │ Engine │ │ Engine │ │ Engine │ │ Engine │ Processing │
│ └────┬────┘ └───┬────┘ └───┬────┘ └───┬────┘ │
│ │ │ │ │ │
│ └──────────┴────┬─────┴──────────┘ │
│ │ │
│ ┌────────┴────────┐ │
│ │ Switching ASIC │ Hardware Forwarding │
│ │ │ Engine │
│ │ ┌─────────────┐ │ │
│ │ │ MAC Address │ │ │
│ │ │ Table │ │ │
│ │ │ (CAM/TCAM) │ │ │
│ │ └─────────────┘ │ │
│ │ ┌─────────────┐ │ │
│ │ │ Switching │ │ │
│ │ │ Fabric │ │ │
│ │ └─────────────┘ │ │
│ └────────┬────────┘ │
│ │ │
│ ┌────────┴────────┐ │
│ │ Management CPU │ Configuration, │
│ │ (Optional) │ SNMP, CLI, Web UI │
│ └─────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ Packet Buffers (Memory) │ │
│ └─────────────────────────────────────────────────────────────┘ │
│ │
│ [Power Supply] [Status LEDs] [Console Port]│
└─────────────────────────────────────────────────────────────────────┘
- •Port Interfaces (PHY) — Physical layer transceivers for each port. Support various media types (copper, fiber) and speeds (10/100/1000 Mbps, 10/25/40/100 Gbps). Handle signal conditioning, encoding, and link negotiation.
- •MAC Engines — Per-port circuitry that processes frame headers, extracts MAC addresses, and interfaces with the switching ASIC. May include ingress/egress queuing.
- •Switching ASIC — The heart of the switch. Application-Specific Integrated Circuit designed exclusively for frame forwarding. Performs MAC table lookups in nanoseconds.
- •MAC Address Table (CAM) — Content Addressable Memory storing MAC-to-port mappings. Enables O(1) lookup time regardless of table size. Typically stores thousands to millions of addresses.
- •Switching Fabric — Internal interconnect allowing any port to communicate with any other port simultaneously. Various architectures: crossbar, shared memory, or combined.
- •Packet Buffers — Memory for temporarily storing frames during congestion. Crucial for handling speed mismatches and traffic bursts.
- •Management CPU — General-purpose processor for configuration, monitoring, and protocol processing (Spanning Tree, SNMP). Present in managed switches; absent in unmanaged switches.
Hardware-Based Forwarding
The defining characteristic that separates switches from software-based bridges is hardware-accelerated forwarding. Switches perform frame forwarding in dedicated silicon at wire speed—meaning they can process frames as fast as they arrive without creating bottlenecks.
Content Addressable Memory (CAM):
The MAC address table in a switch is implemented using CAM—a specialized memory type that performs parallel searches across all entries simultaneously:
Traditional RAM (Software Bridge): CAM (Hardware Switch):
───────────────────────────────── ─────────────────────────
Search: "Find MAC AA:BB:CC:DD:EE:FF" Search: "Find MAC AA:BB:CC:DD:EE:FF"
Step 1: Read entry 0, compare ─ No match All entries searched simultaneously!
Step 2: Read entry 1, compare ─ No match ┌────────────────────────────────┐
Step 3: Read entry 2, compare ─ No match │ Entry 0: No match │
... │ Entry 1: No match │
Step N: Read entry N, compare ─ MATCH! │ Entry 2: No match │
│ ... │
Time: O(n) - linear with table size │ Entry N: MATCH! → Port 5 │
└────────────────────────────────┘
Time: O(1) - constant, regardless
of table size (~10-100 nanoseconds)
Wire-Speed Forwarding:
Modern switches achieve non-blocking, wire-speed forwarding—every port can simultaneously transmit and receive at full capacity without congestion in the switch fabric.
Example calculation for a 48-port Gigabit switch:
Forwarding Requirements:
─────────────────────────
Ports: 48 × 1 Gbps = 48 Gbps total port bandwidth
Full Duplex: 48 Gbps TX + 48 Gbps RX = 96 Gbps total
Minimum frame size: 64 bytes = 512 bits
Line rate at 1 Gbps: 1,000,000,000 bps ÷ 512 bits = ~1.95 million frames/sec
Per port (64-byte frames): 1.488 million packets per second (Mpps)
Total switch capacity required:
48 ports × 1.488 Mpps = 71.4 Mpps for wire-speed forwarding
Modern enterprise switches easily exceed 100-300 Mpps.
Data center switches exceed 1-10 billion packets per second (Bpps).
Forwarding Methods in Switches:
| Method | Operation | Latency | Error Handling | Use Case |
|---|---|---|---|---|
| Store-and-Forward | Buffer entire frame, validate CRC, then forward | Higher (~10-30 μs) | Complete validation | Default for most managed switches |
| Cut-Through | Forward after reading destination MAC | Lower (~2-10 μs) | No CRC validation | Latency-sensitive environments |
| Fragment-Free | Forward after 64 bytes (collision window) | Medium (~5-15 μs) | Catches runts | Balance of latency and error filtering |
| Adaptive | Switches between store-and-forward and cut-through based on error rates | Variable | Intelligent | High-end enterprise switches |
Different switches use different forwarding technologies. ASICs (custom chips) offer highest performance but are fixed-function. FPGAs (Field-Programmable Gate Arrays) allow feature updates but are more expensive. NPUs (Network Processing Units) provide programmability for software-defined networking. Enterprise switches typically use ASICs; data center switches increasingly use programmable alternatives.
Switching Fabric Architectures
The switching fabric is the internal interconnection system that allows frames to travel from any ingress port to any egress port. The fabric architecture determines the switch's capacity, scalability, and whether it can achieve non-blocking performance.
Shared Memory Architecture:
┌────────────────────────────────────────────────────────┐
│ Shared Memory Switch │
├────────────────────────────────────────────────────────┤
│ │
│ Port 1 ─────────┐ │
│ Port 2 ─────────┤ │
│ Port 3 ─────────┼───► [Central Buffer Memory] ◄──────┤
│ Port 4 ─────────┤ (All frames stored here) │
│ Port N ─────────┘ │
│ │
│ Simple architecture, limited scalability │
│ Memory bandwidth becomes bottleneck │
│ Common in small, inexpensive switches │
└────────────────────────────────────────────────────────┘
Crossbar (Crosspoint) Architecture:
┌────────────────────────────────────────────────────────┐
│ Crossbar Switch Fabric │
├────────────────────────────────────────────────────────┤
│ │
│ Output Ports │
│ 1 2 3 4 │
│ │ │ │ │ │
│ 1 ───●────○────○────○ ● = Active connection │
│ I │ │ │ │ ○ = Inactive crosspoint │
│ n │ │ │ │ │
│ p 2 ───○────●────○────○ Each input can connect│
│ u │ │ │ │ to any output │
│ t │ │ │ │ │
│ s 3 ───○────○────●────○ Multiple simultaneous │
│ │ │ │ │ connections possible │
│ P │ │ │ │ │
│ o 4 ───○────○────○────● Non-blocking when no │
│ r │ │ │ │ contention │
│ t │
│ s │
│ │
│ High performance, scalable, parallel transfers │
│ Common in enterprise and data center switches │
└────────────────────────────────────────────────────────┘
| Architecture | Scalability | Cost | Performance | Use Case |
|---|---|---|---|---|
| Shared Memory | Low (4-24 ports) | Low | Memory bandwidth limited | Home/SOHO switches |
| Shared Bus | Medium (24-48 ports) | Medium | Bus bandwidth limited | Small enterprise |
| Crossbar | High (48-400+ ports) | Higher | Non-blocking possible | Enterprise/Data center |
| Multi-Stage (Clos) | Very High (chassis) | Highest | Terabits per second | Data center spine/leaf |
Non-Blocking vs. Blocking:
A switch is non-blocking if it can forward frames across all ports simultaneously at full line rate without any internal congestion. A blocking switch has internal bandwidth limitations that prevent simultaneous full-speed operation of all ports.
Example:
24-port Gigabit Switch Analysis:
─────────────────────────────────
Full Duplex Requirement:
24 ports × 1 Gbps × 2 (full duplex) = 48 Gbps switching capacity
Switch A: 48 Gbps fabric = Non-blocking
All ports can operate at full speed simultaneously
Switch B: 24 Gbps fabric = 2:1 Blocking (oversubscription)
If all ports transmit simultaneously, half the traffic is queued
Real-world impact depends on traffic patterns
Switch C: 12 Gbps fabric = 4:1 Blocking (severe oversubscription)
Significant queuing under moderate load
Acceptable only for lightly-loaded edges
Data center switches typically require non-blocking fabrics. Edge switches may tolerate oversubscription ratios of 2:1 or higher since edge devices rarely sustain full line rate.
Full-Duplex and Microsegmentation
Two capabilities fundamentally differentiate switches from hubs and traditional shared-medium networks: full-duplex operation and microsegmentation. Together, these provide dramatic performance improvements.
Full-Duplex Operation:
In half-duplex mode (hubs, early bridges), a device can either transmit OR receive at any moment—not both. Collisions occur when devices attempt simultaneous transmission.
Full-duplex eliminates this limitation:
Half-Duplex (Hub-based): Full-Duplex (Switch-based):
───────────────────────── ───────────────────────────
Device A Device A
┌───────┐ ┌───────┐
│ │──TX──► │ │──TX──►●──►│
│ │ ┌───┐ │ │ │ Port 1
│ │◄─RX──│HUB│ │ │◄─RX──●◄─│
└───────┘ └───┘ └───────┘
│ Simultaneous!
When A transmits, │
A cannot receive Device B
(and vice versa) ┌───────┐
│ │──TX──►●──►│
Collisions possible │ │ │ Port 2
CSMA/CD required │ │◄─RX──●◄─│
└───────┘
Effective bandwidth:
10 Mbps shared half-duplex Effective bandwidth:
= ~4-5 Mbps practical 10 Mbps TX + 10 Mbps RX
= 20 Mbps per port
No collisions possible!
Microsegmentation:
Microsegmentation takes collision domain segmentation to its logical extreme: each switch port is its own collision domain with exactly one device.
| Network Type | Collision Domain Size | Devices per Domain | Collisions |
|---|---|---|---|
| Hub network | Entire network | All devices | Frequent |
| Bridged network | Per segment | Multiple devices | Reduced |
| Switched network | Per port | One device | Eliminated* |
*When connected to single end device. A hub attached to a switch port recreates a shared collision domain on that port.
Benefits of Microsegmentation:
- •Collision Elimination — With only one device per collision domain, collisions cannot occur. CSMA/CD is effectively disabled.
- •Dedicated Bandwidth — Each device receives full port bandwidth rather than sharing with other devices.
- •Deterministic Performance — Without collision overhead, network latency becomes predictable and consistent.
- •Full-Duplex Enablement — Single-device segments allow full-duplex operation, doubling theoretical throughput.
- •Auto-Negotiation Flexibility — Each port independently negotiates speed and duplex with its connected device.
- •Isolation of Faults — A malfunctioning device affects only its port, not the entire network segment.
With full-duplex switched connections, the CSMA/CD protocol that defined Ethernet for decades becomes irrelevant. Modern Gigabit and faster Ethernet standards do not even require CSMA/CD support for full-duplex links. The classic carrier sensing and collision detection that students learn about is essentially historical in contemporary networks.
VLANs and Logical Segmentation
While switches segment collision domains, they do NOT inherently segment broadcast domains. All ports on a switch, by default, share one broadcast domain—broadcasts flood to all ports. Virtual LANs (VLANs) provide logical broadcast domain segmentation within a single physical switch.
The Broadcast Domain Problem:
Without VLANs, a large switched network exhibits problematic behavior:
- ARP broadcasts from thousands of devices flood everywhere
- DHCP discovery packets reach all segments
- NetBIOS name resolution traffic fills the network
- Broadcast storms have maximum blast radius
- No security isolation between departments
VLAN Solution:
VLANs create multiple logical LANs within one physical switch:
Single Physical Switch
┌─────────────────────────────────────────────────────┐
│ │
│ VLAN 10 (Sales) VLAN 20 (Engineering) │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ Broadcast │ │ Broadcast │ │
│ │ Domain 1 │ │ Domain 2 │ │
│ └─────────────┘ └─────────────┘ │
│ │
│ Port 1: VLAN 10 Port 5: VLAN 20 │
│ Port 2: VLAN 10 Port 6: VLAN 20 │
│ Port 3: VLAN 10 Port 7: VLAN 20 │
│ Port 4: VLAN 10 Port 8: VLAN 20 │
│ │
│ Sales PCs see only other Sales PCs │
│ Engineering PCs see only other Engineering PCs │
│ Broadcast traffic isolated within VLAN │
└─────────────────────────────────────────────────────┘
- •Broadcast Containment — Broadcasts stay within their VLAN, reducing unnecessary traffic on other segments.
- •Security Isolation — Devices in different VLANs cannot communicate at Layer 2. Inter-VLAN communication requires a router, enabling access control.
- •Logical Grouping — Group users by function, project, or security level regardless of physical location.
- •Simplified Administration — Move users between VLANs via configuration rather than physical rewiring.
- •Spanning Tree Per-VLAN — Each VLAN can have its own loop-free topology, enabling load balancing.
- •QoS Policy Application — Apply traffic prioritization policies per-VLAN for different service levels.
802.1Q VLAN Tagging:
To carry multiple VLANs over a single cable (trunk), frames are tagged with VLAN identification:
Standard Ethernet Frame:
┌──────────┬────────┬───────────┬─────────┬─────┐
│ Dest MAC │ Src MAC│ Type/Len │ Payload │ FCS │
└──────────┴────────┴───────────┴─────────┴─────┘
802.1Q Tagged Frame:
┌──────────┬────────┬───────────┬───────────┬─────────┬─────┐
│ Dest MAC │ Src MAC│ 802.1Q Tag│ Type/Len │ Payload │ FCS │
└──────────┴────────┴───────────┴───────────┴─────────┴─────┘
│
▼
┌─────────────────┐
│ TPID: 0x8100 │ Tag Protocol Identifier
│ PCP: 3 bits │ Priority Code Point (QoS)
│ DEI: 1 bit │ Drop Eligible Indicator
│ VID: 12 bits │ VLAN ID (1-4094)
└─────────────────┘
VLAN ID Range: 0-4095 (12 bits)
0 = Priority tag only (no VLAN)
1 = Default VLAN
2-4094 = Usable VLANs
4095 = Reserved
Access ports strip tags for end devices; trunk ports carry tagged frames between switches.
Switch Types and Classifications
Switches are classified along multiple dimensions: management capability, network tier, form factor, and speed/port configuration. Understanding these classifications helps in selecting appropriate switches for different network roles.
Management Classification:
| Type | Configuration | Monitoring | Features | Use Case |
|---|---|---|---|---|
| Unmanaged | None (plug-and-play) | LEDs only | Basic forwarding only | Home, small office, temporary |
| Smart/Web-Managed | Web interface only | Basic port stats | VLANs, QoS, port security | Small business |
| Managed (L2) | CLI, Web, SNMP | Full RMON, sFlow | Full L2 features, spanning tree | Enterprise edge |
| Managed (L3) | CLI, Web, SNMP, automation | Full monitoring | L2 + routing, ACLs, policies | Enterprise core, data center |
Network Tier Classification:
┌─────────────────────────────────────┐
│ Data Center │
│ ┌───────────────────────────┐ │
│ │ Core Switches │ │ High-end, high-speed,
│ │ (Spine Layer in Leaf-Spine)│ │ chassis-based or
│ │ 100-400 Gbps ports │ │ modular
│ └─────────────┬─────────────┘ │
│ │ │
│ ┌─────────────┼─────────────┐ │
│ │ │ │ │
│ ┌─┴───┐ ┌──┴──┐ ┌──┴──┐ │ Aggregation/Distrib.
│ │Aggr │ │Aggr │ │Aggr │ │ 10-100 Gbps uplinks
│ └──┬──┘ └──┬──┘ └──┬──┘ │ PoE, advanced features
│ │ │ │ │
│ ┌──┴──┐ ┌──┴──┐ ┌──┴──┐ │ Edge/Access
│ │Edge │ │Edge │ │Edge │ │ 1-10 Gbps to devices
│ │24-48│ │24-48│ │24-48│ │ PoE for phones, APs
│ └──┬──┘ └──┬──┘ └──┬──┘ │
│ │ │ │ │
│ Servers Servers Servers │
└─────────────────────────────────────┘
Form Factor:
- •Fixed Configuration — Integrated switch with fixed port count and type. Examples: 24-port, 48-port desktop switches. Cost-effective but not expandable.
- •Stackable — Multiple fixed switches combined into single logical unit. Shared management, single MAC table. Common in enterprise access layer.
- •Modular/Chassis — Backbone unit with slots for interchangeable line cards. Highest flexibility and density. Premium price. Examples: Cisco Catalyst 9400, Arista 7500.
- •Rack-Mount (1U-4U) — Standard 19" rack-mounted units. Most common enterprise form factor. 1U for edge, 2-4U for high-density or PoE.
- •Desktop — Small form factor for office/home use. Often unmanaged. Fanless for quiet operation.
- •Industrial — Hardened switches for harsh environments. Extended temperature range, DIN rail mounting, redundant power.
Layer 2 switches forward based on MAC addresses only. Layer 3 switches (also called 'multilayer switches') can also route based on IP addresses. L3 switches combine switch performance with router functionality, eliminating the need for separate routers in many topologies. Most enterprise switches today are L3-capable.
Advanced Switch Features
Modern managed switches incorporate sophisticated features that extend far beyond basic MAC-based forwarding. These capabilities enable enterprise-grade security, traffic engineering, and network operations.
Security Features:
- •802.1X Port Authentication — Devices must authenticate before network access. Integrates with RADIUS servers. Can assign VLAN based on user identity.
- •Port Security — Limits which MAC addresses can use a port. Prevents unauthorized device connection. Can sticky-learn or define static MACs.
- •DHCP Snooping — Validates DHCP messages, prevents rogue DHCP servers. Builds trusted binding table of IP-to-MAC-to-port mappings.
- •Dynamic ARP Inspection (DAI) — Validates ARP packets against DHCP snooping table. Prevents ARP spoofing attacks.
- •IP Source Guard — Ensures traffic comes from legitimate IP addresses. Prevents IP spoofing at access layer.
- •Private VLANs — Isolates ports within same VLAN from each other. Useful for hotel, DMZ, and multi-tenant scenarios.
- •Storm Control — Rate-limits broadcast, multicast, or unknown unicast traffic. Prevents broadcast storms from propagating.
Quality of Service (QoS):
Switches classify and prioritize traffic to ensure critical applications receive appropriate resources:
| QoS Mechanism | Description | Implementation |
|---|---|---|
| Classification | Identify traffic type | DSCP, CoS, ACL matching |
| Marking | Apply priority labels | 802.1p (CoS), DSCP |
| Queuing | Assign packets to queues | Per-port multiple queues |
| Scheduling | Determine transmission order | Strict priority, WRR, DWRR |
| Policing | Enforce rate limits | Token bucket algorithm |
| Shaping | Smooth traffic bursts | Buffer and meter output |
Spanning Tree Protocol (STP):
Redundant paths in a switched network create loops that cause broadcast storms. STP (IEEE 802.1D) and its modern variants (RSTP 802.1w, MSTP 802.1s) prevent loops by blocking redundant paths:
- Elects a root bridge for the topology
- Calculates shortest paths to root
- Blocks redundant paths to create loop-free tree
- Activates blocked paths upon failure (convergence)
Modern alternatives include:
- Rapid PVST+: Per-VLAN spanning tree with fast convergence
- MSTP: Multiple spanning trees for VLAN groups
- Loop Guard/BPDU Guard: Protect against misconfiguration
- SDN-based: Controller-managed loop prevention
Switches can bundle multiple physical links into a single logical link using Link Aggregation (802.3ad/802.1AX). This provides bandwidth multiplication (4 × 1 Gbps = 4 Gbps) and redundancy (surviving link failures). Link Aggregation Control Protocol (LACP) dynamically negotiates and maintains aggregated links.
KEEP LEARNING
Keep learning for free.
Read the complete lesson, save your notes and pick up where you left off with a free account. No card needed.