[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #22453 [Core Tor/Tor]: Relays should regularly do a larger bandwidth self-test



#22453: Relays should regularly do a larger bandwidth self-test
-------------------------------------------------+-------------------------
 Reporter:  arma                                 |          Owner:  juga
     Type:  enhancement                          |         Status:
                                                 |  assigned
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  unspecified
Component:  Core Tor/Tor                         |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  034-triage-20180328,                 |  Actual Points:
  034-removed-20180328, tor-bwauth               |
Parent ID:  #25925                               |         Points:
 Reviewer:                                       |        Sponsor:
-------------------------------------------------+-------------------------

Comment (by teor):

 Replying to [comment:16 juga]:
 > Diving into the code i found that the function where the relay bandwidth
 is compared with `options->AuthDirGuardBWGuarantee` is in
 `set_routerstatus_from_routerinfo` [0].

 You should make the default value of AuthDirGuardBWGuarantee into a
 #define, and use it when you work out how much data to send during a relay
 self-test.

 > To obtain the relay bandwidth, that function calls
 `dirserv_get_credible_bandwidth_kb` [1] which seems to be using either the
 measured bandwidth (by bwauths) or the self advertised bandwidth, but not
 any self measured bandwidth.

 You should not change the directory authority code, because this ticket is
 about relay self-tests.

 > If i understand it correctly, the self measured bandwidth
 (`bandwidthcapacity`) is obtained by `rep_hist_bandwidth_assess` [2].
 >
 > The function that is making use of the circuits to test the bandwidth is
 `router_perform_bandwidth_test` [3] but i don't see how it is storing the
 results or how is related with the previous.
 >
 > So, should `dirserv_get_credible_bandwidth_kb` make use of the bandwidth
 calculated by self tests?, which are the self tests here to be used?

 When a relay performs a bandwidth self-test, the bandwidth usage from the
 self-test is recorded in the bandwidth history. Then every 24 hours, the
 relay puts the highest bandwidth from its history in its descriptor as the
 observed bandwidth. Then torflow reads the descriptor, and uses the
 observed bandwidth to calculate the consensus weight.

 > Where in the code should go the `times out after 30-60`?

 When you start the test, schedule a timer for 30-60 seconds that cancels
 the test of it is still going.

 > and the `12-24 hours, at random`?

 When the relay completes a bandwidth self-test, you should create a timer
 that changes the bandwidth self-test flag from "completed" to "do a self-
 test" in 12-24 hours. If the self-test times out, you should schedule the
 next test in 1-2 hours.

 > [0] https://gitweb.torproject.org/tor.git/tree/src/or/dirserv.c#n2058
 > [1] https://gitweb.torproject.org/tor.git/tree/src/or/dirserv.c#n1780
 > [2] https://gitweb.torproject.org/tor.git/tree/src/or/rephist.c#n1207
 > [3] https://gitweb.torproject.org/tor.git/tree/src/or/router.c#n1626

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/22453#comment:17>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs