[tor-bugs] #4712 [Tor Relay]: Review and update any existing patches for proposal 182

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Thu Mar 8 09:14:06 UTC 2012


#4712: Review and update any existing patches for proposal 182
-----------------------+----------------------------------------------------
 Reporter:  karsten    |          Owner:                  
     Type:  task       |         Status:  new             
 Priority:  normal     |      Milestone:  Tor: unspecified
Component:  Tor Relay  |        Version:                  
 Keywords:             |         Parent:  #4682           
   Points:             |   Actualpoints:                  
-----------------------+----------------------------------------------------

Comment(by arma):

 I opened #5336 to ask Kevin and Rob to do simulations on this.

 In the meantime, here are some early notes on fixes the patch will need:

 {{{
 -  if (connection_counts_as_relayed_traffic(conn, now) &&
 +  if (get_options()->CreditBucket) {
 +   /*write_limit = y + x + M */
 +   global_bucket = global_read_bucket + global_write_bucket
 +       + (int)get_options()->OutgoingBandwidthBurst;
 +   if (global_bucket < 0)
 +     global_bucket = 0;
 +  } else if (connection_counts_as_relayed_traffic(conn, now) &&
 }}}
 - looks like it's doing the credit bucket thing even for conns that do not
 count as relayed traffic (i.e. that fall under BandwidthRate but not
 RelayBandwidthRate). If a Tor client (or relay also used as a client)
 turns on CreditBucket, it will start counting its own traffic and
 directory fetches in some parts of the credit buckets but not others.

 {{{
      global_relayed_read_bucket -= (int)num_read;
      global_relayed_write_bucket -= (int)num_written;
 +
 +    global_read_bucket -= (int)num_read;
 +    if (get_options()->CreditBucket) {
 }}}
 - similarly, here it ignores the changes to global_relayed_foo_bucket.

 - I want to check to make sure that write_bucket is still going negative
 and discouraging us from answering e.g. directory queries. This topic is
 messier since if most relays start declining to answer directory fetches,
 we need to change the algorithm for where clients should go (thus piling
 on even more load to the remaining ones, possibly causing a chain of
 problems).

 - "OutgoingBandwidthBurst 10 MB" is a huge default. It's probably better
 set to [Relay]BandwidthBurst.

 - That said, I wonder if there are situations where the write bucket gets
 dragged down and it basically lives right around
 "0-OutgoingBandwidthBurst", thus putting the relay right back into the
 situation that this patch is trying to solve. We might instrument the
 patch to warn if the write bucket spends too many seconds too close to
 that value.

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


More information about the tor-bugs mailing list