Commit db80f5a0 authored by Pierre Louis Aublin's avatar Pierre Louis Aublin
Browse files

small fix

parent 8be09bc8
Loading
Loading
Loading
Loading
+14 −9
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ MALICIOUS_RATIOS=( 0.2 0.4 0.6 0.8 )

function remove_fw_rules {
	echo "Removing FW rules"
	for n in ${REPLICAS[@]}; do
	for r in ${REPLICAS[@]}; do
		ssh -o StrictHostKeyChecking=no ${SSHKEY_ARG} ${REPLICAS[$r]} sudo iptables -F
	done
}
@@ -31,10 +31,15 @@ function blocklist_malicious {
	pstart=8000
	malicious=$(python -c "print(\"{:.0f}\".format($MALICIOUS * $NUMCLIENTS))")
	pend=$(($pstart + $malicious))
	primary=${1:-0}
	echo "Blacklist malicious nodes: $pstart:$pend"

	for n in ${REPLICAS[@]}; do
		echo ssh -o StrictHostKeyChecking=no ${SSHKEY_ARG} ${REPLICAS[$r]} sudo iptables -A INPUT -p udp --sport $pstart:$pend -j DROP
	for r in ${REPLICAS[@]}; do
		if [ $primary -eq 1 ]; then
			primary=0
		else
		   ssh -o StrictHostKeyChecking=no ${SSHKEY_ARG} ${REPLICAS[$r]} sudo iptables -A INPUT -p udp --sport $pstart:$pend -j DROP
		fi
	done
}

@@ -72,7 +77,7 @@ for mode in speculative; do
	./set_mode.sh $mode

	remove_fw_rules
	blocklist_malicious
	blocklist_malicious 0

	./start_experiment.sh nodes_config_hmac_sig.txt 1 ${NUMCLIENTS} $REQLEN $CRYPTOTHREADS $MALICIOUS 0

@@ -86,7 +91,7 @@ cp client.rs.primaryonly src/bin/client.rs
remove_fw_rules

# no blocklisting
for mode in speculative; do
for mode in broadcast; do
	./set_mode.sh $mode


@@ -97,11 +102,11 @@ for mode in speculative; do
done

# blocklisting
for mode in speculative; do
for mode in broadcast; do
	./set_mode.sh $mode

	remove_fw_rules
	blocklist_malicious
	blocklist_malicious 1

	./start_experiment.sh nodes_config_hmac_sig.txt 1 ${NUMCLIENTS} $REQLEN $CRYPTOTHREADS $MALICIOUS 0

@@ -156,8 +161,8 @@ noblocklist_invalidsig_thr=$(get_experiment_throughput_attack "invalidsig" "spec
blocklist_invalidsig_thr=$(get_experiment_throughput_attack "invalidsig_blocklist" "speculative" $MALICIOUS)

# Primary only attack
noblocklist_primaryonly_thr=$(get_experiment_throughput_attack "primaryonly" "speculative" $MALICIOUS)
blocklist_primaryonly_thr=$(get_experiment_throughput_attack "primaryonly_blocklist" "speculative" $MALICIOUS)
noblocklist_primaryonly_thr=$(get_experiment_throughput_attack "primaryonly" "broadcast" $MALICIOUS)
blocklist_primaryonly_thr=$(get_experiment_throughput_attack "primaryonly_blocklist" "broadcast" $MALICIOUS)

# Compute the ratios
if [ -n "$pbft_invalidsig_thr" ] && [ -n "$pbft_ff" ]; then
+5 −5
Original line number Diff line number Diff line
@@ -198,15 +198,15 @@ functions:
- `fn receive(&self) -> Result<RawMessage, std::io::Error>` to receive a
  message from another node.

Then, the network module is instantiated in `src/statemachine.rs` at line 45
for clients or line 414 for replicas.
Then, the network module is instantiated in `src/statemachine.rs` at line 41
for clients or line 399 for replicas.

Note that you can easily use a different network module for the clients to
replicas and replicas to replicas communication, by changing line 436 in
replicas and replicas to replicas communication, by changing line 423 in
`src/statemachine.rs`
```rust
435   let replica_network = get_network_layer(id, n, true, true, &nodes);
436   let client_network = get_network_layer(id, n, true, false, &nodes);
422   let replica_network = get_network_layer(id, n, true, true, &nodes);
423   let client_network = get_network_layer(id, n, true, false, &nodes);
                            // ^-- create your own function to use a different
                            //     network module for client communication
```