Skip to content

Commit 8483770

Browse files
author
cms5347
committed
Final draft
1 parent 77c620c commit 8483770

File tree

2 files changed

+47
-33
lines changed

2 files changed

+47
-33
lines changed

cms5347_written_deliverable.tex

+23-19
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ \subsubsection{Benefit to Project}
170170

171171
The main benefit of \cite{kademlia} is that it describes how the Kademlia algorithm
172172
is implemented on a network. Using the information in this paper, I created an
173-
adaptation of the Kademlia algorithm for use in a simulation.
173+
adaptation of the Kademlia algorithm for use in a simulation. The simulation in
174+
turn can be used to test how well a Kademlia DHT handles node removals.
174175

175176
\section{Software}
176177
\label{sec:software}
@@ -289,22 +290,21 @@ \subsubsection{simulation.py}
289290
\subsubsection{RunSimulation.py}
290291
\label{sec:runsim}
291292
RunSimulation.py is a script that will build a network and then iteratively run
292-
a number of randomized look-ups (see
293-
\texttt{Simulation.perform\_node\_lookup}
294-
; printing the average RTT to stdout after it finishes each
295-
iteration (trial). One important thing to note is that before actual tests are
296-
run, the script will perform a number of random look-ups equal to half of the
297-
size of the network. This is because in a new network the nodes will learn about
298-
other nodes in the system more rapidly than in an established network. Training
299-
the nodes at the beginning prevents this from affecting the data produced when
300-
nodes are being removed.
293+
a number of randomized look-ups (see \texttt{Simulation.perform\_node\_lookup})
294+
printing the average RTT to stdout after it finishes each iteration (trial). One
295+
important thing to note is that before actual tests are run, the script will
296+
perform a number of random look-ups equal to half of the size of the
297+
network. This is because in a new network the nodes will learn about other nodes
298+
in the system more rapidly than in an established network. Training the nodes at
299+
the beginning prevents this from affecting the data produced when nodes are
300+
being removed.
301301

302302
After each round of look-ups RunSimulation.py will disable some nodes at
303303
random and repeat. It also saves the number and average look-up time for each
304304
trial in a space-separated external file for use later.
305305

306-
RunSimulation.py requires at least 2.7.x, also remember to give it execute
307-
privileges. Instead of execute privileges it can also be invoked with:
306+
RunSimulation.py requires at least 2.7.x. Also remember to give it execute
307+
privileges. Instead of needing execute privileges, it can also be invoked with:
308308
\begin{verbatim}
309309
python RunSimulation.py ...
310310
\end{verbatim}
@@ -363,21 +363,21 @@ \subsubsection{plots.gnuplot}
363363
use it, run it at the prompt as follows:
364364
\begin{verbatim}
365365
$ gnuplot
366-
gnuplot> load 'plots.gnuplots'
366+
gnuplot> load `plots.gnuplots'
367367
\end{verbatim}
368368
The parameters used to create the plots can be altered by editing the following
369369
variables in plots.gnuplot:
370370
\begin{description}
371371
\item[graph\_lower\_bound] The lowest number of nodes that would be removed
372-
per trial in run\_tests.sh. Corresponds to "Node disable start bound" in run\_tests.sh.
372+
per trial in run\_tests.sh. Corresponds to ``Node disable start bound" in run\_tests.sh.
373373
\item[graph\_upper\_bound] The highest number of nodes that would be removed
374-
per trial in run\_tests.sh. Corresponds to "Node disable upper bound" in run\_tests.sh.
374+
per trial in run\_tests.sh. Corresponds to ``Node disable upper bound" in run\_tests.sh.
375375
\item[graph\_increment] The number that was added for each experiment in
376-
run\_tests.sh. Corresponds to "disable increment" in run\_tests.sh.
376+
run\_tests.sh. Corresponds to ``disable increment" in run\_tests.sh.
377377
\item[output\_type] The file output type to write the graphs to. This can be
378378
any file format supported by you copy of gnuplot. Default is eps.
379379
\item[file\_suffix] The part of the filenames produced by run\_tests.sh after
380-
the disable number. Default is '\texttt{\_increase.dat}'.
380+
the disable number. Default is `\texttt{\_increase.dat}'.
381381
\item[image\_size] The size of the images produced by gnuplot, the default is 1024x768.
382382
\end{description}
383383

@@ -412,15 +412,15 @@ \section{Experimental Results and Conclusion}
412412
\cite{kademlia}. The network was then trained by doing five-thousand random
413413
lookups so that nodes learning in early iterations would not affect trends as
414414
much as nodes were removed. This was not strictly necessary, as a comparison of
415-
the data in 0\_increase.dat and 0\_increase\_no\_train.dat shows.
415+
the data in \texttt{0\_increase.dat} and \texttt{0\_increase\_no\_train.dat} shows.
416416
In each test, there were one-hundred trials consisting of
417417
one-thousand random lookups. After each trial, some nodes were removed at random
418418
before doing the next. After each test, the network was regenerated using the
419419
same random seed and the number of nodes to remove after each trial was
420420
increased by five. RunSimulation.py was run a total of ten times, meaning that
421421
at minimum zero nodes were removed from the network after each trial (as a
422422
control group) and at maximum fifty nodes were removed from the network after
423-
each trial. The data from these experiments are included in raw form in Appendix \ref{sec:data}
423+
each trial. The data from these experiments are included in raw form in Section \ref{sec:data}
424424

425425
Figure \ref{fig:points} shows a plot of the average RTT for a lookup versus the
426426
trial number. Each color/shape represents a different number of nodes being
@@ -449,24 +449,28 @@ \section{Experimental Results and Conclusion}
449449

450450
\begin{figure}[htdp]
451451
\centering
452+
\caption{}
452453
\includegraphics[width=\textwidth]{points}
453454
\label{fig:points}
454455
\end{figure}
455456

456457
\begin{figure}[htdp]
457458
\centering
459+
\caption{}
458460
\includegraphics[width=\textwidth]{combined}
459461
\label{fig:combined}
460462
\end{figure}
461463

462464
\begin{figure}[htdp]
463465
\centering
466+
\caption{}
464467
\includegraphics[width=\textwidth]{linear}
465468
\label{fig:linear}
466469
\end{figure}
467470

468471
\begin{figure}[htdp]
469472
\centering
473+
\caption{}
470474
\includegraphics[width=\textwidth]{slopes}
471475
\label{fig:slopes}
472476
\end{figure}

plots.gnuplot

+24-14
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
graph_upper_bound = 50
33
graph_lower_bound = 0
44
graph_increment = 5
5-
output_type="eps"
5+
output_type="png"
66
image_size="1024,768"
77
set macros
88

9+
set title font ",30"
910

11+
points_str = "plot "
1012
combined_str = "plot "
11-
linear_str = "plot "
13+
linear_str = "plot [0:100] [0:6] "
1214
slope_deriv = "fp(x) = "
1315
file_suffix = "_increase.dat"
1416

@@ -25,31 +27,39 @@ do for [i = graph_lower_bound:graph_upper_bound:graph_increment] {
2527
if (i == graph_upper_bound){
2628
combined_str = sprintf("%s \'%d%s\' title \"remove %d nodes per trial\", f%d(x)", combined_str, i, file_suffix, i, i)
2729
linear_str = sprintf("%s f%d(x)", linear_str, i)
30+
points_str = sprintf("%s \'%d%s\' title \"remove %d nodes per trial\"", points_str, i, file_suffix, i)
2831
} else{
2932
combined_str = sprintf("%s \'%d%s\' title \"remove %d nodes per trial\", f%d(x),", combined_str, i, file_suffix, i, i)
3033
linear_str = sprintf("%s f%d(x),", linear_str, i)
34+
points_str = sprintf("%s \'%d%s\' title \"remove %d nodes per trial\",", points_str, i, file_suffix, i)
3135
}
3236

3337
}
3438

35-
set title 'Change in key lookup time as more nodes are disabled'
36-
set ylabel 'Average time per lookup (s)'
37-
set xlabel 'Trial'
39+
40+
41+
set title 'Change in key lookup time as more nodes are disabled' font "DejaVuSans,20"
42+
set ylabel 'Average time per lookup (s)' font "DejaVuSans,12"
43+
set xlabel 'Trial' font "DejaVuSans,12"
3844
set key left
3945

40-
eval combined_str
46+
eval points_str
4147

4248
set term @output_type size @image_size
43-
set output sprintf('combined.%s', output_type)
49+
set output sprintf('points.%s', output_type)
4450
replot
4551

46-
set term x11
52+
#set term x11
4753

4854

49-
set title 'Change in key lookup time as more nodes are disabled'
50-
set ylabel 'Average time per lookup (s)'
51-
set xlabel 'Trial'
52-
set key left
55+
56+
eval combined_str
57+
58+
#set term @output_type size @image_size
59+
set output sprintf('combined.%s', output_type)
60+
replot
61+
62+
#set term x11
5363

5464
eval linear_str
5565

@@ -61,8 +71,8 @@ set term x11
6171

6272
set xlabel "Nodes disabled per trial"
6373
set ylabel "Seconds per nodes disabled"
64-
set key box
65-
plot [0:55] [-.01:.05] 'slopes.dat'
74+
set title "Change in Average RTT as Node Removal Time Increases"
75+
plot [0:55] [-.01:.05] 'slopes.dat' title 'Slope'
6676
set term @output_type size @image_size
6777
set output sprintf('slopes.%s', output_type)
6878
replot

0 commit comments

Comments
 (0)