[tor-bugs] #2704 [Tor Relay]: BandwidthObserved higher than BandwidthBurst

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Thu Mar 10 22:33:43 UTC 2011


#2704: BandwidthObserved higher than BandwidthBurst
-----------------------------------------------+----------------------------
 Reporter:  keb                                |          Owner:                     
     Type:  defect                             |         Status:  new                
 Priority:  normal                             |      Milestone:  Tor: 0.2.2.x-final 
Component:  Tor Relay                          |        Version:  Tor: 0.2.2.23-alpha
 Keywords:  0.2.2.23-alpha bandwidth observed  |         Parent:                     
   Points:                                     |   Actualpoints:                     
-----------------------------------------------+----------------------------

Comment(by arma):

 {{{
     maxval = b->maxima[i] / NUM_SECS_ROLLING_MEASURE;
 }}}
 implies that maxval is a per-second amount, whereas b->maxima is a
 per-10-second amount. So the Maxima we write to the state file is a per-
 second amount.

 Then when we read it, we
 {{{
        v = tor_parse_uint64(cp, 10, 0, UINT64_MAX, &ok, NULL);
         if (have_maxima) {
           maxstr = smartlist_get(s_maxima, cp_sl_idx);
           mv = tor_parse_uint64(maxstr, 10, 0, UINT64_MAX, &ok_m, NULL);
           mv *= NUM_SECS_ROLLING_MEASURE;
         } else {
           /* No maxima known; guess average rate to be conservative. */
           mv = v / s_interval;
         }
 }}}
 and then
 {{{
           b->max_total = mv;
 }}}
 where max_total is also a per-10-second amount. So
 {{{
           mv = v / s_interval;
 }}}
 ought to be
 {{{
           mv = v / s_internal * NUM_SECS_ROLLING_MEASURE;
 }}}

 But that's not our bug, since it would produce smaller numbers not larger
 numbers. But it is a bug.

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


More information about the tor-bugs mailing list