Opened 5 years ago

Closed 4 years ago

Last modified 3 years ago

#12877 closed defect (duplicate)

Investigate Unmeasured relays that get the Fast flag

Reported by: asn Owned by:
Priority: High Milestone:
Component: Core Tor/Tor Version:
Severity: Keywords: 026-triaged-1, 027-triaged-1-out
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

I was looking at some consensuses today, and I noticed that there are many Unmeasured relays with the Fast flag, which doesn't seem right.

For example, in valid-after 2014-08-17 12:00:00 we have:

r k33ac R5oMCf+qgKvU/WE6nmB5/7/Vhlc E3tqtWZ92BE1vbOP4Wg1PKp241c 2014-08-17 02:11:59 50.38.49.173 443 9030
s Fast HSDir Running Stable V2Dir Valid
v Tor 0.2.4.23
w Bandwidth=20 Unmeasured=1

This is an investigative trac ticket, since I'm not sure if this behavior is a feature or a bug yet.

Child Tickets

Change History (17)

comment:1 Changed 5 years ago 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.

comment:2 Changed 5 years ago by asn

And here is an attempt to emulate that threshold without being an authority:

$ grep Bandwidth consensus.z  | grep -v Unmeasured | wc -l
5616
$ grep Bandwidth consensus.z  | grep Unmeasured | wc -l
467

which means that there are 467 unmeasured relays and 5616 measured ones.

And we have:

  V(MinMeasuredBWsForAuthToIgnoreAdvertised, INT, "500"),

comment:3 Changed 5 years ago by nickm

Milestone: Tor: 0.2.???Tor: 0.2.6.x-final
Priority: normalmajor

comment:4 Changed 5 years ago by nickm

Keywords: 026-triaged-1 added

comment:5 Changed 5 years ago by arma

I assume the issue here is that only a minority of dir auths run bwauths, so the non-measuring ones are the ones that dictate the flags.

comment:6 Changed 5 years ago by Sebastian

You're right, but I'm not even convinced if that is bad in the current network where the bwauths miss massive amounts of relays for extended amounts of time

comment:7 Changed 5 years ago by Sebastian

This bug goes both ways: There are also measured relays deserving the fast flag but not getting it

comment:8 Changed 5 years ago by nickm

Milestone: Tor: 0.2.6.x-finalTor: 0.2.7.x-final

comment:9 Changed 5 years ago by nickm

Status: newassigned

comment:10 Changed 5 years ago by arma

Is there anything more to this bug? We have investigated and I think my explanation is right.

comment:11 Changed 5 years ago by nickm

Keywords: 027-triaged-1-out added

Marking triaged-out items from first round of 0.2.7 triage.

comment:12 Changed 5 years ago by nickm

Milestone: Tor: 0.2.7.x-finalTor: 0.2.???

Make all non-needs_review, non-needs_revision, 027-triaged-1-out items belong to 0.2.???

comment:13 Changed 5 years ago by arma

asn: ok to close?

comment:14 Changed 5 years ago by teor

So is the solution for this to run more bwauths?

comment:15 in reply to:  14 Changed 4 years ago by arma

Resolution: duplicate
Status: assignedclosed

Replying to teor:

So is the solution for this to run more bwauths?

Yes. And/or to implement #11327.

I'm going to close this one -- we can continue in #11327.

comment:16 Changed 3 years ago by teor

Milestone: Tor: 0.2.???Tor: 0.3.???

Milestone renamed

comment:17 Changed 3 years ago by nickm

Milestone: Tor: 0.3.???

Milestone deleted

Note: See TracTickets for help on using tickets.