[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r16793 - gnunet/src/dht
From: |
gnunet |
Subject: |
[GNUnet-SVN] r16793 - gnunet/src/dht |
Date: |
Tue, 13 Sep 2011 12:29:11 +0200 |
Author: grothoff
Date: 2011-09-13 12:29:11 +0200 (Tue, 13 Sep 2011)
New Revision: 16793
Modified:
gnunet/src/dht/gnunet-service-dht.c
Log:
NSE also replaces max_hops
Modified: gnunet/src/dht/gnunet-service-dht.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht.c 2011-09-13 10:26:05 UTC (rev 16792)
+++ gnunet/src/dht/gnunet-service-dht.c 2011-09-13 10:29:11 UTC (rev 16793)
@@ -23,6 +23,10 @@
* @brief GNUnet DHT service
* @author Christian Grothoff
* @author Nathan Evans
+ *
+ * TODO:
+ * - decide which 'benchmark'/test functions to keep
+ * - estiamte_diameter?
*/
#include "platform.h"
@@ -161,12 +165,6 @@
#define DHT_DEFAULT_PING_DELAY
GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 1)
/**
- * Real maximum number of hops, at which point we refuse
- * to forward the message.
- */
-#define DEFAULT_MAX_HOPS 10
-
-/**
* How many time differences between requesting a core send and
* the actual callback to remember.
*/
@@ -781,21 +779,11 @@
static unsigned int lowest_bucket; /* Initially equal to MAX_BUCKETS - 1
*/
/**
- * The maximum number of hops before we stop routing messages.
- */
-static unsigned long long max_hops;
-
-/**
* How often to republish content we have previously stored.
*/
static struct GNUNET_TIME_Relative dht_republish_frequency;
/**
- * GNUNET_YES to stop at max_hops, GNUNET_NO to heuristically decide when to
stop forwarding.
- */
-static int use_max_hops;
-
-/**
* The buckets (Kademlia routing table, complete with growth).
* Array of size MAX_BUCKET_SIZE.
*/
@@ -3051,9 +3039,6 @@
diameter = estimate_diameter ();
- if (GNUNET_NO == use_max_hops)
- max_hops = (diameter + 1) * 2;
-
/**
* If we are behaving in strict kademlia mode, send multiple initial
requests,
* but then only send to 1 or 0 peers based strictly on the number of hops.
@@ -3062,7 +3047,7 @@
{
if (hop_count == 0)
return kademlia_replication;
- if (hop_count < max_hops)
+ if (hop_count < log_of_network_size_estimate * 2.0)
return 1;
return 0;
}
@@ -3071,7 +3056,7 @@
* routing right? The estimation below only works if we think we have
reasonably
* full routing tables, which for our RR topologies may not be the case!
*/
- if (hop_count > max_hops)
+ if (hop_count > log_of_network_size_estimate * 2.0)
{
#if DEBUG_DHT
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -5008,19 +4993,7 @@
malicious_get_frequency = DEFAULT_MALICIOUS_GET_FREQUENCY;
}
- if (GNUNET_YES !=
- GNUNET_CONFIGURATION_get_value_number (cfg, "DHT", "MAX_HOPS",
&max_hops))
- {
- max_hops = DEFAULT_MAX_HOPS;
- }
-
if (GNUNET_YES ==
- GNUNET_CONFIGURATION_get_value_yesno (cfg, "DHT", "USE_MAX_HOPS"))
- {
- use_max_hops = GNUNET_YES;
- }
-
- if (GNUNET_YES ==
GNUNET_CONFIGURATION_get_value_yesno (cfg, "dht", "malicious_putter"))
{
malicious_putter = GNUNET_YES;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r16793 - gnunet/src/dht,
gnunet <=