intrig-unicamp / mininet-wifi

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

How to change AP's channel or TxPower? #270

Closed tori22 closed 4 years ago

tori22 commented 5 years ago

Hi, after reading examples, I found there are almost all codes about how to create a new topology.

My question is how to set some important params after topology is created?

For example:

Case1(done):

I want to re-associate ap and sta after sta moves to another ap's neighborhood. cls.update(sta, ap, wlan) It works after I figure out some resource code.

Case 2(still confused):

I want to change one ap's channel and power when I think current channel or TxPower is not good. but after searching source code in link.py, I can't still find a good way.

Conclusion:

  1. how to solve case2?
  2. Can we add some dynamic params change examples?
ramonfontes commented 5 years ago

Hi,

Please consider https://mininet-wifi.github.io/part3/ for cases #1 and #2. By now It works only with the branch dev.

tori22 commented 5 years ago

Thanks for the link. I solved how to change TxPower ; but it doesn't work when trying to change channel according to the code.

py ap1.setChannel(2, intf='ap1-wlan1')

but error shows unbound method setChannel() must be called with IntfWireless instance as first argument (got OVSAP instance instead)

ramonfontes commented 5 years ago

Hi,

Please make sure you have the new compiled version (sudo make install may work).

I just ran sudo mn --wifi and then py ap1.setChannel(2, intf='ap1-wlan1') and it worked.

tori22 commented 5 years ago

Thanks for your reply.

I switch to dev branch and sudo make install. git checkout dev sudo make install

It works now. Thanks again.