Documentation

Bolina Sample Project

Sample Project Overview



This Bolina Sample Project was created to quickly get you into Bolina SDK and easily assess its performance. It will only take you 30 minutes to set it all up and see the first Bolina’s performance results in your own environment. That said, we highly recommend you to start with this before integrating.

This Sample Project is composed by 4 main components:

  • Content Server
  • Bolina Server
  • Network Emulator
  • Mobile Applications (each distributed independently)
    • Android
    • iOS

The content server, Bolina server and network emulator are orchestrated and managed via docker-compose, with each component having its own docker container. The docker compose creates an internal network that interconnects all components, exposing only the network emulator to the outside traffic, namely the traffic from the mobile app.

To set it all up, just follow this guide.



Requirements

The Sample Project only requires docker and docker composed to be installed. It has been successfully tested on both Ubuntu and MacOS.

The Mobile Applications requirements depend on the platform. Android requires Android Studio with Android SD; while iOS requires XCode. These applications are intended to be built and launched into device emulators and physical devices.



How to download

To download the project, you just need clone the git project. After download it, you must init git’s submodule:

git clone https://git.codavel.com/C4S/bolina-sample-project

cd bolina-sample-project

git submodule update –init –recursive



Content Server



The Content Server consists on a Ookla server that behaves similarly to a regular Speedtest server from Ookla. It allows clients to download random files and to upload random data. The Mobile Application uses this service as the final endpoint, for both regular HTTP transfers and Bolina transfers.



Configuration

The Content Server requires no configuration.



Bolina Server



The Bolina Server is responsible for receiving and sending Bolina traffic to and from the Mobile Application. It is capable of communicating with content servers that use regular HTTP, thus it acts as an HTTP proxy that accelerates the data transfer by using Bolina.

In order to map clients and to validate licenses, Bolina Server requires a deployment ID. It also requires a deployment secret, used to authenticate the server and clients. Both values can be fetched from Codavel’s customer area and are unique to each deployment. Please check the Configuration area to see how you can access these values.



Configuration

In order to obtain get both deployment ID and secret, take the following steps:

  1. If you haven’t yet registered on Codavel’s customer area, please do it and validate your account. If you already have, just log in and keep going.
  2. At your private area, create a new deployment with a Free Tier package
    1. Select New Deployment on the home page
    2. Choose a deployment name
    3. Set the Android Package Name as com.codavel.bolina.demo
    4. Select the FREE TIER package
  3. Fetch the deployment id and secret from the created deployment
    1. Go to the home page
    2. Select the created deployment, or select the info icon of the created deployment
    3. Copy the deployment id and secret (this values are also required for the client app configuration)
  4. Paste the deployment id and secret into the Bolina server configuration
    1. Go to the sample project root file
    2. Open the file config_files/bolina_config.json
    3. Paste the deployment id and secret

After configuring the deployment id, the sample project docker compose must be rebuild. To do so, on the sample project root, just run:

docker-compose up –build -d



Network Emulator



The network emulator allows traffic to be affect by network conditions and policies, allowing the  assessment of Bolina’s performance for different kinds of networks using just a single device, such as a laptop. By default, no rules are applied, however, you can set latency policies, packet loss rate policies, and limit the available bandwidth. You can also find network profiles with predefined network conditions, such as 4G, 3G and Wi-Fi.

In order to apply traffic rules, the network emulator receives the traffic directed to the content server and to the bolina server (via docker compose configuration) and redirects the traffic to its intended destination, applying the same network condition rules to both traffics.



Configuration

The content server requires no configuration. However, it can be easily configured through the Bolina Mobile Application, so that traffic rules can be applied without needing to reconfigure the all docker environment. See the following Mobile App documentation for more instructions.



Mobile Application



The Mobile Application is the main tool for users to integrate with Bolina, which is currently available for Android (iOS will be available soon). It consists of an application that performs transfers (both uploads and downloads) to and from a content server and is capable of using both regular HTTP or Bolina to perform them. This allows a direct comparison of Bolina against regular HTTP.



Android

To launch the Android Mobile Application, please take the following steps:

First, clone the mobile application project.

git clone https://git.codavel.com/external/demo-app-android

Open Android Studio and and select Import an existing project.

Inside the app’s build.gradle file, edit the fields deployment ID and deployment secret with the respective values (of both deployment ID and secret), which you previously copied from the Codavel’s customer area and have also used for the Bolina server.

Now, edit the file config.json, located inside app/src/main/assets.

Edit the field servers.address with the IP address of your machine that is running the sample project (the docker compose). In this json file, you can also configure the network emulator behavior, by editing the network_conditions field in the config json.

Finally, you can launch the mobile application, into a device simulator or into a physical device, by pressing Run.