Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

WiFiMon uses JavaScript in frequently-visited websites to trigger the tests. In Section 1, we provide the instructions to embed the scripts in your website downloading Images and scripts from our Apache Server, i.e. fl-5-205.unil.cloud.switch.ch that is located in Lausanne, Switzerland. measures the performance of WiFi networks, as experienced by WiFiMon Software Probes, i.e. End Users (crowdsourced measurements) and/or WiFiMon Hardware Probes (deterministic measurements), by embedding JavaScript code in frequently visited websites. Performance tests are triggered when End Users visit these websites and, in particular, after a web page is loaded so that browsing experience is not impacted by WiFiMon. 

The aforementioned scripts along with the files, i.e. images that are required to perform the tests are contained in the WiFiMon Test Server (WTS). Notably, performance Notably, measurement results, i.e. Download/Upload Rates and Round Trip Times (RTTsRTTs) are relative to the WiFiMon Test Server. In case of the Apache Server located in Lausanne, results are relative to this server. For more accurate results, you may setup your own Apache Server to host the images and scripts that enabled the performance test from your server. The instructions to achieve that are presented in Section 2. In that case the fl-5-205.unil.cloud.switch.ch server should be replaced in all mentions below with your server. 

1. Embed Scripts in your Website

WTS exact location. Thus, for accurate results, the WTS should be located as close as possible to the monitored Subnets. In contrast, there is no requirement for the WiFiMon Analysis Server (WAS) to be placed close to the monitored networks. Note that the WAS and the WTS could be installed within the same machine. In the following, we consider the WAS and the WTS as two separate machines with FQDNs WAS_FQDN and WTS_FQDN respectively.

WiFiMon is currently using 3 JavaScript-based testtools WiFiMon is currently using 3 different JavaScript-based test tools to measure the performance of WiFi networks: . These are (i) NetTest, (ii) boomerang and (iii) speedtest/HTML5. The following paragraphs show the lines that should be included in the HTML code of these websites for each test tool.

1.1. NetTest

...

1.2. boomerang

...

1.3. Speedtest/HTML5

...

2. Download Test Images from your Server

With the JavaScript lines of the previous section, the images and scripts are downloaded from our WiFiMon Test Server, i.e. fl-5-205.unil.cloud.switch.ch, that is located in Lausanne, Switzerland. Therefore, the performance results will be relative to this server.

2.1. NetTest

...

<Files ~ "\.(htm|html|css|dat|js|php|gif|jpg|png|swf)$">

Header always set Access-Control-Allow-Origin "*"

Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"

Header always set Access-Control-Max-Age "1000"

Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"

</Files>

In the sequel, we provide details on (i) installing the WiFiMon Test Server (WTS), i.e. installing a web server, the testtools used by WiFiMon along with the images necessary for them and (ii) the lines that are required to be embedded in the frequently visited websites.

This guide presents the commands required to install the WTS in a Debian-based distribution (Debian, Ubuntu, etc.). Other distributions may also be considered by adjusting the included commands appropriately.

1. WiFiMon Test Server (WTS) Installation

In the following, we detail the steps that are required to install the WiFiMon Test Server (WTS). Notably, WiFiMon currently uses the Apache2 web server. However, readers could adjust the following setup to their preferred web server.

First, Apache2 web server and PHP 7.3 should be installed using the following commands:

Code Block
sudo apt-get update
sudo apt-get install -y apache2
sudo apt-get install -y php php-common 
sudo apt-get install -y libapache2-mod-php7.3
sudo /etc/init.d/apache2 restart

Then,Apache2 mod_headers should be enabled with the following commands:


Code Block
a2enmod headers
sudo service apache2 restart

WiFiMon also requires enabling CORS. The following lines should be added in the /etc/apache2/apache2.conf file and Apache2: should be then restarted:

Code Block
<Files ~ "\.(htm|html|css|dat|js|php|gif|jpg|png|swf)$">

Header always set Access-Control-Allow-Origin "*"

Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"

Header always set Access-Control-Max-Age "1000"

Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"

</Files>
  • Step 4: Scripts and Images: Get the images and scripts related to WiFiMon testtools from https://WTS_FQDN/testtools/ or from the WiFiMon Bitbucket repo: https://bitbucket.software.geant.org/projects/WFMON/repos/agent/browse/testtools. Place wifimon directory inside the root directory of Apache2 and make the following changes:
    • (i) wifimon/js/nettest/nettest-swfobject.js: Change the NetTest.FlashPath with the public link to nettest.swf.
    • (ii) Embed in your website the scripts provided, after specifying the new URL in their src attribute and imagesLocation attribute (see Section 1).

1.2. boomerang

Step 4: Scripts and Images: Get the images and scripts related to WiFiMon testtools from https://WTS_FQDN/testtools/ or from the WiFiMon Bitbucket repo: https://bitbucket.software.geant.org/projects/WFMON/repos/agent/browse/testtools. Place wifimon directory inside the root directory of Apache2 and make the following change:

  • (i) Embed in your website the scripts provided, after specifying the new URL in their src attribute and imagesLocation attribute (see Section 1).

Step 4: Scripts and Images: Get the images and scripts related to WiFiMon testtools from https://WTS_FQDN/testtools/ or from the WiFiMon Bitbucket repo: https://bitbucket.software.geant.org/projects/WFMON/repos/agent/browse/testtools. Place wifimon directory inside the root directory of Apache2 and make the following change:

  • (i) If you have not created a proxy HTML page, you may use proxy.html (included in folder wifimon/js/speedtest) as the proxy HTML page. If this is the case, you will have to replace "xxx.xxx.xxx.xxx" in the agentIP attribute, with the IP address (or domain name) of the server where the WiFiMon Analysis Server is installed. In every case, you will also have to specify the new URLs for the scripts by changing their src attribute.

2. Embed Scripts in your Website

The following paragraphs show the lines that should be included in the HTML code of the frequently-visited websites for each testtool. The FQDN of the WiFiMon Test Server (WTS) is denoted as WTS_FQDN, the FQDN of the WiFiMon Analysis Server (WAS) is denoted as WAS_FQDN and the name of the utilized testtool should be included in the testtool attribute.

Example pages for each testtool are available in the "measurements" folder of the "testtools" directory in the WiFiMon code repository (https://bitbucket.software.geant.org/projects/WFMON/repos/agent/browse/testtools).

2.1. NetTest

NetTest measurements require embedding the following lines of code in your website:

Code Block
languagexml
<html>
<head>
   <script type="text/javascript" src="https://WTS_FQDN/wifimon/js/nettest/jquery-3.5.1.min.js">>
   <script type="text/javascript" src="https://WTS_FQDN/wifimon/js/nettest/nettest-swfobject.js">>
   <script type="text/javascript" src="https://www.google.com/jsapi">>
   <script type="text/javascript" id="settings" hostingWebsite="https" agentIp="WAS_FQDN" agentPort="8443" testtool="NetTest" imagesLocation="https://WTS_FQDN/wifimon/images/" cookieTimeInMinutes="0.01"
            src="https://WTS_FQDN/wifimon/js/nettest/runtests.js" defer></script>
<!--meta http-equiv="refresh" content="30" -->
</head>
</html>
  • agentIP (required): Replace "WAS_FQDN" with the IP address (or domain name) of the WiFiMon Analysis Server.

  • Replace "WTS_FQDN" with the IP address (or domain name) of the WiFiMon Test Server.
  • imagesLocation (required): Public link to the folder where the images are downloaded to perform the NetTest measurements.

  • testtool (required): With this attribute, you specify a name for the testtool. WiFiMon Analysis Server relies on the value of this attribute to visualize measurements. The following assumptions are made: (i) for websites visited by WiFiMon Software Probes the value of the testtool attribute should be specified as "NetTest", while (ii) for websites visited by WiFiMon Hardware Probes the testtool attribute should be specified as "NetTest-x" where x is the number assigned to a particular WiFiMon Hardware Probe.

  • cookieTimeInMinutes (optional): Duration time (in minutes) to set the cookie in order to prevent repeated measurements and overload the WiFiMon Analysis Server. If empty, "1.5" is assumed, i.e. 90 seconds.

  • If your website already included the jquery.min.js, you have to delete the first line.

  • If the above scripts will be embedded to HTTP websites, the attribute hostingWebsite should have the value "http" instead of "https". The value "https" is used for scripts that will be embedded in HTTPS websites.
  • If the WiFiMon Analysis Server is configured to use the WiFiMon Non-Secure Processor, the attribute agentPort should have the value "9000" instead of "8443". The value "8443" is used if the WiFiMon Analysis Server is configured to use the WiFiMon Secure Processor.

2.2. boomerang

Triggering boomerang measurements requires embedding the following lines of code in your website:

Code Block
languagexml
<html>
<head>
       <script type="text/javascript" src="https://WTS_FQDN/wifimon/js/boomerang/jquery-3.5.1.min.js">>
       <script type="text/javascript" src="https://www.google.com/jsapi">>
       <script src="https://WTS_FQDN/wifimon/js/boomerang/boomerang.js" type="text/javascript"></script>
       <script src="https://WTS_FQDN/wifimon/js/boomerang/bw.js" type="text/javascript"></script>
       <script src="https://WTS_FQDN/wifimon/js/boomerang/rt.js" type="text/javascript"></script>
       <script type="text/javascript" id="settings" hostingWebsite="https" agentIp="WAS_FQDN" agentPort="8443" testtool="boomerang" imagesLocation="https://WTS_FQDN/wifimon/images/" cookieTimeInMinutes=""
                   src="https://WTS_FQDN/wifimon/js/boomerang/boomerang-trigger.js" defer></script>
</head>
</html>
  • agentIP (required): Replace "WAS_FQDN" with the IP address (or domain name) of the WiFiMon Analysis Server.
  • Replace "WTS_FQDN" with the IP address (or domain name) of the WiFiMon Test Server.
  • imagesLocation (required): Public link to the folder where the images are downloaded to perform the boomerang measurements.

  • testtool (required): With this attribute, you specify a name for the testtool. WiFiMon Analysis Server relies on the value of this attribute to visualize measurements. The following assumptions are made: (i) for websites visited by WiFiMon Software Probes the value of the testtool attribute should be specified as "boomerang", while (ii) for websites visited by WiFiMon Hardware Probes the testtool attribute should be specified as "boomerang-x" where x is the number assigned to a particular WiFiMon Hardware Probe.

  • cookieTimeInMinutes (optional): Duration time (in minutes) to set the cookie in order to prevent repeated measurements and overload the WiFiMon Analysis Server. If empty, "1.5" is assumed, i.e. 90 seconds.

  • If your website already included the jquery.min.js, you have to delete the first line.
  • If the above scripts will be embedded to HTTP websites, the attribute hostingWebsite should have the value "http" instead of "https". The value "https" is used for scripts that will be embedded in HTTPS websites.

  • If the WiFiMon Analysis Server is configured to use the WiFiMon Non-Secure Processor, the attribute agentPort should have the value "9000" instead of "8443". The value "8443" is used if the WiFiMon Analysis Server is configured to use the WiFiMon Secure Processor.

2.3. Speedtest/HTML5

Speedtest requires two steps.

Step 1: Create the following proxy HTML page in the "measurements" folder of the "testtools" directory in the WiFiMon code repository (https://bitbucket.software.geant.

...

org/projects/WFMON/repos/agent/browse/testtools

...

):

Code Block
languagexml
<!DOCTYPE html>
<html>
<body>
<iframe src="https://WTS_FQDN/

...

wifimon/js/

...

speedtest/

...

2.2. boomerang

...

<Files ~ "\.(htm|html|css|dat|js|php|gif|jpg|png|swf)$">

Header always set Access-Control-Allow-Origin "*"

Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"

Header always set Access-Control-Max-Age "1000"

Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"

</Files>

speedworker.html" style="visibility: hidden;"></iframe>
<body/>
</html>

Step 2: Create the following HTML page with name "speedworker.html" in the "js/speedworker" folder of the "testtools" directory in the WiFiMon code repository(https://bitbucket.software.geant.org/projects/WFMON/repos/agent/browse/testtools):

Code Block
languagexml
<!DOCTYPE html>
<html>
<head>
<title>Speed worker</title>
	<script type="text/javascript" src="jquery-3.5.1.min.js"></script>
	<script type="text/javascript" src="https://www.google.com/jsapi"></script>
	<script type="text/javascript" id="settings" hostingWebsite="https" agentIp="fl-5-205.unil.cloud.switch.ch" agentPort="8443" testtool="speedtest" cookieTimeInMinutes="0.01"
		 src="speedworker-post.js"></script>
</head>
</html>
  • agentIP (required): Replace "" with the IP address (or domain name) of the WiFiMon Analysis Server.

  • Replace "WTS_FQDN" with the IP address (or domain name) of the WiFiMon Test Server.
  • testtool (required): With this attribute, you specify a name for the testtool. WiFiMon Analysis Server relies on the value of this attribute to visualize measurements. The following assumptions are made: (i) for websites visited by WiFiMon Software Probes the value of the testtool attribute should be specified as "speedtest", while (ii) for websites visited by WiFiMon Hardware Probes the testtool attribute should be specified as "speedtest-x" where x is the number assigned to a particular WiFiMon Hardware Probe.

  • cookieTimeInMinutes (optional): Duration time (in minutes) to set the cookie in order to prevent repeated measurements and overload the WiFiMon Analysis Server. If empty, "1.5" is assumed, i.e. 90 seconds.

  • If your website already included the jquery.min.js, you have to delete the first line.
  • If the above scripts will be embedded to HTTP websites, the attribute hostingWebsite should have the value "http" instead of "https". The value "https" is used for scripts that will be embedded in HTTPS websites.

  • If the WiFiMon Analysis Server is configured to use the WiFiMon Non-Secure Processor, the attribute agentPort should have the value "9000" instead of "8443". The value "8443" is used if the WiFiMon Analysis Server is configured to use the WiFiMon Secure Processor

2.3. Speedtest/HTML5

...

<Files ~ "\.(htm|html|css|dat|js|php|gif|jpg|png|swf)$">

Header always set Access-Control-Allow-Origin "*"

Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"

Header always set Access-Control-Max-Age "1000"

Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"

</Files>

  • Step 4: Scripts and Images: Get the images and scripts related to WiFiMon testtools from https://fl-5-205.unil.cloud.switch.ch/testtools/ or from the WiFiMon Bitbucket repo: https://bitbucket.software.geant.org/projects/WFMON/repos/agent/browse/testtools. Place wifimon directory inside the root directory of Apache2 and make the following change:(i) If you have not created a proxy HTML page, you may use proxy.html (included in folder wifimon/js/speedtest) as the proxy HTML page. If this is the case, you will have to replace "xxx.xxx.xxx.xxx" in the agentIP attribute, with the IP address (or domain name) of the server where the WiFiMon Analysis Server is installed. In every case, you will also have to specify the new URLs for the scripts by changing their src attribute.

3. Combining Measurements in the Same Page

In case you want to include Including all three types of testtools (NetTest, boomerang, speedtest/HTML) in the same page, inject same frequently-visited website requires injecting the following HTML lines in the "head" section of your the website:

<iframe src="https://fl-5-205.unil.cloud.switch.chWTS_FQDN/wifimon/measurements/nettest.html" style="visibility: hidden;"></iframe>
<iframe src="https://fl-5-205.unil.cloud.switch.chWTS_FQDN/wifimon/js/speedtest/speedworker.html" style="visibility: hidden;"></iframe>
<iframe src="https://fl-5-205.unil.cloud.switch.chWTS_FQDN/wifimon/measurements/boomerang.html" style="visibility: hidden;"></iframe>

...