From f7f47327894ee018ea47fe46321a32c715ffa487 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Mon, 26 Oct 2020 08:32:36 +0000 Subject: [PATCH] added floodfill network visualization script --- scripts/floodfill-network-visualizer.py | 10 +++++----- src/netcontroller/torcontrol/gentorrc.py | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/floodfill-network-visualizer.py b/scripts/floodfill-network-visualizer.py index 4447e60b..70e6f9c8 100644 --- a/scripts/floodfill-network-visualizer.py +++ b/scripts/floodfill-network-visualizer.py @@ -10,7 +10,7 @@ sys.path.append("src/") from streamfill import identify_neighbors G = nx.Graph() -size = 20 +size = 1000 onions = [] p = subprocess.Popen(["scripts/generate-onions.py", str(size)], @@ -19,15 +19,15 @@ p = subprocess.Popen(["scripts/generate-onions.py", str(size)], for line in iter(p.stdout.readline, b''): line = line.decode().strip() onions.append(line) - G.add_node(line[:4]) + G.add_node(line[:6]) for onion in onions: - neighbors = identify_neighbors(onion, onions, 0.25 * size) + neighbors = identify_neighbors(onion, onions, 0.15 * size) for neighbor in neighbors: - G.add_edge(onion[:4], neighbor[:4]) + G.add_edge(onion[:6], neighbor[:6]) #nx.draw(G, with_labels=True, font_weight='bold') #nx.draw_shell(G, with_labels=True) #nx.draw_random(G, with_labels=True) -nx.draw_kamada_kawai(G, with_labels=True) +nx.draw_kamada_kawai(G) plt.savefig("graph.png") \ No newline at end of file diff --git a/src/netcontroller/torcontrol/gentorrc.py b/src/netcontroller/torcontrol/gentorrc.py index d1dc8749..42693479 100644 --- a/src/netcontroller/torcontrol/gentorrc.py +++ b/src/netcontroller/torcontrol/gentorrc.py @@ -82,6 +82,7 @@ HashedControlPassword """ + str(password) + """ HiddenServiceNumIntroductionPoints 20 HiddenServiceMaxStreams 500 HiddenServiceMaxStreamsCloseCircuit 1 +DisableNetwork 1 HiddenServicePort 80 """ + api_server_ip + """:""" + str(hs_port) torrc_data = add_bridges(torrc_data)