-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
sidlak-c137
committed
May 23, 2024
1 parent
a287258
commit 466b561
Showing
2 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
"""An example of constructing a multisite lan. | ||
Instructions: | ||
Wait for the profile instance to start, and then log in to the nodes. | ||
""" | ||
|
||
# Import the Portal object. | ||
import geni.portal as portal | ||
# Import the ProtoGENI library. | ||
import geni.rspec.pg as pg | ||
|
||
BANDWIDTH_WAN = 10000 | ||
LATENCY_WAN = 15 | ||
|
||
BANDWIDTH_LOCAL = 10000 | ||
LATENCY_LOCAL = 1 | ||
|
||
# Create a portal context. | ||
pc = portal.Context() | ||
|
||
# Create a Request object to start building the RSpec. | ||
request = pc.makeRequestRSpec() | ||
|
||
# Create three raw "PC" nodes, one at each site | ||
servers = [] | ||
for i in ["1", "2", "3"]: | ||
node = request.RawPC("node" + i) | ||
ifaces = [] | ||
for j in ["1", "2", "3"]: | ||
iface = node.addInterface() | ||
ifaces.append(iface) | ||
servers.append(ifaces) | ||
|
||
clients = [] | ||
for i in ["4", "5", "6"]: | ||
node = request.RawPC("node" + i) | ||
iface = node.addInterface() | ||
clients.append(iface) | ||
|
||
for i in ["0", "1", "2"]: | ||
link = request.Link("link" + i) | ||
link.bandwidth = BANDWIDTH_WAN | ||
link.latency = LATENCY_WAN | ||
if i == "0": | ||
link.addInterface(servers[0][0]) | ||
link.addInterface(servers[1][0]) | ||
if i == "1": | ||
link.addInterface(servers[0][1]) | ||
link.addInterface(servers[2][0]) | ||
if i == "2": | ||
link.addInterface(servers[1][1]) | ||
link.addInterface(servers[2][1]) | ||
|
||
for i in ["4", "5", "6"]: | ||
link = request.Link("link" + i) | ||
link.bandwidth = BANDWIDTH_LOCAL | ||
link.latency = LATENCY_LOCAL | ||
if i == "4": | ||
link.addInterface(clients[0]) | ||
link.addInterface(servers[0][2]) | ||
if i == "5": | ||
link.addInterface(clients[1]) | ||
link.addInterface(servers[1][2]) | ||
if i == "6": | ||
link.addInterface(clients[2]) | ||
link.addInterface(servers[2][2]) | ||
|
||
pc.printRequestRSpec(request) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
************************************************************************************************************************************************************************************ | ||
git clone [email protected]:sidlak-c137/RobustMencius.git && cd RobustMencius | ||
sudo apt-get update | ||
sudo apt-get install -y python3-pip | ||
sudo apt install -y python3-virtualenv | ||
sudo apt install -y python3-venv | ||
python3 -m venv py312 && source ./py312/bin/activate | ||
pip install -r requirements.txt | ||
************************************************************************************************************************************************************************************ | ||
|
||
|
||
|
||
************************************************************************************************************************************************************************************ | ||
python3 startServer.py -n server1 -t multipaxos -c three_clients_three_servers_cl -g INFO | ||
python3 startServer.py -n server2 -t multipaxos -c three_clients_three_servers_cl -g INFO | ||
python3 startServer.py -n server3 -t multipaxos -c three_clients_three_servers_cl -g INFO | ||
|
||
python3 startClient.py -n client1 -t multipaxos -c three_clients_three_servers_cl -g INFO -l ./experiments/multipaxos_default/client1.txt | ||
python3 startClient.py -n client2 -t multipaxos -c three_clients_three_servers_cl -g INFO -l ./experiments/multipaxos_default/client2.txt | ||
python3 startClient.py -n client3 -t multipaxos -c three_clients_three_servers_cl -g INFO -l ./experiments/multipaxos_default/client3.txt | ||
************************************************************************************************************************************************************************************ | ||
|
||
|
||
************************************************************************************************************************************************************************************ | ||
python3 startServer.py -n server1 -t multipaxos -c three_clients_three_servers_cl_slow -g INFO | ||
python3 startServer.py -n server2 -t multipaxos -c three_clients_three_servers_cl_slow -g INFO | ||
python3 startServer.py -n server3 -t multipaxos -c three_clients_three_servers_cl_slow -g INFO | ||
|
||
python3 startClient.py -n client1 -t multipaxos -c three_clients_three_servers_cl_slow -g INFO -l ./experiments/multipaxos_slow/client1.txt | ||
python3 startClient.py -n client2 -t multipaxos -c three_clients_three_servers_cl_slow -g INFO -l ./experiments/multipaxos_slow/client2.txt | ||
python3 startClient.py -n client3 -t multipaxos -c three_clients_three_servers_cl_slow -g INFO -l ./experiments/multipaxos_slow/client3.txt | ||
************************************************************************************************************************************************************************************ | ||
|
||
|
||
************************************************************************************************************************************************************************************ | ||
python3 startServer.py -n server1 -t mencius -c three_clients_three_servers_cl -g INFO | ||
python3 startServer.py -n server2 -t mencius -c three_clients_three_servers_cl -g INFO | ||
python3 startServer.py -n server3 -t mencius -c three_clients_three_servers_cl -g INFO | ||
|
||
python3 startClient.py -n client1 -t mencius -c three_clients_three_servers_cl -g INFO -l ./experiments/mencius_default/client1.txt | ||
python3 startClient.py -n client2 -t mencius -c three_clients_three_servers_cl -g INFO -l ./experiments/mencius_default/client2.txt | ||
python3 startClient.py -n client3 -t mencius -c three_clients_three_servers_cl -g INFO -l ./experiments/mencius_default/client3.txt | ||
************************************************************************************************************************************************************************************ | ||
|
||
|
||
************************************************************************************************************************************************************************************ | ||
python3 startServer.py -n server1 -t mencius -c three_clients_three_servers_cl_slow -g INFO | ||
python3 startServer.py -n server2 -t mencius -c three_clients_three_servers_cl_slow -g INFO | ||
python3 startServer.py -n server3 -t mencius -c three_clients_three_servers_cl_slow -g INFO | ||
|
||
python3 startClient.py -n client1 -t mencius -c three_clients_three_servers_cl_slow -g INFO -l ./experiments/mencius_slow/client1.txt | ||
python3 startClient.py -n client2 -t mencius -c three_clients_three_servers_cl_slow -g INFO -l ./experiments/mencius_slow/client2.txt | ||
python3 startClient.py -n client3 -t mencius -c three_clients_three_servers_cl_slow -g INFO -l ./experiments/mencius_slow/client3.txt |