Skip to content

Commit 808f857

Browse files
author
cortze
committed
add cortze/py-dht as submodule + add DHT related parameters to the DAS conf/shape
1 parent db5fd6c commit 808f857

6 files changed

Lines changed: 45 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ myenv*/
55
doc/_build
66
!results/plots.py
77
Frontend/
8+
.idea

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "py-dht"]
2+
path = py-dht
3+
url = https://github.com/cortze/py-dht.git

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ cd das-research
2626
```
2727
python3 -m venv myenv
2828
source myenv/bin/activate
29-
pip3 install -r DAS/requirements.txt
29+
bash install_dependencies.sh
3030
```
3131

3232
## Run the simulator

install_dependencies.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
VENV="./myenv"
2+
3+
echo "Installing dependencies for DAS..."
4+
5+
# activate the venv or raise error if error
6+
source $VENV/bin/activate
7+
if [ $? -eq 0 ]; then
8+
echo "venv successfully sourced"
9+
else
10+
echo "unable to source venv at $VENV , does it exist?"
11+
exit 1
12+
fi
13+
14+
# make sure that the submodule module is correctly downloaded
15+
git submodule update --init
16+
17+
# install requirements for DAS and py-dht and install the dht module from py-dht
18+
pip3 install -r DAS/requirements.txt
19+
pip3 install -r py-dht/requirements.txt
20+
pip3 install -e py-dht

py-dht

Submodule py-dht added at 3f7d754

smallConf.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,26 @@
101101
# True to save git diff and git commit
102102
saveGit = False
103103

104+
# --- DHT Parameters ---
105+
106+
# True to simulate the distribution of the BlockSegments over a simulated DHTNetwork
107+
dhtSimulation = True
108+
109+
# K replication factor, in how many DHT nodes are we going to store the block segments
110+
# reused as how many DHT nodes will fit into each Kbucket to the routing table
111+
ks = [20]
112+
113+
# Number of concurrent DHT nodes that will be contacted during a Lookup
114+
alphas = [1]
115+
116+
# Number of steps without finding any closer DHT nodes to a Hash will the DHT lookup perform before finishing it
117+
# Not using steps4StopCondition as 7 steps looks too much for the DHT (although it could be changed :))
118+
nilStepsToStopLookup = 3
119+
104120
def nextShape():
105-
for run, fm, fr, class1ratio, chi, vpn1, vpn2, blockSize, nn, netDegree, bwUplinkProd, bwUplink1, bwUplink2 in itertools.product(
106-
runs, failureModels, failureRates, class1ratios, chis, validatorsPerNode1, validatorsPerNode2, blockSizes, numberNodes, netDegrees, bwUplinksProd, bwUplinks1, bwUplinks2):
121+
for run, fm, fr, class1ratio, chi, vpn1, vpn2, blockSize, nn, netDegree, bwUplinkProd, bwUplink1, bwUplink2, k, alpha in itertools.product(
122+
runs, failureModels, failureRates, class1ratios, chis, validatorsPerNode1, validatorsPerNode2, blockSizes, numberNodes, netDegrees, bwUplinksProd, bwUplinks1, bwUplinks2, ks, alphas):
107123
# Network Degree has to be an even number
108124
if netDegree % 2 == 0:
109-
shape = Shape(blockSize, nn, fm, fr, class1ratio, chi, vpn1, vpn2, netDegree, bwUplinkProd, bwUplink1, bwUplink2, run)
125+
shape = Shape(blockSize, nn, fm, fr, class1ratio, chi, vpn1, vpn2, netDegree, bwUplinkProd, bwUplink1, bwUplink2, k, alpha, run)
110126
yield shape

0 commit comments

Comments
 (0)