Subtitle: A deep dive into core Layer 2 and Layer 3 operations—from VLANs, trunking, and STP to dynamic routing, NAT, FHRP, and frame sizes.
Routing and switching form the backbone of modern networking infrastructure. While switching controls local traffic flow across local area networks (LANs), routing directs data across different networks and subnet boundaries. Mastering these technologies is essential for passing the CompTIA Network+ (N10-009) exam and ensuring high availability, security, and performance in enterprise environments.
Below is an overview of the key concepts covered in this core Network+ domain.
1. Static vs. Dynamic Routing & Path Selection
Routers make forwarding decisions based on their routing tables. Network administrators populate these tables using two primary methods:
- Static Routing: Routes are manually entered by an administrator.
- Pros: Low CPU/RAM overhead, predictable paths, enhanced security, no bandwidth consumed by protocol updates.
Cons: Requires manual updates when topology changes, error-prone in large or complex environments.
Dynamic Routing: Protocols automatically discover remote networks, adjust routing tables, and adapt to link failures.
Types: Distance Vector (e.g., RIP) and Link-State (e.g., OSPF).
Pros: High adaptability, scales effortlessly across large networks.
Cons: Higher hardware resource consumption, potential exposure to rogue routing updates.
How Routers Choose the Best Route
When multiple paths to a destination exist, routers evaluate specific decision hierarchy metrics:
-
Longest Prefix Match: The most specific network mask is always preferred first (e.g., a
/28route beats a/24route). - Administrative Distance (AD): Evaluates the trustworthiness of the route source. Lower AD values win (e.g., Directly Connected = 0, Static = 1, OSPF = 110).
- Metric: Measures path cost (hops, bandwidth, delay) within a specific routing protocol. Lower metrics win.
2. Network Address Translation (NAT) & Port Address Translation (PAT)
Because private IPv4 addresses cannot traverse the public Internet, translation protocols enable internal networks to communicate externally:
- Static NAT: One-to-one mapping between a single private IP and a single public IP. Used for internally hosted public servers.
- Dynamic NAT: Maps private IPs to a pool of available public IPs on a first-come, first-served basis.
- PAT (Port Address Translation / NAT Overload): Maps multiple private IP addresses to a single public IP by tracking unique source port numbers. PAT is the most widely deployed translation method in modern networks.
3. First Hop Redundancy Protocols (FHRP) & Virtual IPs
To eliminate a single point of failure at the local default gateway, First Hop Redundancy Protocols (FHRP) allow two or more physical routers to share a single Virtual IP (VIP) and Virtual MAC address. End devices target the Virtual IP as their default gateway.
- HSRP (Hot Standby Router Protocol): Cisco proprietary protocol featuring an Active and Standby router pair.
- VRRP (Virtual Router Redundancy Protocol): An open-standard alternative to HSRP operating with a Master and Backup router model.
- GLBP (Gateway Load Balancing Protocol): Cisco proprietary protocol that provides gateway redundancy and active load balancing across multiple routers simultaneously.
4. VLANs, Subinterfaces, and Switch Configurations
Virtual Local Area Networks (VLANs) logically partition a physical switch at OSI Layer 2 into isolated broadcast domains without requiring separate physical hardware.
Key VLAN Types & Terminology
- Data/Access VLANs: Carry standard user-generated traffic.
- Voice VLAN: Dedicated, prioritized traffic lane configured with Quality of Service (QoS) to prevent latency and jitter on VoIP calls.
- Management VLAN: Isolated network segment specifically used for securely accessing switch CLI/web interfaces (e.g., via SSH).
- Native VLAN: Carries untagged traffic across an 802.1Q trunk link.
- Inter-VLAN Routing: Traffic passing between different VLANs must be routed at Layer 3. This is accomplished using Router-on-a-Stick (using logical Subinterfaces on a router) or a Layer 3 switch configured with Switch Virtual Interfaces (SVIs).
Switch Interface Features
- IEEE 802.1Q: The industry-standard protocol for tagging Ethernet frames with a VLAN ID as they pass over trunk links.
- Link Aggregation (LACP / EtherChannel): Combines multiple physical switch interfaces into a single logical link to increase bandwidth and provide link redundancy.
- Speed/Duplex Mismatches: Duplex or speed settings that do not match between connected interfaces result in late collisions, high latency, and severe packet loss.
5. Spanning Tree Protocol (STP)
Redundant links between switches are crucial for fault tolerance, but they create switching loops. Uncontrolled loops cause broadcast storms that can bring down a network within seconds.
- How STP Works: STP (IEEE 802.1D) dynamically blocks redundant paths to maintain a single, loop-free logical topology.
- Election Process: Switches elect a Root Bridge based on the lowest Bridge ID (BID), which combines switch Priority and MAC address.
- Port Roles: Non-root switches determine the shortest path to the Root Bridge. Ports along the best path are placed in Forwarding mode, while redundant ports are placed in Blocking mode.
6. Maximum Transmission Unit (MTU) & Fragmentation
The Maximum Transmission Unit (MTU) defines the largest protocol data unit (packet) a network interface can accept without segmenting it.
-
Standard Ethernet MTU:
1500 bytes. - Fragmentation: If a packet exceeds the path MTU, intermediate routers break it into smaller fragments (unless the IP header has the DF - Don't Fragment flag set, which drops the packet and sends back an ICMP error).
- IPv6 Constraint: IPv6 routers do not perform path fragmentation; end hosts must perform Path MTU Discovery (PMTUD).
-
Jumbo Frames: Frames supporting an MTU up to
9000 bytes. Commonly deployed in Storage Area Networks (SANs) and high-speed data centers to reduce CPU overhead.
Summary Key Takeaways
- PAT Uses Ports: Remember that PAT translates both IP addresses and port numbers, enabling thousands of hosts to share one public IP.
- STP Breaks Loops: STP prevents broadcast storms by electing a Root Bridge and blocking redundant switch ports.
- Subinterfaces Enable Inter-VLAN Routing: Router-on-a-Stick uses 802.1Q encapsulation on logical subinterfaces to route between VLANs over a single cable.
Top comments (0)