Skip to main content

About this free course

Download this course

Share this free course

Discovering computer networks: hands on in the Open Networking Lab
Discovering computer networks: hands on in the Open Networking Lab

Start this free course now. Just create an account and sign in. Enrol and complete the course for a free statement of participation or digital badge if available.

12.2 How are routing decisions made?

In this section you will have a look at how a router makes its routing decisions, using the same demonstration network made in Packet Tracer as you used in the previous section, and running in simulation mode to show you what the packets are doing at each stage.

Watch the video below, which is about 4 minutes long.

How are routing decisions made?

Download this video clip.Video player: 68_how_are_routing_descisions_made.mp4
Copy this transcript to the clipboard
Print this transcript
Show transcript|Hide transcript
 
Interactive feature not available in single page view (see it in standard view).

Activity 2 Test yourself

5 minutes

1. What component of the router’s system does the router use to decide which port to send the data packet out from?

a. 

(a) ARP table


b. 

(b) MAC address table


c. 

(c) Routing table


d. 

(d) Default gateway


The correct answer is c.

2. What does a router do with any packet it cannot find a destination network for in its routing table?

a. 

(a) Sends it out of all ports.


b. 

(b) Creates a new route.


c. 

(c) Returns the packet to the sender.


d. 

(d) Drops the packet.


The correct answer is d.

d. 

Correct. Routers should drop a packet if there is no matching destination network – unless there is a default static route set up.


3. Why do the first few ping packets fail when you ping an IP address you haven’t pinged recently?

a. 

(a) The layer 2 address (MAC address) is not present in the ARP table and must be looked up by the ARP process; this takes time, so the first few packets will fail.


b. 

(b) The router doesn’t know where to send the packet and takes too long to decide.


c. 

(c) The destination device is busy at the time.


d. 

(d) The router was switched off at the time.


The correct answer is a.

Activity 3 Try it out

10 minutes

1. Open PT Anywhere [Tip: hold Ctrl and click a link to open it in a new tab. (Hide tip)] in a new tab or window so you can read these instructions. A ‘spare’ PC is provided at the bottom for use in step 4 of this activity.

Investigate the network and enter the configuration settings into a copy of the table.

DeviceInterfaceIP addressSubnet maskDefault gateway
Router0G0/0  
Router0G0/1  
Router1G0/0  
Router1G0/1  
PC0   
PC1   

2. Check to see if there is a gateway of last resort set on each router. If there is, make a note of each one. (Hint: use the command show ip route.)

3. Ping PC1 from PC0. What happened?

4. Connect an additional PC (PC2) to the switch on the network 192.168.8.1 and configure it with an appropriate IP address, subnet mask and default gateway. (Use the spare PC provided at the bottom for this.)

5. Ping PC0 from PC2. What happened?

Answer

1. On both routers the command show ip interface brief should have given you the IP address of each configured interface. (It will also have given you the status of the configured interfaces which should have been ‘up’). To check the IP addresses and default gateway for each of the PCs you can use the command ipconfig. This is what your table should have looked like.

DeviceInterfaceIP addressSubnet maskDefault gateway
Router0G0/0192.168.0.1255.255.255.0
Router0G0/1192.50.8.1255.255.255.0
Router1G0/0192.168.0.2255.255.255.0
Router1G0/1192.100.8.1255.255.255.0
PC0192.50.8.2255.255.255.0192.50.8.1
PC1192.100.8.2255.255.255.0192.100.8.1

2. To show the gateway of last resort of each router, you need to use the command show ip route. You should have discovered that for both routers, the gateway of last resort was g0/0.

3. When pinging PC1 from PC0 you may have found that the first two or three pings timed out. As you learned in this session, this is because the ARP process needs time to ascertain all MAC addresses for each section of the network.

4. A suitable IP address for PC2 would have been anything in the range 192.100.8.3 to 192.100.8.254, but a logical choice would be 192.100.8.3.

5. When pinging PC0 from PC2 you may again have found that the first two or three pings timed out for the reason given above.

Activity 4 Think about

2 minutes

As you learned in the video ‘How are routing decisions made?’, configuring a static route by setting a router’s gateway of last resort is one way of ensuring that a packet doesn’t get dropped when its destination address isn’t in a router’s routing table. This is how the network in Activity 3 was configured, with each router using the other one as its gateway of last resort. This isn’t an ideal solution though. Can you see why?

Answer

It is possible that a packet could arrive at the router with an IP address that neither router knew anything about. In this event, the packet could end up going backwards and forwards between the routers until it is eventually discarded as it reaches its maximum number of hops specified in its ‘time to live’.