From e300606b19ceb8cfb3bbc1cf40c8356fe5c18daf Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Fri, 15 Mar 2019 17:16:27 +0100 Subject: [PATCH] Improve README --- README.md | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) diff --git a/README.md b/README.md index b8cde14..2e8bb2e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,129 @@ # Donar +## Quickstart + +### Installation + +The following steps are provided for [Fedora 29 Workstation](https://getfedora.org/fr/workstation/download/). +We assume you have two containers or two virtual machines or two physical machines. + +To setup each machine, you should do: + +``` +sudo dnf install --refresh -y cmake gcc gcc-c++ ninja-build glib2-devel glib2 tor valgrind git net-tools nmap-ncat +git clone https://gitlab.inria.fr/qdufour/donar.git +cd donar +mkdir out && cd out && cmake -GNinja .. && ninja && sudo ninja install +``` + +### Commands + +Now your machine is ready and you will be able to use the following commads: + + * `donar` is our main binary. It can be run as a client or a server. + * `udpecho` is a simple udp server that send back the data sent to him. + * `torecho` is a simple tcp server that send back the data sent to him + configure the tor daemon to generate a hidden service URL and be accessible on the Tor network. + * `measlat` can be used in conjunction with `udpecho` or `torecho` to measure a Rount Time Trip (RTT) + +Try to run the previous commands in your terminal without any option, you will see their help. + +At any moment, you can use the following commands that are not part of the project to understand what you are doing: + +```bash +netstat -ulpn # Show programs that listen on an UDP port +netstat -tlpn # Show prograns that listen on a TCP port +nc 127.0.0.1 8000 # Connect via TCP on server 127.0.0.1 listening on port 8000 +nc -u 127.0.0.1 8000 # Connect via UDP on server 127.0.0.1 listening on port 8000 +``` + +### Introduction to the debug tools `udpecho` and `measlat` + +Now let's start simple, we will launch our udp echo server and access it locally: + +```bash +udpecho -p 8000 & +nc 127.0.0.1 8000 +``` + +If you write some data on your terminal and press enter, you will see that your data has been repeated. Well done! + +Now, instead of using `nc`, we will use `measlat` to use this echo server to measure latencies: + +```bash +udpecho -p 8001 & +measlat -h 127.0.0.1 -p 8001 -t udp +``` + +`measlat` will send one packet to our udpecho server and wait to receive it back, measure the time it took, display it and exit. + +You can use `measlat` more extensively by defining the number of measures to do, an interval and the size of the packet: + +```bash +measlat -h 127.0.0.1 -p 8001 -t udp -c 10 -i 100 -s 150 +``` + +### Introduction to `donar` + +Now, let's introduce our main project. +First, kill all the remaining processes `killall udpecho measlat nc`. + +*On both machine* +Move to the donar repository root where you will see the `torrc_simple` file. +We will need to start by launching tor in a terminal: + +```bash +tor -f ./torrc_simple +``` + +*On machine A* +Launch Donar server in a second terminal: + +```bash +donar -s -a naive -e 3000 -r 3001 +``` + +In a third terminal, launch your echo service: + +```bash +udpecho -p 3000 +``` + +Display the content of the file `onion_services.pub` that has been created in your working directory. + +*On machine B* +Copy the content of the file `onion_services.pub` that is on *machine A* to *machine B* in a file named `machine_a.pub`. +Now, run Donar client in a second terminal: + +```bash +donar -c -a naive -o machine_a.pub -r 3000 -e 3001 +``` + +In a third terminal, launch your echo service: + +```bash +udpecho -p 3001 +``` + +*On machine A* +You can access to the echo service from *machine B* by running: + +```bash +nc 127.13.3.7 3001 +# or +measlat -h 127.13.3.7 -p 3001 -t udp +``` + +*On machine B* +You can access to the echo service from *machine A* by running: + +```bash +nc 127.13.3.7 3000 +# or +measlat -h 127.13.3.7 -p 3000 -t udp +``` + +If it works, that's all! You are now mastering Donar! + ## Linphone configuration Choose a SIP UDP, Audio RTP/UDP and Video RTP/UDP that is different between your clients.