Skip to content
Computer Science · 10th Grade · Network Architecture and Web Systems · Weeks 19-27

Routing and Switching

Students learn how routers and switches direct network traffic, ensuring data reaches its intended destination.

Common Core State StandardsCSTA: 3A-NI-04

About This Topic

Routers and switches are the workhorses of network infrastructure, and understanding the difference between them is foundational for any student studying networking. Switches operate at the Data Link layer (OSI Layer 2) and direct frames within a local network using MAC addresses. Routers operate at the Network layer (OSI Layer 3) and connect separate networks using IP addresses and routing tables. US 10th-grade students studying CSTA Standard 3A-NI-04 need to understand how these devices work together to move data across both local and global networks.

Routing algorithms, including static routes and dynamic protocols like OSPF or BGP, decide the best path for each packet based on factors like cost, latency, and congestion. When a router fails, traffic must reroute dynamically, which is a critical feature of the internet's resilience. Students often struggle to visualize multi-hop routing decisions, making physical simulations with labeled cards and maps especially effective.

Active learning shines here because students can simulate packet routing with physical cards, argue about optimal paths, and experience the cascade of failures that occurs when a node goes down.

Key Questions

  1. Explain the difference between a router and a switch.
  2. Analyze how routing tables determine the best path for data packets.
  3. Predict the impact of a router failure on network connectivity.

Learning Objectives

  • Compare the functions of routers and switches in directing network traffic based on their operational layers and addressing schemes.
  • Analyze routing tables to determine the optimal path for data packets across interconnected networks.
  • Predict the consequences of router or switch failures on network connectivity and data transmission.
  • Design a simple network topology and explain how routers and switches would manage traffic flow within it.

Before You Start

Network Basics: IP and MAC Addressing

Why: Students need to understand the fundamental concepts of IP and MAC addresses to grasp how routers and switches use them for traffic direction.

OSI Model Layers

Why: Understanding the roles of the Data Link (Layer 2) and Network (Layer 3) layers is essential for differentiating between switch and router functionality.

Key Vocabulary

RouterA networking device that operates at the Network layer (Layer 3) to connect different networks and forward data packets between them using IP addresses.
SwitchA networking device that operates at the Data Link layer (Layer 2) to connect devices within a single local network, forwarding data frames based on MAC addresses.
Routing TableA data table stored in a router or network device that lists the paths, interface, and metrics to various network destinations, guiding packet forwarding decisions.
MAC AddressA unique hardware identifier assigned to network interfaces for communications at the Data Link layer within a local network segment.
IP AddressA numerical label assigned to each device participating in a computer network that uses the Internet Protocol for communication, identifying the host and network.

Watch Out for These Misconceptions

Common MisconceptionRouters and switches do essentially the same job.

What to Teach Instead

Routers and switches operate at different OSI layers and serve distinct purposes. Switches connect devices within a single network and use MAC addresses to forward frames. Routers connect separate networks and use IP addresses to route packets. Using a switch where a router is needed will not allow traffic to cross network boundaries.

Common MisconceptionRouting decisions are made by the packet, not by the network devices.

What to Teach Instead

Packets contain address information but have no decision-making capability. Routers examine destination IP addresses and consult their routing tables to decide where to forward each packet. The intelligence is in the router, not the packet. Students who simulate being a router quickly internalize this active role.

Common MisconceptionIf one router fails, data between two points cannot be delivered.

What to Teach Instead

Dynamic routing protocols allow other routers to detect a failure and update their routing tables to avoid the failed node, often within seconds. This built-in redundancy is a core design principle of the internet's architecture and why it can sustain significant infrastructure failures without a complete outage.

Active Learning Ideas

See all activities

Real-World Connections

  • Internet Service Providers (ISPs) like Comcast and AT&T use massive networks of routers to direct internet traffic from your home to websites and services across the globe.
  • Large enterprises, such as Google or Amazon, deploy sophisticated switching and routing infrastructure within their data centers to ensure efficient and reliable access to their cloud services and applications.

Assessment Ideas

Quick Check

Present students with a diagram of a small network showing two routers and several connected computers. Ask: 'If Computer A wants to send data to Computer B on a different network, which device will handle the initial forwarding decision, and why?'

Exit Ticket

Provide students with a simplified routing table. Ask them to trace the path a packet would take to reach a specific IP address, listing each hop and the decision made at each router. Include a question: 'What would happen if the path to IP address X became unavailable?'

Discussion Prompt

Pose the scenario: 'Imagine a critical router in your school's network fails. Discuss with a partner: What are the immediate impacts on student access to online resources? How might the network attempt to compensate for the failure?'

Frequently Asked Questions

What is the difference between a router and a switch in networking?
A switch connects devices within the same local network (LAN), using MAC addresses to forward data frames only to the intended recipient device. A router connects separate networks, such as a home LAN to the internet, using IP addresses to determine the best path for each packet across multiple networks.
How do routing tables determine the best path for data packets?
A routing table lists known network destinations and the next hop or outgoing interface for reaching each one, along with a metric like hop count or latency cost. When a packet arrives, the router finds the best matching entry for the destination IP and forwards the packet accordingly. Dynamic routing protocols update these tables automatically as network conditions change.
What happens to network connectivity when a router fails?
When a router fails, any static routes through that device stop working immediately. In networks using dynamic routing protocols, neighboring routers detect the failure through missed keepalive messages and recalculate alternative paths. Traffic reroutes through those paths, though with potentially higher latency or reduced bandwidth until the failed router is restored.
How does active learning help students understand routing and switching?
Physical routing simulations, where students act as routers consulting handwritten routing tables to pass packets, make the forwarding decision process tangible. When a 'router' student is unexpectedly removed from the simulation, classmates immediately observe the downstream traffic failure, making abstract resilience concepts concrete and memorable.