0% found this document useful (0 votes)
15 views7 pages

Communication Protocols Lab 4 Guide

The document contains laboratory notes for a course on Communication Protocols, specifically focusing on static routing and Linux routing. It outlines the objectives, pre-lab work, setup instructions, and detailed laboratory tasks for students to understand IP fundamentals and routing tables. The lab includes tasks such as basic routing, static routing with circular and optimized routes, and analyzing routing loops using Mininet.

Uploaded by

ninhkhoai2106
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views7 pages

Communication Protocols Lab 4 Guide

The document contains laboratory notes for a course on Communication Protocols, specifically focusing on static routing and Linux routing. It outlines the objectives, pre-lab work, setup instructions, and detailed laboratory tasks for students to understand IP fundamentals and routing tables. The lab includes tasks such as basic routing, static routing with circular and optimized routes, and analyzing routing loops using Mininet.

Uploaded by

ninhkhoai2106
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

49202: Communication Protocols

Laboratory Notes: Laboratory 4

Dr. Daniel R. Franklin

March 15, 2021

March 15, 2021 Laboratory Notes - 49202- Communication Protocols 1


CONTENTS CONTENTS

Contents

1 Introduction 2

2 Pre-Lab Work 2

3 Setup 3

4 Laboratory Tasks 4
4.1 Basic Linux Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
4.2 Static routing - circular route . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4.3 Static routing - optimised route . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4.4 Static routing - routing loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

March 15, 2021 Laboratory Notes - 49202- Communication Protocols 1


2 PRE-LAB WORK

1 Introduction
This laboratory primarily covers the content in Module 4, but also includes some material from other
Modules. The main aims of this laboratory are to:
1. To understand some of the fundamentals of IP and the network layer;
2. To understand how to read the routing table of a Linux router; and
3. To learn about static routing (and its shortcomings!).

2 Pre-Lab Work
Before attending the laboratory, you should complete the following pre-lab questions. This will
greatly improve your understanding of what is happening in the laboratory.
1. For the network topology shown in Figure 1, host h1 wants to ping h2.
Assume that each of the core routers has a single static route (in addition to the locally-
connected networks): packets matching [Link]/0 (the default route, i.e. anything not for local
delivery) will be forwarded to the next (clockwise) router in the ring. This is the same as for
the first lab exercise, described in Section 4.2.
(a) What route does the ICMP ping request take?
(b) What route does the ICMP ping reply take?
(c) What is the total number of hops (sum of ping request and ping reply)?
(d) How will the total number of hops differ from any other host that might be pinged in the
network?
(e) Assuming that all links exhibit a fixed latency (delay). What does your result from the
previous part problem imply about the expected total ping time?
(f) What happens if link between r1 and r5 is unplugged?
(g) What happens if link between r1 and r2 is unplugged?
(h) What would do you think might happen if you tried to ping an IP address which doesn’t
actually exist in this network (e.g. [Link])? How would h1 discover this?
2. Repeat the preceding problem, but assume that an optimised static routing table (i.e. all routes
are as short as possible) is used on all routers.
3. Calculate the full optimal routing table for r1 to all other hosts, assuming all links have a metric
(cost) of 100 in both directions.
4. Repeat if the cost of the link between r1 and r2 increased to 1000.
5. Repeat if the link between r1 and r2 is deleted.

March 15, 2021 Laboratory Notes - 49202- Communication Protocols 2


3 SETUP

Internet
h1 h2
h1-eth0 h2-eth0
enp0s3 [Link]
r9-eth1 [Link]
[Link]

r9 (NAT) r1-eth3
r1- r2-eth3
e
10. th5 [Link] r2 [Link]
1.9 r1-eth1 r2-eth1
.1
[Link] [Link]
r2
th .1r1 10 -eth
2 r3

r1- 1.5.1
2
th .8 -e .2 2 10 -eth

10
r1 .1.8 .3

eth
-e .2 .2 1
r8 .8.1
.
10 .3

4
.3
h8-eth0 10 h3-eth0
h8 [Link] r8 r3 h3
r8-eth3 r3-eth3 [Link]
[Link] r8-eth1 r3-eth2 [Link]
[Link] [Link]
r7-eth2 r4-eth1
r7-eth3 [Link] [Link] r4-eth3
[Link]
[Link] r7 r4
h7-eth0 r7
r5- 5.1.5 h4-eth0
2
10 -eth r6 th .4 [Link]
10
eth
[Link] -e 1 -e
.6 1 10 th .5 r4 .4.5
.

t
.7 .6 h2 -e
4

.7 .7
.6 r5 .4.5 10
1 0
r6-eth1 r5-eth2
h7 [Link] [Link] h4
r6 r6-eth3 r5 r5-eth3
[Link]
[Link]

h6-eth0 h5-eth0
[Link] [Link]

h6 h5

Figure 1: Network topology for Lab 4.

3 Setup
Prior to starting the lab, start your virtual machine (refer to Lab 1 notes) and make sure you have the
latest version of the lab scripts:
cd ˜/comm-protocols-labs
git pull
Start your VM (as described in Lab 1), open a terminal window (note: you may always open more
than one terminal window if desired). For this lab, the virtual routers will be configured as shown in
Figure 1 - this is identical to the logical configuration used in Lab 1, with the difference being that
now we are using different approaches to routing.

March 15, 2021 Laboratory Notes - 49202- Communication Protocols 3


4 LABORATORY TASKS

4 Laboratory Tasks

4.1 Basic Linux Routing


Start Mininet from the ospf ring folder:
cd ˜/comm-protocols-labs/ospf_ring
sudo ../[Link]
1. Open two terminals on the same host (e.g. by typing xterm h3 twice at the Mininet prompt).
Confirm the IP address of this host:
ip addr
The interface on the host will have a name like h3-eth0; the IP address in this particular
network will end in a 1 and the subnet is /24 (for example [Link]/24).
2. Examine the routing table:
ip route
(you can also use the older-style unix command route or route -n).
You will see that there are two routes - a “default” route (which means [Link]/0) via the local
gateway, and a local route to the local subnet. Identify the IP address of the local gateway (in
our network it will end in .254) and ping this router (e.g. ping -c 5 [Link]).
3. In the second terminal on this host, issue the following command to delete the assigned IP
address:
ip addr del [Link]/24 dev h3-eth0
Note: this will also delete the default route (as the old local gateway will no longer be reach-
able). Now add an IP address belonging to a different subnet:
ip addr add [Link]/24 dev h3-eth0
Can you still ping the local gateway? Why or why not?
4. Now delete this IP address, and add a different IP address in the same subnet as the original
IP address of this node (e.g. [Link] - make sure you don’t use 254!). Can you ping the
gateway now? Why/why not? What would happen if we used .254?
5. Delete this IP address and restore the original configuration:
ip addr del [Link]/24 dev h3-eth0
ip addr add [Link]/24 dev h3-eth0
ip route add default via [Link]
6. VERY IMPORTANT - exit from mininet!. At the mininet> prompt, please type
exit

March 15, 2021 Laboratory Notes - 49202- Communication Protocols 4


4.2 Static routing - circular route 4 LABORATORY TASKS

to shut down Mininet. You can also use ctrl-d to do the same thing.

4.2 Static routing - circular route


Start Mininet from the static ring folder:
cd ˜/comm-protocols-labs/static_ring
sudo ../[Link]
In this topology, each of the core routers has a single static route (in addition to the locally-connected
networks): packets matching [Link]/0 (the default route, i.e. anything not for local delivery) will
be forwarded to the next (clockwise) router in the ring. NOTE: Internet access will not work in this
topology as there r9 is not in the ring).
1. Open a terminal on host h1. Sequentially ping each host in the network in turn (including h1
itself) using (for example) ping -c 10 h2 (and h3, h4 etc.). Record the mininum, average,
maximum, and standard deviation (mdev reported by ping. Compare the average latency to
each remote host. What do you notice? Given the routes described above, does this make sense?
2. Use traceroute (e.g. traceroute h2) to determine the path taken by the ICMP ping
request packets from h1 to each of the other hosts. Does traceroute give you any useful
information about the path taken by the ICMP ping reply packet? Explain.
3. Use the record-route option of ping (e.g. ping -R h2) to record the path taken by ICMP
ping request and reply packets throughout the network. Note: this can only record a maximum
of 9 hops due to the limited capacity of the IP header (where the path is stored in the ICMP
ping response packet).
Shut down Mininet (ctrl-d or exit at the Mininet prompt) when you have finished this part.

4.3 Static routing - optimised route


Start Mininet from the static opt ring folder:
cd ˜/comm-protocols-labs/static_opt_ring
sudo ../[Link]
Now all routes are shortest-path (assuming equal costs on all links; hence this equates to the minimum
number of hops).
Repeat each of the tasks performed in Section 4.2 - record ping times and routes to each host, recorded
via traceroute and ping -R. Do you see anything different?
Shut down Mininet after completing this step.

4.4 Static routing - routing loop


Start Mininet from the static routing loop folder:

March 15, 2021 Laboratory Notes - 49202- Communication Protocols 5


REFERENCES REFERENCES

cd ˜/comm-protocols-labs/static_routing_loop
sudo ../[Link]
This time, we have deliberately misconfigured the static routes on some of the routers in the network.
1. Examine the routing table on r1. What will happen to a packet intended for h8 when it arrives
at r1? Also examine the routing table on r5 and r4 (in that order), in particular the entries
which relate to r8’s subnet. Can you spot the mistake?
2. From h8, attempt a SINGLE ping of h4 (ping -c 1 [Link]) (or any of the hosts on
the right-hand half-network). Do you get a response? Explain. Note: you CAN’T use h4’s
hostname as the way we have misconfigured the routes will cause the DNS server on r9 to
become unreachable for h8.
3. Open Wireshark on r5 and start a capture on interface r5-eth1 (the interface between r5
and r4). Repeat the single ping and record what you observe. What is happening to the TTL
of the packet?
4. Would you expect to see an ICMP time exceeded in-transit packet being generated somewhere
in the network? Based on your observations in the previous step, try to guess where you might
see this packet, and run Wireshark on that router’s interface to verify your prediction.
5. From another host (for example, h1), try to ping a private IP address which doesn’t have an
associated host, such as [Link], but which exists within the [Link]/8 subnet. To
better understand what is happening, you can also run traceroute to this IP address, and
inspect the routing table on r9 (open an xterm directly on r9 and run ip route). What do
you observe? Can you explain the path that the packet takes - and what happens in the end?

References
[1] James F. Kurose and Keith W. Ross. Computer Networking A Top-Down Approach. 8th edition,
2020.
[2] Behrouz A. Forouzan. TCP/IP Protocol Suite. 4th edition, 2017.

March 15, 2021 Laboratory Notes - 49202- Communication Protocols 6

You might also like