intrig-unicamp / mininet-wifi

Emulator for Software-Defined Wireless Networks
https://mn-wifi.readthedocs.io/
Other
438 stars 239 forks source link

changing the band to 5ghz in mesh #317

Closed tagorepothuneedi closed 4 years ago

tagorepothuneedi commented 4 years ago

Hello

I had tried to simulate the 5Ghz network in mesh mode using mininet-wifi/examples/mesh.py and I had added the band='5' parameter to the .addLink() and passed it. But once after running the dump I see that the mesh is only running 2.4Ghz even the band is set to 5Ghz any fix for this?

Thanks

ramonfontes commented 4 years ago

Hello,

In the mesh scenario you only have to set the channel (e.g. 36).

tagorepothuneedi commented 4 years ago

Hi ramon,

`def topology(mobility): "Create a network." net = Mininet_wifi(link=wmediumd, wmediumd_mode=interference)

info("*** Creating nodes\n")
if mobility:
    sta1 = net.addStation('sta1')
    sta2 = net.addStation('sta2')
    sta3 = net.addStation('sta3')
else:
    sta1 = net.addStation('sta1', position='10,10,0')
    sta2 = net.addStation('sta2', position='50,10,0')
    sta3 = net.addStation('sta3', position='90,10,0')

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

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

info("*** Creating links\n")
net.addLink(sta1, cls=mesh, ssid='meshNet',
            intf='sta1-wlan0',band='5',channel='36', ht_cap='HT40+') )
net.addLink(sta2, cls=mesh, ssid='meshNet',
            intf='sta2-wlan0', band='5',channel='36', ht_cap='HT40+') )
net.addLink(sta3, cls=mesh, ssid='meshNet',
            intf='sta3-wlan0',band='5',channel='36', ht_cap='HT40+') )

` If I add the channel the stations are not pinging each other and the command "sta1 iw dev sta1-mp0 info" is not showing the channel/band/width on which the mesh is operating.

ramonfontes commented 4 years ago

When you set the channel to 36 you're already using 5GHz. What would be the purpose of the band parameter?

tagorepothuneedi commented 4 years ago

Yeah I had remove band param and only setting the channel to 36. But this has same problem. stations are not pinging each other.

ramonfontes commented 4 years ago

Can you please run the code in debug mode and put the outcome here?

Ps. You may want to try git pull before running the code.

tagorepothuneedi commented 4 years ago

Hello ramon

Please find the attached debug from dmesg. https://drive.google.com/file/d/1swchH-F9fMu8PR_-BY7aGby_t4nAj3kS/view?usp=sharing

ramonfontes commented 4 years ago

You should run the code in debug mode setLogLevel('debug'). You don't need to run dmesg.

tagorepothuneedi commented 4 years ago

Hello ramon,

here it is https://drive.google.com/file/d/1ATlSukf1lkiNVhYsgbJx_vxGfw59t3EV/view?usp=sharing

ramonfontes commented 4 years ago

Which regulatory domain are you using? Can you try iw reg set US?

tagorepothuneedi commented 4 years ago

its already set to US i think `0mininet-wifi> sta1 iw reg get *** errRun: ['stty', '-icanon', 'min', '1'] 0global country US: DFS-FCC (2402 - 2472 @ 40), (N/A, 30), (N/A) (5170 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW (5250 - 5330 @ 80), (N/A, 23), (0 ms), DFS, AUTO-BW (5490 - 5730 @ 160), (N/A, 23), (0 ms), DFS (5735 - 5835 @ 80), (N/A, 30), (N/A) (57240 - 63720 @ 2160), (N/A, 40), (N/A)

mininet-wifi> `

ramonfontes commented 4 years ago

Well, the command is correct: iw dev sta1-mp0 mesh join meshNet freq 5180 HT40

Please note that the message error says: command failed: Invalid argument (-22)

I know of no other reason for this error than the regulatory domain.

tagorepothuneedi commented 4 years ago

Hello Ramon

how can I use VHT to set 80mhz channel width in 5ghz band? I saw one of links you suggested in other issues (https://w1.fi/cgit/hostap/plain/hostapd/hostapd.conf) .I tried using vht_capab='SHORT-GI-80' but when I run it was going back in 20mhz. Any help here?

ramonfontes commented 4 years ago

Hi,

I suggest you to use iw.

tagorepothuneedi commented 4 years ago

Getting this below error while using iw command to set 80mhz channel width mininet-wifi> sta1 iw dev sta1-mp0 set freq 5200 80 5210 *** errRun: ['stty', '-icanon', 'min', '1'] 0command failed: Device or resource busy (-16) mininet-wifi> any help is appreciated.

ramonfontes commented 4 years ago

Is the interface up?

ht_cap='80MHz'also works.

tagorepothuneedi commented 4 years ago

Thanks Ramon that worked.

Yes the interface is up. any reasons for the error using iw?

ramonfontes commented 4 years ago

Your network interface was UP!