0% found this document useful (0 votes)
40 views

Distributed Algorithms 2022-2023 Project Validation

This document describes a distributed algorithms project that involves implementing broadcast algorithms. The goals are to develop perfect links and FIFO broadcast algorithms. Testing will evaluate correctness under network and process issues and performance under varying numbers of processes. Students are provided guidance on implementation steps and tools for testing under failure scenarios. Performance will be measured based on aggregate throughput of all processes broadcasting messages over a period of time.

Uploaded by

Survey Taker
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

Distributed Algorithms 2022-2023 Project Validation

This document describes a distributed algorithms project that involves implementing broadcast algorithms. The goals are to develop perfect links and FIFO broadcast algorithms. Testing will evaluate correctness under network and process issues and performance under varying numbers of processes. Students are provided guidance on implementation steps and tools for testing under failure scenarios. Performance will be measured based on aggregate throughput of all processes broadcasting messages over a period of time.

Uploaded by

Survey Taker
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Distributed Algorithms

2022-2023
Project validation

Teaching Assistants:
Diana Petrescu, Athanasios Xygkis

Extra support:
Nicolas Wagner 1
Goal of the project
Implement certain building blocks necessary for distributed systems:

● Focus on broadcast algorithms


● 1st deliverable: Perfect Links
● 2nd deliverable: FIFO broadcast
● 3rd deliverable: To be announced

2
Project Evaluation (1/2)
● The project accounts for 30% of the final grade:

○ The 1st deliverable (Perfect Links) is 20% of the project grade,

○ The 2nd deliverable (FIFO Broadcast) is 40% of the project grade,

○ The yet-to-be-announced 3rd deliverable is 40% of the project grade.

● The project evaluation consists of three parts:

○ Correctness,

○ Performance test,

○ Discussion
3
Project Evaluation (2/2)
● Correctness tests under:

○ Network issues: packet delay, packet loss, packet reordering, no packet corruption

○ Process issues: slow processes, crashed processes

● Performance tests under:

○ Varying number of broadcasting processes,

○ Absence of process crashes/delays

4
Implementation steps

Perfect Links Devise a retransmission strategy to deal with network issues


Tip: Test using only two processes

Uniform Reliable Pick the appropriate algorithm from class


Broadcast Tip: For performance, try to keep your payload small

FIFO Broadcast
Focus on correctness first!
Try to improve performance later.
To-be-announced

5
Traffic Control (1/2)
tc: linux utility for altering the network characteristics (delay, loss, reorder).

How to use:
$ sudo tc qdisc add dev lo root netem 2>/dev/null
$ sudo tc qdisc change dev lo root netem delay 200ms 50ms loss 10% 25% reorder 25% 50%

What it does:
● Adds packet delay of 200ms ± 50ms that is uniformly distributed.
● 10% of the packets are lost. Each successive probability depends by 25% on the the last one: P(n)
= 0.25 * Prob(n-1) + 0.75 * Random (Emulated burst losses)
● 25% of packets (with a correlation of 50%) will get sent immediately, others will be delayed by the
aforementioned delay factor.
More info: https://man7.org/linux/man-pages/man8/tc-netem.8.html

6
Traffic Control (2/2)
For convenience, tools/tc.py applies the TC commands of the previous slide for you.

How to use:
$ python3 tc.py

Good to know:
● The tc rules are applied for as long as this program is running. When this program exits,
the tc rules are reset.
● This program applies the following TC configuration:
config = {
'delay': ('200ms', '50ms'),
'loss': ('10%', '25%'),
'reordering': ('25%', '50%')
}

Edit tools/tc.py to try different configurations


7
Testing (1/3)
Instructions to manually run some processes are given in the GitHub page. Manual
runs are useful for the early phases of developing and for debugging.

For example
# Build the application:
$ ./build.sh

# In first terminal window:


$ ./run.sh --id 1 --hosts ../example/hosts --output ../example/output/1.output
../example/configs/perfect-links.config

# In second terminal window:


$ ./run.sh --id 2 --hosts ../example/hosts --output ../example/output/2.output
../example/configs/perfect-links.config

# In third terminal window:


$ ./run.sh --id 3 --hosts ../example/hosts --output ../example/output/3.output
../example/configs/perfect-links.config

# Wait enough time for all processes to finish processing messages.


# Type Ctrl-C in every terminal window to create the output files. 8
Testing (2/3)
You can also run using the tools/stress.py script.

Usage: ./stress.py -r RUNSCRIPT -t {perfect,fifo} -l LOGSDIR -p PROCESSES -c MESSAGES

Where:
● RUNSCRIPT is the path to run.sh. Remember to build your project first!
● -t specifies which deliverable you run with.
● LOGSDIR is the path to a directory where stdout, stderr and output of each process will be stored.
It also stores generated HOSTS and CONFIG files. The directory must exist as it will not be created
for you.
● PROCESSES specifies the number of processes spawn during validation.
● MESSAGES specifies the number of messages each process is broadcasting.

9
Testing (3/3)
You can edit tools/stress.py in order to test different scenarios.
Go to the bottom of the file and edit the following:
How many threads are interfering with the running
testConfig = { processes.
'concurrency' : 8, How many successful operations (SIGCONT,
'attempts' : 8 , SIGSTOP, SIGTERM) each thread will attempt
'attemptsDistribution' : { before stopping. Threads stop if a minority of
processes has been terminated.
'STOP': 0.48,
'CONT': 0.48, Each thread selects a process randomly
'TERM':0.04 and issues one of these operations with the
given probability.
}
}
10
Further info about stress.py
● You can use tc.py before running stress.py to change the network
configuration.
● You can change the rate at which interfering threads interfere with the
processes:
○ Modify this line: time.sleep(float(random.randint(50, 500)) / 1000.0) under
the StressTest class

11
Measuring performance
We measure performance under no process crashes/delays.

● We are interested in the aggregate throughput:


○ i.e., the combined throughput of all processes.

● Have each process broadcast a large number of messages.


○ The number must be large enough such that no process finishes

● Measure as follows:
○ Start all processes,
○ Wait x minutes,
○ Stop all processes,
○ Take a snapshot.

● Compute the throughput based on the generated logs and the execution time

12

You might also like