Pa4 Team8 Writeup
Pa4 Team8 Writeup
Fnu Shanawaz
Rayaan Mammon
Robin Hurtado
Programming Assignment 4
1. Network design
3. Pingall:
4. Changes Made:
To get the network running so that all nodes can ping each other, I made the following
changes, as shown in the comments on legacy_network.py in lines 35-88:
#added default route for each host through the interface on the adjoining router
through which the host is connected to the router
info('*** Add hosts\n')
h1 = net.addHost('h1', cls=Host, ip='10.0.0.1/24', defaultRoute='via 10.0.0.3')
h2 = net.addHost('h2', cls=Host, ip='10.0.0.2/24', defaultRoute='via 10.0.0.3')
h3 = net.addHost('h3', cls=Host, ip='10.0.1.1/24', defaultRoute='via 10.0.1.3')
h4 = net.addHost('h4', cls=Host, ip='10.0.1.2/24', defaultRoute='via 10.0.1.3')
#separated these out in groups that made sense to me so I could more easily
see connected nodes
info('*** Add links\n')
net.addLink(h1, s1)
net.addLink(h2, s1)
net.addLink(h3, s2)
net.addLink(h4, s2)
net.addLink(s2, r5)
net.addLink(s1, r3)
5. Questions:
● What were any interesting findings and lessons learned?
I started off thinking this would be simple, that we already had the pieces, and it
would just be a couple of little tweaks to put it all together. Instead, I ended up
spending two solid weeks trying to get the network connected correctly,
searching mininet api and python commands, and then forgetting everything
about subnetting while trying just to get the nodes to all talk to each other. I know
from our meetings that my teammates were also struggling with understanding
how to accomplish their parts as well, so collaborating to help each other or bring
the pieces together was very difficult. I know I personally learned a ton about
mininet, and have very little experience with Python, so I learned a lot of python
commands as well. One of the big things I had to figure out to accomplish the
route forwarding was how to send a command to the node. It was not difficult,
but it felt like a big win when I figured it out.
● Why didn’t the original program forward packets between the hosts?
The original program did not forward packets between the hosts for three
reasons that I can see. First, each node could only see what it was directly
attached to, so packets from the host were only making it as far as the first router
connected to that host. Second, because the routers did not have ip addresses
assigned by default, there was no way to even tell the packets how to get
through. Third, the hosts did not have default routes set up. I wasn’t sure if that
was really necessary, but once I got the network working I tested what happened
if I removed the default routes from the hosts. I found that broke it, so I
determined the default routes were essential.
Yes. This is the line that enables forwarding on the routers. R3 has to be able to
forward packets between the subnet it shares with the hosts on to the subnet it
shares with r4, and r4 has to be able forward between its two subnets, and r5 has
to be able to forward between ITS two subnets. So the forwarding needs to be
enabled on every one of the routers.
I broke this many times on the path to figuring it out. Removing a default route
from the hosts isolates them to only communicate with the nodes they are
connected with. The host does not know by default to go through the router to be
able to go outside of that direct subnet. Going through the router gives the
node’s packets access to the other subnets because the router contains the
routing table that directs the router where to send that packet to get it one step
closer to its destination.
6. Screen cap of chat session
Screen cap of Wireshark trace
Screen cap of successful wget
Screen cap of both encrypted server (web and chat) clients