Routing table and next hop

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Routing table and next hop

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. What does each row in a routing table tell a router?
A Which destination network to match and which next hop to send those packets to
B Which password a device must use to join the network
2. What is the 'next hop' in a routing table row?
A The next router the packet is handed to on its way
B The final computer that receives the packet
3. A router has these rows: 192.168.1.0 via 10.0.0.2 and 0.0.0.0 via 10.0.0.9. A packet is addressed to 8.8.8.8. Which next hop is used?
A 10.0.0.2, because it is the first row in the table
B 10.0.0.9, because the default route is used when nothing else matches
4. When is the default route 0.0.0.0 used?
A Every time, before the router checks any other row
B When no other row in the table matches the destination
5. Two rows match a packet's destination. One is a small, specific network and the other is the default route. Which does the router choose?
A The more specific network, because it is the best match
B The default route, because it covers every address

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1192.168.2.0/24 via 10.0.0.2 AA routing table row: packets for the 192.168.2.0/24 network are sent to the next hop 10.0.0.2.
20.0.0.0/0 via 10.0.0.1 B0.0.0.0/0 via 203.0.113.1
3A router picks the most specific row that matches the destination, so a /24 row beats a /8 row. CThe default route: packets that match no other row go to the next hop 10.0.0.1.
4The default route sends all unmatched traffic, such as packets bound for the internet, to one next hop. DThe next hop must be a router that forwards the packet, not the final device the packet is for.
5Routing table row: 192.168.5.0/24 via 192.168.5.77 (a device on that network) E10.1.2.0/24 via 10.0.0.3
6Packet for 8.8.8.8 matches a 10.0.0.0/8 row, so the router uses that row instead of the default route 0.0.0.0 F8.8.8.8 is not inside 10.0.0.0/8, so that row does not match and the default route is used.

Definitions

routing table

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
_________ via 192.168.1.1
2.
ip route add 10.1.0.0/16 ___ 10.0.0.2
3.
10.1.0.0/16 via 10.0.0.2 10.1.5.0/24 via 10.0.0.3 Packet to 10.1.5.9 -> ________
4.
10.1.0.0/16 via 10.0.0.2 0.0.0.0/0 via 10.0.0.1 8.8.8.8 matches no row, so use _______ route
5.
ip _____ show default via 192.168.1.1 dev wlan0

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A Default route: 192.168.0.0/24
B Used when no other row matches
C 0.0.0.0/0 -> 10.1.1.1
Question 2
A # destination -> next hop
B 192.168.1.0/24 -> direct
C 10.0.0.0/8 -> 10.1.1.2
D 255.255.255.255/0 -> 10.1.1.1
Question 3
A dest = 8.8.8.8
B if no row matches dest:
C drop the packet
D else:
E use the matching row
Question 4
A 10.0.0.0/8 -> 10.1.1.2
B 10.5.0.0/16 -> 10.1.1.3
C Packet to 10.5.2.9 uses row 1
D Longer prefix = best match
Question 5
A dest = 172.16.4.2
B row 1: 10.0.0.0/8 no match
C row 2: 172.16.0.0/12 matches
D send to next hop of row 1

Answer Key

Routing table and next hop
Section A: Quick Questions
Q1
A — Which destination network to match and which next hop to send those packets to
Q2
A — The next router the packet is handed to on its way
Q3
B — 10.0.0.9, because the default route is used when nothing else matches
Q4
B — When no other row in the table matches the destination
Q5
A — The more specific network, because it is the best match
Section B: Match the Pairs
Q1
192.168.2.0/24 via 10.0.0.2 → A routing table row: packets for the 192.168.2.0/24 network are sent to the next hop 10.0.0.2.
Q2
0.0.0.0/0 via 10.0.0.1 → The default route: packets that match no other row go to the next hop 10.0.0.1.
Q3
A router picks the most specific row that matches the destination, so a /24 row beats a /8 row. → 10.1.2.0/24 via 10.0.0.3
Q4
The default route sends all unmatched traffic, such as packets bound for the internet, to one next hop. → 0.0.0.0/0 via 203.0.113.1
Q5
Routing table row: 192.168.5.0/24 via 192.168.5.77 (a device on that network) → The next hop must be a router that forwards the packet, not the final device the packet is for.
Q6
Packet for 8.8.8.8 matches a 10.0.0.0/8 row, so the router uses that row instead of the default route 0.0.0.0 → 8.8.8.8 is not inside 10.0.0.0/8, so that row does not match and the default route is used.
Section C: Definitions
Q1
routing table — A list a router uses to pick where to send each packet. Each row has a destination network and a next hop. The default route 0.0.0.0 is used when no other row matches.
Section D: Fill in the Blanks
Q1
0.0.0.0/0 via 192.168.1.1
Q2
ip route add 10.1.0.0/16 via 10.0.0.2
Q3
10.1.0.0/16 via 10.0.0.2 10.1.5.0/24 via 10.0.0.3 Packet to 10.1.5.9 -> 10.0.0.3
Q4
10.1.0.0/16 via 10.0.0.2 0.0.0.0/0 via 10.0.0.1 8.8.8.8 matches no row, so use default route
Q5
ip route show default via 192.168.1.1 dev wlan0
Section E: Spot the Error
Q1
A — The default route is 0.0.0.0/0, which matches every destination. 192.168.0.0/24 is just one ordinary network, so it can't act as the catch-all route.
Q2
D — The default route destination must be 0.0.0.0/0. 255.255.255.255/0 is not the default route, so the router would have no catch-all row.
Q3
C — When no other row matches, the router uses the default route and sends the packet to the default next hop. It should not drop the packet.
Q4
C — 10.5.2.9 matches both rows, but row 2 (/16) has the longer prefix, so it is the best match. The packet should use row 2, not row 1.
Q5
D — Row 1 did not match the destination. The packet must go to the next hop of the matching row, which is row 2.