GithubHelp home page GithubHelp logo

Comments (13)

ramonfontes avatar ramonfontes commented on June 6, 2024

from mininet-wifi.

zhangzee avatar zhangzee commented on June 6, 2024

#!/usr/bin/python

"""
Setting the position of Nodes (only for Stations and Access Points) and providing mobility using mobility models.

"""

from mininet.net import Mininet
from mininet.node import Controller,OVSKernelSwitch
from mininet.link import TCLink
from mininet.cli import CLI
from mininet.log import setLogLevel, info
from mininet.node import Controller, RemoteController, OVSKernelSwitch, OVSSwitch

from mininet.wifiReplaying import replayingMobility

def topology():

"Create a network."
net = Mininet( listenPort = 6633,topo=None)
mycontroller = RemoteController("remoteController",ip="172.21.6.219")
net.controllers = [mycontroller]
net.nameToNode["remoteController"] = mycontroller

info( '*** Adding hosts\n' )
h1 = net.addHost( 'h1', ip='192.168.0.1/24', mac='00:00:00:00:00:01' )
h2 = net.addHost( 'h2', ip='192.168.0.2/24', mac='00:00:00:00:00:02' )

print "*** Creating nodes"
sta1 = net.addStation( 'sta1', mac='00:00:00:00:00:03', ip='192.168.0.3/24', speed=1 )
#sta2 = net.addStation( 'sta2', mac='00:00:00:00:00:03', ip='10.0.0.3/8' )
ap1 = net.addAccessPoint( 'ap1', ssid= 'new-ssid1', dpid='0000000100000001',mode= 'g', channel= '1', position='4,4,0', range='30'  )
ap2 = net.addAccessPoint( 'ap2', ssid= 'new-ssid2', dpid='0000000100000002',mode= 'g', channel= '1', position='55,17,0', range='30' )
ap3 = net.addAccessPoint( 'ap3', ssid= 'new-ssid3', dpid='0000000100000003',mode= 'g', channel= '1', position='105,23,0', range='30' )
ap4 = net.addAccessPoint( 'ap4', ssid= 'new-ssid4', dpid='0000000100000004',mode= 'g', channel= '1', position='20,55,0', range='30' )
ap5 = net.addAccessPoint( 'ap5', ssid= 'new-ssid5', dpid='0000000100000005', mode= 'g', channel= '1', position='73,65,0', range='30' )
ap6 = net.addAccessPoint( 'ap6', ssid= 'new-ssid6', dpid='0000000100000006',mode= 'g', channel= '1', position='120,78,0', range='30' )
ap7 = net.addAccessPoint( 'ap7', ssid= 'new-ssid7', dpid='0000000100000007',mode= 'g', channel= '1', position='0,105,0', range='30' )
ap8 = net.addAccessPoint( 'ap8', ssid= 'new-ssid8', dpid='0000000100000008',mode= 'g', channel= '1', position='50,102,0', range='30' )
ap9 = net.addAccessPoint( 'ap9', ssid= 'new-ssid9', dpid='0000000100000009',mode= 'g', channel= '1', position='99,118,0', range='30' )

info( '*** Adding switch\n' )
s1 = net.addSwitch('s1',dpid='0000000100000010')
s2 = net.addSwitch('s2',dpid='0000000100000011')
s3 = net.addSwitch('s3',dpid='0000000100000012')
s4 = net.addSwitch('s4',dpid='0000000100000013')
s5 = net.addSwitch('s5',dpid='0000000100000014')
s6 = net.addSwitch('s6',dpid='0000000100000015')
s7 = net.addSwitch('s7',dpid='0000000100000016')

print "*** Configuring wifi nodes"
net.configureWifiNodes()
print "*** Associating and Creating links"
net.addLink(s1, s2,1 , 1)
net.addLink(s1, s3,2 , 3)
net.addLink(s1, s4,3 , 3)
net.addLink(s1, h1,5 , 1)
net.addLink(s1, s5,4 , 2)
net.addLink(s2, s6)
net.addLink(s2, s7)
#net.addLink(s2, h2)

net.addLink(s3, ap1, 1, 2)
net.addLink(s3, ap2, 2, 2)
net.addLink(s4, ap3)
net.addLink(s4, ap6)
net.addLink(s4, ap5)
net.addLink(s5, ap8)
net.addLink(s6, ap4)
net.addLink(s7, ap7)
net.addLink(s7, ap9)
net.addLink(s7, h2)

#set the bw loss delay and so on 
net.setChannelEquation(bw='100', loss='0.04', delay='0', latency='0')

info( '*** Starting network\n')
net.start()

"""uncomment to plot graph"""
net.plotGraph(max_x=120, max_y=120)

getTrace(sta1, '/home/liangjun/mininet-wifi/examples/replaying/replayingMobility/node5.dat')
#getTrace(sta2, '/home/liangjun/mininet-wifi/examples/replaying/replayingMobility/node2.dat')

replayingMobility(net)
print "*** Running CLI"
CLI( net )

print "*** Stopping network"
net.stop()

def getTrace(sta, file):

file = open(file, 'r')
raw_data = file.readlines()
file.close()

sta.position = []

for data in raw_data:
    line = data.split()
    x = line[0] #First Column
    y = line[1] #Second Column
    sta.position.append('%s,%s,0' % (x, y))

if name == 'main':
setLogLevel( 'info' )
topology()

from mininet-wifi.

zhangzee avatar zhangzee commented on June 6, 2024

this is the experiment topology script , and the node5.dat is self-defined moving path among APs, And the whole network is controlled by the remote controller.

from mininet-wifi.

ramonfontes avatar ramonfontes commented on June 6, 2024

from mininet-wifi.

zhangzee avatar zhangzee commented on June 6, 2024

did you have a similar experiments? the reply support video clip ?

from mininet-wifi.

ramonfontes avatar ramonfontes commented on June 6, 2024

from mininet-wifi.

zhangzee avatar zhangzee commented on June 6, 2024

I donn't have dropbox, I think about this question . Thank you !

from mininet-wifi.

zhangzee avatar zhangzee commented on June 6, 2024

o , I guess the instability may be associated with the wifi access . Every access to wifi aps produces different access delay , so using the mininet-wifi as my experiment environment may be inappropriate unless I can fix the wifi access delay.

from mininet-wifi.

ramonfontes avatar ramonfontes commented on June 6, 2024

from mininet-wifi.

zhangzee avatar zhangzee commented on June 6, 2024

For example , there are three APs(ap1, ap2, ap3) and one mobile node(sta ). The sta handover from ap1 to ap2 and from ap2 to ap3 , I mean the wifi access time from ap1 to ap2 is different from the sta handover from ap2 to ap3 . I just mean the wireless access time is uncertain. Is it?

from mininet-wifi.

ramonfontes avatar ramonfontes commented on June 6, 2024

from mininet-wifi.

zhangzee avatar zhangzee commented on June 6, 2024

Can you give me a email address? I try to give you a video clip .

from mininet-wifi.

ramonfontes avatar ramonfontes commented on June 6, 2024

from mininet-wifi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.