Bus Monitoring

Benchmarking Number of Connections

Using Docker

Necessary resources:

  • Docker

  • jstatd.all.policy file

  • BenchmarkNConnectons.jar program from InterSCity-onibus

For this example, we are considering that all extra files are stored at the host machine in /home/meslin/Desktop/MUSANet/.

Create the jstatd.all.policy file in /home/meslin/Desktop/MUSANet/ with the following content:

grant codebase "file:${java.home}/../lib/tools.jar" {

permission java.security.AllPermission;

};

Open a terminal and run a MUSANet image to instantiate a ContextNet slice with one Gateway. The -p and --privileged options are optional.

$ sudo docker run -it -v /home/meslin/Desktop/MUSANet/:/MUSANet -p 5500:5500/udp --privileged meslin/musanet

Visit our website at https://musanet.meslin.com.br/

This slice IP address: 172.17.0.2

Working Directory = /

Gateway started...

Gateway MR-UDP IP: 172.17.0.2:5500

Open another terminal and ssh to the slice. Please, note its IP address underlined above. Use musanet:musanet as credentials to login and switch to root using musanet as password. Goto root home directory and copy the jstatd.all.policy from host to the slice. Enable external monitoring using jstatd as shown below:

$ ssh musanet@172.17.0.2

musanet@172.17.0.2's password:

Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 5.8.0-41-generic x86_64)


* Documentation: https://help.ubuntu.com

* Management: https://landscape.canonical.com

* Support: https://ubuntu.com/advantage


This system has been minimized by removing packages and content that are

not required on a system that users do not log into.


To restore this content, you can run the 'unminimize' command.


The programs included with the Ubuntu system are free software;

the exact distribution terms for each program are described in the

individual files in /usr/share/doc/*/copyright.


Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by

applicable law.


musanet@c75990bd2126:~$ su -

Password: musanet

root@c75990bd2126:~# cd

root@c75990bd2126:~# cp /MUSANet/jstatd.all.policy .

root@c75990bd2126:~# jstatd -J-Djava.security.policy=jstatd.all.policy -J-Djava.rmi.server.hostname=172.17.0.2

Open n terminals. The following instruction must be applied to all terminals. Run a generic Ubuntu Docker image in all of them:

$ sudo docker run -it -v /home/meslin/Desktop/MUSANet/:/MUSANet ubuntu

Update, upgrade and install Java JDK 8 (ContextNet is compatible only with version 8).

root@6c98d9708326:/# apt update

root@6c98d9708326:/# apt install -y openjdk-8-jdk

Run the benchmark:

root@6c98d9708326:/# java -jar /MUSANet/BenchmarkNConnections.jar -a 172.17.0.2 -p 5500

To monitor the MUSANet, run jvisualvm:

$ jvisualvm

Right click Remote in jvisualvm Application tab and click Add Remote Host..., then, in Add Remote Host dialog, use the slice IP address as Host name: and add a custom Display name: (you must select the checkbox at left). The contextnet-2.7.jar application should appear under the selected display name. Right click the contextnet-2.7.jar and click Open.