-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8084cba
commit d209d80
Showing
5 changed files
with
41 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/python | ||
|
||
from mininet.log import setLogLevel, info | ||
from mn_wifi.cli import CLI | ||
from mn_wifi.net import Mininet_wifi | ||
|
||
|
||
def topology(): | ||
"Create a network." | ||
net = Mininet_wifi(iot_module='mac802154_hwsim') | ||
# iot_module: fakelb or mac802154_hwsim | ||
# mac802154_hwsim is only supported from kernel 4.18 | ||
|
||
info("*** Creating nodes\n") | ||
sensor1 = net.addSensor('sensor1', ip6='2001::1/64', panid='0xbeef') | ||
sensor2 = net.addSensor('sensor2', ip6='2001::2/64', panid='0xbeef') | ||
sensor3 = net.addSensor('sensor3', ip6='2001::3/64', panid='0xbeef', position='10,150,0') | ||
|
||
|
||
|
||
info("*** Configuring nodes\n") | ||
net.configureWifiNodes() | ||
|
||
net.plotGraph(max_x=300, max_y=300) | ||
|
||
net.setMobilityModel(time=0, model='RandomDirection',max_x=100, max_y=100, seed=20) | ||
|
||
info("*** Starting network\n") | ||
net.build() | ||
|
||
info("*** Running CLI\n") | ||
CLI(net) | ||
|
||
info("*** Stopping network\n") | ||
net.stop() | ||
|
||
|
||
if __name__ == '__main__': | ||
setLogLevel('info') | ||
topology() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.