oblig inf3190
play

Oblig INF3190 Marcel Marek Feb. 09, 2018 Mininet Virtual network - PowerPoint PPT Presentation

Oblig INF3190 Marcel Marek Feb. 09, 2018 Mininet Virtual network emulator Mininet CLI Python API Doc: http://mininet.org/sample-workflow/ 2 Set up the environment local (your laptop) Install dependencies


  1. Oblig INF3190 Marcel Marek Feb. 09, 2018

  2. Mininet • Virtual network emulator • Mininet CLI • Python API • Doc: http://mininet.org/sample-workflow/ 2

  3. Set up the environment – local (your laptop) • Install dependencies • apt-get install libsdl-dev libfdt-dev libpixman-1-dev libglib2.0-dev zlib1g-dev • Setup qemu • Download from: http://heim.ifi.uio.no/marcelma/inf3190/qemu-2.5.0.tar.bz2 • tar -xvf qemu-2.5.0.tar.bz2 • cd qemu-2.5.0/ • ./configure --disable-kvm --target-list="i386-softmmu x86_64-softmmu" • make • Download image for qemu and unzip it • http://heim.ifi.uio.no/marcelma/inf3190/mininet-vm-x86_64.qcow2.zip • Run • ./x86_64-softmmu/qemu-system-x86_64 -hda mininet-vm-x86_64.qcow2 3

  4. Set up the environment – local (eg 3468 Fortress lab) • Setup qemu • Download from: http://heim.ifi.uio.no/marcelma/inf3190/qemu-2.5.0.tar.bz2 • tar -xvf qemu-2.5.0.tar.bz2 • cd qemu-2.5.0/ • ./configure --disable-kvm --target-list="i386-softmmu x86_64-softmmu" • make • Download image for qemu and unzip it • http://heim.ifi.uio.no/marcelma/inf3190/mininet-vm-x86_64.qcow2.zip • Run • ./x86_64-softmmu/qemu-system-x86_64 -hda mininet-vm-x86_64.qcow2 4

  5. Set up the environment – remote (login.ifi.uio.no) • Connect to the login server with X window forwarding • ssh –Y login.ifi.uio.no • Setup qemu • Download from: http://heim.ifi.uio.no/marcelma/inf3190/qemu-2.5.0.tar.bz2 • tar -xvf qemu-2.5.0.tar.bz2 • cd qemu-2.5.0/ • ./configure --disable-kvm --target-list="i386-softmmu x86_64-softmmu" • make • Download image for qemu and unzip it • http://heim.ifi.uio.no/marcelma/inf3190/mininet-vm-x86_64.qcow2.zip • Run • ./x86_64-softmmu/qemu-system-x86_64 -hda mininet-vm-x86_64.qcow2 5

  6. Set up the environment – remote (openstack – www.uh-iaas.no) • Download qemu image • http://heim.ifi.uio.no/marcelma/inf3190/mininet-vm-x86_64.qcow2.zip • Open www.uh-iaas.no • Create SSH Key-pair • https://dashboard.uh-iaas.no/dashboard/project/access_and_security/ • Upload image • https://dashboard.uh-iaas.no/dashboard/project/images • Create and Start instance • https://dashboard.uh-iaas.no/dashboard/project/instances/ • Connect to your instance • ssh –Y mininet@<IP from web> 6

  7. Example script class MyTopo( Topo ): "Simple topology example." def __init__( self ): "Create custom topo." # Initialize topology Topo.__init__( self ) # Add hosts A = self.addHost('A') B = self.addHost('B') C = self.addHost('C') # Add links self.addLink (A, B) self.addLink (B, C) 7

  8. Example script continue def Config(net, args): A = net.getNodeByName('A') B = net.getNodeByName('B') C = net.getNodeByName('C') AB = A.intf(A.name+'-eth0') BA = B.intf(B.name+'-eth0') AB.config(bw=10, delay='10ms', loss=0.0, use_tbf=False) BA.config(bw=10, delay='10ms', loss=0.0, use_tbf=False) BC = B.intf(B.name+'-eth1') CB = C.intf(C.name+'-eth0') BC.config(bw=10, delay='10ms', loss=0.0, use_tbf=False) CB.config(bw=10, delay='10ms', loss=0.0, use_tbf=False) #Enter commands here A.cmd('xterm&') B.cmd('xterm&') C.cmd('xterm&') 8

  9. Example script continue topo = MyTopo() net = Mininet(topo=topo, link=TCLink, controller = OVSController) net.start() Config(net,args) #dumpNodeConnections(net.hosts) net.stop() • Complete script in /home/mininet/ 9

  10. Have a problem? Ask for help! • Piazza, oracle sessions, email … • It does not work. • I compiled qemu and downloaded the image, but when I try to run the image I get “GTK could not be initialized”. Btw I am trying this on my laptot (Ubuntu 16.04) 10

  11. Thank you! 11

Recommend


More recommend