CompTIA Review

Network+ · Chapter 9

Introduction to IP Routing

The IP routing process, frames versus packets, MAC addresses and ARP, reading a route table, static and dynamic routing, autonomous systems, and route selection.

Return to next-hop missionReview supports the next application check; visiting this page does not earn points.

The IP routing process

  • A router decides where to send a packet using its route table and the destination network of the packet. It does not need the destination host, the originating network, or the return path to route the packet.
  • Routers rebuild Ethernet frames at routed hops. Without NAT, source and destination IP addresses stay the same; TTL decreases and the IPv4 header checksum changes.
  • A frame carries a packet to only two places: a host on the local network, or a router interface when the packet is going to a remote network.
  • When the destination is on another network, the host sets the destination MAC address to the default gateway. The destination IP address never changes.

Ethernet frames are local and rebuilt at routed hops. Without NAT, the IP source and destination remain end to end, while routers update TTL and the IPv4 header checksum.

MAC addresses and ARP

  • MAC (hardware) addresses are always local. They are used only on the local LAN and never pass a router interface.
  • Address Resolution Protocol (ARP) finds the MAC address of the default gateway, or of a local host, from an IP address.
  • A host ARPs for the destination if it is on the same network. If not, it ARPs for the default gateway.
  • At the far end, the router interface facing the destination network ARPs for the destination host.
  • Reverse ARP (RARP) does the opposite, deriving an IP address from a MAC address, similar to DHCP. It does not update route tables.
TaskCommand
View the ARP cache on a Windows or Mac hostarp -a
View the ARP cache on a Cisco router or switchshow ip arp
View the route table on a Cisco routershow ip route

The chapter text prints arp -g in Exercise 9.1 and in question 6, but the command on a host is arp -a (question 18). Cisco routers use show ip arp.

Reading the route table

  • The route table is the router's map of the internetwork. Routing decisions are made by destination network, not by host.
  • A C in the table means the network is directly connected because it is configured on an interface. An S is a static route.
  • The gateway of last resort is the default route. If it is not set and no route matches, the packet is dropped.
  • To find the exit interface, match the destination IP address to the network that contains it. 172.16.20.94 falls inside 172.16.20.64/27, so the exit interface is FastEthernet 0/2 (question 14).
Route in the tableAddresses it coversExit interface
172.16.20.0/27172.16.20.0 to .31FastEthernet 0/0
172.16.20.32/27172.16.20.32 to .63FastEthernet 0/1
172.16.20.64/27172.16.20.64 to .95FastEthernet 0/2
172.16.20.128/27172.16.20.128 to .159FastEthernet 0/3

A router with these four routes has no match for 172.16.20.100. That address sits between the /27 blocks, so the packet is dropped.

Frame fields

FieldWhat it does
Destination MAC addressThe next device on this local network. For a remote destination, the default gateway.
Source MAC addressThe sender on this local network. Rewritten at every router hop.
EtherTypeIdentifies the protocol inside the frame. 0x0800 is IPv4 and 0x0806 is ARP.
PacketThe IP packet. Without NAT its IP endpoints stay the same; routers change TTL and the IPv4 header checksum.
Frame check sequence (FCS)A 4-byte cyclic redundancy check at the end of the frame. The destination uses it to verify the frame arrived intact.

The source MAC, destination MAC, and EtherType are included when the FCS is calculated, but only the FCS tells the receiver that the frame is intact.

When there is no route

  • If the router has no route to the destination network, it drops the packet.
  • The router also sends an ICMP destination unreachable message to the sender. The original packet is never returned.
  • Logging happens only if it is configured. Routers do not ask for dynamic updates when they meet an unknown network.
  • If a ping is lost along the way, the sender sees Request timed out. Destination unreachable appears when a router lacks the route.

Static and dynamic routing

ItemStatic routingDynamic routing
How routes get inAn administrator adds every route by hand to every routerRouting protocols learn and share routes automatically
When the network changesNothing updates until an administrator changes itTables update automatically
Traffic pathA packet takes the same route regardless of network statusRouters can move traffic to another path
Best forSmall, simple networksNetworks with many locations or planned growth
Default on routersYes, static routing is the defaultMust be configured
  • The main job of a routing protocol is to update routing tables.
  • Convergence is the term for the result of all routes being updated in the routing table through a dynamic routing protocol. Faster convergence is better.

If a question asks for routing that is automated as new locations are added, the answer is dynamic routing, not static routing, DHCP, or RARP.

Autonomous systems, IGP, and EGP

  • An autonomous system (AS) is a collection of networks or subnets in the same administrative domain.
  • An interior gateway protocol (IGP) is a dynamic routing protocol used inside an autonomous system. RIP, EIGRP, and OSPF are IGPs.
  • An exterior gateway protocol (EGP) is a dynamic routing protocol used between autonomous systems. BGP is the EGP in use today.
  • Administrative distance (AD) decides the most trusted route when two or more routes to the same network exist.
  • Distance-vector and link-state describe how routing protocols share and calculate routes. Chapter 10 covers them in detail.

Route selection

  • Exam objective 2.1 lists three factors for route selection: prefix length, administrative distance, and metric.
  • A router first prefers the route with the longest matching prefix, because it is the most specific.
  • If prefix lengths tie, the router prefers the lowest administrative distance.
  • If administrative distance also ties, the router prefers the lowest metric.
Route sourceTypical administrative distance
Connected0
Static1
eBGP20
EIGRP90
OSPF110
RIP120

Written lab: Lab_A network

Host_A (172.16.10.2) connects to Lab_A through e0 (172.16.10.1). Host_B (172.16.20.2) connects through e1 (172.16.20.1). Host_C (172.16.30.2) and Host_D (172.16.30.3) connect through e2 (172.16.30.1).

Destination networkExit interface
172.16.10.0/24e0
172.16.20.0/24e1
172.16.30.0/24e2
#StatementAnswer
1Host_A sends to Host_C and ARPs for the MAC address ofInterface e0
2Host_C sends to Host_D and ARPs for the MAC address ofHost_D
3A packet routed to 172.16.30.3: interface sends an ARP request fore2, Host_D
4After routing from Host_A to Host_C, source IP and destination IP are172.16.10.2, 172.16.30.2
5Host_A sends to 172.16.20.2: interface sends an ARP request toe1, Host_B

Exercise 9.1: Examine the ARP cache

  • Open a command prompt, find the IP address of the default gateway, and ping a website such as www.wiley.com.
  • Run arp -a and locate the entry for the default gateway. This gives you the MAC address of the router.
  • Look at the other entries. The default gateway's MAC address is relevant only to local clients on the network.

The ipconfig command shows the default gateway on Windows. The chapter text writes ifconfig, which is the command on Mac and Linux.

Review question answer key

QConceptAnswer
1Required for routing a packetC. Destination network of the packet
2Command to display the route tableA. show ip route
3True about static routesD. All routes must be manually configured
4Meaning of C in a route entryC. The network is configured on the interface (directly connected)
5Destination is on another networkB. Destination MAC is set to the default gateway
6View the ARP cache on a Cisco routerD. show ip arp
7Map of the internetwork inside a routerB. Route table
8Protocol that finds the gateway's MACA. ARP
9EtherType for IPv4C. 0x0800
10Automated routing for a growing networkB. Dynamic routing
11No route to the destination (choose two)C and D. Packet dropped, ICMP unreachable sent to the sender
12End of a frame to verify it arrived intactD. FCS (frame check sequence)
13Message when a ping is lost en routeA. Request timed out
14Exit interface for 172.16.20.94C. FastEthernet 0/2
15Best description of dynamic routingC. Routing tables update automatically when the network changes
16True statement about MAC addressesB. Always local on the LAN and never routed
17Result of all routes being updatedD. Convergence
18View the ARP cache on your hostD. arp -a
19Where the packet gets changedC. Destination host
20Collection of networks in one administrative domainA. Autonomous system

Interactive visuals

This chapter has interactive visuals for the routing process, ARP, the route table, frame fields, static and dynamic routing, the written lab, and route selection. Open them at /network-plus/ch9.