cleanup
authorChristian Grothoff <christian@grothoff.org>
Mon, 1 Aug 2011 08:18:39 +0000 (08:18 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 1 Aug 2011 08:18:39 +0000 (08:18 +0000)
src/nse/gnunet-service-nse.c
src/nse/nse.h
src/nse/test_nse.conf
src/nse/test_nse_multipeer.c

index b0a8a143525ca7c78e5c71d52fafcf77bb5ba092..84a4ea9f04bff046fdc59e166595e4a803afd0be 100644 (file)
 #include "gnunet_nse_service.h"
 #include "nse.h"
 
-#define NODELAYS GNUNET_NO
+/**
+ * Should messages be delayed randomly?  This option should be set to
+ * GNUNET_NO only for experiments, not in production.  It should also
+ * be removed once the initial experiments have been completed.
+ */
+#define USE_RANDOM_DELAYS GNUNET_YES
 
 /**
  * Should we generate a histogram with the time stamps of when we received
  * NSE messages to disk? (for performance evaluation only, not useful in
- * production)
+ * production).  The associated code should also probably be removed
+ * once we're done with experiments.
  */
 #define ENABLE_HISTOGRAM GNUNET_NO
 
@@ -84,8 +90,10 @@ static struct GNUNET_TIME_Relative gnunet_nse_interval;
  */
 static struct GNUNET_TIME_Relative proof_find_delay;
 
-
 #if ENABLE_HISTOGRAM
+/**
+ * Handle for writing when we received messages to disk.
+ */
 static struct GNUNET_BIO_WriteHandle *wh;
 #endif
 
@@ -393,9 +401,7 @@ get_matching_bits_delay (uint32_t matching_bits)
 static struct GNUNET_TIME_Relative 
 get_delay_randomization (uint32_t matching_bits)
 {
-#if NODELAYS
-  return GNUNET_TIME_UNIT_ZERO;
-#else
+#if USE_RANDOM_DELAYS
   struct GNUNET_TIME_Relative ret;
 
   if (matching_bits == 0)
@@ -403,6 +409,8 @@ get_delay_randomization (uint32_t matching_bits)
   ret.rel_value = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
                                            (uint32_t) (get_matching_bits_delay (matching_bits - 1) / (double) (hop_count_max + 1)));
   return ret;
+#else
+  return GNUNET_TIME_UNIT_ZERO;
 #endif
 }
 
@@ -448,11 +456,11 @@ get_transmit_delay (int round_offset)
     {
     case -1:
       /* previous round is randomized between 0 and 50 ms */
-#if NODELAYS
-      ret = GNUNET_TIME_UNIT_ZERO;
-#else
+#if USE_RANDOM_DELAYS
       ret.rel_value = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
                                                50);
+#else
+      ret = GNUNET_TIME_UNIT_ZERO;
 #endif
 #if DEBUG_NSE
       GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 
index 45748b1f38b29bd573c4bf8cb8fd50c61babe442..38cafafa3ede508a10125608f098d84e9eb67e45 100644 (file)
 
 #include "gnunet_common.h"
 
+/**
+ * Generate debug-level log messages?
+ */
 #define DEBUG_NSE GNUNET_NO
 
-#define VERIFY_CRYPTO GNUNET_NO
-
-
 /**
  * Network size estimate sent from the service
  * to clients.  Contains the current size estimate
index ab64dffe28fd205246f12c9f691a12d6fda2bf47..38910d9c28c5f7a567229eb3d590c5294a11e351 100644 (file)
@@ -9,13 +9,13 @@ BINARY = gnunet-service-nse
 #BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/nse/.libs/gnunet-service-nse
 #PREFIX = valgrind --leak-check=full --log-file=valgrind_nse.%p
 AUTOSTART = YES
-DEBUG = YES
+DEBUG = NO
 CONFIG = $DEFAULTCONFIG
 PROOFFILE = $SERVICEHOME/proof.nse
 # Overriding network settings for faster testing (do NOT use
 # these values in production just because they are here)
 WORKDELAY = 1
-INTERVAL = 120000
+INTERVAL = 5000
 WORKBITS = 1
 
 HISTOGRAM = $SERVICEHOME/nse-histogram
@@ -58,7 +58,7 @@ EXTERNAL_ADDRESS = 127.0.0.1
 AUTOSTART = NO
 
 [testing]
-NUM_PEERS = 100
+NUM_PEERS = 10
 WEAKRANDOM = YES
 TOPOLOGY = NONE
 CONNECT_TOPOLOGY = SMALL_WORLD_RING
index e15892bce4d8a17962201e5af53174d53a5c634c..0f5edeb4874fcdc335ceed0a936c44fe4f7737c0 100644 (file)
@@ -51,7 +51,7 @@ struct NSEPeer *peer_tail;
 /**
  * How long do we run the test?
  */
-#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 60)
+#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
 
 static int ok;