[tor-bugs] #24250 [Core Tor/Tor]: In a private network some relays advertise zero bandwidth-observed

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Apr 19 21:16:19 UTC 2018


#24250: In a private network some relays advertise zero bandwidth-observed
-------------------------------------------------+-------------------------
 Reporter:  Sebastian                            |          Owner:  (none)
     Type:  defect                               |         Status:  new
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  unspecified
Component:  Core Tor/Tor                         |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  029-backport, 031-backport,          |  Actual Points:
  032-backport, 033-backport,                    |
  034-triage-20180328, 034-removed-20180328      |
Parent ID:                                       |         Points:  1
 Reviewer:                                       |        Sponsor:
-------------------------------------------------+-------------------------
Changes (by teor):

 * keywords:  034-triage-20180328, 034-removed-20180328 =>
     029-backport, 031-backport, 032-backport, 033-backport,
     034-triage-20180328, 034-removed-20180328
 * points:   => 1


Comment:

 Here's one source of this bug:
 * the relay measures its own bandwidth rate in bytes per seconds, then
 divides by 1024 to get kilobytes per second. When the bytes per second
 figure is less than 1024, the result is zero.

 Here's how I suggest we make progress on this issue:
 * fix the truncation bug by always rounding up: make N / 1024 become (N +
 1023)/1024 (we don't need to check for overflow in the addition if it's
 64-bit arithmetic)
 * if we are about to publish a descriptor with 0 bandwidth, work out why,
 and log a diagnostic, then publish a descriptor with 1 bandwidth - this
 fixes a bunch of torflow / tor bugs where they can't handle 0 bandwidths.

 Here are the different diagnostics I can think of:
   * just started up, don't have 24 hours of bandwidth history - info level
   * a tor relay should always be using some bandwidth, so if we end up
 with zero otherwise, we should log a BUG with our uptime, inbound and
 outbound bandwidths, and the length of our bandwidth history

 We should backport the "always publish 1 or greater" fix to 0.2.9 and
 later. Maybe we should backport the diagnostic logging if it's not too
 big.

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


More information about the tor-bugs mailing list