summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-12-26 22:18:41 -0500
committerJoe Crayne <joe@jerkface.net>2020-01-01 23:28:00 -0500
commit9f33d972b60959d69318e5f243ffae4252d6d3f5 (patch)
tree6e02c4257763b983a9a72bb297e28635f84ea3d8
parentd187c97aa8fd1c5385a99a8b061793d7a000fadb (diff)
Notes on virtual network testing environment.
-rw-r--r--dht/vnet/README.vnet.md73
1 files changed, 73 insertions, 0 deletions
diff --git a/dht/vnet/README.vnet.md b/dht/vnet/README.vnet.md
new file mode 100644
index 00000000..caa84057
--- /dev/null
+++ b/dht/vnet/README.vnet.md
@@ -0,0 +1,73 @@
1What We Have
2============
3
4./build.sh
5----------
6
7First, as root, run the ./build.sh script. This will use the _tuntap_ subcommand
8of _ip_ in order to create a variety of virtual interfaces. It then will assign to
9each of these a unique address of the form:
10
11 inum.vnum.99.99
12
13where _inum_ is between 80 and 95 and _vnum_ is either 88 or, if your wlan0
14interface is on an IPv4 lan, the very last component of your wlan0 IP address.
15For example, if wlan0 has address 192.168.5.33, then _vnum_ will be 33. This
16allows multiple test environments to coexist on a lan and, provided routing
17tables allow it, be routable from each other.
18
19Note that the ip addresses of the testing environment are chosen from the pool
20that RFCs assign to actual global internet addresses rather from one of the
21reserved local lan domains. This is because the software algorithms may want
22to recognize lan domains and treat them specially, so we want to simulate the
23appearance of actual internet peers.
24
25
26./run.sh
27--------
28
29Next, make a symlink (named "dhtd") in the _vnet_ folder to the dhtd binary.
30And run the ./run.sh script. You do not need root. This will create a
31detached _screen_ session where each window is running a different instance of
32the dhtd daemon with a different working directory. Each instance will bind to
33a different inum.vnum.99.99 ip address created by the ./build.sh script.
34
35./everywhere.sh
36---------------
37
38To run the same command in every one of the running test instances, you may use
39the ./everywhere.sh script. It's command line arguments are expected to be a
40shell command that will be run repeatedly from within the working directory of
41each of the running dhtd daemons. Since this is a shell command and not a dht
42command, you may need to specify the path to the dht client binary as the first
43argument.
44
45./clean.sh
46----------
47
48After issuing "stop" to all the dhtd instances, you may want to clean up and
49remove all the working directories and network interfaces. To accomplish this,
50as root, run the ./clean.sh script.
51
52Note: You probably do not want to run build.sh and clean.sh repeatedly if you
53are testing changes to the dhtd program as you can simply, without root, use
54./run.sh to re-launch a modified version of the daemon.
55
56
57What We Want
58============
59
60We want to test TCP-only connectivity. This means some combination of iptables
61and possibly the cgroups commands to create more controlled virtual network
62environments. The following man pages are relevant:
63
64 man 4 veth
65 man 2 clone
66 man 8 iptables
67 man 7 cgroups
68
69We need to bootstrap an instance of dhtd off of our test network and also an
70instance of uTox (or some other toxcore-based client) and get them to build a
71TCP-mediated link. This would, of course, disabling UDP in one or both of the
72clients either by a hardcoded temporary source code patch or through iptables
73rules.