Commit 7c580d4a authored by Pierre Louis Aublin's avatar Pierre Louis Aublin
Browse files

fixing a few warnings and improving the documentation

parent db80f5a0
Loading
Loading
Loading
Loading
+31 −6
Original line number Diff line number Diff line
@@ -50,14 +50,24 @@ following we assume a similar setup: a set of 5 machines:
  most `#cores - 3`;
- clients and experiment scripts are executed on `node4`;
- the IP address of `node<n>` is `10.10.1.<n+1>`;
- you have password-less ssh and root access on every machine. The SSH key is
  hardcoded to `~/.ssh/cloudlab_ed25519` in `config.sh`.
- you have password-less ssh on every machine. The SSH key is hardcoded to
  `~/.ssh/cloudlab_ed25519` in `config.sh`.
- you can run `sudo` commands without having to enter your password:
```bash
$ sudo visudo
# for a user
username ALL=(ALL) NOPASSWD:ALL

# for a group
%wheel ALL=(ALL) NOPASSWD:ALL
```

If the names or IPs are different you can execute the following steps:

- change `REPLICAS_IP` and `CLIENTS_IP` in `create_node_list.sh`;
- set the `HOSTS` global variable to the list of replicas machines names. E.g.,
  `export HOSTS="replica1 replica2 replica3 replica4"`
  `export HOSTS="replica1 replica2 replica3 replica4"`. Or, to run experiments
  locally: `export HOSTS="localhost localhost localhost localhost"`.

Experiment in F3 functionality requires Bash version 4 or newer. This should
not be a problem with modern Linux distributions (E.g., Ubuntu 22.04 ships Bash
@@ -71,25 +81,40 @@ First, we need to install a few dependencies and download the source code:
```bash
$ sudo apt update
$ sudo apt install curl git iptables
$ sudo apt install python3 python3-matplotlib python3-pandas # node4 only
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
$     # select standard installation (just press enter)
$ . "$HOME/.cargo/env"
$ git clone https://nohost.iijlab.net/gitlab/pierrelouis/dais25_speculor_ae.git
```

You should now be able to compile it and create (and export) the nodes
configuration files:
Please also install the following python packages on ```node4```, for the
scripts to generate nice plots from the experimental results:
```bash
$ sudo apt install python3 python-is-python3 python3-matplotlib python3-pandas
```

You should now be able to compile the code (from any machine). Note that the
different scripts in the next section compile the code as necessary. Compiling
the code at this point is only to check the setup was done correctly.
```bash
$ cd dais25_speculor_ae
$ cargo build --release
   Compiling rusty_bft v0.2.0 (dais25_speculor_ae)
    Finished `release` profile [optimized + debuginfo] target(s) in 2.54s
```

Before starting experiments, you need to create (and export) the nodes
configuration files. This has to be done from the node from which clients and
experiments are executed (`node4` by default).
```bash
$ ./create_and_export_nodes_list.sh
```

## A.3 Execution

All these scripts have to be run from the node from which clients and
experiments are executed (`node4` by default).

### F1: PBFT latency breakdown

We measure the latency breakdown of PBFT, and in particular the
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ impl KVS {
    }

    pub fn execute_request(&mut self, c: KVSCommand) -> KVSCommand {
        let default_value = vec![0 as u8; KVS_VALUE_LEN];
        let default_value = vec![0_u8; KVS_VALUE_LEN];
        match c.mode {
            KVSRequest::Get => KVSCommand {
                mode: KVSRequest::Reply,
+5 −4
Original line number Diff line number Diff line
use crate::configuration::{Node, READ_TIMEOUT_MS};
//use crate::configuration::READ_TIMEOUT_MS;
use crate::configuration::Node;
use crate::message::RawMessage;
use crate::network::*;

@@ -197,7 +198,7 @@ impl TCPNetwork {
        let s = unsafe { libc::socket(libc::AF_INET, libc::SOCK_STREAM, 0) };
        TCPNetwork::set_tcp_nodelay(s);
        TCPNetwork::set_nonblock(s);
        //TCPNetwork::set_so_reuseport(s);
        TCPNetwork::set_so_reuseport(s);

        let r = unsafe {
            libc::bind(
@@ -341,7 +342,7 @@ impl TCPNetwork {
        ))
    }

    fn recv_data(id: u32, s: i32, buf: &mut [u8]) -> usize {
    fn recv_data(_id: u32, s: i32, buf: &mut [u8]) -> usize {
        let mut len_tmp = 0;

        //println!("{} recv {} bytes from {}", id, buf.len(), s);
@@ -368,7 +369,7 @@ impl TCPNetwork {
        len_tmp
    }

    fn send_data(id: u32, s: i32, buf: &[u8]) -> usize {
    fn send_data(_id: u32, s: i32, buf: &[u8]) -> usize {
        let mut total = 0;
        let mut bytesleft = buf.len();