Glasnost is the name given to a testing tool developed by Max Planck Institute for Software Systems. Glasnost can detect if your Internet Service Provider (ISP) is manipulating user traffic by throttling or blocking flows belonging to specific applications like YouTube and BitTorrent. The tool enables users to easily test their broadband connections for manipulation by their ISPs. There isn’t a need to install software on user systems as Glasnost tests run from a web page in a browser. Also, common users who are not computer experts can easily run Glasnost tests by simply visiting a website. In this article, we provide an introduction to Glasnost. We also cover installation and configuration of Glasnost server that can be used by other users. This article is the first in a series of two articles on Glasnost. The next article will cover how you can test your own ISP with Glasnost and a couple of other interesting aspects of Glasnost.
What is Glasnost
Glasnost is a testing tool and its goal is to enable customers detect if their ISP is shaping or differentiating their traffic. Traffic shaping is a technique used in network engineering often to make user traffic conform to a contract between the service provider and customer. Glasnost test are designed to enable a user to check whether traffic belonging to her applications is being rate-limited or blocked.
A user can detect traffic manipulation by just pointing her web browser to a web page. The web page downloads and runs a Java applet inside the web browser on the user system. The Java applet emulates different application flows between the user system and Glasnost measurement server. The performance of different application flows between your host and Glasnost measurement servers is measured and compared. The tests can detect traffic shaping in both upstream and downstream directions and provide separate results. The tests can go a step further by detecting whether application flows are being shaped based on their port numbers of their packet’s payload.
Glasnost operates on a client/server model and a complete Glasnost system looks like the graphic below.
Figure The Glasnost System
The steps in the graphic are explained here:
Step 1: The user opens the Glasnost web page in a Java-enabled web browser.
- Step 2: The web page displays an interface allowing user to select and run a Glasnost test. The web page also contains the address of Glasnost server.
- Step 3: The web browser connects to the Glasnost server and loads a Java applet. The applet starts to emulate a sequence of flows for the test selected by user in Step 2.
- Step 4: After the test is completed, collected data is analyzed and results are displayed in a web page.
Glasnost performs each test individually and detects traffic differentiation by the ISP at the time of the test. An ISP may have sophisticated traffic differentiation policies, throttling or blocking traffic according to specific applications, user tiers, days of the week, or time. A Glasnost test would detect if a specific user is a victim of traffic differentiation at a specific point in time without any extrapolation.
Installing and Configuring Glasnost
Glasnost was developed to run on the Linux operating system. It is not available as a package of precompiled software, so you cannot use a package manager like APT to download and install it. It comes as source code that you must compile before you can run a Glasnost server. In this article, we’ve attempted to provide easy to follow instructions to setup a Glasnost server.
We built a test environment for this article consisting of a system running Ubuntu 12.04.4 LTS, a popular distribution of Linux. The Ubuntu system is used to run both web and Glasnost servers in the test environment. In a real world deployment, the web and Glasnost servers would more likely run on different machines. If you already have a web server deployment, you may setup Glasnost on a separate server and allow users to run Glasnost tests through a web page from your primary website.
Figure Glasnost Test Environment
The source code of Glasnost is available for download as a tar archive at http://broadband.mpi-sws.org/transparency/glasnost-latest.tgz. In the Unix/Linux world, tar (contraction of tape archive) refers to a file format initially developed to write data to backup tapes. Today, tar is mostly used to collect many files into a single large file for distribution. A tar archive preserves information such as directory structure, dates, and even user and group permissions.
We assume that basic IP configuration in place on the Ubuntu system and it can reach the Internet. We will be logged in as root for all that follows. The logical starting point is to download Glasnost source code using the command wget.
root@ubuntu:~# wget http://broadband.mpi-sws.org/transparency/glasnost-latest.tgz --2014-02-10 06:53:32-- http://broadband.mpi-sws.org/transparency/glasnost-latest.tgz Resolving broadband.mpi-sws.org (broadband.mpi-sws.org)... 18.104.22.168 Connecting to broadband.mpi-sws.org (broadband.mpi-sws.org)|22.214.171.124|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 254960 (249K) [application/x-gzip] Saving to: `glasnost-latest.tgz' 100%[================================================================>] 254,960 197K/s in 1.3s 2014-02-10 06:53:36 (197 KB/s) - `glasnost-latest.tgz' saved [254960/254960]
The tar archive glasnost-latest.tgz we just downloaded is placed into the current directory, by default.
root@ubuntu:~# pwd /root root@ubuntu:~# ls glasnost-latest.tgz
The source code needs to be compiled before we can run a Glasnost server. But there are quite a few packages (precompiled software) that are needed to compile and run Glasnost. These packages are mentioned below and can all be downloaded using Advanced Packaging Tool (APT).
First, we run apt-get update to download updated information about package lists from repositories, containing newest version numbers and dependencies.
root@ubuntu:~# apt-get update Reading package lists... Done root@ubuntu:~# apt-get install libpcap-dev Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libpcap0.8-dev The following NEW packages will be installed: libpcap-dev libpcap0.8-dev 0 upgraded, 2 newly installed, 0 to remove and 9 not upgraded. Need to get 219 kB of archives. Setting up libpcap-dev (1.1.1-10) ...
The package libcurl4-gnutls-dev provides the development files needed to build Glasnost that makes use of curl, a tool for transferring data with URL syntax.
root@ubuntu:~# apt-get install libcurl4-gnutls-dev Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: comerr-dev krb5-multidev libgcrypt11-dev libgnutls-dev libgnutls-openssl27 libgnutlsxx27 libgpg-error-dev libgssrpc4 libidn11-dev libkadm5clnt-mit8 libkadm5srv-mit8 libkdb5-6 libkrb5-dev libldap2-dev libp11-kit-dev librtmp-dev libtasn1-3-dev zlib1g-dev Suggested packages: krb5-doc libcurl3-dbg libgcrypt11-doc gnutls-doc gnutls-bin krb5-user The following NEW packages will be installed: comerr-dev krb5-multidev libcurl4-gnutls-dev libgcrypt11-dev libgnutls-dev libgnutls-openssl27 libgnutlsxx27 libgpg-error-dev libgssrpc4 libidn11-dev libkadm5clnt-mit8 libkadm5srv-mit8 libkdb5-6 libkrb5-dev libldap2-dev libp11-kit-dev librtmp-dev libtasn1-3-dev zlib1g-dev 0 upgraded, 19 newly installed, 0 to remove and 9 not upgraded. Need to get 4,139 kB of archives. Setting up libcurl4-gnutls-dev (7.22.0-3ubuntu4.7) ... Processing triggers for libc-bin ... ldconfig deferred processing now taking place
The package libmicrohttpd-dev provides the development files for libmicrohttpd that is a small C library for incorporating HTTP server functionality into Glasnost.
root@ubuntu:~# apt-get install libmicrohttpd-dev Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libmicrohttpd5 The following NEW packages will be installed: libmicrohttpd-dev libmicrohttpd5 0 upgraded, 2 newly installed, 0 to remove and 9 not upgraded. Need to get 108 kB of archives. After this operation, 299 kB of additional disk space will be used. <> Setting up libmicrohttpd-dev (0.4.6-1) ... Processing triggers for libc-bin ... ldconfig deferred processing now taking place
The package build-essential contains a list of other packages which are essential for building other packages from source code. This package makes it easy to install all packages needed to build Glasnost.
root@ubuntu:~# apt-get install build-essential Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: dpkg-dev fakeroot g++ g++-4.6 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libdpkg-perl libstdc++6-4.6-dev libtimedate-perl Suggested packages: debian-keyring g++-multilib g++-4.6-multilib gcc-4.6-doc libstdc++6-4.6-dbg libstdc++6-4.6-doc The following NEW packages will be installed: build-essential dpkg-dev fakeroot g++ g++-4.6 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libdpkg-perl libstdc++6-4.6-dev libtimedate-perl 0 upgraded, 11 newly installed, 0 to remove and 9 not upgraded. Need to get 12.9 kB/9,250 kB of archives. <> Setting up build-essential (11.5ubuntu2.1) ..
We will also install the Apache web server to render web pages to launch and run Glasnost as well as to display results.
root@ubuntu:~# apt-get install apache2 Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap Suggested packages: apache2-doc apache2-suexec apache2-suexec-custom The following NEW packages will be installed: apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap 0 upgraded, 9 newly installed, 0 to remove and 9 not upgraded. Need to get 1,833 kB of archives. After this operation, 5,222 kB of additional disk space will be used. <> Setting up apache2 (2.2.22-1ubuntu1.4) ... Processing triggers for libc-bin ... ldconfig deferred processing now taking place
Glasnost makes heavy use of PHP and the php package is needed to successfully render Glasnost tests to users.
root@ubuntu:~# apt-get install php5 Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libapache2-mod-php5 php5-cli php5-common Suggested packages: php-pear php5-suhosin The following NEW packages will be installed: libapache2-mod-php5 php5 php5-cli php5-common 0 upgraded, 4 newly installed, 0 to remove and 9 not upgraded. Need to get 0 B/6,359 kB of archives. After this operation, 17.3 MB of additional disk space will be used. <> Setting up php5 (5.3.10-1ubuntu3.9) ... Setting up php5-cli (5.3.10-1ubuntu3.9) ... update-alternatives: using /usr/bin/php5 to provide /usr/bin/php (php) in auto mode.
We are now going to extract the files in glasnost-latest.tgz to the root directory of Apache, that is, /var/www.
root@ubuntu:~# tar zxvf glasnost-latest.tgz -C /var/www glasnost/ glasnost/protocols.spec glasnost/Makefile glasnost/tools.h glasnost/script_validator.cc glasnost/tools.cc glasnost/http_server.cc glasnost/COPYING glasnost/README glasnost/glasnost_replayer.h glasnost/glasnost_parser.h glasnost/glasnost-analysis2.php glasnost/glasnost.php glasnost/glasnost_parser.cc glasnost/mpi.css glasnost/GlasnostReplayer.jar glasnost/glasnost_replayer.cc glasnost/GlasnostReplayerMac.jar glasnost/gserver.cc glasnost/glb.php glasnost/GlasnostReplayer.java root@ubuntu:~# ls /var/www glasnost index.html
There are a couple of modifications you need to make to the files extracted from glasnost-latest.tgz, before you can successfully build Glasnost. First, you need to open the file gserver.cc in an editor and add #include <sys/stat.h> to existing #include statements at the beginning of the file. Second, you need to replace the file /var/www/glasnost/Makefile with the Makefile attached with this article. The Makefile provided with the source code would never compile the way it is.
You may now go to the directory /var/www/glasnost and run the make utility to build Glasnost using the modified Makefile.
root@ubuntu:~# cd /var/www/glasnost root@ubuntu:/var/www/glasnost# make ==> gserver.cc g++ -g -Wall -L/usr/lib/i386-linux-gnu gserver.cc -c -o gserver.o ==> glasnost_replayer.cc g++ -g -Wall -L/usr/lib/i386-linux-gnu glasnost_replayer.cc -c -o glasnost_replayer.o glasnost_replayer.cc: In member function â€˜bool GlasnostReplayer::getline(char**, size_t*, FILE*, int*)â€™: glasnost_replayer.cc:1232:16: warning: value computed is not used [-Wunused-value] ==> http_server.cc g++ -g -Wall -L/usr/lib/i386-linux-gnu http_server.cc -c -o http_server.o ==> tools.cc g++ -g -Wall -L/usr/lib/i386-linux-gnu tools.cc -c -o tools.o ==> glasnost_parser.cc g++ -g -Wall -L/usr/lib/i386-linux-gnu glasnost_parser.cc -c -o glasnost_parser.o g++ gserver.o glasnost_replayer.o http_server.o tools.o glasnost_parser.o -o gserver -g -Wall -L/usr/lib/i386-linux-gnu -L/usr/lib/i386-linux-gnu -lpcap -lcurl -lz –lmicrohttpd
We also need to edit the file glasnost.php and change the values of variables $store_directory, $startpage, and $mlab_server per below.
# Where to store logs, use an absolute path if possible! $store_directory = "logs"; # The startpage of the Glasnost test. We redirect users there. $startpage = "glb.php"; # This array holds the names of all measurement servers (where gserver runs on) $mlab_server = array ( '192.168.1.2',
Finally, we need to edit the file glb.php and set the variable $server per below.
$server = array ( 'http://192.168.1.2', );
We need to create the directory /var/www/glasnost/logs.
root@ubuntu:/var/www/glasnost# mkdir logs
Finally we are ready to launch the Glasnost server.
root@ubuntu:/var/www/glasnost# ./gserver -i eth0 -s protocols.spec Starting gserver (Version: 10.05.2010) Configuration: -p 19970 -i eth0 -d . -scriptdir . HTTP test fetcher daemon running.
This brings the article to its end that is first in a series of two articles on Glasnost. In the next article, we will cover how to use the Glasnost server just installed to run tests from client systems. We will also explore a couple of other interesting aspects of Glasnost.