Introduction to Routing and Switching
Fundamentals, key concepts, and typical device roles in modern IP networks.
1. Overview
| Layer (OSI) |
Primary Function |
Typical Devices |
Core Purpose |
| Layer 2 – Data Link |
Forward frames based on MAC addresses within a single broadcast domain. |
Switches, bridges, NICs |
Local‑area connectivity, VLAN segmentation. |
| Layer 3 – Network |
Forward packets based on IP addresses across multiple broadcast domains. |
Routers, Layer‑3 switches, firewalls |
Inter‑network communication, path selection, traffic control. |
Routing and switching together create a scalable, resilient network that can move data efficiently from a source host to a destination host, whether they are on the same LAN or across the globe.
2. Switching Fundamentals
2.1 Basic Operation
- Frame Reception – Switch receives an Ethernet frame on a port.
- MAC Learning – Source MAC → port mapping is stored in the CAM (Content‑Addressable Memory) table.
- Forwarding Decision
- Known Destination MAC → forward out the specific port.
- Unknown Destination MAC → flood to all ports in the same VLAN (except the incoming port).
- Loop Prevention – Spanning Tree Protocol (STP) disables redundant links to avoid broadcast storms.
2.2 Key Features
| Feature |
Description |
Benefit |
| VLANs (Virtual LANs) |
Logical segmentation of a switch into separate broadcast domains. |
Improves security, reduces broadcast traffic. |
| Trunking (802.1Q) |
Carries multiple VLANs over a single link using tags. |
Efficient use of uplink bandwidth. |
| Port Security |
Limits MAC addresses per port, can shut down ports on violation. |
Mitigates MAC‑spoofing attacks. |
| Link Aggregation (LACP) |
Bundles multiple physical links into one logical link. |
Increases bandwidth, provides redundancy. |
| Quality of Service (QoS) |
Prioritizes traffic (e.g., voice, video). |
Guarantees performance for latency‑sensitive apps. |
2.3 Switch Types
| Type |
Typical Use |
Notable Traits |
| Unmanaged Switch |
Small offices, home labs. |
Plug‑and‑play, no configuration. |
| Managed Switch |
Enterprise LANs. |
CLI/GUI/REST API, VLANs, STP, QoS. |
| Layer‑3 Switch |
Campus core/aggregation. |
Hardware‑based routing, high‑speed inter‑VLAN routing. |
| PoE Switch |
Powering IP phones, APs, cameras. |
Supplies up to 30 W per port (IEEE 802.3bt). |
3. Routing Fundamentals
3.1 Basic Operation
- Packet Reception – Router receives an IP packet on an interface.
- Lookup – Destination IP is matched against the routing table.
- Forwarding Decision – Selects the best route (longest‑prefix match, lowest metric).
- Encapsulation – Packet is placed in a new frame appropriate for the outgoing interface.
- Transmission – Frame is sent out the selected interface.
3.2 Routing Table Components
| Entry Type |
Description |
| Directly Connected |
Networks attached to router interfaces (e.g., 192.168.1. |