MoCA Monitors

The Monitor is a MoCA component in charge of gathering information about the mobile device and the wireless network, sending it periodicaly to CIS at the fixed network. It collects informations about the available device´s resources, such as: CPU usage, free memory and remaining battery energy and some connectivity data such as: MAC address, IP/Mask and the current Access Point. It also performs scans on the wireless network to identify all Access Points within the range of the device, obtaining their physical addresses (BSSIDs) and their RSSI (Received Signal Strength Indicator) values. The monitor also sends information when a handoff is detected, i.e. when either the current IP address or AP changes.

Currently, we have implemented monitor versions for Windows XP, for Windows CE, for Symbian OS/Nokia S60 and for Linux. For Monitor XP, there is the production version that actually communicates with the MoCA architecture and a demo version that does not depends on running MoCA services and should be used for debugging or testing purposes, e.g. to evaluate the signal quality for each network's AP.

Additionally, we have implemented a monitor simulator, for those who dont have a WiFi-enabled device or just want to simulate the device mobility. The monitor simulator simulates the sending of device's context to CIS so, from the CIS point of view, there is no difference between a context information received from a simulator or from an actual monitor, gathering information about wireless connectivity.

This page is organized as follows.

Monitor Windows XP

Requirements

  • Windows XP
  • A Wi-Fi card installed
  • Administrator rights on the target machine

Download and Installation

To install the monitor, unzip one of the files below and run Setup.exe.

FileDescription
Installer Installer for the production mode
Installer with Demo Installer of a partial monitor with a demo application that shows all information gathered in the device and published in CIS. Just for debugging purposes.

Configuration and Usage

To configure monitor, you should change the monitor.properties file. This file is stored in the directory C:\Windows\MonitorXP and contains the following variables:

VariableDescription
CIS_ADDRESSAddress where CIS service is running
CIS_PORTPort where CIS service is waiting for requests (at CIS_ADDRESS)
CIS_PERIODICITYPeriodicity (in seconds) of sending information to CIs service
CS_ADDRESSAddress where CS service is running
CS_PORTPort where CS service is waiting for requests
DEFAULT_CARD_QUERY_INTERVALInterval for device scan. Value in miliseconds.
MONITOR_PORTPort where monitor is waiting for client requests
DS_ADDRESSAddress where DS service is running
DS_PORTPort where DS service is waiting for requests

Example:

CIS_ADDRESS                   = cis.lac.inf.puc-rio.br
CIS_PORT                      = 55010
CIS_PERIODICITY               = 3
CS_ADDRESS                    = cs.lac.inf.puc-rio.br
CS_PORT                       = 55016
DS_ADDRESS                    = ds.lac.inf.puc-rio.br
DS_PORT                       = 55017
DEFAULT_CARD_QUERY_INTERVAL   = 250
MONITOR_PORT                  = 61555
         

This configuration file only applies to the production version.

After starting the monitor, the application will show the window below.

Monitor Windows CE

Requirements

  • A Pocket PC device running Windows CE, equipped with a Wi-fi interface
  • Microsoft Compact Framework 2.0 installed

Download and Installation

To install the monitor, download and run the .cab file below on a temporary folder of your Pocket PC device

FileDescription
MocaMonitorCE-1.5-RC3 Installer Installer for the latest version of Monitor CE
MocaMonitorCE Installer Installer for the Monitor CE

Configuration and Usage

To configure monitor, you should change the monitor_properties.txt file. This file is stored in the application directory and contains the configuration of some variables like the ones described for the Monitor XP version

Example:

         
		
		
<?xml version="1.0" encoding="utf-8" ?>

	<configuration>
	
	<appSettings>
	
		<!-- CIS IP and Port -->
		<cisAddress value = "139.82.24.240"/>
		<cisPort value = "55010"/>
		
		<!-- DS IP and Port -->
		<dsAddress value = "139.82.24.240"/>
		<dsPort value = "8500"/>
		
		<;!-- CS IP and Port -->
		<csAddress value = "139.82.24.240"/>
		<csPort value = "55016"/>
		
		
		<!-- Periodicity to send data to CIS -->
		<sendDataPeriodicity value = "15000"/>
		
		<!-- Periodicity to get device data -->
		<devDataPeriodicity  value = "10000"/>
		
		<!-- Periodicity to scan APs -->
		<scanDataPeriodicity value = "1000"/>
		
		<!-- Periodicity to get GPS Data -->
		<gpsDataPeriodicity value = "2000"/>
		
		<!-- Scan query time interval -->
		<cardQueryInterval   value = "5000"/>
		
		<!-- GPS query time interval -->
		<gpsQueryInterval   value = "5000"/>
					
	</appSettings>
	
	</configuration>

This configuration file only applies to the Monitor CE version.

After starting the monitor, the application will show the user interface with the screens shown below:



Device data screen



Connectivity and Wireless Network data screen



GPS data screen



MoCA Services parameters screen

Monitor Symbian OS/Nokia S60

Requirements

  • A Nokia S60 3rd Edition device with WLAN interface.

Download and Installation

To install the monitor, download and run the .SIS file below on a temporary folder of your Nokia S60 3rd Edition device or, copy the .SIS file to the PC and install the monitor by the Nokia PC Suite.

FileDescription
MocaMonitorSymbian-1.0 Installer Installer for the latest version of Monitor Symbian.

Configuration and Usage

To install the monitor for Symbian you must follow these steps:

  1. Startup the Nokia PC Suite application.
  2. Connect your phone to Nokia PC Suite.
  3. On Windows Explorer, double-click the .SIS instalation file.
  4. Nokia application installer will ask if you want to install the application on the phone. Choose "yes". Nokia application installer will then transfer the installation process to the phone interface.
  5. On the phone, choose "yes" to begin installing the Monitor application.
  6. A security warning dialog will appear. Choose "continue".
  7. Another dialog displays details of the Monitor application. Choose "continue".
  8. If the phone has a memory card, the installer will ask if the application should be installed on the internal phone memory or on the memory card. Choose the one that is more suited for you.
  9. Another dialog will list the permissions needed to run the Monitor application. Choose "continue".
  10. The installation process should finish properly.

To use the Monitor, it is necessary to establish a connection with some wlan access point. To do so, you can use the WLAN Wizard to search for access points, or use some application (like the web browser) that connects to the network."

After the installation process, the application executable will be located on the phone application menu.

The application main window has two commands: "Options" and "Exit". The "Exit" command terminates the application. The "Options" command pops up a menu with further options. The "Edit MoCA Config" options lets the user change the MoCA Configuration. The following options area available:

OptionDescription
CIS AddressAddress where CIS service is running
CIS PortPort where CIS service is waiting for requests (at CIS_ADDRESS)
CIS PeriodicityPeriodicity (in seconds) of sending information to CIS service
CS PortPort where CS service is waiting for requests
DS AddressAddress where DS service is running
DS PortPort where DS service is waiting for requests
Monitor PortPort where monitor is waiting for client requests

The user should navigate the config screen and select the desired item with the D-pad. Then an editor pops up so that the user can edit the parameter. If the user selects "Ok" then the data is accepted. If the user selects "Cancel" the change is discarded. This screen has two commands: "Save" and "Cancel". The "Save" command saves all options to the config file. The "Cancel" command discards all changes, and closes the config screen.

The "Device Info" option displays the collected device information. The collected items are: the device vendor, device model, cpu usage (not yet implemented), amount of free memory, and the device MAC address.

The "Network Info" option displays the collected information about the network. This option displays the current IP address of the device, its network mask, the currently connected access point (if any), IP address and access point change (if the application detected those events), and the number of scanned access points in the vicinity. If any access point is detected, its MAC address, SSID, and signal strength are listed in that window.

The "MoCA" option displays the current MoCA configuration.

The D-pad can be used to scroll the information up/down when applicable.

Monitor Linux

Requirements

  • The java runtime environment (jre) 1.5 or greater installed.
  • A wireless card.
  • A linux kernel 2.6 with a shell (if not bash, please change the first line of the script scanning.sh).
  • A kernel compiled with wireless extension from version 11 to 21. For other versions support requires wireless tools.

Download and Installation

To install the monitor for GNU/Linux, download and unzip the MocaMonitorLinux-1.0 Installer to any folder you like.

FileDescription
MocaMonitorLinux-1.0 Installer Installer for the latest version of Monitor Linux.
Monitor Client Test This is a simple java TCP client program that connects to Monitor linux running on local machine (connects to 127.0.0.1) via TCP on the port 61555. See the README file to more details.

Open the text file monitor.properties and edit the following fields:

cis.address                 = 127.0.0.1
cis.port                    = 55010
cis.periodicity             = 2
monitor.port                = 61555
default_card_query_interval = 2
         		

Monitor sends UDP packages to CIS on the addreess and port defined above. So if you're under a firewall be sure you have outbound permission to these packages. After that, run monitor script as root to start the deamon.

The monitor is going to output the scans to the standard I/O if started with -v option. In case any error occur it generates a error.log file to the current directory describing the error.

If you are running monitor under a desktop you probably is going to see an error about battery, it's ok, just ignore it. Because desktops don't have baterry as power source anyway.

Attention: If you notice that Monitor is not getting the full list of all visible access points, run it as root.

Monitor Simulator

Download

The current release (candidate) is 1.5-RC1. Below is the link to latest release.

Install

To install the monitor simulator you must follow these steps:

  1. Download the installation file
  2. Unpack the installation file. The downloaded install archive contains everything required to run the Monitor on your system. The install archive has a single top-level directory named monitor-VERSION, where VERSION is the version downloaded (eg. 1.0). This directory contains all the Monitor related files beneath that.
  3. Define the JAVA_HOME environment variable. This variable should be the directory where a Java Development Kit is installed.
  4. Define the MONITOR_HOME environment variable which is the directory where you just unpacked the Monitor install archive.
  5. Add MONITOR_HOME/bin to your path so that you can run the scripts provided with Monitor.

Running

There are two modes for running the monitor: stand-alone or gui.

Stand-alone

The monitor simulator is configured through the property file monitor.properties. You should provide the such file and put in %MONITOR_HOME%\conf.

You should configure the following properties:

ParameterDescription
monitor.scanIntervalPeriodicity (in miliseconds) of sending information to CIS service
cis.serverIP Address of the CIS server
cis.portPort where CIS service is waiting for requests
fileXFile that have scans samples
intervalXInterval (in milliseconds) of sending information for fileX

The information sent by simulator is configured through the pair of properties (fileX, intervalX). For instance:

monitor.scanInterval=1000
monitor.repeating=true
cis.server.host=localhost
cis.monitor.port=55010
file1=conf/Scan-Banco_01.txt
interval1=5000
file2=conf/Scan-EspacoAberto.txt
interval2=10000
file3=conf/Scan-Mesa_03.txt
interval3=20000
          

This example will send a scan to the CIS for one second of interval (see monitor.scanInterval). The first 5 scans will be read from the file1 file, i.e. conf/Scan-Banco_01.txt. The number of scans is defined by the ratio intervalX/monitor.scanInterval. Thus, the 10 following scans will be read from the file2 file, and so on. If the monitor.repeating property is equal to true, simulator will send the scans indefinitely.

A scan file (like scanX.txt) contains information about device type, CPU usage, memory level, MAC address, etc, using a format composed by pairs of <attribute name>=<attribute value>#:

Vendor=Ericsson#Model=R600#CpuUsage=7#FreeMemory=12888#....
ParameterValue
VendorA string containing the device's vendor
ModelA string contanining the device's model
CpuUsageAn integer value representing the percentual value of the CPU usage
Free MemoryAn integer value representing the amount of memory free, in Kbytes
EnergyLevelAn integer value representing the percentual value of battery level
PeriodicityPeriodicity this information will be sent to CIS
IPChangeA boolean value (0 for false and 1 for true) representing a change of the IP address
APChangeA boolean value (0 for false and 1 for true) representing a change of the AP
IPThe device's IP address
NetworkMaskIP mask
MacAddrdevice's MAC address
Sequence of AP RSSIs

Sequence of APs and the RSSI strengh of each one. Two sequences must be separated by the & separation character. Each AP information, contains the following information:

AP's MacAddrAccess Point's MAC address
RSSIA negative integer, representing the RSSI signal
AP identifierA string identifying the AP

The character # is used for separate the AP's MacAddr from RSSI information

For instance:

Vendor=Ericsson#Model=R600#CpuUsage=7#FreeMemory=12888#EnergyLevel=63#Periodicity=0#IpChange=0#ApChange=0#Ip=10.10.10.24#NetworkMask=255.255.255.0#MacAddr=00:02:2D:A5:06:45#CurrentApMacAddr=00:02:2D:A5:06:12#ApList=[[MacAddr=00:0E:84:80:78:5E#Rssi=-76#Ssid=Wi-Fi PUC][MacAddr=00:02:2D:A5:06:12#Rssi=-83#Ssid=LAC]]

Implementation Details

the translation of this section is pending

O 802.11 Wireless Network Scanner - WScanner tem o objetivo de identificar e obter a intensidade do sinal de todos Access Points (AP) que estão no raio de cobertura do dispositivo móvel, tal funcionalidade é implementada através de um scanning na rede sem fio. Além disso, o WScanner mostra na tela a lista de APs identificados com suas respectivas força de sinal, grava tais informações em um arquivo e se necessário as envia para um servidor local ou remoto.

A intensidade do sinal de cada AP identificado durante o scanning é representada em dBm. Essa informação é obtida diretamente do driver da placa de rede sem fio. A implementação atual do WScanner é específica para dispositivos móveis (laptop ou Desktop com placa de rede sem fio) com Windows XP.

O WScanner faz scanning em placas de rede sem fio 802.11 de diferentes fabricantes, pois na sua implementação ele não interage diretamente com o driver de cada fabricante, e sim com a arquitetura de rede do Windows. Esta arquitetura é ilustrada in the figure below.

NIS Architecture

Como ilustrado na Figura 1, a comunicação entre a aplicação e o driver da placa de rede sem fio não é direta. Os seguintes componentes da NDIS (Network Driver Interface Specification) são intermediários nessa comunicação:

  • NDIS Protocol Driver - driver de protocolo da NDIS que interage com a NDIS Wrapper para enviar e receber pacotes através do driver da placa de rede sem fio (NDIS Miniport Driver). Esse driver é específico para cada sistema operacional;
  • NDIS Wrapper - driver no modo kernel que exporta um conjunto de interfaces de software definidas pela NDIS para interagir com o driver da placa de rede. A NDIS Wrapper isola o driver da placa de rede sem fio das aplicações. Desta forma, é possível acessar o driver de placas de diferentes fabricantes através do mesmo conjunto de interfaces.

Requirements

O WScanner foi desenvolvido em ANSI C utilizando o Visual Studio .NET. Dentre as etapas de implementação envolvidas no trabalho temos:

  • Implementação do driver de protocolo da NDIS com o objetivo de interagir com a NDIS Wrapper;
  • Implementação da aplicação WScanner;
  • Implementação de uma interface gráfica em ANSI C usando a WIN32 API;
  • Desenvolvimento de um instalável para o driver;
  • Desenvolvimento de um instalável para o WScanner;

Para obter as informações da rede sem fio tanto no Windows XP quanto no Windows CE nós utilizamos a arquitetura de rede da microsoft, conhecida por Network Driver Interface Specification (NDIS). Através desta, o monitor dispara e coleta os resultados dos scanning realizados na rede sem fio usando interfaces e comandos da NDIS Wrapper comuns aos drivers de todas as placas de rede. %para obter informações dos APs que estão no raio de cobertura do dispositivo móvel. Uma visão geral dessa arquitetura é mostrada in the figure below. Dessa forma, a implementação do monitor torna-se independente do fabricante da placa de rede sem fio, pois toda a comunicação entre o monitor e o driver da placa de rede ocorre via a NDIS Wrapper. As demais informações (CPU, Nível de energia, ...) são obtidas utilizando APIs específicas da Microsoft. No Linux, a lista de APs com as respectivas intensidade do sinal é obtida via chamadas ioctl e, as demais informações são coletadas a partir dos arquivos contidos no /proc na estrutura de diretórios do Linux.

Additional information:

  • MSDN Library
  • Network Devices and Protocols: Windows DDK