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)
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.
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
git submodule update –init –recursive
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.
The Content Server requires no configuration.
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.
In order to obtain get both deployment ID and secret, take the following steps:
- 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.
- At your private area, create a new deployment with a Free Tier package
- Select New Deployment on the home page
- Choose a deployment name
- Set the Android Package Name as com.codavel.bolina.demo
- Select the FREE TIER package
- Fetch the deployment id and secret from the created deployment
- Go to the home page
- Select the created deployment, or select the info icon of the created deployment
- Copy the deployment id and secret (this values are also required for the client app configuration)
- Paste the deployment id and secret into the Bolina server configuration
- Go to the sample project root file
- Open the file config_files/bolina_config.json
- 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
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.
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.
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.
To launch the Android Mobile Application, please take the following steps:
First, clone the mobile application project.
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.