Thursday, March 31, 2016

Air Time Fairness - ATF


The coolest feature Cisco had ever added to a WLC, in my opinion, is ATF. This feature was introduced in 8.1MR2 code 8.1.120.0 and ATF Phase-2 (Client fair Sharing) is available in 8.2 code. This is something that was missing on Wireless gears. 
  Why ATF is so cool ? Because it performs QoS in the Wireless part of the network, not in the Wired, as usual.
 What ATF really do is create budget and attribute those budget to SSIDs. When a frame is about to be transmitted, ATF verifies the SSID budget and evaluate if the SSID has enough airtime to transmit that frame. If negative, the frame can be dropped or deferred. 
  The drop action as it is and the deferred rely on the Queues for store frames for a certain amount of time and transmit as soon as the SSID has budge.Therefore, it has a limited time period and the frame may be dropped in case no budge release.
 The over wall mechanism actually is not too much different from regular QoS mechanism but the possibility to control frame transmission at Wireless side, it is revolutionary.
  One interesting information is that ATF act only in downstream traffic and the reason for that is obvious, Access Point can not control upstream traffic. Maybe in the future, some protocol could allows for upstream ATF but it depends on Client intelligence.
 the applicability of ATF is also obvious and what makes it so amazing is how easy it is to deploy. Conventional QoS depends on the whole network to be ready, while ATF, wireless Engineer can do the job by himself. Of course, this doesn´t replace the conventional QoS as mentioned above.
  
  The following list, presents the Capabilities and was taken from:
"b_Air_Time_Fairness_Phase1_and_Phase2_Deployment_Guide"

Available on cisco.com.


ATF Functionality and Capabilities
• ATF policies are applied only in the downlink direction (AP transmitting frames to client). Only airtime in the downlink direction,
that is AP to client, can be controlled accurately by the AP. Although airtime in the uplink direction, that is client to AP, can
be measured, it cannot be strictly controlled. Although the AP can constrain airtime for packets that it sends to clients, the AP
can only measure airtime for packets that it ‘hears’ from clients because it cannot strictly limit their airtime.

• ATF policies are applied only on wireless data frames; management and control frames gets ignored.

• When ATF is configured per-SSID, each SSID is granted airtime according to the configured policy.

• ATF can be configured to either drop or defer frames that exceed their airtime policies. If the frame is deferred, it will be buffered
and transmit at some point in the future when the offending SSID has a sufficient airtime budget. Of course, there is a limit as
to how many frames can be buffered. If this limit is crossed, frames will be dropped regardless.

• ATF can be globally enabled or disabled

• ATF can be enabled or disabled on an individual access point, AP group or entire network

• ATF will be supported on the 1260, 1570, 1700, 2600, 2700,3700,3600,3500, series access points in local and FlexConnect
mode. (Mesh mode not supported)


• ATF results and statistics are available on the wireless controller.


 Some more important information about ATF:
It is disabled by default. Can be configured as monitor mode and Policy mode and can be applied per AP, per AP group or All APs.



Tuesday, March 29, 2016

Playing With Python - A bit more!


 I´m working in a Python script and my objective is:


1-Access to a Wireless Lan Controller;
2-Perform some commands, for example, "show ap summary";
3-Save the output in a file;
4-Open the file;
5-Get the AP hostname and put in a variable.;
6-Perform the command "show ap auto-rf 802.11b 'AP name';
7-Save the output in a file;
8-Get information about Wireless
9-Show it in some format;

So far, I have accomplished 4 out of 9 steps. My script looks like this:

#!/usr/bin/python
from Exscript.util.interact import read_login
from Exscript.protocols import SSH2
from Exscript import Account

user    = "xxxxx"
passwd  = "xxxxxxxx"
wlc_ip  = "xxxxxxxxxxxxx"

account = Account(user,passwd)
conn = SSH2()
conn.connect(wlc_ip)
conn.login(account)

conn.execute(user)
conn.execute(passwd)
conn.execute("config paging disable")
conn.execute("show ap summary")

print conn.response

f = open(wlc_ip, 'w+')


f.write(conn.response)

conn.send("logout")
conn.send("y")
conn.close()

 I am learning about Python file handling in order for accomplish what I want to do. 
 As soon as I have a progress, I will put here. If someone out there had any hint, will be very very nice!

************************************************************************

Well, I didn´t to much progress but I did some.

Now I am at step 5!

First, this piece of code, gives me only the APs hostname:


fin = open("fin.txt")
fout = open("fout.txt","w+")
for line in fin:
     if 'AIR'  in line:
         list = line.split(" ")
         fout.write(list[0]+'\n')



fin.close()
fout.close()

What it does is, it open the fin.txt file which is the file I got from WLC and Analise. If AIR in line, which means, only those lines with APs, separate by spaces and take the first element. As AP hostname is the first element, I am storing on the fout file the hostname of all APs.

ap = open("fout.txt")

some_ap = ap.readlines()
print some_ap[1]


ap.close()

The second part of code, takes the file created above and create a list in which each index will actually a hostname. The idea now is call the command
"show ap auto-rf 802.11b 'AP name'" and pass on each AP as argument. This command must be executed one by one, so , that´s why I need to be specific.

For sure a developer would lauch at my code and I believe it is too bad but for now it´s all I have.

When everything is working fine, I will try to be more elegant. 

+++++++++++++++++++++++++++++++++++++++++++++

May 28, 2016

A few days ago I have finished my script. I did it with a little help from a friend but I did the most part of it, so I am posting it as my code:

 Recapping my objectives:

1-Access to a Wireless Lan Controller;
2-Perform some commands, for example, "show ap summary";
3-Save the output in a file;
4-Open the file;
5-Get the AP hostname and put in a variable.;
6-Perform the command "show ap auto-rf 802.11b 'AP name';
7-Save the output in a file;
8-Get information about Wireless
9-Show it in some format;

Well, step 1 was accomplished using Exscript. First I tried with Paramiko directly but the odd behavior of Cisco WLC asking for user login twice, prevent me succeed with Paramiko.
 Exscript was a big asset once it allows me login in and preform commands.

 Step 4 was solved the same way. The "conn.execute" Exscript´s function do the job like a charm.

Steps 3, 4 and 5 was accomplished using Python file handling ability. Not that complicated.

The piece of code responsible for that, looks like this:


for line in extract_hostname:
    if 'System Name' in line:
        list = line.split(" ")
        show_hostname.write(list[2]+'\n')
        print ("The hostname is : " + list[2])
        i=list[2].strip()

First, the script performed the command conn.execute("show sysinfo"), because this command will bring the WLC hostname somewhere.

The "show sysinfo" command output was stored in a file called "wlc_hostname"

get_hostname  = open("wlc_hostname", "w+")
get_hostname.write(conn.response)

get_hostname.close()

Then, I created an variable to receive the file:

extract_hostname = open("wlc_hostname")

show_hostname = open("hostname", "w+")

Finally, the code above work on this file in order to find the hostname.

for line in extract_hostname makes the script look line by line. The WLC hostname is shown somewhere like this:

System Name...................................... XXXXXXXXXX

When ths script gets to this line, it splits the line and get the piece that contains the hostname. Stores the hostname in a list for future usage.

Well, all this was only to get the WLC hostname. As I intend to run this script among many WLC, I think it is a good idea to have each file as WLC hostname.

Therefore, my final goal was extract KPIs from WLC and save it in a CSV file. Then, the same methodology was applied:

The command "Show ap auto-rf 802.11a/b 'ap hostname' is passed to WLC via "conn.execute", the hole output was written in a file with "conn.response" and then the file was edited with the piece of code bellow:





x = []
fin = open("XXXXXXXXXX")
fout = open("wlc_ip"+"-" + timestamp + ".txt","w+")

print "Creating a list of hostnames..."

for line in fin:
      if 'AIR'  in line:
         list = line.split(" ")
         x.append(list[0]) 


for line in x:
         conn.execute("show ap auto-rf 802.11a " + line)
         fout.write(conn.response)         



fin.close()
fout.close()

The code takes the output row from "show ap summary", read the row, find out the word 'AIR' and sttract the hostname, storing it in a variable called 'line'.
Once we get the hostname, a for statement run over the list "x" using the command "show ap auto-rf 802.11a and instead using the AP´s hostname, use the variable "line". For each loop, the information from one AP was got.

  The result is a very long file separated by AP. After that a similar script gets the KPIs in CSV format, as we can see bellow:

APhostname,RADIO_TYPE_80211a,0,0,1,2,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,2,0
APhostname,RADIO_TYPE_80211a,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0
APhostname,RADIO_TYPE_80211a,0,0,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
APhostname,RADIO_TYPE_80211a,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0
APhostname,RADIO_TYPE_80211a,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0
APhostname,RADIO_TYPE_80211a,0,0,1,10,1,0,0,0,2,2,4,2,0,0,0,0,0,0,2,6,2,0
APhostname,RADIO_TYPE_80211a,0,0,1,5,1,0,0,1,1,1,2,0,0,0,0,0,0,1,1,3,0,0
APhostname,RADIO_TYPE_80211a,0,0,0,3,1,0,0,1,0,0,0,1,1,0,0,0,0,1,0,0,2,0
APhostname,RADIO_TYPE_80211a,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
APhostname,RADIO_TYPE_80211a,0,0,13,2,1,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0
APhostname,RADIO_TYPE_80211a,0,0,2,12,1,0,0,1,0,2,4,3,1,0,1,0,0,1,1,4,5,1

Each comma-separated value represents one KPI retrieved from the WLC. PKIs like air time utilization, "AP Name","Radio Type","Receive Utilization","Transmit Utilization","Channel Utilization","Attached Clients","Power Level","RSSI", "SNR",etc.

Why don´t use Cisco Prime instead? Those information can be shown with reports, doesn´t it? Yes, it is.

What I am looking for a system to control Wireless network behavior using firstly command line interface. With one command I can see how things are going on.I don´t need to access Prime GUI and export reports. Someone could say, then schedule reports! The problem with reports schedule is the period of one hour per report. In one hour we can have a lot of changes in the network.
 The script can get information at any time I want, I can reduce the frequency and this can be every 10 minutes or every each 5 seconds. I can store this results in a database for example. Actually, there is no limit at all!!



Wednesday, March 23, 2016

CCI and SNR on Wireless Network


Lately, I´ve been looking for putting some light over some obscure subject in my head about CCI and SNR. We are planing to deploy a very large Wireless Network and consequently, we need to be prepared for very crowded spaces.
  It turns out that CCI , the short for Co-Channel Interference, is a natural consequence when it comes to deploy many Access Points in a relatively small area. There´s a equation related to crowded space that is not easy to solve. If you have a space in which you´ll have too much people on it, you consequently will need too many Access Points in order for accommodate all those peoples. This is known as "Coverage for performance".Once you try to accommodate too many Access Point together, you´ll have problem with CCI in the 2.4 frequency band or even 5.0 Gigahertz.
  The other factor is SNR. Well, SNR is the short for Signal to Noise Ratio and, as its name states, Ratio means a comparative value between to things. This things is Noise floor and Power.
  The fact is , when we are planing  wireless network, we have to have some north in order to ensure that the network will offer a good users experience . Once Wifi KPIs is not well defined as it is in mobile, SNR is considered to be a very good parameter when it comes to have a reliable network.
 When we go through papers, we often see value like -67 dBm RSSI ate the edge of the Cell and 35 dB SNR. An environment with such KPIs, is considered to be good for any kind of transmission over Wireless network.(Video, voice and data).
  Therefore, this is not the only one important  thing to consider. Actually, it is really easy to achieve a good SNR if you have the desired resource available. I mean, if you can spread out as many Access Point as necessary.




 You probably will get astonished if I said that one and only one Access Point installed at the right place and height can provide at least -90 dBm RSSI for a whole stadium. For sure this is just a curiosity, but you wont to be wrong in your design if you followed  the figure above. This is in fact, the correct deployment for a really good Wireless environment. As we can see, we have Cells with RSSI equal to -67 dBm at the edge and consequently, 35 dB SNR. We also have the necessary distance between cells accounting for 20 dBm in Signal Strength between two cell. This is necessary because, if an Access Point hears another Access Point with a signal strength greater than 19 dBm , this means both Access Point can transmit without to provoke CCI.
  The problem is that this cells will repeat over and over around an area and, most important, Access Point cells is not round like that. Considering the obstacle and others factors, at the end of the store, it is really complicate deploy 2.4 band and keep the network healthy.
 Back to CCI and SNR, the conclusion is that, we need to have a good SNR in the environment but this is not enough. A good SNR with a poor frequency reuse allowing for CCI, will result in users with five bars wireless client and poor wireless connection.
  I will explain CCI in another opportunity. By now, that´s all. Keep in mind that bad SNR will make you fail at all but, good SNR does not guarantee success.