RINA Rumba and win $1k

Want to play with RINA implementations and win $1k in September 2017?

Then sign up and join the TADHack event, on the weekends 23 – 24 September and 30 September – 1 October.

Scope of the ARCFIRE Challenge

The scope of the challenge is to show a working hack using one of the global sponsors’ technologies over a RINA network. All TADHacks must be built utilizing one or more of the SDK’s and API’s of the global sponsors, the winner(s) of the Arcfire RINA Rumba prize should be able to show that hack running over a RINA network.

Context of the Challenge

For TADHack you should see RINA as an innovative way to provide networking services, going beyond the Internet’s flaws and giving the application developer an easy way to build a distributed application. We want the focus to be on the seamless way to write and deploy a distributed application with inherent mobility, QoS awareness, security and isolation.

Minimum Deliverable of the Challenge

The minimum deliverable is that a TADHack application (Matrix) works over a RINA network. At least it has to work in one system (one “server” and two “clients”), but we encourage deployments over multiple systems (more details are provided in the following sections).
So for example if your hack team decide to create something using the global sponsor Matrix resources, then in addition to win the RINA Rumba prize your hack must demonstrate that the application works using the RINA API to communicate over a network. For a hint on this, Matrix is Python based, and uses an event-driven networking engine written in Python called Twisted. Your challenge would be to extend the Twisted framework with a RINA API Twisted module .

Support

The TADHack event is being supported remotely by the ARCFIRE team and they will be contactable over both weekends 23 – 24 September and 30 September – 1 October. The preferred mode of contact with the ARCFIRE RINA Stack team will be over TADHack Slack Chanel, however we are also available on the ARCFIRE Slack channel on https://arcfire.slack.com just click on the badge below to get an invite   

slack 0 / 10

We are also available on Freenode IRC channel #irati. Click the link to join the channel

Assessment criteria and process

There will be a panel of 5 experts from the ARCFIRE project that will assess that the hack sub- mission is based on:

  • Correct use of the RINA API to access network IPC services (minimum).
    • For example between 1 Matrix/Synapse server and two clients.
  • Carrying out different deployments
    • Single deployment with 3 nodes, single DIF.
      • For example: 1 Matrix/Synapse server in one node, 1 client at every node (3 clients total).
    • Single deployment with 7 nodes, single DIF.
      • For example 2 federated Matryx/Synapse servers (at different nodes), 1 client at every node (7 clients total). All clients must be able to join the same chatroom.
    • More complex deployments with multiple DIFs can also be attempted, contact the organisers via the support channels if you are interested.
  • Supporting application Mobility
    • It should be automatic but the developer should be able to demonstrate it working for their hack.
  • Ability to request QoS parameters.

The panel will verify that each hack submission is conforming to the minimum criteria first (using the RINA stack for networking) and from there the more the hack supports, the more votes from the panel it will get and closer you or your team will be to winning the prize.

Prize Amount: $1k

The prize money will be given as cash.

Resources

For a quick introduction to RINA have a look at some recent presentations, or for detailed information please visit:  http://pouzinsociety.org.

The RINA API documentation is available here https://github.com/vmaffione/rlite/tree/next#9-rina-api-documentation.

Here is an example simple Python application that uses the RINA API: https://github.com/vmaffione/rlite/blob/master/user/tools/rina-toy (can be used as a template).

Some example applications written in C are available here https://github.com/IRATI/stack/tree/master/rina-tools/src/rlite.

RINA implementations

There are a number of open source RINA implementations that provide the same RINA API to applications available.

For this Hackathon we suggest participants to use the rlite implementation, detailed instructions on how to setup the RINA environments required for the hackathon are provided in the “Hacker workflow” section below.

However, if teams prefer to use the IRATI implementation the IRATI page at github should provide enough details to setup an equivalent scenario (support is also available via the Slack channel).

RINA Integration with TADHack Sponsor Technology

In order to assist TADHackers to use the RINA stack we offer some understanding on our side of how the global partner technologies of Matrix would integrate with the RINA stack. Investigation with Temasys, Telestax or Apifonica is still ongoing.

Matrix

Matrix is an open source distributed persistent messaging fabric with eventual consistency, open federation and strong cryptographic guarantees – used for securely exchanging messages and synchronising communication history between humans, devices and services with no single points of control or data ownership. It consists of an open standard defining RESTful HTTP APIs and open source, Apache-licensed reference server and client implementations for exchanging and persisting arbitrary JSON data. It can be used to exchange group chat, voice or video calls, IoT data, or any information you could wish to publish/subscribe via an internet-wide open persistent messaging network. Many clients and services have been written based on the Matrix open standard – including Riot, a feature-rich open source client.
The TADHack resource page of Matrix is here => https://tadhack.com/2017/matrix-resources/.
Matrix/Synapse is Python based, and uses an event-driven networking engine written in Python called Twisted. The challenge would be to extend the Twisted framework with a RINA Twisted module.

It could be the case that all the developer needs to create is an equivalent of this class. https://github.com/twisted/twisted/blob/trunk/src/twisted/internet/tcp.py. While that class is a good starting point, it might be enough to implement only the interface ITransport in this file https://github.com/twisted/twisted/blob/trunk/src/twisted/internet/interfaces.py which is a subset of the interface ITCPTransport implemented by the Connection class in the file you linked. On top of that the Connection class uses socket calls, so it looks like the ideal example/starting point for developing a RINA twisted module.
It will also be necessary to modify a Matrix client to add support for the RINA API (e.g. Weechat with a Matrix client support https://matrix.org/docs/projects/client/weechat.html). The Weechat source file that needs to be modified to support the RINA API is https://github.com/weechat/weechat/blob/master/src/core/wee-network.c .

 

Hacker Workflow

This section contains detailed instructions on how to setup the development and testing workflow, using rlite, one of the available open source RINA implementations. Complete documentation for the RINA implementation used here is available online at https://github.com/vmaffione/rlite/tree/next#documentation.

Development, testing and single system scenario (minimum deliverable)

Of note this process will work both on a physical or a virtual machine(s).

Build and install the rlite RINA implementation on the development machine

Run the following commands on an Ubuntu machine (e.g. Ubuntu 16.04):

$ sudo apt-get install gcc g++ libprotobuf-dev protobuf-compiler cmake linux-headers-$(uname -r) python swig
$ git clone -b next https://github.com/vmaffione/rlite
$ cd rlite
$ ./configure
$ make
$ sudo make install
$ sudo depmod -a

 

Configure and run the rlite RINA implementation on the development machine

Run the following commands to load the software on a development machine and create a normal IPCP for local testing and the single system scenario. This will create a single DIF named “n.DIF”, where applications can register and allocate flows to each other.
$ sudo modprobe rlite-normal
$ sudo rlite-uipcps # To be run in a separate terminal or in background
$ sudo rlite-ctl ipcp-create n.IPCP normal n.DIF
$ rlite-ctl ipcps-show # list all the local IPCPs

 

Multiple machine deployment scenarios: option A, using the demonstrator

With this option only a single Linux physical machine with QEMU-KVM support is required, using the demonstrator tool. The demonstrator (https://github.com/IRATI/demonstrator) is a command-line tool which allows the user to easily try and test the IRATI stack in a multi-node scenario. Each node is emulated using a light Virtual Machine (VM), run under the control of the QEMU hypervisor. All the VMs are run locally without any risk for your PC, so you don’t need a dedicated machine or multiple physical machines. All the user has to do is to prepare a configuration file which describes the scenario to be demonstrated. This requires the user to specify all the Layer 2 connections between the nodes and all the DIFs which lay over this L2 topology. A DIF can be stacked over other DIFs, and arbitrary levels of recursion is virtually supported by the tool. The demonstrator configuration files for the 3 node and 6 node scenarios are provided in the following subsections.

Build VM images to be used with the RINA demonstrator using buildroot

See complete documentation at https://github.com/vmaffione/rlite/tree/next#8-development-workflow. Buildroot is a simple, efficient and easy-to-use tool to generate embedded Linux systems through cross-compilation. The demonstrator runs the images generated by buildroot.
$ git clone -b next https://github.com/vmaffione/buildroot
$ cd buildroot

The current buildroot configuration does not contain packages to build Matrix/Synapse, Weechat or its dependencies, therefore hackers would have to create these packages in order to be able to run their modified versions of Synapse and Weechat on the Demonstrator virtual machines. Once these packages have been created, you can trigger the build process the following way.

# Update the last line as suggested by the comments

$ vi update.sh

# Build the image and copy it to the `demo/` folder inside the RINA stack source code.

$ ./update.sh

To add scripts and configuration files to the generated images, it is sufficient to copy the script in the `overlay` directory inside the buildroot repository, and run ./update.sh.

$ cd buildroot
$ cp -r $SOMETHING overlay/
$ ./update.sh

 

Use the demonstrator to setup VM-based RINA networks

The demonstrator documentation is available at https://github.com/vmaffione/rlite/tree/next#51-using-the-demonstrator. Some examples are available in the `demo/examples/` directory in the RINA stack repo.
The following commands are used to prepare a 3-nodes RINA network with a single normal DIF (Can be used for the 3-node deployment).
$ cd rlite/demo
$ ./demo.py -c examples/star.conf # Generate up.sh and down.sh
$ ./up.sh # Bring the network up
$ ./access.sh a # open a shell inside the node called “a”
$ ./down.sh # Bring the network down

To generate scripts to setup/tear down the 7-node deployment, just use the examples/seven.conf configuration file, following the same workflow as before.
Remember that the demonstrator must be run inside a physical machine (no VMs).

 

Multiple machine deployment scenarios: option B, using multiple physical (or virtual) machines

This option has the advantage that no buildroot packages need to be prepared, but the setup, test and verification steps involve multiple machines and more manual steps. rlite and the hacked applications have to be installed in all the machines. In addition to this, each machine needs a proper configuration file for rlite, and a number of rlite control commands have to be entered in order to allows RINA systems to discover each other (all these steps are automated using the demonstrator tool).
In order to avoid requiring too many physical systems, hackers can run both the single server and multiserver scenarios with 3 systems. The same configuration can be achieved with 3 physical machines connected via an Ethernet switch, or with 3 Virtual Box (or XEN) VMs connected to the same internal network.

Single server scenario: as described (1 node hosts a Matrix/Synapse server, all nodes a single Weechat client).
Federated server scenario: 2 nodes host a Matrix/Synapse server (federated), all nodes host 2 clients (each one connected to a different server instance). All clients must be able to join the same chat room.

Hackers are also allowed to try more complex deployments involving more physical machines (providing they have managed to get the 3-systems deployment up and running).

3-systems

The physical layout and IPC Processes at the n1.DIF for the 3 systems configuration is shown in the Figures above. We assume that the name of the interfaces connected to the Ethernet switch is ‘eth0’ (you can replace them by their real name otherwise).

Configuration at System A

Create a file /etc/rina/initscript with the following contents:

#### Contents of /etc/rina/initscript

ipcp-create 300.1.IPCP shim-eth 300.DIF

ipcp-config 300.1.IPCP netdev eth0

ipcp-create n1.1.IPCP normal n1.DIF

ipcp-register n1.1.IPCP 300.DIF

ipcp-enroller-enable n1.1.IPCP

###################################

 Run the following commands:

$ sudo ip link set eth0 up

$ sudo modprobe rlite-normal

$ sudo modprobe rlite-shim-eth

$ sudo rlite-uipcps # To be run in a separate terminal or in background

$ sudo rlite-node-config # wait for it to terminate

Configuration at System B

Create a file /etc/rina/initscript with the following contents:

#### Contents of /etc/rina/initscript

ipcp-create 300.2.IPCP shim-eth 300.DIF

ipcp-config 300.2.IPCP netdev eth0

ipcp-create n1.2.IPCP normal n1.DIF

ipcp-register n1.2.IPCP 300.DIF

ipcp-enroll n1.2.IPCP n1.DIF 300.DIF n1.1.IPCP

###################################

Run the following commands:

$ sudo ip link set eth0 up

$ sudo modprobe rlite-normal

$ sudo modprobe rlite-shim-eth

$ sudo rlite-uipcps # To be run in a separate terminal or in background

$ sudo rlite-node-config # wait for it to terminate

Configuration at System C

Create a file /etc/rina/initscript with the following contents:

#### Contents of /etc/rina/initscript

ipcp-create 300.3.IPCP shim-eth 300.DIF

ipcp-config 300.3.IPCP netdev eth0

ipcp-create n1.3.IPCP normal n1.DIF

ipcp-register n1.3.IPCP 300.DIF

ipcp-enroll n1.3.IPCP n1.DIF 300.DIF n1.1.IPCP

###################################

Run the following commands:

$sudo ip link set eth0 up

$ sudo modprobe rlite-normal

$ sudo modprobe rlite-shim-eth

$ sudo rlite-uipcps # To be run in a separate terminal or in background

$ sudo rlite-node-config # wait for it to terminate

 

Happy Hacking !!!

Leave a comment

Your email address will not be published. Required fields are marked *