Professional Documents
Culture Documents
Pa4 Gonzalez Houser Pettit Reed
Pa4 Gonzalez Houser Pettit Reed
1. Network Design:
● Gonzalez
● Houser
● Pettit
Final Code
from mininet.net import Mininet
from mininet.node import Host, Node
from mininet.cli import CLI
from mininet.log import setLogLevel, info
def myNetwork():
# Change the ipbase from 10.0.0.0/8 to 10.0.1.0/24 allowing us to divide the address space
# into multiple subnets
net = Mininet(topo=None, build=False, ipBase='10.0.1.0/24')
info('*** Adding controller\n')
info('*** Adding switches\n')
info('***Add links\n')
#assign r1-eth1 10.0.1.1/24 connected to h2 at 10.0.1.2/24
net.addLink(h2, r1, intfName2='r1-eth1', params2={'ip': '10.0.1.1/24'})
if __name__ == '__main__':
setLogLevel('info')
myNetwork()
Original code
from mininet.net import Mininet
from mininet.node import Host, Node
from mininet.cli import CLI
from mininet.log import setLogLevel, info
def myNetwork():
net = Mininet(topo=None, build=False,
ipBase='10.0.0.0/8')
Changes:
We updated the IP addresses to make it a little easier on the brain to read, 1 and 2 for host 1
and 2, and then used a /24 mask to split the subnets at that level. The /8 subnet mask originally
wasn’t discrete enough to differentiate between our subnets.
We also put in the default route to flow each host back through the appropriate link off the
router.
3. Screen capture of the programming running with no Python errors (needed only if
step 4 and step 5 below don’t work.
6. Questions:
a. What were any interesting things found and lessons learned?
There was no default route and as it was setup, the mask was not discrete
enough.
Yes, without this line both hosts can ping the router, but it will not forward
anything between subnets, so h1 cannot ping h2.
We elected to change the subnet mask of h1 from /24 to /8. This change broke
the program and made h2 unreachable from h1, and h1 unreachable from h2.
Changing the subnet mask, changes the network segment portion of the IP
address. This moves the host to an unrecognized subnet with no default route to
reach other hosts on the network.