diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-03-19 09:58:55 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-03-19 09:58:55 +0000 |
commit | 5df7f24fe0f8371c931b78a135c864af8e167c6a (patch) | |
tree | 8eaf46f077969aeaacc1767ba6b3e5ea6f88b920 /src/nse | |
parent | 453364efe4a8f3d1bfd57bca478d8b0ebc1d1fc8 (diff) | |
download | gnunet-5df7f24fe0f8371c931b78a135c864af8e167c6a.tar.gz gnunet-5df7f24fe0f8371c931b78a135c864af8e167c6a.zip |
- working version of NSE profiler
Diffstat (limited to 'src/nse')
-rw-r--r-- | src/nse/gnunet-nse-profiler.c | 31 | ||||
-rw-r--r-- | src/nse/nse_profiler_test.conf | 75 |
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] |
2 | SERVICEHOME = /tmp/nse-profiler/ | 2 | SERVICEHOME = /tmp/nse-profiler/ |
3 | 3 | ||
4 | [testbed] | ||
5 | AUTOSTART = NO | ||
6 | PORT = 12113 | ||
7 | ACCEPT_FROM = 127.0.0.1; 10.6.0.0/16; | ||
8 | HOSTNAME = localhost | ||
9 | MAX_PARALLEL_TOPOLOGY_CONFIG_OPERATIONS = 5 | ||
10 | OVERLAY_TOPOLOGY = RANDOM | ||
11 | OVERLAY_RANDOM_LINKS = 10 | ||
12 | OPERATION_TIMEOUT = 45 s | ||
13 | |||
4 | [nse] | 14 | [nse] |
5 | PORT = 0 | 15 | PORT = 12114 |
6 | UNIXPATH = /tmp/test-nse-service-nse.unix | 16 | UNIXPATH = /tmp/test-nse-service-nse.unix |
7 | BINARY = gnunet-service-nse | 17 | BINARY = 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 | |||
16 | PROOFFILE = $SERVICEHOME/nse.proof | 26 | PROOFFILE = $SERVICEHOME/nse.proof |
17 | 27 | ||
18 | [arm] | 28 | [arm] |
19 | PORT = 0 | 29 | DEFAULTSERVICES = core nse |
20 | DEFAULTSERVICES = core | ||
21 | UNIXPATH = /tmp/test-nse-service-arm.unix | 30 | UNIXPATH = /tmp/test-nse-service-arm.unix |
22 | 31 | ||
23 | [statistics] | 32 | [statistics] |
24 | AUTOSTART = YES | 33 | AUTOSTART = YES |
25 | PORT=0 | 34 | PORT = 12115 |
26 | 35 | ||
27 | [fs] | 36 | [fs] |
28 | AUTOSTART = NO | 37 | AUTOSTART = NO |
29 | PORT=0 | ||
30 | 38 | ||
31 | [datastore] | 39 | [datastore] |
32 | AUTOSTART = NO | 40 | AUTOSTART = NO |
33 | PORT = 0 | ||
34 | 41 | ||
35 | [dht] | 42 | [dht] |
36 | AUTOSTART = NO | 43 | AUTOSTART = NO |
37 | PORT = 0 | ||
38 | 44 | ||
39 | [nat] | 45 | [nat] |
40 | DISABLEV6 = YES | 46 | DISABLEV6 = YES |
41 | BINDTO = 127.0.0.1 | 47 | BINDTO = 127.0.0.1 |
42 | ENABLE_UPNP = NO | 48 | ENABLE_UPNP = NO |
43 | BEHIND_NAT = NO | 49 | BEHIND_NAT = NO |
@@ -46,31 +52,16 @@ INTERNAL_ADDRESS = 127.0.0.1 | |||
46 | EXTERNAL_ADDRESS = 127.0.0.1 | 52 | EXTERNAL_ADDRESS = 127.0.0.1 |
47 | 53 | ||
48 | [transport] | 54 | [transport] |
49 | PORT = 0 | 55 | plugins = udp |
50 | plugins = unix | ||
51 | |||
52 | [transport-unix] | ||
53 | PORT = 1 | ||
54 | |||
55 | [transport-tcp] | ||
56 | PORT = 0 | ||
57 | 56 | ||
58 | [transport-udp] | 57 | [transport-udp] |
59 | PORT = 0 | 58 | PORT = 12116 |
60 | |||
61 | [transport-http] | ||
62 | PORT = 0 | ||
63 | |||
64 | [transport-https] | ||
65 | PORT = 0 | ||
66 | 59 | ||
67 | [core] | 60 | [core] |
68 | AUTOSTART = YES | 61 | AUTOSTART = YES |
69 | PORT = 0 | ||
70 | 62 | ||
71 | [peerinfo] | 63 | [peerinfo] |
72 | AUTOSTART = YES | 64 | AUTOSTART = YES |
73 | PORT = 0 | ||
74 | 65 | ||
75 | [dns] | 66 | [dns] |
76 | AUTOSTART = NO | 67 | AUTOSTART = NO |
@@ -82,10 +73,7 @@ AUTOSTART = NO | |||
82 | AUTOSTART = NO | 73 | AUTOSTART = NO |
83 | 74 | ||
84 | [resolver] | 75 | [resolver] |
85 | PORT = 0 | 76 | AUTOSTART = YES |
86 | |||
87 | [ats] | ||
88 | PORT = 0 | ||
89 | 77 | ||
90 | [mesh] | 78 | [mesh] |
91 | AUTOSTART = NO | 79 | AUTOSTART = NO |
@@ -99,35 +87,6 @@ AUTOSTART = NO | |||
99 | [vpn] | 87 | [vpn] |
100 | AUTOSTART = NO | 88 | AUTOSTART = NO |
101 | 89 | ||
102 | [testing] | ||
103 | WEAKRANDOM = YES | ||
104 | |||
105 | [testing_old] | ||
106 | NUM_PEERS = 2000 | ||
107 | TOPOLOGY = NONE | ||
108 | #CONNECT_TOPOLOGY = SMALL_WORLD_RING | ||
109 | CONNECT_TOPOLOGY = ERDOS_RENYI | ||
110 | CONNECT_TOPOLOGY_OPTION = CONNECT_MINIMUM | ||
111 | CONNECT_TOPOLOGY_OPTION_MODIFIER = 5 | ||
112 | # PERCENTAGE = 3 | ||
113 | PROBABILITY = .1 | ||
114 | F2F = NO | ||
115 | CONNECT_TIMEOUT = 360 s | ||
116 | CONNECT_ATTEMPTS = 3 | ||
117 | #HOSTKEYSFILE = ../../contrib/testing_hostkeys.dat | ||
118 | HOSTKEYSFILE = hostkeys.dat | ||
119 | MAX_CONCURRENT_SSH = 20 | ||
120 | USE_PROGRESSBARS = YES | ||
121 | PEERGROUP_TIMEOUT = 1000 s | ||
122 | TOPOLOGY_OUTPUT_FILE = nse_topo_2000_peers_initial | ||
123 | MAX_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 | ||
128 | DELETE_FILES = NO | ||
129 | #SKEW_VARIANCE = 30000 | ||
130 | |||
131 | [nse-profiler] | 90 | [nse-profiler] |
132 | OUTPUT_FILE = nse_output_2000_peers.dat | 91 | OUTPUT_FILE = nse_output_2000_peers.dat |
133 | TOPOLOGY_OUTPUT_FILE = nse_topo_2000_peers | 92 | TOPOLOGY_OUTPUT_FILE = nse_topo_2000_peers |