Bellmanford + WIFIBridgeLink Examples

 

[Topology]

 

Host 1 --wired link-- s3(open vswitch) -- ( WIFIBridgeLink) -- s4(open vswitch) -- ( WIFIBridgeLink) -- s5(open vswitch) -- ( WIFIBridgeLink) --wired link-- Host 2

 

[Goal]

  Try to use remote controller with bellmanford module find a way from the sender to receiver.

 

p.s. In this example, I try to use two different virtual machines. One is mininet + NS3 environment (generate hosts, open vswitches, and wireless links). The other is used for remote POX controller.

 

[Scripts for mininet + NS3] (test-wifi6.py)

#!/usr/bin/python

 

"""

This example shows how to create an empty Mininet object

(without a topology object) and add nodes to it manually.

"""

 

from mininet.net import Mininet

from mininet.node import OVSController,RemoteController

from mininet.link import Link

from mininet.cli import CLI

from mininet.log import setLogLevel, info

 

import mininet.ns3

from mininet.ns3 import WIFIBridgeLink, WIFISegment

import ns.wifi

from functools import partial

 

def emptyNet():

 

    "Create an empty network and add nodes to it."

 

    net = Mininet( controller = partial(RemoteController, ip='192.168.0.195', port=6633))

 

    info( '*** Adding controllers\n' )

    net.addController( 'c0' )

    net.addController( 'c1' )

 

    info( '*** Adding hosts\n' )

    h1 = net.addHost( 'h1', ip='10.0.0.1' )

    h2 = net.addHost( 'h2', ip='10.0.0.2' )

 

    info( '*** Adding switches\n' )

    s3 = net.addSwitch( 's3' )

    s4 = net.addSwitch( 's4' )

    s5 = net.addSwitch( 's5' )

 

    info( '*** Creating links\n' )

    Link( s3, h1 )

    Link( s5, h3 )

    #wifi=WIFISegment(standard = ns.wifi.WIFI_PHY_STANDARD_80211a)

    WIFIBridgeLink( s3, s4 )

    WIFIBridgeLink( s4, s5 )

 

    info( '*** Starting network\n')

    net.start()

    mininet.ns3.start()

 

    info( '*** Running CLI\n' )

    CLI( net )

 

    info( '*** Stopping network' )

    mininet.ns3.stop()

    mininet.ns3.clear()

    net.stop()

 

if __name__ == '__main__':

    setLogLevel( 'info' )

    emptyNet()

 

[Steps]

1. Run the remote pox controller on virtual machine 1.

 

2. Execute the test-wifi6.py on virtual machine 2.

 

3. h1 ping h2.

on virtual machine 2.

 

on virtual machine 1.

from the above figure, we can clearly see that the bellmanford finds a way for h1 to h2 via s 3, s4, and s5.

 

Dr. Chih-Heng Ke

Department of Computer Science and Information Engineering, National Quemoy University, Kinmen, Taiwan

Email: smallko@gmail.com / smallko@nqu.edu.tw