gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r16271 - gnunet/src/nse


From: gnunet
Subject: [GNUnet-SVN] r16271 - gnunet/src/nse
Date: Mon, 1 Aug 2011 10:18:39 +0200

Author: grothoff
Date: 2011-08-01 10:18:39 +0200 (Mon, 01 Aug 2011)
New Revision: 16271

Modified:
   gnunet/src/nse/gnunet-service-nse.c
   gnunet/src/nse/nse.h
   gnunet/src/nse/test_nse.conf
   gnunet/src/nse/test_nse_multipeer.c
Log:
cleanup

Modified: gnunet/src/nse/gnunet-service-nse.c
===================================================================
--- gnunet/src/nse/gnunet-service-nse.c 2011-08-01 08:11:40 UTC (rev 16270)
+++ gnunet/src/nse/gnunet-service-nse.c 2011-08-01 08:18:39 UTC (rev 16271)
@@ -45,12 +45,18 @@
 #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 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 @@
 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 @@
   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 @@
     {
     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, 

Modified: gnunet/src/nse/nse.h
===================================================================
--- gnunet/src/nse/nse.h        2011-08-01 08:11:40 UTC (rev 16270)
+++ gnunet/src/nse/nse.h        2011-08-01 08:18:39 UTC (rev 16271)
@@ -30,11 +30,11 @@
 
 #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

Modified: gnunet/src/nse/test_nse.conf
===================================================================
--- gnunet/src/nse/test_nse.conf        2011-08-01 08:11:40 UTC (rev 16270)
+++ gnunet/src/nse/test_nse.conf        2011-08-01 08:18:39 UTC (rev 16271)
@@ -9,13 +9,13 @@
 #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 @@
 AUTOSTART = NO
 
 [testing]
-NUM_PEERS = 100
+NUM_PEERS = 10
 WEAKRANDOM = YES
 TOPOLOGY = NONE
 CONNECT_TOPOLOGY = SMALL_WORLD_RING

Modified: gnunet/src/nse/test_nse_multipeer.c
===================================================================
--- gnunet/src/nse/test_nse_multipeer.c 2011-08-01 08:11:40 UTC (rev 16270)
+++ gnunet/src/nse/test_nse_multipeer.c 2011-08-01 08:18:39 UTC (rev 16271)
@@ -51,7 +51,7 @@
 /**
  * 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;
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]