[tor-bugs] #12877 [Tor]: Investigate Unmeasured relays that get the Fast flag

Tor Bug Tracker & Wiki blackhole at torproject.org
Sun Aug 17 12:37:26 UTC 2014


#12877: Investigate Unmeasured relays that get the Fast flag
------------------------+--------------------------
     Reporter:  asn     |      Owner:
         Type:  defect  |     Status:  new
     Priority:  normal  |  Milestone:  Tor: 0.2.???
    Component:  Tor     |    Version:
   Resolution:          |   Keywords:
Actual Points:          |  Parent ID:
       Points:          |
------------------------+--------------------------

Comment (by asn):

 Looking at `set_routerstatus_from_routerinfo()` we have:
 {{{
   rs->is_fast = node->is_fast =
     router_is_active(ri, node, now) &&
     !dirserv_thinks_router_is_unreliable(now, ri, 0, 1);
 }}}

 And in `dirserv_thinks_router_is_unreliable()` we have:
 {{{
   if (need_capacity) {
     uint32_t bw_kb = dirserv_get_credible_bandwidth_kb(router);
     if (bw_kb < fast_bandwidth_kb)
       return 1;
   }
   return 0;
 }}}
 which is straightforward and relies on
 `dirserv_get_credible_bandwidth_kb()`.

 So, now let's dig into the interesting function
 `dirserv_get_credible_bandwidth_kb()`, which tells us:
 {{{
 /** Return the bandwidth we believe for assigning flags; prefer measured
  * over advertised, and if we have above a threshold quantity of measured
  * bandwidths, we don't want to ever give flags to unmeasured routers, so
  * return 0. */
 }}}

 The threshold is enforced here:
 {{{
   /* Check if we have a measured bandwidth, and check the threshold if not
 */
   if (!(dirserv_query_measured_bw_cache_kb(ri->cache_info.identity_digest,
                                        &mbw_kb, NULL))) {
     threshold = get_options()->MinMeasuredBWsForAuthToIgnoreAdvertised;
     if (routers_with_measured_bw > threshold) {
       /* Return zero for unmeasured bandwidth if we are above threshold */
       bw_kb = 0;
 }}}

 Since, bwauths are enabled, I would have assumed that we are above that
 threshold and the bandwidth value for all unmeasured relays would be set
 to `0`, however since unmeasured relays get the `Fast` flag it probably
 isn't the case.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/12877#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list