Pages

Thursday, November 10, 2016

802.11r roaming (Fast BSS Transition)

 So far 802.11 standard not mentioned any specific roam implementation until 802.11r amendment. So that each vendor will do the research in different ways and will come up with different solution.  So we got different roaming techniques from diffrent vendors. But each roam technique have their own advantages and limitations. So 802.11r amendment came to standardize the roaming across different vendors and address all the existing limitations.

First we will understand the different available roam techniques and their limitations. Then we can go to 802.11r. Below are the different roam algorithms according to their priority from top to bottom.

CCKM : It is Cisco specific roam  technique only. We can’t roam with other vendor infra.

MoveOp : It is Motorola specific roam  technique only. We can’t roam with other vendor infra

Pre-auth : we need to pre-auth with many APs that will consume network resources. Each AP have to remember PMKSA of all the clients.

OKC :  Each vendor Implemented on their own way. So inter vendor roaming and inter controller roaming not possible.

PMK Caching: We need to maintain PMK caching for each AP. Which is not possible when we have large networks.

802.11r advantages:

1. we can roam across different vendors using the standardized roam technique.

2. We should able to  roam across entire ESS even APs may not be under same controller under same mobility domain.

3. We should able to reserve the required bandwidth at the time of connection it self.

4. Getting the AP neighbor reports .

5. We are able to roam less than 100 ms so that voice will continue without any breaks.


6. Authentication for the client device should be done only once.

FT  definitions:         


          Mobility Domain : A set of BSS (basic service sets), within the same ESS (extended service set), that support Fast BSS transitions.

 i.e  All the  APs under multiple controller will create one Mobility domain. So that client can roam between APs of different controller.

PMK-R0 :  First level of the Fast BSS Transition key hierarchy. Derived from MSK (say PMK). Usually it is controller which will hold the PMK.

PMK-R1 :  Second level of the Fast BSS Transition key hierarchy. Derived from PMK-R0.
                       Usually it is AP which will derive PMK-R1 keys.

FT Key Hierarchy:


FT Key Handling Process:


FT Methods:


Over-the-Air
•        STA communicates directly with the target AP using FT authentication frames.
Over-the-DS
•        STA communication to the target AP via current AP using FT Action frames.


Below is the snapshot of beacon which specifies the FT Authentication as part of AKMP suite. We can see Mobility domain Filed and FT capability  which tells it is using FT over Air or FT over DS.





FT Initial Association:


Below Capture will show us the FT Initial Association



Below packet shows the FT initial association request packet MDIE and RSNIE





Below packet shows the FT initial association response packet MDIE and FTIE





RSN Re-association (Over the Air):




Below capture shows the FT re-association procedure.



Below capture shows FT re-association request packet format



Below capture shows FT re-association response packet format


FT RSN Re-association (Over DS)





Thursday, April 9, 2015

FAQ on Wi-Fi New Technologies

FAQ  at Interviews in New Wi-Fi Standards


1.)  802.11ac is also called as?
2.) What are throughput values achieved using 802.11ac?
3.) what are underlying Standard modifications that had helped  802.11ac to get high throughput?
4.) 802.11 ac works on which Band?
5.) How many no overlapping channels are possible is 11ac in enabled in A band?

Friday, February 1, 2013

What is Wi-Fi Protected Setup (WPS)

Nowadays Wi-Fi is common in many houses and offices.But Configuring the AP is not easy for new users. If they want to configure the better security such a way that others don't use your Wi-Fi ,we should configure Higher security methods like WPA/WPA2. If they use open security others can easily access your network.

        To overcome this problem Wi-Fi introduced the concept of Wi-Fi Protected Setup(WPS) which is the easy way to configure your new Wi-Fi setup securely without understanding higher security methods like WPA/WPA2.

Wi-Fi Protected Setup certification started from  January  2007.

WPS uses WPA2 Personal method and is compatible with legacy devices that are  CERTIFIED for WPA/WPA2 Personal.


Products certified for WPS offer users at least one of three easy setup solutions
1. Personal Information Number (PIN)
2. Push Button Configuration (PBC)
3. Near-Field Communication (NFC)

WPS are tested and certified to include both PIN and PBC configurations in APs, and at a minimum, PIN in client devices.


Traditional Way of Connecting WLAN 



1. User activates the AP by connecting it to a power source and to a wired network from a computer 
2. User launches a web browser to log into an administrative page and access the AP .
3. User assigns a network name to set the SSID 
4. Navigates to a security settings page to select the type of security to be used.
5. User will  enter a passphrase which the AP will use to generate the security key .
6. The user configures the device to connect  the network through WLAN application on the device, 
7. The client device presents the user with the network names (SSIDs) of all WLANs it finds in the vicinity. 
       The user selects the appropriate network name (created in Step 3) and connects to the network
8. The user is then prompted to enter the passphrase created in Step 5 . 
9. The client and the AP exchange security credentials and the new device is securely connected to the   
     WLAN. 




With WPS we will get below benefits.


          1.  In most cases, WPS eliminates for the user Steps 2-5 of the legacy method.
          2.  it simplifies some of the remaining tasks required of the user, such as the establishment of a               
              passphrase.
          3. Ensures that the SSID and WPA2 security key are properly configured
          4 .Adding new devices is  based upon a discovery protocol that is consistent across vendors
          5. Registrar will issue the credentials of devices being enrolled on the network. Usually AP will be  
             registrar on the network.
          6. When a new device that support  for WPS comes within range of an active AP, its presence is  
              detected, communicated to the Registrar 
          7.  the user is prompted to initiate the action that authorizes the issuance of registration credentials.

1. Personal Information Number (PIN)


  • Usually called as PIN method
  • PIN is provided for each device that will join the network
  • A fixed label may be placed on a device to identify the PIN for the user, or a dynamic PIN can be generated and shown on the device’s display
  • The PIN is used to ensure that the device that the user intends to add to the network is the one that is added and to help avoid accidental or malicious attempts of others to add unintended devices to the network
  • User accesses the Registrar through a GUI on the AP, or via a Web browser or UI on another device on the network
  • User enters client’s PIN into the Registrar via UI or Web browser
  • AP validates the PIN and connects to the network through Registrar, Most the cases AP acts as Registrar.

2. Push Button Configuration (PBC)


  • Usually called as Push method
  • Network name (SSID) is generated automatically for the AP and broadcast for discovery by clients
  • User pushes buttons on both the AP and client device
  • Then AP automatically  connect to the AP and join the network. 

3. Near-Field Communication (NFC)

  • This is optional feature of WPS for connecting the network
  • Network name (SSID) is generated automatically for the AP and broadcast for discovery by clients
  • User touches an NFC-enabled client device to the NFC target mark on the AP or brings the client within close proximity of it, approximately 10cm.
  • The Registrar reads the client’s identifying credentials from an NFC token embedded in the device
  • Then AP automatically  connect to the AP and join the network. 
  • Testing for NFC began in 2008



Tuesday, January 29, 2013

LWAPP Protocol Basics


In this topic i am planning to cover LWAPP protocol which is basic protocol for all controller based communications. For  CAPWAP protocol also base is LWAPP protocol. Now all the vendors are using CAPWAP/LWAPP protocol for communicating between Controller and APs.


Overview

        LWAPP is a generic protocol defining how Wireless Termination Points   communicate with Access Controllers.  Wireless Termination Points and   Access Controllers may communicate either by means of Layer 2   protocols or by means of a routed IP network.


LWAPP goals
  •   Centralization of the bridging, forwarding, authentication and policy enforcement
  •   Permit shifting of the higher level protocol processing burden away from the WTP
  •   Providing a generic encapsulation and transport mechanism
Note :

  WTP -Wireless Termination Points . Llike APs.
  AC   - Acess Controller . Like Controllers or Wireless Switchesor WLAN appliance  

State machine of LWAPP


LWAPP communication will happen with below messages

LWAPP discovery

     L2: MAC level Broadcast domain

     L3:
        No need of same subnet
        Discovery request
        Limited broad cast(255.255.255.255)
       Well Known Multicast
       Unicast IP address
       Discovery Response is always Unicast message


LWAPP Packets are classified into two types.

LWAPP data messages
For waded Wireless frames

LWAPP control messages
Control channel is series of Control messages between AC and WTP assosiated with session ID and key.


LWAPP control messages

1. Discovery
2. Control Channel management
3. WTP configuration management
4. Mobile session management
5. Firmware management

Control message format


      0                   1                   2                   3
      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |  Message Type |    Seq Num    |      Msg Element Length                           |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                           Session ID                                                                      |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |      Msg Element [0..N]                    |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+





All LWAPP control messages

    Description                                                      Value
Discovery Request                                             1
Discovery Response                                          2
Join Request                                                      3
Join Response                                                   4
Join ACK                                                         5
Join Confirm                                                     6
Unused                                                            7-9
Configure Request                                           10
Configure Response                                        11
Configuration Update Request                         12
Configuration Update Response                      13
WTP Event Request                                       14
WTP Event Respons                                      15
Change State Event Request                           16
Change State Event Response                         17
Unused                                                           18-21

   Echo Request                                                 22
Echo Response                                               23
Image Data Request                                        24
Image Data Response                                     25
Reset Request                                                26
Reset Response                                              27
Unused                                                           28-29
Key Update Request                                      30
Key Update Response                                    31
Primary Discovery Request                             32
Primary Discovery Response                          33
Data Transfer Request                                    34
Data Transfer Response                                 35
Clear Config Indication                                  36
WLAN Config Request                                 37
WLAN Config Response                              38
Mobile Config Request                                  39
Mobile Config Response                               40




Discovery

a. Discovery Request:
Necessary step even for static AC also
Wait MaxDiscoveryInterval

b. Discovery Response
Wait Discovery Interval and select one of ACs move to joining state


c. Primary Discovery Request
Check Preferred AC availability
If it is connected to Another AC and configured with primary AC

d. Primary Discovery Response
Advertises availability and services
Connect to Primary AC



Control Channel management

a.Join Request

It is used as MTU discovery Mechanism
With unknown MTU path discovery ,Initial Join Request with 1596bytes.
It will try with 15961500bytes.
If valid certificate generates session key and context for session.
Note : Join Request consists of certificate and Wnonce must be considered as invalid.



b. Join Response

Capable and willing to provide service
Heartbeat timer initiated ,expiration deletion of AC-WTP session.
Timer refreshed on Echo Request.
Valid PSK-MIC responds with Join ACK.





C. Join ACK

WTP to AC , a mean of Key confirmation

D. Join confirm

AC to WTC , a mean of Key confirmation
It will put NeighbourDeadInterval expiration will give Echo request.
Note : This two happen with Pre shared key only.




e. Echo Request

Keep alive mechanism

f. Echo Response

AC should reset Heartbeat timer.
If not received AC consider WTP not reachable.

g. Key Update Request

WTP to AC to initiate re-keying phase
Includes new session unique identifier.


h. Keyupdate Response

Includes session ID,PSK-MIC element.

i. Keyupdate ACK

By WTP used for key derivation process
Those session keys used in encryption

j . KeyUpdate confirm

Closes re-keying loop.

h. KeyUpadate Trigger

AC to make WTP to start keyupdate request.








Friday, December 28, 2012

Cisco AP Configuration


As we use WLAN as solution . Many times we will end up with configuring diffrent kind of vendors APs.
In this part i will try to cover some of the very basic info for Cisco AP configiguration. 
Cisco Configuraion guide will cover all aspects but it is very huge. So covering here some of important steps only.

1. Connecting the AP

Cisco AP we can connect in primarly through Serial, Telnet , http and https.

For connecting to serial baud rate we need to use 9600 and all others are default
default user/password :Cisco/Cisco

2. Assigning the host name


ap>enable
Password:xxxxxxx
ap#config terminal
Enter configuration commands, one per line. End with CTRL-Z.
ap(config)#hostname my_ap
my_ap(config)#end
my_ap#


3.Assigning IP address

 For assigning IP address first check IP address

AP# show ip interface brief

Interface     IP-Address     OK?  Method  Status                  Protocol
BVI           10.108.00.5    YES  manual   up                      up      
dot11radio0   unassigned     YES  unset   administratively down   down    
dot11radio1   unassigned     YES  unset   administratively down   down    
    

Once we know the current ip address then we can assign IP address

configure terminal
interface bvi1
ip address <IP xxx.xxx.xxx.xxx>  <mask xxx.xxx.xxx.xxx>
end

4. Creating open Profile 

conf t
dot11 ssid <ssid name>
authentication open 
guest-mode
inter d0/d1
ssid <ssid name>
no shut
end


5. configuring the radius server on AP along with secure profile

config terminal
aaa new-model
radius-server host <Radius_server_IP> auth-port 1812 acct-port 1813 key <secret key in the radius server>
aaa group server radius  rad_eap
server <Radius_server_IP> auth-port 1812 acct-port 1813
aaa authentication login eap_methods group rad_eap

dot11 ssid <ssid name>
authentication open eap eap_methods
authentication network-eap eap_methods
authentication key-management wpa
inter d0/d1
encryption mode ciphers <aes/tkip>
ssid <ssid name>
no shut
end


5. Creating local DHCP server on AP 

configure terminal
ip dhcp excluded-address low_address [ high_address]
ip dhcp <pool pool_name>
network subnet_number [ mask | prefix-length ]
lease { days [ hours ] [ minutes ] |infinite }
end

example:

AP# configure terminal
AP(config)# ip dhcp excluded-address 172.16.1.1 172.16.1.20
AP(config)# ip dhcp pool test
AP(dhcp-config)# network 172.16.1.0 255.255.255.0
AP(dhcp-config)# lease 10
AP(dhcp-config)# default-router 172.16.1.1
AP(dhcp-config)# end


6. Creating local radius server

configure terminal
aaa new-model
radius-server local
nas <ip-address_of_AP> key <shared-key>
user <username>  password <password>
end

example:

AP# configure terminal
AP(config)# radius-server local
AP(config-radsrv)# nas 10.91.6.159 key 110337
AP(config-radsrv)# nas 10.91.6.162 key 110337
AP(config-radsrv)# nas 10.91.6.181 key 110337
AP(config-radsrv)# user jsmith password twain74 


7. Setting the clock on the AP

AP# clock set 13:32:00 23 July 2001

8.Configuring the data rates on the AP.

configure terminal
interface dot11radio { 0 | 1 }
speed
802.11b, 2.4-GHz radio:
{[1.0] [11.0] [2.0] [5.5] [basic-1.0] [basic-11.0] [basic-2.0] [basic-5.5] | range | throughput}
802.11g, 2.4-GHz radio:
{[1.0] [2.0] [5.5] [6.0] [9.0] [11.0] [12.0] [18.0] [24.0] [36.0] [48.0] [54.0] [basic-1.0] [basic-2.0] [basic-5.5] [basic-6.0] [basic-9.0] [basic-11.0] [basic-12.0] [basic-18.0] [basic-24.0] [basic-36.0] [basic-48.0] [basic-54.0] | range |
throughput [ofdm] | default }
802.11a 5-GHz radio:
{[6.0] [9.0] [12.0] [18.0] [24.0] [36.0] [48.0] [54.0] [basic-6.0] [basic-9.0] [basic-12.0] [basic-18.0] [basic-24.0] [basic-36.0] [basic-48.0] [basic-54.0] |
range | throughput | default }
802.11n 2.4-GHz radio:
{[1.0] [11.0] [12.0] [18.0] [2.0] [24.0] [36.0] [48.0] [5.5] [54.0] [6.0] [9.0] [basic-1.0] [basic-11.0] [basic-12.0] [basic-18.0] [basic-24.0] [basic-36.0] [basic-48.0] [basic-5.5] [basic-54.0] [basic-6.0] [basic-9.0] [default] [m0-7] [m0.] [m1.] [m10.] [m11.] [m12.] [m13.] [m14.] [m15.] [m2.] [m3.] [m4.] [m5.] [m6.] [m7.] [m8-15] [m8.] [m9.] [ofdm] [only-ofdm] | range | throughput }
802.11n 5-GHz radio:
{[12.0] [18.0] [24.0] [36.0] [48.0] [54.0] [6.0] [9.0] [basic-12.0] [basic-18.0] [basic-24.0] [basic-36.0] [basic-48.0] [basic-54.0] [basic-6.0] [basic-9.0] [default] [m0-7] [m0.] [m1.] [m10.] [m11.] [m12.] [m13.] [m14.] [m15.] [m2.] [m3.] [m4.] [m5.] [m6.] [m7.] [m8-15] [m8.] [m9.] | range | throughput }
end

ex: 
conf t
int d0
speed basic-1.0 54.0
end

9.Configuring the  Channel on the AP.

configure terminal
interface dot11radio { 0 | 1 }
channel
{frequency | least-congested | width [20 | 40-above | 40-below] | dfs }
end

example:

conf t
int d0
channel 36
end


10.Configuring the Power of radio  on the AP.

configure terminal
interface dot11radio { 0 | 1 }
power local
These options are available for the 802.11b, 2.4-GHz radio (in mW):
{ 1 | 5 | 20 | 30 | 50 | 100 | maximum }
These options are available for the 5-GHz radio (in mW):
{ 5 | 10 | 20 | 40 | maximum }
These options are available for the 802.11a, 5-GHz radio (in dBm):
{-1 | 2 | 5 | 8 | 11 | 14 | 15 | 17 | maximum }
These options are available for the AIR-RM21A 5-GHz radio (in dBm):
{ -1 | 2 | 5 | 8 | 11 | 14 | 16 | 17 | 20 | maximum }
These options are available for the 2.4-GHz 802.11n radio (in dBM):
{ -1 | 2 | 5 | 8 | 11 | 14 | 17 | 20| 23 | maximum }
end

example:

conf t
int d0
power local 17
end

11.Configuring the Power of radio  on the AP.

configure terminal
interface dot11radio { 0 | 1 }
world-mode
dot11d country_code code
{ both | indoor | outdoor } world-mode roaming | legacy
end

example:

conf t
int d0
world-mode dot11d country_code US both
end

12.Disabling Short Radio Preamble

configure terminal
interface dot11radio 0
no preamble-short
end

Enabling Short Radio Preamble

configure terminal
interface dot11radio 0
no preamble-short
end

13.selecting the Transmit and Receive Antennas

configure terminal
interface dot11radio { 0 | 1 }
antenna receive
{diversity | left | middle | right}
antenna transmit
{diversity | left | right}
end

example:
configure terminal
interface dot11radio  0
antenna receive left
antenna transmit left
end

14. enabling and disabling the radios

configure terminal
interface dot11radio  0/1
shut
no shut
end

Saturday, October 6, 2012

How Roam , PMK caching, OKC and Pre-auth works


In this topic we can cover below points

1. What is Wi-Fi roaming and why it requires ?
2. Different infrastructures where roam can happen.
3. Different ways of handling roaming

1. What is Wi-Fi roaming and why it requires ?


As everybody is using the mobile, roaming will happen seamlessly between cell towers when we are moving 
on different ways like cars, trains and buses. So that our call won't cut in between. Similar be the case
with Laptops and Smart phones where we connected to the network through Wi-Fi. We may be downloading some movie
or game or talking on Skype through Wi-Fi .We  need fast transition to move from one AP to another without users
knowledge. 

Days are coming soon where everybody will use Skype with video call by using Wi-fi. Already some of countries implemented Wi-Fi for entire city there we can use Wi-Fi like our Cell towers. 

2. Different infrastructures where roam can happen.


Roaming will happen whenever we roam from coverage area of one AP to coverage area of another AP in the ESS. As we know BSS is the coverage area of single AP like below picture.













Fig :1


ESS is the coverage area of Two or more APs which have same SSID so that clients can able to roam between those APs without disconnecting the network like below pic.

















      Fig : 2

So from the above discussion we understand that roaming will happen whenever we have ESS. The ESS roaming can happened in different ways like below.

a. Roaming between two Independent APs( Autonomous APs like above Fig :2)

b. Roaming between two APs under the controller (Thin APs)























c. Roaming between two APs which under two different controllers.




















3. Different ways of handling roaming

Usually if we use open authentication without any security there is no much delay in connecting.
But in practical we will use different authentication methods to protect the our network.So it will take some time to complete the authentication which will cause some delay in re-connecting. So we are using diffrent Technics to overcome those. whenever we roam our client from one AP to another AP re-Association will happen. 

Re-association can happen in 4 different ways

a. Full dot1x authentication with new AP
b. PMK caching
c. Pre-authentication
d. Opportunistic Key caching (OKC)

a. Full dot1x authentication with new AP


Whenever we roam from one AP to another new AP first time it will do the complete 802.1x process like below.




But time critical applications  like Voice and Video make disturb as dot1x process considerable amount of time while re-connecting the network.


b. PMK caching


  • Usually whenever we connect any AP with any dot1x method or PSK we will derive the PMK and followed by PMKSA.
  • In PMK caching whenever we connect to any AP we save the PMKSA (PMKID is part of PMKSA) as per life time.

Later point of time if we are trying to connect to the same AP(BSSID) we will check whether PMKSA of that AP is available in the client cache . 



  • If it is available we send that PMKSA in the re-association request.
  • Then AP will check PMK cache of AP ,if it is avilable then without going to the dot1x process again it will go the direct first step of 4-way handshake. 
  • So that considerable amount of time will be saved in re-connecting the AP.

c. Pre-authentication
















  • In Pre-authentication Client will Authenticate to the other APs which are in the ESS even client is not assosiated with those APs and Client even may be in the APS coverage area. 
  • So that whenever it went to that APs coverage area client can skip the dot1x process and continue the 4-way handshake process. 

  • In pre-authentication client will authenticate other Aps through the AP which is currently connected. whenever client send EAPOl request current AP will forward the request to the targeted AP through distribution system.
  • For identifying these frames client will send in ETHER TYPE 88-C7 instead of 88-8E. For pre-authentication to happen both client and AP have to support pre-authentication. That we can see in the beacon frame of the AP.



d. Opportunistic Key caching (OKC)


  • Opportunistic Key caching (OKC) is supported by only few vendors  like Aruba and Motorola.
  • Opportunistic Key caching (OKC) will happen with controller based infrastructure rather than autonomous APs.
  •  controller based infrastructure will work in split-MAC architecture where some of part of operations handled at  AP and some Part of operations handled at controller.
  •  In this whenever client completes dot1x process with AP1 of the controller both client and AP1 have pmkid1 . 
  •  So this pmkid1 will be forwaded to the controller .
  •  Controller will forward the pmkid1 to the other APs in  the network under that controller.
  •  For deriving the PMMID2 with second AP AP2 client will use the formula for calculating the PMKID.
  •  PMKID=HMAC-SHA1-128(PMK,"PMK name"||AA||SPA).

  •  So whenever it is roaming to the second AP it already have PMKID2 for the second AP. 
  • As second AP already have  PMKID2 through controller by using same formula. It will check the client PMKID2 with its PMKID2. 
  • If it is  matches it will skip dot1x process and go the first step of the 4-way handshake process.


Saturday, August 18, 2012

How WLAN CSMA/CA Works


In Wireless LANs CSMA/CA is core concept in comunicating wirelessly. In any shared medium accessing the medium without collision is important part. Its like not talking all at a time, so that remaining people should understood the other's talk.

                       In Ethernet it is achieved through CSMA/CD as it is using full duplex communication. But in wireless it is using Halfduplex communication. The half-duplex constraint applies to devices that share a relative physical area and RF frequency.Several mechanisms are used as a part of 802.11 channel access to minimize the likelihood of frame collisions by multiple STAs attempting to access the transmission medium simultaneously.


Collisions often occur, but the processes used by the 802.11 protocol are in place to minimize the likelihood of collisions and define the appropriate response in the event that a collision is inferred.

Two most common coordination access methods used in WLANs

  1.Distributed Coordination Function (DCF)
  2.Enhanced Distributed Coordination Access (EDCA is part of HCF).

1. Distributed Coordination Function (DCF)


  • Using the foundational DCF coordination function logic is active in every station (STA) in a basic service set (BSS) whenever the network is in operation.i.e. each station within a DCF follows the same channel access rules.
  • This method is contention-based, which means that each device “competes” with one another to gain access to the wireless medium.
  • After a transmission opportunity is obtained and observed, the contention process begins again.
  • As the original 802.11 network access method, DCF is the most simple channel access method but it lacks support for quality of service (QoS).
  • In order to maintain support for non-QoS devices in QoS-enabled networks, support for DCF is required for all 802.11 networks.




2. Hybrid Coordination Function (HCF)


  • As an optional access method that may be used in addition to DCF, HCF was introduced to support QoS. 
  • HCF assimilated elements of both DCF and PCF mechanisms, creating a contention-based HCF method, called EDCA, and a contention-free HCF method, called HCCA.
  • EDCA inaugurated a means of prioritizing contention-based wireless medium (WM) access by classifying 802.11 traffic types by User Priorities (UP) and Access Categories (AC).
  • There are a total of 8 UPs, which map to 4 ACs. 
  • EDCA is used by stations that support QoS in a QoS BSS to provide prioritized WM access, but HCF is not used in non-QoS BSSs.


3.Point Coordination Function (PCF)


  • As an optional PCF is a contention-free access method.
  • PCF provides polling intervals to allow uncontended transmission opportunities for participating client devices.
  • In this approach, the AP of a BSS acts as a point coordinator (PC), initiating contention-free periods in which prioritized medium access is granted to clients, one at a time.
  • PCF has gone unused in 802.11 WLANs.

Summary

• DCF is the fundamental, required contention-based access service for all networks
• PCF is an optional contention-free service, used for non-QoS STAs
• HCF Contention Access (EDCA) is required for prioritized contention-based QoS services
• HCF Controlled Access (HCCA) is required for parameterized contention-free QoS services

802.11 Channel Access Mechanisms


Both contention-based access methods described previously (i.e. DCF and EDCA) employ similar mechanisms to moderate channel access and to minimize collisions.

Below is Outline for Channel Access:

1. STAs use a physical carrier sense (Clear Channel Assessment—CCA) to determine if the WM is busy.
2. STAs use virtual carrier sense (Network Allocation Vector—NAV) to detect if the WM is busy. When the virtual timer (NAV) reaches zero, STAs may proceed.
3. If conditions 1 and 2 are met, STAs wait the necessary IFS interval, as prescribed by the protocol.
4. If conditions 1 and 2 are met through the duration of condition 3, STAs generate a random backoff number in accordance with the range of allowed values.
5. STAs begin decrementing the backoff timer by one for every slot time duration that the WM is idle.
6. After decrementing the backoff value to zero, with an idle medium, a STA may transmit the allotted frame exchange, in accordance with the parameters of the obtained transmission opportunity.
7. If another STA transmits before Step 6 is completed, STAs observe steps 1, 2, 3, and 5 until the backoff timer is equal to zero.
8. After a successful transmission, repeat as needed.



Carrier Sense


  • 802.11 WLANs uses Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA).
  • For STAs to cooperate effectively on a half-duplex channel, each STA must be able to determine when the medium is clear, and when another device is actively transmitting. 
  • The physical carrier sense uses the physical radio interface to sample the wireless medium to detect transmissions. Virtual carrier sense refers to the use of Duration values in the MAC header of a frame and NAV timers to virtually determine if another STA is transmitting.
  • These two mechanisms determine the status of the medium, whether idle or busy.


Physical Carrier Sense


  • The physical carrier sense mechanism defined by IEEE is known as clear channel assessment (CCA).
  • CCA is the physical measurement taken by a radio interface to determine if the wireless medium is currently in use. The physical layer, which can be divided into two sublayers—the physical medium dependent (PMD, lower sublayer) and the physical layer convergence procedure (PLCP, upper sublayer)—performs this task and communicates this information to the MAC. 
  • According to the CCA mode in use, the PMD issues service primitives to the PLCP sublayer indicating whether the wireless medium is in use. 
  • The PLCP sublayer then communicates with the MAC layer to indicate a busy or idle medium, which prevents the MAC from attempting to forward a frame for transmission.
  • Each PHY within the 802.11-2007 standard dictates the specific operations and signal thresholds used to carry out the CCA mechanism.
  • CCA can be divided into two separate processes: Energy detection (ED) and carrier sense (CS). 
  • ED functionality is based upon raw RF energy. When an energy level detected in the channel crosses a certain threshold for a certain period of time, the “busy medium” indication will be triggered.
  • On the other hand, CS—more precisely, “preamble detection”—monitors and detects 802.11 preambles, which are used to trigger the CCA mechanism and indicate a busy medium.



Virtual Carrier Sense




  • Virtual carrier sense mechanism is defined in addition to the physical carrier sense.
  • Virtual carrier sense uses information found in 802.11 frames to predict the status of the wireless medium.
  • This is performed by means of the network allocation vector (NAV), which is a timer that is set using the duration values in the MAC header of a frame. 
  • Each frame contains a duration value, indicating the time required for a station to complete the conversation. 
  • All STAs use these duration values to set their NAV, and then they count down the NAV timer, waiting for the medium to become available.


See the Duration Filed in MAC header in below Pic (second filed)






  • All STAs attempt to process all frames—and a minimum of the first in a frame exchange—on their channel.
  • The first frame in a frame exchange is significant because it can, and sometimes must, be used to determine how long a given transmission opportunity will occupy the wireless medium.

See below wireless capture for Duration value







  • The MAC header of each frame contains a Duration field, which indicates the amount of time necessary to complete the entire frame exchange, or the entire TXOP duration. 
  • In DCF, a transmission opportunity only allows for the transmission of one frame, thus the Duration value represents the required IFS interval and the acknowledgement frame (ACK), if one is required.
  • The exception to this rule is for networks in which RTS/CTS or CTS-to-self protection is enabled. In this case, the transmission opportunity allows for the use of these frames. 
  • In HCF, several frames may be transmitted within a transmission opportunity. Thus, the Duration value refers to the TXOP duration. 
  • In either case, non-transmitting STAs must remain idle while the medium is reserved.
  • When STAs read the Duration value in a frame, they set their NAV timer accordingly and count down this duration.
  • The duration value in the MAC header indicates the time required to complete the transmission opportunity after the current—the frame in which the Duration value resides—frame if completed. 
  • If a STA is counting down its NAV and it receives another frame with a longer duration (would increase its NAV), the STA increases its NAV accordingly.
  • Conversely, when a STA receives a frame with a shorter duration value (would decrease its NAV), the STA ignores this value and continues to observe the longer NAV duration.


See below RTS / CTS exchange





  • In networks where mixed PHY technologies are supported, protection mechanisms are enabled to satisfy the equirements of frame processing and adherence to the common channel access protocol.
  • Frames used as a protection mechanism (often an RTS/CTS exchange or CTS-to-Self) are transmitted at a common rate understood by all PHYs in the network.
  • Legacy PHY STAs read the Duration value in the protection frame(s), set their NAV timer.


Interframe Spacing (IFS)


  • After each frame transmission, 802.11 protocols require an idle period on the medium, called an interframe space (IFS). 
  • The length of the IFS is dependent upon a number of factors, such as the previous frame type, the following frame type, the coordination function in use, the access category of the following frame (in a QoS BSS), as well as the PHY type.
  • The purpose of an IFS is both to provide a buffer between frames to avoid interference as well as to add control and to prioritize frame transmissions.
  • Each IFS “is the time from the end of the last symbol of the previous frame to the beginning of the first symbol of the preamble of the subsequent frame as seen at the air interface




In other words, the IFS interval is observed beginning with the completion of the previous frame. The length of each IFS interval, excluding AIFS, is fixed for each PHY

Short Interframe Space (SIFS)



  • SIFS are used within all of the different coordination functions.
  • For 802.11-2007, SIFS is the shortest of the IFSs and is used prior to ACK and CTS frames as well as the second or subsequent MPDUs of a fragment burst.
  • However, with 802.11n, a shorter IFS (RIFS) was introduced.
  • The IEEE explains the use of SIFS accordingly:

                              “SIFS shall be used when STAs have seized the medium and need to keep it for the duration of the frame exchange sequence to be performed. Using the smallest gap between transmissions within the frame exchange sequence prevents other STAs, which are required to wait for the medium to be idle for a longer gap, from attempting to use the medium, thus giving priority to completion of the frame exchange sequence in progress.”


  • SIFS is used as a priority interframe space once a frame exchange sequence has begun. 
  • This is true when multiple frames are transmitted within a TXOP (as with frame bursting) and it is also true when a single frame is transmitted (as with typical data-ack exchanges).

PCF Interframe Space (PIFS)

  • PIFS are used by STAs during the contention-free period (CFP) in PCF mode. 
  • Because PCF has not been implemented in 802.11 devices, you will not see PIFS used for this purpose. 
  • However, PIFS may be used as a priority access mechanism for Channel Switch Announcement frames, as used to meet DFS requirements. 
  • In order to gain priority over other STAs during contention, the AP can transmit a Channel Switch Announcement frame after observing a PIFS.

DCF Interframe Space (DIFS)

  • When a STA desires to transmit a data frame (MPDU) or management frame (MMPDU) for the first time within a DCF network, the duration of a DIFS must be observed after the previous frame’s completion.
  • The duration of a DIFS is longer than both the SIFS and PIFS.

Arbitration Interframe Space (AIFS)

  • The AIFS shall be used by QoS STAs to transmit all data frames (MPDUs), all management frames (MMPDUs), and the following control frames: PS-Poll, RTS, CTS (when not transmitted as a response to the RTS), BlockAckReq, and BlockAck (when not transmitted as a response to the BlockAckReq) With EDCA.
  • The basic contention logic is the same as with non-QoS networks, but in order to facilitate QoS, there are some notable differences.
  • While DCF can designate a single DIFS value for each PHY, EDCA establishes unique AIFS durations for access categories (AC). 
  • For this reason, an AIFS is typically notated as an AIFS[AC]. 
  • QoS STA’s TXOPs are obtained for a specific access category, so delineation between ACs must be made.
  • For improved control of QoS mechanisms, AIFS values are user-configurable. 
  • By default, QoS APs announce an EDCA parameter set in the Beacon frame that notifies stations in the BSS about QoS values.
  • By changing these values in the AP configuration, the AP will broadcast a different set of parameters to the BSS.

Extended Interframe Space (EIFS)

  • The EIFS value is used by STAs that have received a frame that contained errors. 
  • By using this longer IFS, the transmitting station will have enough time to recognize that the frame was not received properly before the receiving station commences transmission.
  • If, during the EIFS duration, the STA receives a frame correctly , it will resume using DIFS or AIFS, as appropriate.

Reduced Interframe Space (RIFS)

  • RIFS were introduced with 802.11n to improve efficiency for transmissions to the same receiver in which a SIFS-separated response is not required, such as a transmission burst.


See below Pic for IFS comparison





  • The graphic demonstrates the relationship between the different IFS intervals.
  • You will notice that the initial frame (“Busy Medium”) transmission is preceded by a DIFS or AIFS.
  • The graphic shows the relative relationship of the IFS lengths.
  • SIFS are the shortest IFS (excluding 802.11n’s RIFS) and PIFS are second shortest, while DIFS and AIFS take up the caboose.
  • SIFS, PIFS, and RIFS are used to provide priority access for a given type of frame, which eliminates the need for added contention


Calculating an Interframe Space


The 802.11-2007 specification provides the information necessary for us to calculate the durations for each IFS.
As noted previously, SIFS, PIFS, and DIFS are fixed values for each PHY, while AIFS will vary in accordance with the AC in use.
EIFS are fixed per PHY in DCF networks, but vary when used with EDCA.
The formulas and components used for SIFS, PIFS, DIFS, EIFS, and AIFS calculations are as follows:

aSIFSTime = aRxRFDelay + aRxPLCPDelay + aMACProcessingDelay + aRxTxTurnaroundTime
aSlotTime = aCCATime + aRxTxTurnaroundTime + aAirPropagationTime+ aMACProcessingDelay.

The “aSIFSTime” is the same as a SIFS, measured in microseconds (µs). Similarly, the “aSlotTime” is the same as a slot time. Both of these values are provided for each PHY in the 802.11 specification.

PIFS = aSIFSTime + aSlotTime
DIFS = aSIFSTime + 2 × aSlotTime

Given that the SIFS and slot time values are provided for us in the standard, these calculations are pretty simple.

See below IFS calculations



EIFS (DCF) = aSIFSTime + DIFS + ACKTxTime

In this formula, the “ACKTxTime” is the amount of time it takes to transmit an ACK frame at the lowest mandatory rate in the BSS.

EIFS (EDCA) = aSIFSTime + AIFS[AC] + ACKTxTime

The EIFS (EDCA) formula mirrors the same for DCF, but replaces the DIFS with the appropriate AIFS[AC].

An AIFSN is a number (AIFS Number) value that is user-configurable and determines the brevity (or length) of an AIFS interval. AIFSN values are set for each access category, giving the AIFS[AC] a shorter or longer duration, in accordance with the desired priority.

This is demonstrated by the AIFS[AC] formula:
AIFS[AC] = AIFSN[AC] × aSlotTime + aSIFSTime