0% found this document useful (0 votes)
66 views

Programming Assignment 4 Steps 1-5

This document describes programming assignment 4 for a subnet addressing project in Mininet. It provides the steps taken to create the network with hosts, switches and routers and assign IP addresses and default routes. It explains that static routes were needed between all network elements for full connectivity. Issues in the original program are discussed like order of elements and lack of routes. Lessons learned include the importance of element order, explicit routes, and debugging techniques.

Uploaded by

api-540907926
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

Programming Assignment 4 Steps 1-5

This document describes programming assignment 4 for a subnet addressing project in Mininet. It provides the steps taken to create the network with hosts, switches and routers and assign IP addresses and default routes. It explains that static routes were needed between all network elements for full connectivity. Issues in the original program are discussed like order of elements and lack of routes. Lessons learned include the importance of element order, explicit routes, and debugging techniques.

Uploaded by

api-540907926
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Programming Assignment 4 - Subnet Addressing in Mininet

Team 2 - Connect4U
Matthew Stoney, Cheuk On Yim, Paola Torres, Wicaksa Munajat

Step 1: Labeled Network


Step 2: Screen capture of program without errors
Step 3: Screen capture of successful pingall (and successful h1 and h2 pings)
Step 4: List of lines that were changed
The following line numbers correspond to the legacy_routers.py script submitted with this
assignment.
1. Line 24: The ipBase was changed to 10.0.1.0/24 from the original 10.0.0.0/8 to reflect
the private networks network created.
2. Line 35 and 36: These lines were moved up so the switches are created before the
routers. In the original python script generated by miniedit, s2 was located after r5 and
s1 was located after r4. This caused compile errors.
3. Line 41: The IP address portion of this line for r3 was modified to 10.0.1.2/24. The
original miniedit script had the IP address as all zeros. This is the line where r3 gets its
corresponding IP address in the West Coast Network of 254 hosts that leads to h1.
4. Line 43: The IP address portion of this line for r4 was modified to 192.168.1.2/30. The
original miniedit script had the IP address as all zeros. This is the line where r4 received
its corresponding IP address in the network.
5. Line 45: The IP address portion of this line for r5 was modified to 10.0.2.2/24. The
original miniedit script had the IP address as all zeros. This is the line where r5 gets its
corresponding IP address in the East Coast Network of 254 hosts that leads to h2.
6. Line 52: This line was modified to assign h1 its IP address with a subnet mask. The
default route portion of this line was modified to lead to the r3 router interface facing h1.
The original miniedit script had the default route as none and the IP address did not
include the subnet mask.
7. Line 53: This line was modified to assign h2 its IP address with a subnet mask. The
default route portion of this line was modified to lead to the r5 router interface facing h2.
The original miniedit script had the default route as none and the IP address did not
include the subnet mask.
8. Line 59: was moved up in the file and reordered to h2,s2. In the original miniedit script,
this line appears at the bottom of all the addLink commands. This was moved up and
flipped so that the host links are added first, then the switches, then the routers.
9. Line 60 and 61: the interfaces and their corresponding IP addresses between switch 1
and r1 and switch 2 and r5, respectively, are created and linked. The original miniedit
script did not include any interfaces.This creates the link between the routers and
switches. The switches do not have IP addresses, only the routers.
10. Line 62 and 63: the interfaces and their corresponding IP addresses between r3 and r4
and r4 and r5, respectively, are created and linked. The original miniedit script did not
include any interfaces. This creates the link between the routers.
11. Line 80 through 85: These lines were added to create the 6 static routes which allow the
network as whole to pingall. The original script created by the miniedit did not include
these lines. Each router has two routes assigned to it. For r3 and r5 the routes are to
reach the router on the opposite side of the network and the host on the opposite side of
the network. For r4, the routes are to reach both hosts via both their corresponding
routers.

Step 5: Answers to the questions:


a. What were any interesting findings and lessons learned?
1. The lessons learned from this assignment were that order matters when creating
networks, at least to some extent.
2. Even if the links and interfaces are created, the network will not work until the
routes are explicitly given to the network.
3. Routes are not bidirectional so a route must be given for traveling right through
the routers and then another route for traveling left through the routers.
4. Drawing a picture of the network helps in selecting all the routes because there
are too many numbers to keep track of mentally. This also helps give a visual
representation of the network.
5. When debugging, always check that the interfaces are all spelled correctly. This
will save hours of debugging.
b. Why didn’t the original program forward packets between the hosts?
The original script created by miniedit was unable to forward packets between the hosts
because the elements of the network were only able to see their next hop routers and
nothing else beyond this. Their routing tables were not filled originally so the paths
between network elements (hosts, switches, routers) were unknown.
c. Is the line ‘r3.cmd(‘sysctl -w net.ipv4.ip_forward=1’)’ required?
Yes, this line is required in all three routers because this is what enables IPv4
forwarding. Setting forward equal to 0 would disable forwarding which would prevent
packets from being transmitted between router interfaces.
d. Intentionally break your working program, e.g.: change a subnet length, IP
address, or default route for a host. Explain why your change caused the network
to break.
Changing a single IP address in the program successfully breaks it because the mapped
routing tables are now incorrect. This new element is not included in the routing tables
so it becomes a bit of a blind spot in the network. Without any working instructions the
routers don’t know how to route packets through this IP address because their tables say
that that specific interface should have a different IP address than what it was incorrectly
modified to.

You might also like