gnunet-developers
[Top][All Lists]
Advanced

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

[GNUnet-developers] Query TTL question


From: Hendrik Pagenhardt
Subject: [GNUnet-developers] Query TTL question
Date: Thu, 22 Jan 2004 09:38:59 +0100

Hello,

I noticed quite high numbers in the statistics of my gnunetd regarding
p2p namespace queries:

Uptime (seconds)                                            :            76770
# p2p queries sent                                          :          2312962
# p2p queries received                                      :           500532
# p2p super queries received                                :           330263
# p2p CHK content received (kb)                             :           162462
# p2p search results received (kb)                          :            90859
# client queries received                                   :            13443
# client CHK content inserted (kb)                          :                0
# client 3HASH search results inserted (kb)                 :                0
# client file index requests received                       :                0
# file index requests received                              :                0
# super query index requests received                       :                0
# client CHK content deleted (kb)                           :                0
# client 3HASH search results deleted (kb)                  :                0
# client file unindex requests received                     :                0
# file unindex requests received                            :                0
# super query unindex requests received                     :                0
# client SBlock insert requests received                    :                0
# client namespace queries received                         :                0
# p2p namespace queries received                            :         14142350
# p2p SBlocks received                                      :               81

So that means my node receives about 184 namespace queries per second.
Compared to the other query numbers this appears very high. Is this
normal behavior? And if yes, why are so many NS queries floating the
network?

I looked through the sources then and found the following in handler.c:

  if (ttl < 0) {
    ttl = ttl - 2*TTL_DECREMENT - randomi(TTL_DECREMENT);
    if (ttl > 0)
      return OK; /* just abort */
  } else
    ttl = ttl - 2*TTL_DECREMENT - randomi(TTL_DECREMENT);

This is part of "handleNSQUERY" and "handleQUERY" and is executed before
the query is evaluated. When I read it correctly, it decrements the TTL
by between twice and three times TTL_DECREMENT. When the TTL was
negative before, it is tested after the decrement to be positive, and if
true handling the query is aborted. In effect this means that when an
underflow of the TTL occurs, it is dropped? And only then? Shouldn't it
be dropped when the TTL becomes negative with a certain probability?

And there is a difference between "handleNSQUERY" and "handleQUERY":

  /* adjust TTL */
  if ( (ttl > 0) &&
       (ttl > (int)(prio+3)*TTL_DECREMENT) )
    ttl = (int) (prio+3)*TTL_DECREMENT; /* bound! */

This is only used in "handleQUERY", but I think it should be done also
for namespace queries...

Ciao,
     Hendrik





reply via email to

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