AP Networking • Device Roles & Packet Paths

Router vs. Switch

Compare routers and switches by the decisions they actually make: local versus remote traffic, MAC and routing tables, gateways, VLANs, broadcast boundaries, re-encapsulation, and troubleshooting evidence.

Independent AP Networking resource • Updated 2026-09-09 • Includes 24 free digital flashcards
Decision rule: first decide whether the destination is local or remote; then identify the address and table used for the next forwarding step.
Practice with Flashcards
Core model

A switch answers “where on this Layer 2 network?”; a router answers “which IP network/path next?”

The most useful router-versus-switch comparison is not a memorized “Layer 2 versus Layer 3” sentence. It is the forwarding decision each device must make. A basic Ethernet switch forwards frames using destination MAC information inside a VLAN. A router forwards IP packets between networks using destination IP prefixes. Those two decisions meet whenever a host sends to a remote subnet.

AP Networking reasoning chain: Destination IP → local-or-remote decision → next Layer 2 destination → switch forwarding → router route selection if needed → new outgoing link-layer delivery → service verification.
Side-by-side comparison

Compare forwarding objects, addresses, tables, and boundaries

QuestionLayer 2 switchRouter / routing function
Primary forwarding objectEthernet frameIP packet
Primary destination usedDestination MACDestination IP prefix
Forwarding informationMAC/CAM table: MAC → port/VLANRouting table: prefix → next hop/interface
Typical scopeWithin a Layer 2/VLAN domainBetween IP networks
Broadcast relationshipBroadcasts remain within relevant VLANSeparates Layer 2 broadcast domains
Troubleshooting artifactMAC table, VLAN/port stateIP config, route table, next hop

Swipe horizontally to see the complete comparison.

Host decision

The host decides local versus remote before either device forwards the traffic

Consider host 192.168.10.25/24. The /24 mask means addresses 192.168.10.0 through 192.168.10.255 are in the host's local subnet range, with network/broadcast reservations as applicable. When the destination is 192.168.10.80, the host treats it as local. When the destination is 192.168.20.80, the host treats it as remote and uses its configured gateway for the first hop.

Critical distinction: the default gateway is not used merely because it exists. It is used when the host's IP/subnet logic says the destination requires a routed next hop.
Local traffic walkthrough

Same-subnet traffic can remain entirely within switching

1. Compare192.168.10.80 is local to 192.168.10.25/24.
2. ResolveSender obtains the peer's local MAC.
3. FrameDestination MAC = peer.
4. SwitchSwitch forwards using MAC table.
5. DeliverPeer receives the IP packet inside the frame.
IP source: 192.168.10.25 IP destination: 192.168.10.80 Ethernet source: MAC-of-Host-A Ethernet dest: MAC-of-Host-B Host A ─────── Switch ─────── Host B │ Router (not required for this local exchange)

The router can be physically connected to the switch and still not be the forwarding destination for this same-subnet exchange.

Remote traffic walkthrough

A remote packet is placed inside a local frame addressed to the gateway

Now Host A at 192.168.10.25/24 sends to 192.168.20.80. The destination IP is remote, so Host A needs the MAC of its local default gateway. The switch does not “understand the remote subnet” to choose the route; it simply forwards the frame toward the gateway MAC.

FIRST LAN: IP source: 192.168.10.25 IP destination: 192.168.20.80 Ethernet source: MAC-of-Host-A Ethernet dest: MAC-of-Gateway Host A ──frame──> Switch ──frame──> Router │ route lookup for 192.168.20.80 │ ▼ outgoing interface

The IP destination does not become the gateway's IP. The gateway is the next Layer 2 destination on the local LAN; the IP packet still targets the remote host.

Re-encapsulation

The Layer 2 header can change hop by hop while the routed packet continues

When the router receives the local Ethernet frame, it processes the Layer 2 framing, examines the IP packet, selects an outgoing route, and sends the packet using the appropriate link-layer framing for the next segment. On another Ethernet segment, that means new source/destination MAC addresses appropriate to that hop.

Common exam trap: do not say the original source host sends an Ethernet frame directly to the remote host's MAC across multiple routed networks. MAC delivery is local to the relevant Layer 2 segment.
Switch table

A MAC table maps Layer 2 identity to a forwarding location

Switch-A# show mac address-table VLAN MAC Address Type Port 10 00aa.1111.2222 DYNAMIC Gi1/0/3 10 00bb.3333.4444 DYNAMIC Gi1/0/8 10 00cc.5555.6666 DYNAMIC Gi1/0/24

In this hypothetical artifact, a frame in VLAN 10 destined for 00bb.3333.4444 can be forwarded toward Gi1/0/8 based on the learned entry. The table does not tell you which IP network a remote destination belongs to or which route should be selected.

Routing table

A route table maps destination prefixes to next forwarding choices

Router-A# show ip route C 192.168.10.0/24 directly connected, Gi0/0 C 192.168.20.0/24 directly connected, Gi0/1 S 10.50.0.0/16 via 192.168.20.2 S 10.50.30.0/24 via 192.168.20.3 S* 0.0.0.0/0 via 192.168.10.1

A packet for 10.50.30.25 matches the /16, /24, and default route, but the /24 is the longest matching prefix and therefore the most specific of those choices. This is fundamentally different from a switch finding a destination MAC entry.

Unknown destinations

Switch flooding and router route lookup solve different “unknown” problems

If a switch lacks a learned entry for a destination MAC within the relevant VLAN, its Layer 2 handling can involve flooding that unknown unicast within the VLAN according to switching behavior. A router with no sufficiently usable route does not solve the problem by flooding the packet across all routed interfaces as though they were one Ethernet domain.

This difference matters because “not in the table” has different consequences depending on which table you mean.

Broadcast domains

A VLAN creates a Layer 2 boundary; routing connects different IP networks across boundaries

A switch can carry multiple VLANs, each representing a separate logical Layer 2 broadcast domain. Broadcast traffic in VLAN 10 is not simply treated as VLAN 20 traffic. To communicate between IP networks assigned to those VLANs, a Layer 3 routing function must forward between them, subject to policy.

Review VLANs Explained and Network Switching for the Layer 2 side.

Layer 3 switch

One chassis can switch some traffic and route other traffic

A multilayer switch can learn MAC addresses and switch frames inside VLAN 10 while also maintaining IP interfaces and routes that forward packets from VLAN 10 to VLAN 20. The device name does not erase the two forwarding concepts.

★ Routing Practice • Router vs. Switch

A five-minute warm-up for Router vs. Switch

Tomorrow’s opening question can pick up where this page leaves off: have students trace the connection and explain why traffic takes that path. The 300 Bell Ringers give you short questions and teacher answers you can use without preparing a new starter each morning.

300 AP Networking Bell Ringers
$74.99
BUY TEACHER PACK → See what is included in the 300 Bell Ringers →
Instant Access • Full-Year Teacher Resource

For exam questions, identify the described function. “Forwards using destination MAC” describes switching behavior. “Selects a path using destination IP prefixes” describes routing behavior. See Layer 2 vs. Layer 3 Switch.

Consumer devices

A box labeled “router” may contain several networking functions

A typical small-office/home device may combine an IP router, Ethernet switch, wireless access point, DHCP service, NAT, and firewall functions. Two wired clients on the same LAN can be switched locally through the device's integrated switch, while Internet-bound traffic uses its routing/NAT/firewall functions.

Routing Lab • 120 Missions

Let students try Router vs. Switch for themselves

Reading the explanation is a start. In the browser simulator, students work through a broken network, choose what to test and see whether their fix worked. It gives them another chance to use what they learned about Router vs. Switch.

AP Networking Browser Troubleshooting Simulator
$29.99
120 Missions • 60 Failure Patterns • Offline Copy
GET THE SIMULATOR → See all 120 missions & features

This is why hardware labels are weaker evidence than forwarding behavior.

Worked case 1

Same VLAN fails: do not start with the remote route table

Host A and Host B are both intended to be in VLAN 10 and subnet 192.168.10.0/24. A cannot reach B, but both can reach the gateway independently. Because the failing exchange is local, begin with each host's prefix, VLAN membership, local address resolution, and switch MAC learning between the two access ports.

Evidence boundary: a route to another network is not the first unresolved dependency for this same-subnet flow.

Routing Exam Practice • Router Vs Switch

Check whether Router vs. Switch has really stuck

Once students have worked through this topic, give them questions mixed in with the rest of the course. The Exam Prep Vault includes practice exams, multiple-choice questions and artifact labs so they cannot rely on a chapter heading to tell them what to do.

AP Networking Complete Exam Prep Vault
$39.99
GET THE EXAM PREP VAULT → See the Exam Prep Vault contents →
4 Practice Exams • 320 MCQs • 60 Artifact Labs
Worked case 2

Local traffic works, remote subnet fails: move the boundary to routing

Host A reaches another VLAN 10 peer successfully but cannot reach 192.168.20.80. Local link, VLAN 10 switching, and at least part of Host A's local configuration now have known-good evidence. Inspect the default gateway, gateway reachability, route to 192.168.20.0/24, policy, destination-side path, and return route.

Do not move backward to replacing Host A's Ethernet cable without evidence that contradicts the successful local test.

Premium Routing Feedback

Spend less time marking explanations about Router vs. Switch

When students explain their answer, it takes more than a right-or-wrong check to see what they understand. The Grading Copilot helps you review how they used the clues, where their explanation falls short and what feedback to give next. You make the final grading decision.

AP Networking Artifact Analysis Grading Copilot
$49.99
8 Criteria • 5 Task Modes • Offline Premium Copy
GET THE GRADING COPILOT → See the free Copilot preview
Worked case 3

Wrong default gateway: local works while remote fails

Host A is 192.168.10.25/24 but its gateway is incorrectly set to 192.168.10.254 when the intended router is 192.168.10.1. Host A can still communicate directly with 192.168.10.80 because that destination is local. Remote destinations fail because the host's routed next-hop configuration is wrong.

This symptom pattern is powerful because successful local traffic preserves the switch path while isolating a dependency required only for remote traffic.

NEW • COMPLETE 180-DAY TEACHER CURRICULUM

Teach Router vs. Switch as part of a planned school year

This page gives you one topic. The 180-Day Teacher Curriculum puts it into a full course plan, with daily teaching notes, student activities and checks for understanding. Use it when you need to know what comes before this lesson and what to teach next.

AP Networking Complete 180-Day Teacher Curriculum
$199.99
180 Lessons • 180 Daily Simulators • 36 Teaching Weeks
GET THE 180-DAY CURRICULUM → See 3 free curriculum examples
Worked case 4

The route is correct, but security policy denies the flow

The router has a valid route to 10.50.30.0/24 and the next hop is reachable. The application still fails because an ACL or firewall rule denies the required port. A correct route proves path selection, not permission.

Next discriminating evidence: policy/rule counters or logs for the exact source, destination, protocol, and port. This prevents “routing problem” from becoming a catch-all diagnosis.

Troubleshooting matrix

Use what works to decide whether to inspect switching or routing next

Observed resultKnown-good evidenceFirst unresolved area
No physical linkLittle/no Layer 1 evidenceNIC, cable, port, local physical attachment
Link up; same-VLAN peer failsPhysical attachmentIP/prefix, VLAN, ARP, MAC learning, local policy
Same-VLAN peer works; gateway failsLocal switching pathGateway address, gateway VLAN/interface, ARP/local gateway path
Gateway works; remote numeric IP failsLocal host-to-router pathRoute, next hop, policy, destination/return path
Remote numeric IP works; name failsIP forwarding to tested destinationDNS resolution path/configuration
Route exists; application port failsSome Layer 3 path evidenceService listener, ACL/firewall, return state/path

Swipe horizontally to see the complete troubleshooting matrix.

Evidence boundaries

Do not let one successful artifact prove a different layer

EvidenceSupportsDoes not alone prove
MAC learned on expected portLayer 2 source learning/locationRemote route exists
Gateway MAC resolvesLocal Layer 2 reachability/address resolution to gatewayRouter has path to final destination
Route table has matching prefixRouter has a forwarding choiceFirewall permits flow or return path works
Ping to remote numeric IP succeedsSome IP reachability for tested trafficDNS or exact application service works
Application succeedsTested end-to-end service worksEvery protocol/path is healthy

Swipe horizontally to see the full evidence table.

Exam traps

Five mistakes that make router-vs-switch answers weaker

Decision drill

Ask these five questions for any router-versus-switch scenario

1. DestinationWhat IP is the host trying to reach?
2. ScopeDoes the sender treat it as local or remote?
3. FrameWhose MAC is the next local destination?
4. ForwardWhich table answers the next decision?
5. VerifyWhat artifact proves that decision worked?

That sequence converts a vocabulary question into packet-path reasoning.

Free digital flashcards

24 router vs. switch digital flashcards

Practice local-versus-remote decisions, MAC tables, routing tables, gateways, VLANs, broadcast domains, re-encapsulation, longest-prefix matching, troubleshooting boundaries, security policy, and AP Networking exam traps.

All router-vs-switch cards
Click or press Enter/Space to reveal.
Explain which forwarding table or boundary supports the answer.
0 seen•24 cards
Continue studying

Connect device roles to switching, routing, VLANs, and troubleshooting