Skip to content

Commit

Permalink
fix for 802.11p
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonfontes committed May 13, 2020
1 parent eab90c1 commit 79defbb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
26 changes: 10 additions & 16 deletions examples/ieee80211p.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/python

"""You can use this code to work with IEEE 802.11p.
*** You have to install wireless-regdb and CRDA.
*** Please refer to the user manual for further information
*** Tested with 5805 Mhz"""
"""
NOTE: you have to install wireless-regdb and CRDA
please refer to https://mininet-wifi.github.io/80211p/
"""

from mininet.log import setLogLevel, info
from mn_wifi.link import wmediumd, ITSLink
Expand All @@ -17,26 +17,20 @@ def topology():
net = Mininet_wifi(link=wmediumd, wmediumd_mode=interference)

info("*** Creating nodes\n")
sta1 = net.addStation('sta1', ip='10.0.0.1/8',
position='10,10,0')
sta2 = net.addStation('sta2', ip='10.0.0.2/8',
position='20,20,0')
sta1 = net.addStation('sta1', ip='10.0.0.1/8', position='25,50,0')
sta2 = net.addStation('sta2', ip='10.0.0.2/8', position='50,50,0')

info("*** Configuring Propagation Model\n")
net.setPropagationModel(model="logDistance", exp=3.5)

net.setModule('./mac80211_hwsim.ko')
net.setPropagationModel(model="logDistance", exp=4.5)

info("*** Configuring wifi nodes\n")
net.configureWifiNodes()

net.plotGraph(max_x=50, max_y=50)
net.plotGraph(max_x=100, max_y=100)

info("*** Starting ITS Links\n")
net.addLink(sta1, intf='sta1-wlan0',
cls=ITSLink, channel='161')
net.addLink(sta2, intf='sta2-wlan0',
cls=ITSLink, channel='161')
net.addLink(sta1, intf='sta1-wlan0', cls=ITSLink, channel='181')
net.addLink(sta2, intf='sta2-wlan0', cls=ITSLink, channel='181')

info("*** Starting network\n")
net.build()
Expand Down
3 changes: 2 additions & 1 deletion mn_wifi/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -1541,13 +1541,14 @@ def __init__(self, node, intf=None, channel=161):
"configure ieee80211p"
intf = node.getNameToWintf(intf)
wlan = node.params['wlan'].index(intf.name)
LinkAttrs.__init__(self, node, intf, wlan)

if isinstance(self, master):
self.kill_hostapd()

self.node = node
self.channel = channel
self.freq = self.get_freq()
self.freq = str(self.get_freq()).replace('.', '')
self.range = intf.range
self.name = intf.name
self.mac = intf.mac
Expand Down

0 comments on commit 79defbb

Please sign in to comment.