Wednesday, 18 December 2013

EAP based setup based on external registrar

Station willing to connect to AP, sends out a probe request with WPS IE, request type set to enrollee.

AP sends a Wi-Fi Simple Configuration probe response to the Registrar with
Response Type set to AP.


After this M1 to M8 exchange occurs. Enrollee (the station) may decide to associate to a WSC-enabled AP and initiate the registration protocol by sending message M1 to the Registrar; assuming that
the Registrar is not yet prepared to enroll the candidate enrollee it will respond with message M2D.

M2D – this message indicates that the Registrar is unable to authenticate with the Enrollee, but it is willing to provide descriptive information about the Registrar to the Enrollee.

Phase 1:
1. The Enrollee sends its Discovery message using an 802.11 probe request. The
Discovery message is broadcast by the AP to all external Registrars.
2. The AP responds to the probe request with its own Discovery data.
3. The Enrollee connects to the AP and initiates 802.1X.
4. The Enrollee‟s M1 message is proxied to all External Registrars as UPnP events.
Each active Registrar (Internal Registrar, if enabled, and all the External
Registrars that have subscribed to receive UPnP events from the AP) should
send M2 or M2D.
5. The two external Registrars send M2D messages to the AP. The AP queues
these up for delivery to the Enrollee.
6.The AP sequentially delivers the M2D messages to the Enrollee, which responds
with ACK messages to each one. After the last M2D has been delivered without
a WSC_MSG response, the AP sends EAP-Failure to terminate the 802.1X
connection.


Phase 2:
1. Enter PIN in ER.
2. Registrar notifies the AP when it becomes active by setting the Selected Registrar attribute to TRUE
3. After the AP receives a SetSelectedRegistrar UPnP action with Selected Registrar TRUE, AP incorporates Selected Registrar flag set to TRUE in its Beacons and Probe Responses
4. Enrollee reconnects and restarts the 802.1X authentication. This time, Registrar sends an M2 message rather than an M2D message.
5. The Enrollee and Registrar engage in the complete Registration Protocol until the
Enrollee is provisioned with its Credential.

Monday, 16 December 2013

Out-of-Band setup

In out-of-band methods there is a transfer of information by a channel other than the Wi-Fi channel itself.

  1. Near-Field-Communication Method, in which the user simply has to bring the new client close to the access point to allow a near field communication between the devices. NFC Forum compliant RFID tags can also be used. Support of this mode is optional.
  2. USB Method, in which the user uses a USB flash drive to transfer data between the new client device and the access point of the network. Support of this mode is optional, but deprecated.

The USB method has been deprecated and is not part of the Alliance's certification testing.

Thursday, 7 November 2013

Hostapd - user space daemon for AP and authentication server

To make hotspot on a laptop, Check if iwlist to check if it has AP capability as shown below.


Download hostpad source code from http://hostap.epitest.fi/hostapd/. Read http://wireless.kernel.org/en/users/Documentation/hostapd for further details.
root@ramapriya:/home/ramapriya/hostapd-2.4/hostapd#cp defconfig .config
root@ramapriya:/home/ramapriya/hostapd-2.4/hostapd#make
You get two binaries after successful make: hostapd and hostapd_cli.

Once set up is ready, change hostapd.conf file in hostapd folder.
A sample configuration is given below:


interface=wlan0
ctrl_interface=/var/run/hostapd
ssid=Shim_te_ccmp
hw_mode=g
wpa_passphrase=123456789012
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
ht_capab=[SHORT-GI-20][TX-STBC][HT40-][RX-STBC1]
channel=1
rts_threshold=2346
fragm_threshold=2346
beacon_int=100
wpa=2
ieee80211n=1
wmm_enabled=1
wpa_group_rekey=0
wps_state=1

2. Start hostapd.
./hostapd  hostapd.conf

3. Start the AP using the configuration in hostapd.conf file.
./hostapd_cli

Possible errors:
fatal error: netlink/genl/genl.h: No such file or directory
Solution:
sudo apt-get install libnl-dev



Thursday, 12 September 2013

Useful links

http://www.wildpackets.com/resources/compendium/wireless_lan/802_11n
http://www.my80211.com/home/2009/12/5/80211-null-data-frames.html
http://www.digitalthreat.net/2012/01/bypassing-wps-router-security/
4way handshake:
http://etutorials.org/Networking/802.11+security.+wi-fi+protected+access+and+802.11i/Part+II+The+Design+of+Wi-Fi+Security/Chapter+10.+WPA+and+RSN+Key+Hierarchy/Details+of+Key+Derivation+for+WPA/

Aggregation:
https://en.wikipedia.org/wiki/Frame_aggregation
Block ACK:
http://wiki.deliberant.com/faq/autoba-auto-block-ack/

EAP-PEAP:
https://supportforums.cisco.com/blog/154046
802.11e:
http://www.eetimes.com/document.asp?doc_id=1271987
802.11r:
http://www.codealias.info/technotes/the_ieee_802.11r_standard_for_fast_wireless_handoffs
http://www.cisco.com/c/en/us/support/docs/wireless-mobility/wireless-lan-wlan/116493-technote-technology-00.html

Legacy power save:
http://processors.wiki.ti.com/index.php/OMAP_Wireless_Connectivity_Power_Save
https://community.arubanetworks.com/t5/Technology-Blog/802-11-TIM-and-DTIM-Information-Elements/ba-p/256997
https://alethea.in/legacy-power-save-mode/

For beginners in C:
http://www.thegeekstuff.com/2010/03/debug-c-program-using-gdb/
(note: info args to know the arguments passed to the function and 
     info locals to print local variables (in the current stack frame)
http://www.geeksforgeeks.org/memory-layout-of-c-program/

Linux
Download kernel source code:
http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.3.3-wily/

Compiling kernel module:
http://www.thegeekstuff.com/2013/06/compile-linux-kernel/

followed by update-grub

To invoke a utility or shell script with a particular priority
http://en.wikipedia.org/wiki/Nice_(Unix)

Useful utilities:
gnome-system-monitor
gnome-www-browser

http://cciew.blogspot.in/2011/02/short-slot-time.html

Beamforming:
http://ruwanindikaprasanna.blogspot.in/2016/01/is-my-80211ac-wifi-ap-beamforming.html

Spatial multiplexing:
https://wifijedi.com/2009/02/01/how-stuff-works-spatial-multiplexing/

Certified Wireless Analysis Professional notes:
http://mrncciew.com/2014/10/04/my-cwap-study-notes/

Linux network drivers:
http://linuxgazette.net/156/jangir.html

Kernel crash:
http://www.dedoimedo.com/computers/crash-analyze.html#mozTocId782257
http://blog.csdn.net/u011839461/article/details/12001437

Spin lock internals- Very nice article:
http://www.linuxinternals.org/blog/2014/05/07/spinlock-implementation-in-linux-kernel/

Top half and Bottom halves:
---------------------------------
https://www.quora.com/What-is-the-advantage-of-new-request_threaded_irq-over-request_irq
Tasklets:
https://www.ibm.com/developerworks/library/l-tasklets/

DMA
https://www.kernel.org/doc/Documentation/DMA-API-HOWTO.txt

Cryptography
http://crypto.stackexchange.com/questions/27131/differences-between-the-terms-pre-master-secret-master-secret-private-key

https://support.ssl.com/Knowledgebase/Article/View/19/0/der-vs-crt-vs-cer-vs-pem-certificates-and-how-to-convert-them

Setting ASUS as AP:
http://askubuntu.com/questions/404881/how-do-i-install-an-asus-usb-ac56-wifi-adapter
http://w1.fi/hostapd/
http://freeradius.org/download.html
SIM800 user manual
https://cdn-shop.adafruit.com/product-files/2637/SIM800+Series_AT+Command+Manual_V1.09.pdf


Code composer studio setup:
http://software-dl.ti.com/ccs/esd/CCSv7/CCS_7_1_0/exports/ccs_setup_7.1.0.00014.exe
[‎3/‎3/‎2017 2:26 PM] Janaki Vallabha Eranna:
http://software-dl.ti.com/ccs/esd/CCSv7/CCS_7_1_0/exports/ccs_setup_7.1.0.00014.exe

How to send SMS from ADB
http://stackoverflow.com/questions/4043490/how-do-i-send-an-sms-from-a-shell

To build web demo for sensortag
-------------------------------------
http://processors.wiki.ti.com/index.php/Contiki_setting_up_sw

Main page:
----------
http://processors.wiki.ti.com/index.php/Contiki-6LOWPAN

Download and setup contiki
--------------------------
http://www.contiki-os.org/start.html

Setup tool chain
-----------------
http://processors.wiki.ti.com/index.php/Contiki_setting_up_sw

Setting up edge router
----------------------
http://processors.wiki.ti.com/index.php/Cc26xx_sw_examples

Source code:
------------
https://github.com/contiki-os/contiki

sniffer:
--------
http://processors.wiki.ti.com/index.php/Contiki_sniffer

6lowpan coding documentation
----------------------------
https://github.com/contiki-os/contiki/blob/master/doc/sicslowpan-doc.txt


/home/user/Documents/src/contiki-master/examples/cc26xx

PCI BAR essentials
--------------------
https://docs.oracle.com/cd/E19455-01/805-7378/hwovr-28/index.html
https://github.com/billfarrow/pcimem

11AC resources
==========
STBC
------
http://www.radio-electronics.com/info/antennas/mimo/precoding-codes-alamouti-diversity-space-time.php

MIMO GI
----------
http://rfmw.em.keysight.com/wireless/helpfiles/89600b/webhelp/subsystems/wlan-mimo/Content/mimo_fmt_grdintparams.htm

Where is hard link used?
https://www.lifewire.com/what-are-hard-links-2190041

Deep learning
----------------
https://docs.aws.amazon.com/dlami/latest/devguide/tutorial-conda.html

Thursday, 8 August 2013

U-APSD

Unscheduled Automatic Power Save Delivery (U-APSD)

The uplink data frames sent by stations (STA → AP) are used as indications (triggers) to AP that the power saving stations are awake. Here is a nice article on NULL frame which is being sent from STA to AP to inform that it is planning to switch to power save mode: http://www.my80211.com/home/2009/12/5/80211-null-data-frames.html.

AP then sends the buffered data frames (buffered when the stations where in doze mode).

In APSD a station is awake during a Service Period (SP). An unscheduled SP begins when the AP receives a trigger frame from a station and ends when the station receives a QoS Data or QoS Null frame indicating the end of the service period (EOSP).

QOS Info Field when sent from AP(beacon)


AP needs inform to stations whether it supports the 

  1.  U-APSD(UN-scheduled) or 
  2. Scheduled power save mode 
by setting and resetting U-APSD flag bit in QoS info field. If U-APSD bit is 1, then it supports U-APSD and if U-APSD =0 then it does not supports U-APSD



QOS Info Field when sent from STA ((re)association request frame)



Max SP length (2 bit field) indicates max number of total buffered MSDUs and MMPDUs the WMM AP may deliver to WMM STA during the service period triggered by WMM STA.

  Max SP length

Setting 0 in AC (BE, BK, VI and VO) indicate that the corresponding AC is neither trigger-enabled nor delivery-enabled.

 TIM in the Beacon might not indicate whether frames are buffered at the AP, it requires to periodically send QoS Null frames if no other triggers are sent in order to learn the actual buffer status of the AP.


If U-APSD is configured through ADDTSs each time a new application starts which requires its usage, then the stations can rely on the TIM information of the Beacons to be informed about new traffic at the AP, enter into U-APSD mode through ADDTS when a communication starts and revert back to legacy
power save mode when it ends.

Wednesday, 7 August 2013

rfkill

Some devices come with a hard switch that lets you kill different types of RF radios: 802.11 / Bluetooth. Some times these buttons may kill more than one RF type. The Linux kernel rfkill subsystem exposes these hardware buttons and lets userspace query its status and set its status through a /dev/rfkill.

 To get the current rfkill status, use rfkill list:


Note that an index (3) is assigned  for wireless LAN interface.
To turn off the interface, use the command rfkill block <index> and to turn on the interface again, use rfkill unblock <index>



Monday, 5 August 2013

Part 3: P2P Group Owner Negotiation


Once the two P2P Devices have found each other, they start the Group Owner(GO) Negotiation phase. This is implemented using a three-way handshake, namely GO negotiation.Request/Response/Confirmation,  whereby the two devices agree on which device will act as P2P GO and on the channel where the group will operate, which can be in the 2.4 Ghz or 5 Ghz bands.

In order to agree on the device that will act as P2P GO, P2P devices send a numerical parameter, the GO Intent value, within the three-way hand-shake, and the device declaring the highest value becomes the P2P GO. To prevent conflicts when two devices declare the same GO Intent, a tie-breaker bit is included in the GO Negotiation Request, which is randomly set every time a GO Negotiation Request is sent.


P2P GO Negotiation Request from device 1:



If operating channel is not available, it will use another channel from the Channel List.Configuration time is Time needed by the device to get configured an function as a GO in units of 10 milliseconds.

 WPS IE in GO negotiation request:

GO negotiation response from device 2:



WPS IE in GO negotiation response:

                

When using PIN based WSC, the selected PIN (from the display of either the
P2P Client or P2P Group Owner) is indicated using Device Password ID
attribute. For example for devices using pushbutton authentication,


A P2P Device may decline Group Owner Negotiation if the Device Password ID
in the GO Negotiation Response is incompatible with the Provisioning
information it shall use to execute Provisioning.

P2P GO Negotiation confirmation from device 1:


Group Owner determination is depicted below.


Once the devices have discovered each other and agreed on the respective roles, the next phase is the establishment of a secure communication using Wi-Fi Protected Setup.