Skip to content

Commit

Permalink
Update README and configs
Browse files Browse the repository at this point in the history
  • Loading branch information
jimouris committed Mar 9, 2023
1 parent 0aeea65 commit 78a5939
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 80 deletions.
53 changes: 33 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# PLASMA: Private, Lightweight Aggregated Statistics against Malicious Adversaries with Full Security
<h1 align="center">PLASMA: Private, Lightweight Aggregated Statistics against Malicious Adversaries with Full Security <a href="https://github.com/TrustworthyComputing/plasma/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg"></a> </h1>
<h3 align="center">A Framework for Private Heavy-Hitters and Histograms</h3>


### WARNING: This is not production-ready code.

This is software for a research prototype. Please
Expand All @@ -10,10 +13,10 @@ This repository builds upon [heavy-hitters](https://github.com/henrycg/heavyhitt
First, make sure that you have a working Rust installation:

```bash
$ rustc --version
rustc 1.65.0-nightly
$ cargo --version
cargo 1.65.0-nightly
❯❯ rustc --version
rustc 1.67.1
❯❯ cargo --version
cargo 1.67.1
```

### Build from sources
Expand All @@ -25,56 +28,61 @@ cargo build --release

Server 0:
```bash
$ cargo run --release --bin hh-server -- --config src/bin/config_32.json --server_id 0
cargo run --release --bin hh-server -- --config src/bin/config_32.json --server_id 0
```

Server 1:
```bash
$ cargo run --release --bin hh-server -- --config src/bin/config_32.json --server_id 1
cargo run --release --bin hh-server -- --config src/bin/config_32.json --server_id 1
```

Server 2:
```bash
$ cargo run --release --bin hh-server -- --config src/bin/config_32.json --server_id 2
cargo run --release --bin hh-server -- --config src/bin/config_32.json --server_id 2
```

Now, the servers should be ready to process client requests. In a third shell, run the following command to send 100 client requests to the servers (this will take some time):
Now, the servers should be ready to process client requests. In a forth shell, run the following command to send 100 client requests to the servers:

Clients:
```bash
$ cargo run --release --bin hh-leader -- --config src/bin/config_32.json -n 100
cargo run --release --bin hh-leader -- --config src/bin/config_32.json -n 100
```

To run with the presence of malicious clients include the `--malicious` flag followed by the percentage of malicious clients to generate ([0.0, 0.9]). For instance, to run with 5% malicious clients use:
```bash
cargo run --release --bin hh-leader -- --config src/bin/config_32.json -n 100 --malicious 0.05
```


## Histogram

Server 0:
```bash
$ cargo run --release --bin histogram-server -- --config src/bin/config_8_histogram.json --server_id 0
cargo run --release --bin histogram-server -- --config src/bin/config_8.json --server_id 0
```

Server 1:
```bash
$ cargo run --release --bin histogram-server -- --config src/bin/config_8_histogram.json --server_id 1
cargo run --release --bin histogram-server -- --config src/bin/config_8.json --server_id 1
```

Server 2:
```bash
$ cargo run --release --bin histogram-server -- --config src/bin/config_8_histogram.json --server_id 2
cargo run --release --bin histogram-server -- --config src/bin/config_8.json --server_id 2
```

Now, the servers should be ready to process client requests. In a third shell, run the following command to send 100 client requests to the servers (this will take some time):
Now, the servers should be ready to process client requests. In a forth shell, run the following command to send 100 client requests to the servers:

Clients:
```bash
$ cargo run --release --bin histogram-leader -- --config src/bin/config_8_histogram.json -n 100
cargo run --release --bin histogram-leader -- --config src/bin/config_8.json -n 100
```


## The config file

The client and servers use a common configuration file, which contains the parameters for the system. An example of one such file is in `src/bin/config_32.json`. The contents of that file are here:

```
```bash
{
"data_bytes": 4,
"threshold": 0.01,
Expand All @@ -89,8 +97,13 @@ The client and servers use a common configuration file, which contains the param

The parameters are:

* `data_bytes`: The bitlength of each client's private string. In iDPF this is #bits, in Histograms this is #bytes
* `data_bytes`: Number of bytes of each string (x8 for bits).
* `threshold`: The servers will output the collection of strings that more than a `threshold` of clients hold.
* `server0` and `server1`: The `IP:port` of tuple for the two servers. The servers can run on different IP addresses, but these IPs must be publicly addressable.
* `*_batch_size`: The number of each type of RPC request to bundle together. The underlying RPC library has an annoying limit on the size of each RPC request, so you cannot set these values too large.
* `server0`, `server1`, and `server2`: The `IP:port` of tuple for the two servers. The servers can run on different IP addresses, but these IPs must be publicly addressable.
* `addkey_batch_size`: The number of each type of RPC request to bundle together. The underlying RPC library has an annoying limit on the size of each RPC request, so you cannot set these values too large.
* `unique_buckets` and `zipf_exponent`: Each simulated client samples its private string from a Zipf distribution over strings with parameter `zipf_exponent` and support `unique_buckets`.

<p align="center">
<img src="./logos/twc.png" height="20%" width="20%">
</p>
<h4 align="center">Trustworthy Computing Group</h4>
Binary file added logos/twc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/bin/amazon_128.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"data_bytes": 16,
"threshold": 0,
"threshold": 0.01,
"server_0": "3.140.71.107:8000",
"server_1": "18.222.42.81:8001",
"server_2": "3.129.193.161:8002",
Expand Down
2 changes: 1 addition & 1 deletion src/bin/amazon_256.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"data_bytes": 32,
"threshold": 0,
"threshold": 0.01,
"server_0": "3.140.71.107:8000",
"server_1": "18.222.42.81:8001",
"server_2": "3.129.193.161:8002",
Expand Down
10 changes: 10 additions & 0 deletions src/bin/amazon_32.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"data_bytes": 4,
"threshold": 0.01,
"server_0": "3.140.71.107:8000",
"server_1": "18.222.42.81:8001",
"server_2": "3.129.193.161:8002",
"addkey_batch_size": 100,
"unique_buckets": 10,
"zipf_exponent": 1.03
}
2 changes: 1 addition & 1 deletion src/bin/amazon_64.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"data_bytes": 8,
"threshold": 0,
"threshold": 0.01,
"server_0": "3.140.71.107:8000",
"server_1": "18.222.42.81:8001",
"server_2": "3.129.193.161:8002",
Expand Down
11 changes: 0 additions & 11 deletions src/bin/config_512.json

This file was deleted.

46 changes: 0 additions & 46 deletions tests/dpf_test.rs

This file was deleted.

0 comments on commit 78a5939

Please sign in to comment.