Router Forwarding Decisions and the IP Routing Table
Real CCIE Lab Workbook
CCIE Written Exam Dumps
CCNA Exam Dumps
CCNP Exam Dumps
CISCO Specialist Exam Dumps
CISCO Online and Proctored Exam Dumps
CCNA Study Guide
CCNP Study Guide
CCNA Lab Guide
CCNP Lab Guide
VMware Exam Dumps
CompTIA Exam Dumps
Amazon Exam Dumps
Check Point Exam Dumps
Citrix Exam Dumps
PMI Exam Dumps
Google Exam Dumps
Microsoft Exam Dumps
Earlier in this chapter, Figure 4-1 shows the network layer concepts of routing, while
Figure 4-2 shows the data-link encapsulation logic related to routing. This next topic
dives a little deeper into that same process, using an example with three routers forwarding
(routing) one packet. But before looking at the example, the text first summarizes
how a router thinks about forwarding a packet.
A Summary of Router Forwarding Logic
First, when a router receives a data-link frame addressed to that router’s data-link address,
the router needs to think about processing the contents of the frame. When such a frame
arrives, the router uses the following logic on the data-link frame:
Step 1. Use the data-link Frame Check Sequence (FCS) field to ensure that the frame
had no errors; if errors occurred, discard the frame.
Step 2. Assuming that the frame was not discarded at Step 1, discard the old data-link
header and trailer, leaving the IP packet.
Step 3. Compare the IP packet’s destination IP address to the routing table, and find
the route that best matches the destination address. This route identifies the
outgoing interface of the router, and possibly the next-hop router IP address.
Step 4. Encapsulate the IP packet inside a new data-link header and trailer, appropriate
for the outgoing interface, and forward the frame.
With these steps, each router forwards the packet to the next location, inside a data-link
frame. With each router repeating this process, the packet reaches its final destination.
While the router does all the steps in the list, Step 3 is the main routing or forwarding step.
The packet has a destination IP address in the header, whereas the routing table lists slightly
different numbers, typically a list of networks and subnets. To match a routing table entry,
the router thinks like this:
Network numbers and subnet numbers represent a group of addresses that begin with the
same prefix. Think about those numbers as groups of addresses. In which of the groups
does this packet’s destination address reside?
The next example shows specific examples of matching the routing table.
A Detailed Routing Example
The routing example uses Figure 4-11. In this example, all routers happen to use the
Open Shortest Path First (OSPF) routing protocol, and all routers know routes for all
subnets. In particular, PC2, at the bottom, sits in subnet 184.108.40.206, which consists
of all addresses that begin with 150.150.4. In the example, PC1 sends an IP packet to
220.127.116.11, PC2’s IP address.
Figure 4-11 Simple Routing Example, with IP Subnets
NOTE Note that the routers all know in this case that “subnet 18.104.22.168” means “all
addresses that begin with 150.150.4.”
The following list explains the forwarding logic at each step in the figure. (Note that the
text refers to Steps 1, 2, 3, and 4 of the routing logic shown in the previous section.)
Step A. PC1 sends the packet to its default router. PC1 first builds the IP packet,
with a destination address of PC2’s IP address (22.214.171.124). PC1 needs to
send the packet to R1 (PC1’s default router) because the destination address
is on a different subnet. PC1 places the IP packet into an Ethernet frame,
with a destination Ethernet address of R1’s Ethernet address. PC1 sends the
frame on to the Ethernet. (Note that the figure omits the data-link trailers.)
Step B. R1 processes the incoming frame and forwards the packet to R2. Because the
incoming Ethernet frame has a destination MAC of R1’s Ethernet MAC, R1 copies
the frame off the Ethernet for processing. R1 checks the frame’s FCS, and no
errors have occurred (Step 1). R1 then discards the Ethernet header and trailer
(Step 2). Next, R1 compares the packet’s destination address (126.96.36.199) to
the routing table and finds the entry for subnet 188.8.131.52—which includes
addresses 184.108.40.206 through 220.127.116.11 (Step 3). Because the destination
address is in this group, R1 forwards the packet out interface Serial0 to nexthop
Router R2 (18.104.22.168) after encapsulating the packet in a High-Level Data
Link Control (HDLC) frame (Step 4).
Step C. R2 processes the incoming frame and forwards the packet to R3. R2 repeats
the same general process as R1 when R2 receives the HDLC frame. R2 checks the FCS field and finds that no errors occurred (Step 1). R2 then discards
the HDLC header and trailer (Step 2). Next, R2 finds its route for subnet
22.214.171.124—which includes the address range 126.96.36.199–188.8.131.52—
and realizes that the packet’s destination address 184.108.40.206 matches that
route (Step 3). Finally, R2 sends the packet out interface Fast Ethernet 0/0 to
next-hop router 220.127.116.11 (R3) after encapsulating the packet in an Ethernet
header (Step 4).
Step D. R3 processes the incoming frame and forwards the packet to PC2. Like
R1 and R2, R3 checks the FCS, discards the old data-link header and trailer,
and matches its own route for subnet 18.104.22.168. R3’s routing table entry
for 22.214.171.124 shows that the outgoing interface is R3’s Ethernet interface,
but there is no next-hop router because R3 is connected directly to subnet
126.96.36.199. All R3 has to do is encapsulate the packet inside a new Ethernet
header and trailer, with a destination Ethernet address of PC2’s MAC address,
and forward the frame.