The ONL NPR Tutorial

NPR Tutorial >> The Remote Laboratory Interface TOC

New Window?

Configuring Routes

[[ dumbbell-commit-done.png  Figure ]]

If we try to send traffic from n1p3 to n2p2 using the configuration we just committed in the preceding page The Remote Laboratory Interface => Configuring Topology, NPR 1 (the left router) will drop the packets because no routes have been installed; i.e., all of its route tables are empty. This page explains conceptually how an NPR route table is used to forward packets from an input port to an output port and shows you how to install route tables.

An example based on some of the concepts discussed on this page is given in NPR Tutorial => Examples => The_Remote_Laboratory_Interface. The sections in this page are:

 

The NPR Route Table

The most basic activity of a router is to transmit incoming packets out the output port designated by the best matching entry in its route (or forwarding) table. Conceptually, each port of an NPR has a route table in which each entry has three fields:

For now, suppose that we are using only a basic NPR that uses only route tables for packet forwarding decisions. (Later, we will see how NPR filters can alter packet forwarding.) When a packet arrives to port P, the NPR picks from port P's route table the best matching (P, N, S) entry using the longest prefix match (LPM) algorithm and forwards the packet knowing that the packet should go out port N.
 

Generating Default Routes

In order for both NPRs to forward traffic between all hosts and between the two NPRs, we need to install route tables at the inputs that have attached links; i.e., ports 1.2, 1.3, 1.4, 2.1, 2.2, and 2.3 (the notation X.Y refers to NPR X, port Y). [[ route-tables-2way-resize.png  Figure ]]

The figure (right) shows route tables that could be used at ports 1.3, 2.1, 2.2 and 1.4 to forward packets flowing from n1p3 to n2p2 and back to n1p3. They have been arranged to show which entries would be used to forward the packets.

Recall: The nXpY network interface is assigned the IP address 192.168.X.Z where Z = 16 x (Y+1); e.g., n2p2 has the IP address 192.168.2.48.
So, packets flowing to n2p2 will have a destination IP address of 192.168.2.48 in its header.
The packets flowing from n1p3 to n2p2 (192.168.2.48) will match the prefix/mask fields 192.168.2.0/24 and 192.168.2.48/28 at ports 1.3 and 2.1 respectively. The packets flowing in the reverse direction from n2p2 to n1p3 (192.168.1.64) will match the prefix/mask fields 192.168.1.0/24 and 192.168.1.64/28 at ports 2.2 and 1.4 respectively.
[[ Generate Default Routes Figure ]]

The easiest way to generate the route tables we need is to generate default route tables at every port (including ones without attached hosts):

[[ Route Table 1.3 Figure ]]

You can verify that the route tables are correct. For example, look at the routing table at port 1.3 by enterring (not shown):

You should see a route table similar to the one shown right. The first five entries reflect the NPR's standard IP addressing where hosts on subnet 192.168.X.Z/28 are assumed to be attached to port Y and Z = 16 x (Y+1). For example, the third (P, N, S) entry is (192.168.1.48/28, 2, 46), and means that packets destined for a host in the subnet 192.168.1.48/28 (e.g., 192.168.1.48) should be forwarded to output port (next hop) 2.

The last (P, N, S) entry (192.168.2.0/24, 4, 49) forwards packets destined to hosts connected to NPR 2 and will forward those packets out port 4. The RLI generated that entry automatically because it could tell that there is only one route to the hosts attached to NPR 2.

But even when if there were multiple paths to NPR 2, the RLI would have inserted an arbitrary entry for packets destined for NPR 2.
Watch Out!!! If there are multiple paths, the output port chosen by the RLI may not be the one you want. So, check router-to-router entries in route tables.
 

The Route Table Edit Menu

[[ route-table.png Figure ]]

You can examine the route table at a single port. In the figure (right), we are about to open the NPR.1:port 3 (port 1.3) route table window. The route table window has a Route Table => Edit menu that allows the user to add a route, delete a route, stop statistics and generate local default routes. Also, you can modify a route table entry by selecting an entry field and changing only that field (e.g., next hop). You must select File => Commit before the changes take effect.
[[ delete-route-block-resize.png  Figure ]]

The Add Route and Delete Route menu items are straightforward to use. Note also that you can delete a block of entries (shown right):


[[ local-default-routes-resize.png  Figure ]]

The Generate Local Default Routes menu item allows you to generate a route table that assumes the 192.168.X.Z/28 subnetting described earlier. Here is how you would use this menu item to install a route table at port 1.3 that is identical to the one generated earlier by the Topology => Generate Default Routes menu item in the main RLI window:

All of the route entries have used non-overlapping prefix/mask entries. But we can construct a route table using the fact that route lookup uses the LPM algorithm.

 

Verifing Connectivity Using Ping

You can verify that packets from one host can reach another one by using the ping command. For example, if you want to see if packets can be sent from n1p3 to n2p2 (and back), ping n2p2 from host n1p3 by enterring:

onlusr> source ~onl/.topology	# add control network IP addresses to env
onlusr> ssh $n1p3		# ssh to host n1p3 through control network 
$n1p3>  ping n2p2		# send ping packets to n2p2 from $n1p3
        ^C			# enter ctrl-c to terminate the ping command

This provides a simple test that there is network connectivity between the sender and receiver.

Watch Out!! A common mistake is to enter "ping $n2p2" when you meant "ping n2p2". The first form attempts to send five ping packets to the control network interface, not the data network interface, attached to the n2p2 host.
[[ ping-success.png Figure ]]

The figure above shows that we have used ping to send five ping packets to n2p2 from n1p3 (onl029). The -c 5 limits ping to sending five packets instead of a continuous stream of packets.

When a user enters the ping command, the sending host sends one ICMP echo request packet to the destination once per second. When the receiver gets the ICMP echo request packet, it sends back an ICMP echo reply packet to the original sender. As each response is received, ping outputs information indicating the sequence number and the round-trip time (RTT). After ping terminates, it outputs a report indicating packet loss and RTT statistics (minimum, average, maximum, standard deviation). The ping command is a simple tool for general network troubleshooting. And a successful test (right) is a good indicator that you will likely be able to send packets between the two hosts participating in the ping.

[[ netstat-ping-resize.png  Figure ]]
The figure above shows how you can use the "netstat -i" Unix command to verify that the proper number of ICMP echo request packets were received at and ICMP echo reply packets sent from n2p3. The netstat command window shows that we ran netstat twice on the the receiver host onl074 &mdash once before pinging from n1p3 and once after ping finished. It shows that the receiver received six (6) packets and sent six (6) packets even though we sent only five (5) ping packets. The extra packet is an ARP packet which shows up if we wait long enough between network usage.
 

Recap


 Revised:  Wed, Aug 6, 2008 

  
  

NPR Tutorial >> The Remote Laboratory Interface TOC