aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: bee8dbf46f5f38f14ad61844f11f3a86f20e9b61 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# mknet

mknet is a tool to simulate various network topologies
locally thanks to network namespaces and traffic control (tc).

## Prepare your environment

Get the repository and its submodules:

```bash
git clone https://git.deuxfleurs.fr/Deuxfleurs/mknet.git
cd mknet
git submodule update --init
```

Compile benchmark tools:

```bash
( cd benchmarks/warp && go build )
( cd benchmarks/s3concurrent && go build )
( cd benchmarks/s3lat && go build )
```

Switch to root as it is required by our tool,
and setup your python environment.

```bash
sudo -i
pip3 install --user .
( cd scenarios && pip3 install --user -r requirements.txt )
```

Sometimes, it is required to add manually your local python lib folder to the environment:

```bash
export PYTHONPATH=$PYTHONPATH:$HOME/.local/lib/python3.10/site-packages/
```

You can check that everything has been installed by running in a python REPL:

```
import garage_admin_sdk
```

## Topologies

All topologies:
  - `./topo/with-vdsl.yml` - A topology mixing datacenters with fast internal connectivity and an isolated VDSL node
  - `./topo/50ms.yml` - An artifical topology simulating nodes with high bandwidth but with a fixed 50ms latency, useful to quantify the impact of latency on a distributed software
  - `./topo/multi-dc.yml` - Simulate 3 DC interconnected with 50ms latency WAN network and close to zero latency inside the DC
  - `./topo/slow.yml` - Simulate 3 nodes interconnected with a low latency, very low bandwidth link. Useful to debug bandwidth bottlenecks

Feel free to write new topologies!

## Scenarios

All scenarios:
 - `./scenarios/garage-s3lat [garage-v0.7|garage-v0.8]` - Run s3lat on Garage
 - `./scenarios/garage-warp [garage-v0.7|garage-v0.8] [default|fast]` - Run warp on Garage. 2 flavors are available: fast and default.

*Scenarios take optional flavors as input that modulate their behavioir. Passing them is not mandatory,
a default one will be selected for you.*

How to run them:

```bash
./mknet scenario <topology> <scenario>
./mknet scenario ./topo/50ms.yml ./scenarios/garage-s3lat
```

How to write good scenarios:
  - If a scenario can be run with multiple different parameters, write one scenario with multiple flavors
  - If the logic ran is different, write a new scenario
  - A scenario code must remain short and looks like a DSL, abstract the logic in the `fragments/` module

## Manual usage

```bash
./mknet create ./topo/with-vdsl.yml
./mknet run-all ./scenarios/garage-manual
./mknet run dc1:dc1s1 /tmp/mknet-bin/garage* -c /tmp/mknet-store/garage/dc1/dc1s1/garage.toml status
./mknet run-all ./scenarios/clean
./mknet destroy