aboutsummaryrefslogtreecommitdiff
path: root/src/nse
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-03-19 09:58:55 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-03-19 09:58:55 +0000
commit5df7f24fe0f8371c931b78a135c864af8e167c6a (patch)
tree8eaf46f077969aeaacc1767ba6b3e5ea6f88b920 /src/nse
parent453364efe4a8f3d1bfd57bca478d8b0ebc1d1fc8 (diff)
downloadgnunet-5df7f24fe0f8371c931b78a135c864af8e167c6a.tar.gz
gnunet-5df7f24fe0f8371c931b78a135c864af8e167c6a.zip
- working version of NSE profiler
Diffstat (limited to 'src/nse')
-rw-r--r--src/nse/gnunet-nse-profiler.c31
-rw-r--r--src/nse/nse_profiler_test.conf75
2 files changed, 34 insertions, 72 deletions
diff --git a/src/nse/gnunet-nse-profiler.c b/src/nse/gnunet-nse-profiler.c
index 5777916a0..391a7656f 100644
--- a/src/nse/gnunet-nse-profiler.c
+++ b/src/nse/gnunet-nse-profiler.c
@@ -382,13 +382,16 @@ connect_nse_service ()
382{ 382{
383 struct NSEPeer *current_peer; 383 struct NSEPeer *current_peer;
384 unsigned int i; 384 unsigned int i;
385 unsigned int connections;
385 386
387 if (0 == connection_limit)
388 return;
386 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting to nse service of peers\n"); 389 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting to nse service of peers\n");
387 for (i = 0; i < num_peers; i++) 390 connections = 0;
391 for (i = 0; i < num_peers_in_round[current_round]; i++)
388 { 392 {
389 if ((connection_limit > 0) && 393 if ((num_peers_in_round[current_round] > connection_limit) &&
390 (num_peers > connection_limit) && 394 (0 != (i % (num_peers_in_round[current_round] / connection_limit))))
391 (0 != (i % (num_peers / connection_limit))))
392 continue; 395 continue;
393 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 396 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
394 "nse-profiler: connecting to nse service of peer %d\n", i); 397 "nse-profiler: connecting to nse service of peer %d\n", i);
@@ -401,8 +404,10 @@ connect_nse_service ()
401 NULL, NULL, 404 NULL, NULL,
402 &nse_connect_adapter, 405 &nse_connect_adapter,
403 &nse_disconnect_adapter, 406 &nse_disconnect_adapter,
404 current_peer); 407 current_peer);
405 GNUNET_CONTAINER_DLL_insert (peer_head, peer_tail, current_peer); 408 GNUNET_CONTAINER_DLL_insert (peer_head, peer_tail, current_peer);
409 if (++connections == connection_limit)
410 break;
406 } 411 }
407} 412}
408 413
@@ -448,6 +453,7 @@ stats_finished_callback (void *cls,
448 GNUNET_free (stats_context); 453 GNUNET_free (stats_context);
449 return; 454 return;
450 } 455 }
456 LOG_DEBUG ("Finished collecting statistics\n");
451 if (NULL != data_file) 457 if (NULL != data_file)
452 { 458 {
453 /* Stats lookup successful, write out data */ 459 /* Stats lookup successful, write out data */
@@ -589,9 +595,7 @@ finish_round (void *cls,
589 char buf[1024]; 595 char buf[1024];
590 size_t buf_len; 596 size_t buf_len;
591 597
592 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 598 LOG (GNUNET_ERROR_TYPE_INFO, "Have %u connections\n", total_connections);
593 "Have %u connections\n",
594 total_connections);
595 if (NULL != data_file) 599 if (NULL != data_file)
596 { 600 {
597 buf_len = GNUNET_snprintf (buf, sizeof (buf), 601 buf_len = GNUNET_snprintf (buf, sizeof (buf),
@@ -655,6 +659,8 @@ peer_churn_cb (void *cls, const char *emsg)
655 GNUNET_TESTBED_operation_done (entry->op); 659 GNUNET_TESTBED_operation_done (entry->op);
656 GNUNET_CONTAINER_DLL_remove (oplist_head, oplist_tail, entry); 660 GNUNET_CONTAINER_DLL_remove (oplist_head, oplist_tail, entry);
657 GNUNET_free (entry); 661 GNUNET_free (entry);
662 if (num_peers_in_round[current_round] == peers_running)
663 run_round ();
658} 664}
659 665
660 666
@@ -707,6 +713,7 @@ next_round (void *cls,
707 if (current_round == num_rounds) 713 if (current_round == num_rounds)
708 { 714 {
709 /* this was the last round, terminate */ 715 /* this was the last round, terminate */
716 ok = 0;
710 GNUNET_SCHEDULER_shutdown (); 717 GNUNET_SCHEDULER_shutdown ();
711 return; 718 return;
712 } 719 }
@@ -735,13 +742,9 @@ master_controller_cb (void *cls,
735 { 742 {
736 case GNUNET_TESTBED_ET_PEER_START: 743 case GNUNET_TESTBED_ET_PEER_START:
737 peers_running++; 744 peers_running++;
738 if (num_peers_in_round[current_round] == peers_running)
739 run_round ();
740 break; 745 break;
741 case GNUNET_TESTBED_ET_PEER_STOP: 746 case GNUNET_TESTBED_ET_PEER_STOP:
742 peers_running--; 747 peers_running--;
743 if (num_peers_in_round[current_round] == peers_running)
744 run_round ();
745 break; 748 break;
746 case GNUNET_TESTBED_ET_CONNECT: 749 case GNUNET_TESTBED_ET_CONNECT:
747 total_connections++; 750 total_connections++;
@@ -817,7 +820,7 @@ run (void *cls, char *const *args, const char *cfgfile,
817 fprintf (stderr, "Refusing to run a round with 0 peers\n"); 820 fprintf (stderr, "Refusing to run a round with 0 peers\n");
818 return; 821 return;
819 } 822 }
820 GNUNET_array_grow (num_peers_in_round, num_rounds, num); 823 GNUNET_array_append (num_peers_in_round, num_rounds, num);
821 num_peers = GNUNET_MAX (num_peers, num); 824 num_peers = GNUNET_MAX (num_peers, num);
822 } 825 }
823 if (0 == num_peers) 826 if (0 == num_peers)
@@ -875,7 +878,7 @@ main (int argc, char *const *argv)
875 static struct GNUNET_GETOPT_CommandLineOption options[] = { 878 static struct GNUNET_GETOPT_CommandLineOption options[] = {
876 {'C', "connections", "COUNT", 879 {'C', "connections", "COUNT",
877 gettext_noop ("limit to the number of connections to NSE services, 0 for none"), 880 gettext_noop ("limit to the number of connections to NSE services, 0 for none"),
878 1, &GNUNET_GETOPT_set_string, &num_peer_spec}, 881 1, &GNUNET_GETOPT_set_uint, &connection_limit},
879 {'d', "details", "FILENAME", 882 {'d', "details", "FILENAME",
880 gettext_noop ("name of the file for writing connection information and statistics"), 883 gettext_noop ("name of the file for writing connection information and statistics"),
881 1, &GNUNET_GETOPT_set_string, &data_filename}, 884 1, &GNUNET_GETOPT_set_string, &data_filename},
diff --git a/src/nse/nse_profiler_test.conf b/src/nse/nse_profiler_test.conf
index 398eb27de..b9d0c3efc 100644
--- a/src/nse/nse_profiler_test.conf
+++ b/src/nse/nse_profiler_test.conf
@@ -1,8 +1,18 @@
1[PATHS] 1[PATHS]
2SERVICEHOME = /tmp/nse-profiler/ 2SERVICEHOME = /tmp/nse-profiler/
3 3
4[testbed]
5AUTOSTART = NO
6PORT = 12113
7ACCEPT_FROM = 127.0.0.1; 10.6.0.0/16;
8HOSTNAME = localhost
9MAX_PARALLEL_TOPOLOGY_CONFIG_OPERATIONS = 5
10OVERLAY_TOPOLOGY = RANDOM
11OVERLAY_RANDOM_LINKS = 10
12OPERATION_TIMEOUT = 45 s
13
4[nse] 14[nse]
5PORT = 0 15PORT = 12114
6UNIXPATH = /tmp/test-nse-service-nse.unix 16UNIXPATH = /tmp/test-nse-service-nse.unix
7BINARY = gnunet-service-nse 17BINARY = gnunet-service-nse
8#BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/nse/.libs/gnunet-service-nse 18#BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/nse/.libs/gnunet-service-nse
@@ -16,28 +26,24 @@ WORKBITS = 0
16PROOFFILE = $SERVICEHOME/nse.proof 26PROOFFILE = $SERVICEHOME/nse.proof
17 27
18[arm] 28[arm]
19PORT = 0 29DEFAULTSERVICES = core nse
20DEFAULTSERVICES = core
21UNIXPATH = /tmp/test-nse-service-arm.unix 30UNIXPATH = /tmp/test-nse-service-arm.unix
22 31
23[statistics] 32[statistics]
24AUTOSTART = YES 33AUTOSTART = YES
25PORT=0 34PORT = 12115
26 35
27[fs] 36[fs]
28AUTOSTART = NO 37AUTOSTART = NO
29PORT=0
30 38
31[datastore] 39[datastore]
32AUTOSTART = NO 40AUTOSTART = NO
33PORT = 0
34 41
35[dht] 42[dht]
36AUTOSTART = NO 43AUTOSTART = NO
37PORT = 0
38 44
39[nat] 45[nat]
40DISABLEV6 = YES 46DISABLEV6 = YES
41BINDTO = 127.0.0.1 47BINDTO = 127.0.0.1
42ENABLE_UPNP = NO 48ENABLE_UPNP = NO
43BEHIND_NAT = NO 49BEHIND_NAT = NO
@@ -46,31 +52,16 @@ INTERNAL_ADDRESS = 127.0.0.1
46EXTERNAL_ADDRESS = 127.0.0.1 52EXTERNAL_ADDRESS = 127.0.0.1
47 53
48[transport] 54[transport]
49PORT = 0 55plugins = udp
50plugins = unix
51
52[transport-unix]
53PORT = 1
54
55[transport-tcp]
56PORT = 0
57 56
58[transport-udp] 57[transport-udp]
59PORT = 0 58PORT = 12116
60
61[transport-http]
62PORT = 0
63
64[transport-https]
65PORT = 0
66 59
67[core] 60[core]
68AUTOSTART = YES 61AUTOSTART = YES
69PORT = 0
70 62
71[peerinfo] 63[peerinfo]
72AUTOSTART = YES 64AUTOSTART = YES
73PORT = 0
74 65
75[dns] 66[dns]
76AUTOSTART = NO 67AUTOSTART = NO
@@ -82,10 +73,7 @@ AUTOSTART = NO
82AUTOSTART = NO 73AUTOSTART = NO
83 74
84[resolver] 75[resolver]
85PORT = 0 76AUTOSTART = YES
86
87[ats]
88PORT = 0
89 77
90[mesh] 78[mesh]
91AUTOSTART = NO 79AUTOSTART = NO
@@ -99,35 +87,6 @@ AUTOSTART = NO
99[vpn] 87[vpn]
100AUTOSTART = NO 88AUTOSTART = NO
101 89
102[testing]
103WEAKRANDOM = YES
104
105[testing_old]
106NUM_PEERS = 2000
107TOPOLOGY = NONE
108#CONNECT_TOPOLOGY = SMALL_WORLD_RING
109CONNECT_TOPOLOGY = ERDOS_RENYI
110CONNECT_TOPOLOGY_OPTION = CONNECT_MINIMUM
111CONNECT_TOPOLOGY_OPTION_MODIFIER = 5
112# PERCENTAGE = 3
113PROBABILITY = .1
114F2F = NO
115CONNECT_TIMEOUT = 360 s
116CONNECT_ATTEMPTS = 3
117#HOSTKEYSFILE = ../../contrib/testing_hostkeys.dat
118HOSTKEYSFILE = hostkeys.dat
119MAX_CONCURRENT_SSH = 20
120USE_PROGRESSBARS = YES
121PEERGROUP_TIMEOUT = 1000 s
122TOPOLOGY_OUTPUT_FILE = nse_topo_2000_peers_initial
123MAX_OUTSTANDING_CONNECTIONS = 100
124#SINGLE_PEERINFO_PER_HOST = YES
125#NUM_PEERINFO_PER_HOST = 10
126#SINGLE_STATISTICS_PER_HOST = YES
127#NUM_STATISTICS_PER_HOST = 10
128DELETE_FILES = NO
129#SKEW_VARIANCE = 30000
130
131[nse-profiler] 90[nse-profiler]
132OUTPUT_FILE = nse_output_2000_peers.dat 91OUTPUT_FILE = nse_output_2000_peers.dat
133TOPOLOGY_OUTPUT_FILE = nse_topo_2000_peers 92TOPOLOGY_OUTPUT_FILE = nse_topo_2000_peers