-
Notifications
You must be signed in to change notification settings - Fork 17
Applications for Channel Assignment
There are four applications for channel assignment:
-
ChannelAssignment initial version. In "Auto" mode the scans and the algorithm are executed without user interaction. In "Manual" mode it allows the user to directly establish the channels of the APs.
-
ChannelAssignment based on Internal and External Interference Impact. In "Auto" mode the scans and the algorithm are executed without user interaction. In "Manual" mode it allows the user to directly establish the channels of the APs.
Note. Additional requirements for the first two applications. These applications integrate the channel assignment algorithms within the Wi-5 controller. The Matlab code implementing the algorithm has been exported as a Java library , which is integrated in the controller and can then be called from the channel assignment application. As the code is compiled previously, it can run fast and does not need the controller to have Matlab. However, you have to install MATLAB Compiler Runtime (MCR) libraries in the Wi-5 controller: see this.
Algorithm for optimal channel assignment, only based on the "distance in dBs" between APs. It takes monitoring info as an input, calculates the Internal Interference Impact, runs an algorithm and implements the resulting channel assigmnent in the APs, changing the channel of the AP itself and that of its associated STAs. It uses as an input the result of the application for obtaining the distance in dBs.
These are the parameters that the user can set for the application, using poolfile:
-
TimeToStart
(sec): The application will wait some seconds before starting. It gives time to the user to start the agents. -
PauseBetweenScans
(sec): Time between successive scans. -
ScanningInterval
(sec): Time used for collecting the monitoring information. -
AddedTime
(sec): An extra time after scanning (a margin). Recommended value: 1 second. -
NumberOfScans
: Number of scans to calculate the cumulative moving average and run the algorithm. -
IdleTime
(sec): Time between channel assignment and restart the process. -
Channel
: Channel used for the measurement of the distance (sending and hearing for special beacons). -
Method
: Three values can be chosen:-
1
: Wi-5 algorithm. It will use the algorithm for optimal channel selection. -
2
: Random channel selection. -
3
: Least Congested Channel (LCC).
-
-
Threshold
: If Internal Interference Impact is below this value, the algorithm will not be triggered. -
Mode
: Two values can be chosen:-
auto
: The scans and algorithm will execute without user interaction -
manual
: User will be able to choose channels and STAs' agents before scans and algorithm.
-
-
Filename
: Optional, all console info will be stored in a file if this parameter is used.
After the initial wait for agents’ connections, the application orders a scan, waits ScanningInterval + AddedTime
seconds and gets the distance in dBm, doing that for each agent. It repeats the loop after PauseBetweenScans
seconds for NumberOfScans
times, each iteration saving the cumulative moving average.
Using this average, it runs the channel assignment algorithm and sets the APs’ channels according to that result. Then, it waits IdleTime
seconds until it restarts the process.
This will result on the algorithm being run every:
IdleTime + AlgorithmTime +
+ NumberOfScans*[NumberOfAgents*(ScanningInterval+ AddedTime+ ProcessingTime)]
+(NumberOfScans-1)*PauseBetweenScans
As an example, the line CHANNEL 30 30 2 1 3 7200 6 1
in poolfile
, with 3 agents, will result in the channel assignment algorithm being run every 7299.5 seconds (roughly 2 hours).
AlgorithmTime
is the time required for running the Matlab code, which in our setup (Intel Core i3) varies between 1 and 8 seconds.
ProcessingTime
is the time required after each scanning. In our setup it is about 0.5 seconds.
The scheme of the operation of switching an AP with its associated STAs is illustrated in ShowMatrixOfDistancedBs. We also show here some parts of the log information shown by the controller.
First, this is the information sent by the last AP:
[ChannelAssignment] Agent: /192.168.1.13 in channel 6
AP MAC: 60:E3:27:4F:CA:63
AP TxPower: 10 dBm
avg signal: -44.3179827593 dBm
pathloss: 54.3179827593 dB
[ChannelAssignment]
[ChannelAssignment] Agent: /192.168.1.15 in channel 6
AP MAC: 60:E3:27:4F:CA:63
AP TxPower: 10 dBm
avg signal: -50 dBm
pathloss: 60.0 dB
[ChannelAssignment]
[ChannelAssignment] Agent: /192.168.1.14 in channel 6
AP MAC: 60:E3:27:4F:CA:63
AP TxPower: 10 dBm
avg signal: -31.0237290871 dBm
pathloss: 41.0237290871 dB
Now, the controller has all the information so it can build the matrix of pathloss and run the algorithm (in this example, 4 APs have been used), obtaining a channel assignment including channels 1, 6 and 11 in this case:
[ChannelAssignment] === MATRIX OF PATHLOSS (dB) ===
192.168.1.13 ---------- 67.95 dB 65.52 dB 53.97 dB
192.168.1.15 64.68 dB ---------- 60 dB 52.14 dB
192.168.1.14 60 dB 50 dB ---------- 40 dB
192.168.1.10 54.31 dB 60 dB 41.02 dB ----------
[ChannelAssignment] =================================
Optimization terminated.
[ChannelAssignment] =======CHANNEL ASSIGNMENTS=======
1 11 6 11
When the optimisation algorithm has finished, and a channel assignment has been decided, a message WRITE odinagent.channel 1
is sent by the controller to each AP:
[ChannelAssignment] =================================
[ChannelAssignment] Setting AP /192.168.1.13 to channel: 1
[ChannelAssignment] Setting AP /192.168.1.15 to channel: 11
[ChannelAssignment] Setting AP /192.168.1.14 to channel: 6
[ChannelAssignment] Setting AP /192.168.1.10 to channel: 11
[ChannelAssignment] =================================
When the AP receives the message, it has to instruct all the associated STAs to switch to the new channel. Beacons with the Channel Switch Announcement element are used for this. A countdown is implemented so the STA switches to the new channel when it reaches zero.
When the AP has finished the channel switch (including the switch of the associated STAs), it sends to the Wi-5 controller a 200 write handler 'odinagent.channel' OK
message.
It calculates the optimal channel assignment, but it also takes into account the External Interference Impact, the value of interference "heard" by al Wi-5 APs in all channels.
Once the controller calculates the Internal Interference Impact, if it is above the Threshold
assigned as parameter, the APs will scan in all channels with the auxiliary interface to create the External Interference Impact matrix. The algorithm will use both Interference Impact values to calculate the channel assignments.
These are the parameters that the user can set for the application, using poolfile:
-
TimeToStart
(sec): The application will wait some seconds before starting. It gives time to the user to start the agents. -
PauseBetweenScans
(sec): Time between successive scans. -
ScanningInterval
(sec): Time used for collecting the monitoring information. -
AddedTime
(sec): An extra time after scanning (a margin). Recommended value: 1 second. -
NumberOfScans
: Number of scans to calculate the cumulative moving average and run the algorithm. -
Timeout
(sec): Time until order a rescan. -
Channel
: Channel used for the measurement of the distance (sending and hearing for special beacons). -
Method
: Three values can be chosen:-
1
: Wi-5 algorithm. It will use the algorithm for optimal channel selection. -
2
: Random channel selection. -
3
: Least Congested Channel (LCC).
-
-
Threshold
: If Internal Interference Impact is below this value, the algorithm will not be triggered. -
Mode
: Two values can be chosen:-
auto
: The scans and algorithm will execute without user interaction -
manual
: User will be able to choose channels and STAs' agents before scans and algorithm.
-
-
Filename
: Optional, all console info will be stored in a file if this parameter is used.
See the application running in the following video:
Interactive (prompt-based) application, which allows the user to introduce a channel number for each AP throught the keyboard.
It performs a continuous loop (10 sec) between the 11 channels of 2.4 GHz. The application moves an AP between all the channels.
Additional requirements for running ChannelAssignment
You can also follow the instructions here
-
Run the Matlab Compiler by typing
deploytool
in Matlab command line and selectLibrary Compiler
. -
In the compiler window, select
Java Package
asType
. -
Click the plus sign (
+
) next to theExported Functions
section, and select the filegetChannelAssignments.m
-
Fill in the Library Information as you see fit. In this section, the most important part is the Class Name. This will be the name of the class that needs to be instantiated in the Java code. Change the default value of
Class1
to a more suitable name, e.g.wi5
. -
Save the project.
-
Click the
Package
button to create the.jar
file. -
Go to the folder
for_redistribution_files_only
in the output file and copy the generated.jar
file in order to deploy it on another computer.
Note. A version generated with Matlab version R2015a (v8.5) can be downloaded from here.
- Download and Install MATLAB Compiler Runtime (MCR) from https://www.mathworks.com/products/compiler/mcr.html. Make sure to select the version corresponding to the Matlab version used for generating the jar file.
This document assumes that the MCR is installed to location $MCR
. You can set an environment variable named $MCR
for your system, or replace $MCR
with the exact path to the installation in the following steps.
- Commands after download and unzip MCR:
chmod +x -R MCR/
./install -mode silent -agreeToLicense yes
- Copy the following
.jar
into your project, and add it to the build path where XX should be replaced with the MCR version.
$MCR/MATLAB_Runtime/vXX/toolbox/javabuilder/jar/javabuilder.jar
Note. In this directory you have the javabuilder.jar
version R2015a (v8.5). In this case vXX
would be v85
.
- Copy the
.jar
file generated previously (e.g.wi5.jar
) into the project and add it to the build path.
Note. In this directory you have a file called wi5.jar
, which is the result of this compilation.
- The following directories should be added to the
LD_LIBRARY_PATH
.
$MCR/MATLAB_Runtime/v85/runtime/glnxa64:$MCR/MATLAB_Runtime/v85/bin/glnxa64:$MCR/MATLAB_Runtime/vXX/sys/os/glnxa64:$MCR/MATLAB_Runtime/v85/sys/opengl/lib/glnxa64
IMPORTANT: We have observed system errors when LD_LIBRARY_PATH
is modified permanently (by modifying /etc/ld.so.conf.d/
or by other means).
Therefore, we modify it within the terminal that is to run the odin controller with the following command:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MCR/MATLAB_Runtime/v85/runtime/glnxa64:$MCR/MATLAB_Runtime/vXX/bin/glnxa64:$MCR/MATLAB_Runtime/v85/sys/os/glnxa64:$MCR/MATLAB_Runtime/v85/sys/opengl/lib/glnxa64
It is adequate to run this command once, just before odin controller is started. For subsequent runs, you do not need to run the command again.
For example, with MCR version 8.5 installed in /usr/local/MATLAB
, you have to execute the following command:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/MATLAB/MATLAB_Runtime/v85/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v85/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v85/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v85/sys/opengl/lib/glnxa64
- For the use of the library, you can take a look at the sample java file provided.