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.
- Part (a): Static Routing
- Part (b) - Dynamic Routing using OSPF and OSPF6
- What to hand in
- Grading scheme
IntroductionIn 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. 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 poweroffon a terminal connected to the VM.
Part (a): Static Routing
Network LayoutThe network you are going to build and configure is shown below and comprises seven routers and four hosts. 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|
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:
- Include a copy of the completed table in your report.
QUESTIONS1. 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?
Ensure you select the following:
View -> Show -> IPv4 Addresses
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 DevicesMake 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.
- 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.
R1:~# ping -c 3 18.104.22.168and
PING 22.214.171.124 (126.96.36.199) 56(84) bytes of data.
64 bytes from 188.8.131.52: icmp_seq=1 ttl=64 time=20.8 ms
64 bytes from 184.108.40.206: icmp_seq=2 ttl=64 time=0.427 ms
64 bytes from 220.127.116.11: icmp_seq=3 ttl=64 time=0.389 ms
--- 18.104.22.168 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
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 hostsLogin 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., 22.214.171.124 or 126.96.36.199 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.
QUESTION4. What is a default gateway? Again you should examine the other Linux hosts and test that you can ping and ping6 neighbouring devices.
- 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 SuiteThe 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:
||Configure interfaces, static routes|
||Configure OSPF for IPv4|
||Configure OSPF for IPv6|
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:
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 R1Let 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
enableto gain administrative privilege. You can look at the current configuration using the commands:
enable show running-config
Configuring static routingWe 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 -6) command:
R2:~# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 188.8.131.52 * 255.255.255.0 U 0 0 0 eth0 184.108.40.206 * 255.255.255.0 U 0 0 0 eth1 220.127.116.11 * 255.255.255.0 U 0 0 0 eth2 18.104.22.168 * 255.255.255.0 U 0 0 0 eth3For IPv4, that means devices it can reach with ARP.
QUESTION5. 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 22.214.171.124/24 126.96.36.199 ipv6 route 2404:2000:2002:1007::/64 2404:2000:2002:1003::3Try 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: 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.
QUESTIONS6. 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:
netserverNote that the Netperf server will listen to port 12865 by default. Run the Netperf client on m3 by typing this command:
netperf -H 188.8.131.52 -l 60 -t TCP_STREAM
- Record the results shown by Netperf in your report.
- Record the new results shown by Netperf in your report.
QUESTIONS8. 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 OSPF6Even 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 OSPFNow 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: 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 routeto give something like this: If you can't see all subnets, find out why and fix it.
- Include at least one version of this routing table in your report.
QUESTIONS1. 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.
- Disconnect from the OSPF process on one of the routers and run the
routecommand at the Unix prompt. Describe how the Unix routing table has changed.
Configuring OSPF6Check your OSPFv3 (IPv6) routing table to ensure all the subnets are showing as expected. HINT: We can run the command
show ipv6 ospf6 routeto give the desired output.
- Record the OSPFv3 (IPv6) routing table in your report.
QUESTION3. 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 edgeWe 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 184.108.40.206 ping6 -n 2404:2000:2002:1012::20Find out what the -n flag does. Why do we use it here? We can also use the tools
traceroute6to see the path that packets take through the network. For example:
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
QUESTIONS4. 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.
- Test your IPv6 network using the aforementioned tools and record the results of your tests.
Exploring the network from the coreIn 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.
QUESTION8. What changes occurred to this table when you disconnect c2?
OSPF in actionHINT: 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 lsaThis 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 monitorThis allows to look at the Link State Advertisements in OSPF. Repeat the experiment with disconnecting c2.
- Record the debugging output from the experiment with disconnecting c2.
QUESTION9. 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 schemeThe following aspects will be assessed:
- (80%) Did you correctly answer the questions and compete the tasks?
- Part (a) (40%)
- Part (b) (40%)
- (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.
- Marks awarded for: