0% found this document useful (0 votes)
86 views5 pages

Pa4 Team8 Writeup

Uploaded by

api-755222816
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)
86 views5 pages

Pa4 Team8 Writeup

Uploaded by

api-755222816
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
You are on page 1/ 5

Team 8

Fnu Shanawaz
Rayaan Mammon
Robin Hurtado

Programming Assignment 4

1. Network design

2. Screen cap of full program running with no errors


- We got the legacy updated to work and ping all, but were not able to get the
whole thing running with the server client and tls as well.

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:

# moved adding switches to before adding routers per instructions

#changed ip=None to ip=CIDR notation subnet for each router


r3 = net.addHost('r3', cls=Node, ip='10.0.0.3/24')
r3.cmd('sysctl -w net.ipv4.ip_forward=1')
r4 = net.addHost('r4', cls=Node, ip='192.168.1.1/30')
r4.cmd('sysctl -w net.ipv4.ip_forward=1')
r5 = net.addHost('r5', cls=Node, ip='10.0.1.3/24')
r5.cmd('sysctl -w net.ipv4.ip_forward=1')

#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)

# assigned ip addresses to r3 & r4 connected interfaces


net.addLink(r3, r4, intfName1='r3-eth1', params1={'ip': '192.168.1.2/30'},
intfName2='r4-eth0',params2={'ip': '192.168.1.1/30'})

# assigned ip addresses to r4 & r5 connected interfaces


net.addLink(r4, r5, intfName1='r4-eth1', params1={'ip': '192.168.2.2/30'},
intfName2='r5-eth1', params2={'ip': '192.168.2.1/30'})

#added forwarding rules info and section


info('*** Add forwarding rules\n')

#forwarding rule for r3 to reach subnet attaching to r5 through attached r4


r3.cmd('ip route add 192.168.2.0/30 via 192.168.1.1 dev r3-eth1')
# forwarding rule for r3 to reach subnet attaching to h3&h4 through attached r4
r3.cmd('ip route add 10.0.1.0/24 via 192.168.1.1 dev r3-eth1')

# forwarding rule for r4 to reach subnet attaching to h1&h2 through attached r3


r4.cmd('ip route add 10.0.0.0/24 via 192.168.1.2 dev r4-eth0')
# forwarding rule for r4 to reach subnet attaching to h3&h4 through attached r5
r4.cmd('ip route add 10.0.1.0/24 via 192.168.2.1 dev r4-eth1')

# forwarding rule for r5 to reach subnet attaching to r4 through attached r4


r5.cmd('ip route add 192.168.1.0/30 via 192.168.2.2 dev r5-eth1')
# forwarding rule for r5 to reach subnet attaching to h1&h2 through attached r4
r5.cmd('ip route add 10.0.0.0/24 via 192.168.2.2 dev r5-eth1')

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.

● Is the line ‘ r3.cmd('sysctl -w net.ipv4.ip_forward=1') ’ required?

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.

● 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.

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

You might also like