Computer Network Design - Lab 2: Static and Dynamic Routing

NWEN 302: 2021 Trimester 2

Assigned: 6 Sep 2021 (Monday)
Due: 15 Sep 2021 (Wednesday) for Part(a) - CORE topology file and answers to all questions and report for part (a);
26 Sep 2021 (Sunday) for Part(b) - answers to all questions and combined report for both parts
SUBMISSION OF REASONABLE ATTEMPTS FOR BOTH PARTS ARE MANDATORY.
Value: 20%

Introduction

In this lab, you will use CORE to create networks with multiple routers and hosts, gain practical experience configuring IPv4 and IPv6 addresses, explore the use of static routes and routing protocols, and configure the Open Shortest Path First (OSPF) routing protocol. Modern IP networks are "dual-stacked" in the sense that they run IPv4 and IPv6 protocols concurrently. IPv4 addresses have almost run out and you can expect to see increased use of IPv6 addressing throughout your career. All configuration and testing needs to be done for both IPv4 and IPv6 in this lab. You will use standard networking tools to explore and troubleshoot the network.

This lab is divided into two parts. In Part (a), you will manually configure static routes whereas in Part (b), you will use dynamic routing protocols. There are a number of places in this document where there are QUESTIONS and TASKS in blue text. You should make sure you cover ALL these points in your report.

tip icon.jpg

You are strongly encouraged to save your configuration on a regular basis into different files somewhere outside the VM. Do not spend a couple of hours making changes only to find the save fails and you have to do it all over again. When you need to pause the exercise and resume it later, always stop your CORE session, exit CORE, and shutdown the VM gracefully. Do not just exit VirtualBox. To gracefully shutdown the VM, you can either select Machine -> ACPI Shutdown on the VM Window, or type sudo poweroff on a terminal connected to the VM.

Part (a): Static Routing

Network Layout

The network you are going to build and configure is shown below and comprises seven routers and four hosts.

lab2topology.png

You can see from the diagram that there will be a number of alternative paths through the network. You will be exploring to set this up.

Creating an Initial Setup

Create the above network topology using the CORE GUI. Using the “network-layer virtual nodes” button on the top left (the router icon), select router, and place the routers and hosts as necessary.

Once a router or host has been placed, you can right-click on it and click “services”. CORE can automatically provision many network services, including routing platforms such as Free Range Routing and Quagga. Except for the IPForward service, leave all the other options unselected.

HINT: When using CORE, you need to enter IP addresses in CIDR notation. Refer to your lecture slides for more information about how to specify subnet masks.

You will now need to configure the IPv4 address and netmask and IPv6 address. This can be done easily in CORE. With the emulation stopped, double click on each router and host and configure the IP addresses as given in the following table:
Router Port Link IPv4 Address IPv4 Netmask IPv6 Address
R1   c1 1.1.1.1 255.255.255.0 2404:2000:2002:1001::1/64
R1   c2 1.1.2.1 255.255.255.0 2404:2000:2002:1002::1/64
R1   c11 1.1.11.1 255.255.255.0 2404:2000:2002:1011::1/64
R1   c12 1.1.12.1 255.255.255.0 2404:2000:2002:1012::1/64
R2   c1 1.1.1.2 255.255.255.0 2404:2000:2002:1001::2/64
R2   c3 1.1.3.2 255.255.255.0 2404:2000:2002:1003::2/64
R2   c4 1.1.4.2 255.255.255.0 2404:2000:2002:1004::2/64
R2   c5 1.1.5.2 255.255.255.0 2404:2000:2002:1005::2/64
R3   c2 1.1.2.3 255.255.255.0 2404:2000:2002:1002::3/64
R3   c3 1.1.3.3 255.255.255.0 2404:2000:2002:1003::3/64
R3   c7 1.1.7.3 255.255.255.0 2404:2000:2002:1007::3/64
R4   c5 1.1.5.4 255.255.255.0 2404:2000:2002:1005::4/64
R4   c6 1.1.6.4 255.255.255.0 2404:2000:2002:1006::4/64
R5   c4 1.1.4.5 255.255.255.0 2404:2000:2002:1004::5/64
R5   c8 1.1.8.5 255.255.255.0 2404:2000:2002:1008::5/64
R5   c9 1.1.9.5 255.255.255.0 2404:2000:2002:1009::5/64
R6   c6 1.1.6.6 255.255.255.0 2404:2000:2002:1006::6/64
R6   c7 1.1.7.6 255.255.255.0 2404:2000:2002:1007::6/64
R6   c8 1.1.8.6 255.255.255.0 2404:2000:2002:1008::6/64
R6   c10 1.1.10.6 255.255.255.0 2404:2000:2002:1010::6/64
R6   c13 1.1.13.6 255.255.255.0 2404:2000:2002:1013::6/64
R6   c14 1.1.14.6 255.255.255.0 2404:2000:2002:1014::6/64
R7   c9 1.1.9.7 255.255.255.0 2404:2000:2002:1009::7/64
R7   c10 1.1.10.7 255.255.255.0 2404:2000:2002:1010::7/64
m1 eth0 c11 1.1.11.10 255.255.255.0 2404:2000:2002:1011::10/64
m2 eth0 c12 1.1.12.20 255.255.255.0 2404:2000:2002:1012::20/64
m3 eth0 c13 1.1.13.30 255.255.255.0 2404:2000:2002:1013::30/64
m4 eth0 c14 1.1.14.40 255.255.255.0 2404:2000:2002:1014::40/64

The table gives the address allocations for each of the links. Use the information in this table to create the links - for example, link c1 should connect R1 and R2. You will need to record the ports allocated to each link on the routers. To make this easier, select:

View -> Show -> Interface Names

Doing so will show you which interface names between pairs of routers and hosts need to be configured with the given IP addresses. For example, link c3 between R1 and R2 will require you to configure eth1 on R1 and eth1 on R3:

image2.png

TASK 1

  • Include a copy of the completed table in your report.

QUESTIONS

1. How many subnets are there in the network? Support your answer by listing down all the subnet addresses (using both IPv4 and IPv6 addresses).

2. What is a netmask and why does IPv4 need one?

3. Are you able to ping m3 from m1? Why?

TASK 2

Ensure you select the following:

View -> Show -> IPv4 Addresses

And:

View -> Show -> IPv6 Addresses 
  • Save your CORE topology file as lab2-task2.imn. Include a screenshot of YOUR network diagram in your report. The screenshot should include visible IPv4 and IPv6 addresses. It is acceptable (and often necessary) to include a seperate screenshot for each address type. For the sake of readability, deselect:

View -> Show -> Interface Names

Starting up the Devices

Make sure you have completed the above network topology and configured all the addresses before starting the emulation.

Once you are ready, start the emulation by clicking the "Start Emulation" button (the green play button). CORE will create instances of the virtual routers and hosts which may take a few seconds. Please wait for the session to be ready.

You will now login to the routers to configure them. To login to each network device, double click on it - an xterm terminal window will open. You have full administrative rights on the CORE nodes and can modify files on the host - with power comes responsibility!

You will test the link between each routers follows: On every router (R1 to R7), use ping and ping6 to test the connection to every directly connected router. For instance, for R1, you should ping and ping6 to R2 and R3 since R1 is directly connected to these 2 routers. There is no routing set up yet so will not be able to ping across the network. This is a laborious task but you need to make sure each link is tested and working before you proceed.

TASK 3

  • Record your ping and ping6 tests showing that IPv4 and IPv6 connectivity between the routers and their directly connected neighbours is possible. You will test connectivity from the hosts to the routers they are directly connected to next, in Task 4.
For example:

R1:~# ping -c 3 1.1.1.2
PING 1.1.1.2 (1.1.1.2) 56(84) bytes of data.
64 bytes from 1.1.1.2: icmp_seq=1 ttl=64 time=20.8 ms
64 bytes from 1.1.1.2: icmp_seq=2 ttl=64 time=0.427 ms
64 bytes from 1.1.1.2: icmp_seq=3 ttl=64 time=0.389 ms

--- 1.1.1.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2025ms
rtt min/avg/max/mdev = 0.389/7.220/20.846/9.635 ms

and

R1:~# ping6 -c 3 2404:2000:2002:1001::2
PING 2404:2000:2002:1001::2(2404:2000:2002:1001::2) 56 data bytes
64 bytes from 2404:2000:2002:1001::2: icmp_seq=1 ttl=64 time=20.6 ms
64 bytes from 2404:2000:2002:1001::2: icmp_seq=2 ttl=64 time=0.521 ms
64 bytes from 2404:2000:2002:1001::2: icmp_seq=3 ttl=64 time=0.176 ms

--- 2404:2000:2002:1001::2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2025ms
rtt min/avg/max/mdev = 0.176/7.108/20.629/9.561 ms

Configuring the Linux hosts

Login to the machine m1. CORE automatically configures a default route on hosts m1 and m2. For hosts m3 and m4, you will need to set the default gateway (while the emulation is stopped) by selecting "services" and then clicking the tool icon next to "DefaultRoute", under the "Utility" column. Change the CORE default to match the appropriate IP of the gateway (i.e., 1.1.13.6 or 1.1.14.6 depending on what host you are configuring). You will need to do this for the IPv6 default gateway entry too.

Examine the IPv4 and IPv6 routing table in the host using the route command.

QUESTION

4. What is a default gateway?

Again you should examine the other Linux hosts and test that you can ping and ping6 neighbouring devices.

TASK 4

  • Record your ping and ping6 tests showing that IPv4 and IPv6 connectivity between the hosts and the routers they are directly connected to is possible.

The Quagga Routing Suite

The router devices use a software package called Quagga, which is an open-source routing protocol suite for Linux and Unix. If you want to know more about Quagga, visit the docs.

The command line interface to this software is a very good implementation of the industry standard Cisco routers so using Google to find Quagga and Cisco documentation will be helpful. Quagga runs as a set of Unix processes that handle different routing protocols. In this lab, we will be using the Zebra, OSPFv2 (IPv4), and OSPFv3 (IPv6). You can connect to these processes using telnet:

Process Command Usage
Zebra telnet localhost 2601 Configure interfaces, static routes
OSPF telnet localhost 2604 Configure OSPF for IPv4
OSPF6 telnet localhost 2606 Configure OSPF for IPv6
If you are presented with a “connection refused” error, ensure the appropriate services have been enabled in the CORE GUI.

HINT: The configuration of Zebra and OSPF follows Cisco-alike style. It means you can undo your configuration by "no + original command".

HINT: There is no default password (or enable password) set. You can configure them (while the emulation is stopped) by right-clicking on the node you wish to connect to, selecting "services", then selecting "Zebra", and finally entering the following at the bottom of the file:

password zebra
enable password zebra

We'll be connecting to the OSPF process later in the lab to debug it. Next, practice connecting to the Zebra process to familiarise yourself.

Connect to the Zebra process on R1

Let us try connect to the Zebra process on router R1. To connect to Zebra, type "telnet localhost 2601." You should see something like this:

R1:~# telnet localhost 2601 
Trying 127.0.0.1... 
Connected to localhost. 
Escape character is '^]'. 

Hello, this is Quagga (version 1.2.4). 
Copyright 1996-2005 Kunihiro Ishiguro, et al. 

User Access Verification 

Password:
Router> enable
Password: 
Router# 

You need to use enable to gain administrative privilege. You can look at the current configuration using the commands:

enable
show running-config

Configuring static routing

We said earlier that routing was not configured across the network. That means that each router can only talk to devices on networks it is directly connected to. Check the routing table using the route (or route -6) command:

R2:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
1.1.1.0       *               255.255.255.0   U     0      0        0 eth0
1.1.3.0       *               255.255.255.0   U     0      0        0 eth1
1.1.4.0       *               255.255.255.0   U     0      0        0 eth2
1.1.5.0       *               255.255.255.0   U     0      0        0 eth3

For IPv4, that means devices it can reach with ARP.

QUESTION

5. What is the mechanism for IPv6 which corresponds to ARP? Briefly describe this in your report.

You will configure each router and create static routes to other networks. For example, configure R2 and add routes to the network between R3 and R6 under the zebra service like this:

ip route 1.1.7.0/24 1.1.3.3
ipv6 route 2404:2000:2002:1007::/64 2404:2000:2002:1003::3

Try adding these routes to the bottom of the configuration file and check the output of the route command to see the changes. Your configuration file should look similar to the image below:

97f8650690b50e1dd5b1533a09c7f4b5.png

HINT: This is an example. If you ping router R6 from router R2, you will need to configure routes for the return path for traffic to take, or you will not see a response.

QUESTIONS

6. How many static routes, at the minimum, would you need to add to allow m1, m2, m3 and m4 to talk to each other? Explain how you reached your answer. (Note: you need to consider both IPv4 and IPv6.)

7. In a number of places there is a choice of paths. What is the criteria (metric) that you use to choose the path(s)?

Let us now modify the network to be more realistic. In particular, let us limit the capacities of every link as follows:
Link Capacity (Mbps)
c1 400
c2 100
c3 50
c4 1000
c5 50
c6 100
c7 25
c8 50
c9 100
c10 200
c11 Unlimited
c12 Unlimited
c13 Unlimited
c14 Unlimited
Double click on the link to change its characteristics.

HINT: Before moving forward, install nerperf with the command "sudo apt install -y netperf".

You will now measure the performance of the static routes you have setup above between hosts m1 and m3 using Netperf. To do this, open a terminal on each host m1 and m3. Setup m1 as the Netperf server by typing this command:

netserver

Note that the Netperf server will listen to port 12865 by default. Run the Netperf client on m3 by typing this command:

netperf -H 1.1.11.10 -l 60 -t TCP_STREAM

TASK 5

  • Record the results shown by Netperf in your report.

Next, study the network and consider the link capacity. Find a better route between hosts m1 and m3 and reconfigure the static routes accordingly. Repeat the tests using netperf.

TASK 6

  • Record the new results shown by Netperf in your report.

QUESTIONS

8. How has the network performance improved with your route reconfiguration? Explain your answer.

9. Do you need to also configure another set of static routes for m2 and m4 to communicate with improved performance? Why?

Part (b) - Dynamic Routing using OSPF and OSPF6

Even if you weren't able to calculate the answer to Q6 above correctly you can see that the answer is not trivial and as your network grows and more routers are added the problem gets much harder. We'll create a simple OSPF setup on the seven routers so that each device will be able to reach all the others.

Remove any static routes you added in the previous section. While the emulation is stopped, right-click on the nodes and select "services". Comment out the routes you added under the Zebra configuration.

Configuring OSPF

Now we need to enable the OSPF services using the CORE GUI. While the emulation is stopped, right-click on a node, select "services", then select "OSPF" and "OSPFv3". Your configuration should look similar to the image below:

1c0a0b46375e17cfc3eb5459121bd3e0.png

Once you apply the changes CORE will automatically update the Zebra configuration with the appropriate OSPFv2 and OSPFv3 settings.

What has changed?

We can look at the changes in a number of ways.

HINT: When running OSPF-specific (or OSPFv3-specific) commands, you need to telnet to the appropriate process - refer to the table earlier to find the correct ports. Alternatively, you can type "vtysh" into the terminal running on a node to execute many of the commands without entering a specific process. Note that the OSPF debugging you will perform later cannot be run from vtysh and must be run when connected to a process directly (i.e., telnet localhost 2604 for OSPFv2/IPv4 or telnet localhost 2606 for OSPFv3/IPv6).

From the OSPFv2 process we can run the command show ip ospf route to give something like this:

b113147ba9a32fcae8fd7f8f79b4c3d0.png

If you can't see all subnets, find out why and fix it.

TASK 1

  • Include at least one version of this routing table in your report.

QUESTIONS

1. Which router was the example above taken from? Briefly explain your answer.

2. Will the table look the same on each router? Briefly explain your answer.

TASK 2

  • Disconnect from the OSPF process on one of the routers and run the route command at the Unix prompt. Describe how the Unix routing table has changed.

Configuring OSPF6

Check your OSPFv3 (IPv6) routing table to ensure all the subnets are showing as expected.

HINT: We can run the command show ipv6 ospf6 route to give the desired output.

TASK 3

  • Record the OSPFv3 (IPv6) routing table in your report.

QUESTION

3. How would you test that this change (OSPFv3 is now running on all routers) enables IPv6 packets to be forwarded?

Exploring the network from the edge

We should now have a working network which we can test and explore. Every device should be reachable from every other device. For example, if you log into m4 you should be able to ping m2:

ping -n 1.1.12.20
ping6 -n 2404:2000:2002:1012::20

Find out what the -n flag does. Why do we use it here?

We can also use the tools traceroute and traceroute6 to see the path that packets take through the network. For example:

ed9def9967e7a9cbfd046cbc0477c494.png

Next, double click on either R1 or R3 and run the command:

ifconfig eth1 down

This disconnects the link C2 shown on the network diagram earlier. Re-run the traceroute command. Once you are done, you can bring the link back up:

ifconfig eth1 up

QUESTIONS

4. What happens to the output of traceroute after disconnecting? Explain the result.

5. What happens if you wait for some time? Explain the result.

6. What happens if you Re-connect the link c2? Explain the result.

7. The changes you see take some time to happen. How long? Explain your result and how you worked this out.

You also trace the path that packets take through the network using mtr and ping -R. These tools are used very commonly to test for and diagnose network problems. Try using them while disconnecting links. Each tool has advantages and disadvantages in this situation.

TASK 4

  • Test your IPv6 network using the aforementioned tools and record the results of your tests.

Exploring the network from the core

In the section above we tried turning a link off and on again to see what happens from a user perspective. In this section we'll look more closely at what's happening with the OSPF protocols in the core. Connect to R3 and then connect to the OSPF process. Look at the routing table using show ip ospf route command.

QUESTION

8. What changes occurred to this table when you disconnect c2?

OSPF in action

HINT: Connect to the OSPF process by typing "telnet localhost 2604".

We can examine the OSPF protocol much more closely by turning on debugging in the OSPF process using:

enable
terminal monitor
debug ospf lsa

This puts a significant load on a router in production and we need to turn it off when we've finished debugging by using:

no debug ospf lsa
no terminal monitor

This allows to look at the Link State Advertisements in OSPF. Repeat the experiment with disconnecting c2.

TASK 5

  • Record the debugging output from the experiment with disconnecting c2.

QUESTION

9. What happened when c2 was disconnected? Use your theoretical knowledge of OSPF and debugging output from the router to explain.

What to hand in

  • A PDF format report including your answers to all the questions and output from all the tasks listed above.
  • The completed CORE file lab2-task2.imn

Grading scheme

The following aspects will be assessed:

  1. (80%) Did you correctly answer the questions and compete the tasks?
    • Part (a) (40%)
    • Part (b) (40%)
  2. (20%) Is the report well written?
    • Marks awarded for:
      • Clarity - Is each part, task and question clearly marked?
      • Consistency - Has the chosen format been adhered to?
      • Presentation - Free of spelling/grammatical/typographical errors.
That's the end of this lab. If you have any issues, attend any of the Helpdesk sessions, or e-mail nwen302-staff@ecs.vuw.ac.nz.
Topic attachments
I Attachment Action Size Date Who Comment
97f8650690b50e1dd5b1533a09c7f4b5.pngpng 97f8650690b50e1dd5b1533a09c7f4b5.png manage 39 K 15 Sep 2021 - 01:29 Main.camerodunc1 Auto-attached by ImagePlugin