Skip to content

Commit

Permalink
General tweaks, editing, organization.
Browse files Browse the repository at this point in the history
  • Loading branch information
parkeraddison committed Mar 5, 2021
1 parent 4fad73e commit 3cb40ed
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 14 deletions.
3 changes: 3 additions & 0 deletions docs/guide/approach.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,17 @@ Below we'll get a sense of how the entire tool is run when you issue a `make sta

Let's work backwards.

### Deployed services
Within each condition group we have the network layout seen above, each with a unique latency and bandwidth combination specified in your *conditions* config, and with a client container for each behavior in your *behaviors* config.

All of these groups of routers, networks, and clients are managed by the daemon -- which tells the routers to set up their target conditions and tells the clients to connect to each of their respective routers, start their behavior scripts, and start collecting data, etc.

### Config and compose
In order for the daemon to know know what conditions to request from the router and what behaviors to request from the clients, it utilizes 'labels' from a [Docker Compose](https://docs.docker.com/compose/) file.

A compose file allows us to define and start all of our containers and networks at once. Technically, the compose file is run with the command `make raw`. It specifies which networks each container should connect to, which image to use, what the container name should be, what local files the container should be able to access, etc. Key-value pairs of metadata, called 'labels' can also be specified for each container in the compose file. When the daemon sees a router with the label "com.dane.tc.latency: 50ms" it knows to ask that router for 50ms of latency. Similarly, when the daemon sees a client with the label "com.dane.behavior: streaming", it knows to tell that client to run the streaming starter script.

Since it would be annoying (and not very automated) to need to write this compose file by hand each time we want to run the tool, we leverage a minimal Docker container which parses your configuration file and writes the compose file for us. This happens with the command `make compose`.

### All together now
To wrap it all up, when we run `make start`, both the `compose` and `raw` targets are run sequentially, producing the final tool pipeline seen above.
2 changes: 1 addition & 1 deletion docs/guide/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ List of values. Possible values:
| `ping` | Ping a DNS server once every three seconds. Great for testing purposes. |
| `browsing` | Run a script to endlessly browse Twitter. |
| `streaming` | Run a script to endlessly watch YouTube. |
| `custom/<filename.py>` | Run a custom Python script. See [Using Custom Scripts](3_extending.md).
| `custom/<filename.py>` | Run a custom Python script. See [Using Custom Scripts](extending.md).

## Conditions

Expand Down
10 changes: 9 additions & 1 deletion docs/guide/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ sort: 5

# Frequently Asked Questions

- [The tool isn't working. It fails silently, or fails to launch behaviors or network-stats.](#the-tool-isnt-working-it-fails-silently-or-fails-to-launch-behaviors-or-network-stats)
- [I have a question that's not on this list](#i-have-a-question-thats-not-on-this-list)


## The tool isn't working. It fails silently, or fails to launch behaviors or network-stats.

Make sure that all submodules have been cloned. You can do this by running
```bash
git submodule update --init --recursive
```
```

## I have a question that's not on this list

Great! Feel free to [post an Issue](https://github.com/dane-tool/dane/issues/new) or [start a Discussion](https://github.com/dane-tool/dane/discussions/new) at our [GitHub repository](https://github.com/dane-tool/) and we'd be happy to assist you -- and maybe even add your question to this list.
90 changes: 79 additions & 11 deletions docs/guide/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,105 @@ sort: 1

# Tool Quickstart

To use the tool, you must configure your desired network conditions and behaviors.
Setting up DANE for a first time should be relatively straightforward, we'll get you collecting some network traffic data in no time.

Source code for the tool can be found at [network-data-generation](https://github.com/dane-tool/dane).
To use the tool: make sure you have the requirements, download the code, build the Docker images locally, then specify your configuration for desired network conditions and behaviors.

If you're interested in how the tool works, see [How It Works](approach.md). To look at the source code, see [https://github.com/dane-tool/dane](https://github.com/dane-tool/dane).

## Requirements

The data collcetion tool runs on Linux. You will need:
DANE supports Windows, Mac, and Linux as long as the current version of Docker is available.

- [Docker 19.03+](https://docs.docker.com/get-docker/)
- [Docker Compose 1.27+](https://docs.docker.com/compose/install/)
- [GNU Make](https://www.gnu.org/software/make/)

```tip
- For Mac, I recommend using Homebrew to `brew install make`
- For Windows, I recommend using [GitBash](https://git-scm.com/downloads) as your terminal and using Chocolatey to `choco install make`
```
```note
If you are using Windows you must use the Hyper-V backend for Docker. Since WSL2 lacks support for network emulation (see [WSL issue #6065](https://github.com/microsoft/WSL/issues/6065)) and Windows Home does not have access to Hyper-V, Windows Home is not supported.
```

## Getting Started

You can start using this tool and conducting analysis of different network conditions by running:
### Download the tool

First we need to download DANE:
```bash
git clone \
https://github.com/dane-tool/dane.git \
--recursive
```

## Environment file and secrets
### Build images

A handful of Docker images are built locally. This will take a few minutes if it's your very first time, so let's start the process now then move on to configuration while we wait.

Simply navigate into the directory you just cloned and run:
```bash
cd dane
make build
```

### Configuration

It's time to specify what kind of client behaviors and network conditions we want to see!

Open up the `config.json` file and set the list of behaviors to your desired client behaviors. Try "ping", "streaming", or "browsing" to use some of our built in starting behaviors. Or, write a custom script and run it by specifying "custom/filename.py".

Set the list of condition objects to have your desired number of networks and desired latency and bandwidth in each network as "_ms" and "_Mbit" values.

Specify if you want your clients to connect a VPN.

Your final config file should look similar to the following example, which ultimately produces one containers each in a "good" and "bad" network:
```json
{
"behaviors": [
"ping"
],
"conditions": [
{
"latency": "200ms",
"bandwidth": "5Mbit"
},
{
"latency": "20ms",
"bandwidth": "50Mbit"
}
],
"vpn": {
"enabled": true,
"server": "vpn.ucsd.edu"
},
...
}
```

```tip
Any configured conditions which are better than the conditions of your home network will fall back to the conditions of your home network.
DANE is pretty magical, but it won't be able to create an internal network which exceeds your own local conditions!
If you'd like to configure a network to have the same conditions as your home network, you can configure values like "0ms" and "999Mbit".
```

### Environment file (secrets)

The containers will need secret variables that store things like VPN or website login credentials.

Please create a file named `.env` and place it in this directory. Inside the file, add the login information for your VPN:
Please create a file named `.env` and place it in the 'dane' directory. You can easily create an empty file with a 'touch' command:
```bash
touch .env
```

Inside the file, add the login information for your VPN if you have `vpn.enabled: true` in your config.

```
VPN_USERNAME=<your username>
VPN_USERGROUP=<the 'group' to use for the VPN -- probably "2-Step Secured - allthruucsd">
VPN_USERGROUP=<the login group for VPN access>
VPN_PASSWORD=<your password>
```

Expand All @@ -52,10 +120,10 @@ When you're done collecting data, open a new terminal in this directory and run
make stop
```

## Example

![](../media/demo.gif)

## Data

After the tool has been stopped, data can be found in `data/`.

## Example

![](../media/demo.gif)
2 changes: 1 addition & 1 deletion docs/info/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ sort: 2

See something you'd like improved? Better yet, have some improvements coded up locally you'd like to contribute?

We welcome you to submit an Issue or make a Pull Request detailing your ideas!
We welcome you to [submit an Issue](https://github.com/dane-tool/dane/issues/new) or [make a Pull Request](https://github.com/dane-tool/dane/pulls) detailing your ideas!

0 comments on commit 3cb40ed

Please sign in to comment.