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

oblig inf3190
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Oblig INF3190

Marcel Marek

  • Feb. 09, 2018
slide-2
SLIDE 2

2

Mininet

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

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
slide-4
SLIDE 4

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
slide-5
SLIDE 5

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
slide-6
SLIDE 6

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>
slide-7
SLIDE 7

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)

slide-8
SLIDE 8

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&')

slide-9
SLIDE 9

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/
slide-10
SLIDE 10

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

  • n my laptot (Ubuntu 16.04)
slide-11
SLIDE 11

11

Thank you!