[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-dev] Existing Tor Guard Selection Algorithm
- To: Reinaldo Junior <rjunior@xxxxxxxxxxxxxxxx>
- Subject: Re: [tor-dev] Existing Tor Guard Selection Algorithm
- From: George Kadianakis <desnacked@xxxxxxxxxx>
- Date: Mon, 15 Feb 2016 14:27:16 +0200
- Cc: Ola Bini <obini@xxxxxxxxxxxxxxxx>, Fan Jiang <fanjiang@xxxxxxxxxxxxxxxx>, Tania Silva <tsilva@xxxxxxxxxxxxxxxx>, Ivan Pazmino <ipazmino@xxxxxxxxxxxxxxxx>, "asn@xxxxxxxxxxxxxx" <asn@xxxxxxxxxxxxxx>, "tor-dev@xxxxxxxxxxxxxxxxxxxx" <tor-dev@xxxxxxxxxxxxxxxxxxxx>
- Delivered-to: archiver@xxxxxxxx
- Delivery-date: Mon, 15 Feb 2016 07:28:08 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1455539275; bh=4vWy9XMIGQEzaDJgxPiWF5cSU1ibUCtccY74DJmMBTc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=LqPnPxuawI2BdhQ2tRVc/rNHuUNNnjySKK1GCFbZEbYLUENnLqRTmZou5H3EGSV/0 6SVLEZ9QIPwbQN/QjKv6aX2uzgaZqGlYeqx0foeKLylt8N8h2uOWRSiuYupu1W0VKr i1/GaNwFNDV/QPL7DhS95DUI3WsqNhqODsbCYUeM=
- In-reply-to: <CAHOpymMYZAyBHtaNSfGmeOXH_H1eXk6bj-_bOg8fCzsb2cskTQ@xxxxxxxxxxxxxx> (Reinaldo Junior's message of "Thu, 11 Feb 2016 11:57:31 -0500")
- List-archive: <http://lists.torproject.org/pipermail/tor-dev/>
- List-help: <mailto:tor-dev-request@lists.torproject.org?subject=help>
- List-id: discussion regarding Tor development <tor-dev.lists.torproject.org>
- List-post: <mailto:tor-dev@lists.torproject.org>
- List-subscribe: <https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev>, <mailto:tor-dev-request@lists.torproject.org?subject=subscribe>
- List-unsubscribe: <https://lists.torproject.org/cgi-bin/mailman/options/tor-dev>, <mailto:tor-dev-request@lists.torproject.org?subject=unsubscribe>
- References: <CADGuLM6bLy1OUnVa=ZFpJFAdLyQgQ7tObaYrx=v-NZ6xZ6XP3g@xxxxxxxxxxxxxx> <87oabnv23b.fsf@xxxxxxxxxx> <CAHOpymMYZAyBHtaNSfGmeOXH_H1eXk6bj-_bOg8fCzsb2cskTQ@xxxxxxxxxxxxxx>
- Reply-to: tor-dev@xxxxxxxxxxxxxxxxxxxx
- Sender: "tor-dev" <tor-dev-bounces@xxxxxxxxxxxxxxxxxxxx>
Reinaldo Junior <rjunior@xxxxxxxxxxxxxxxx> writes:
> On Thu, Feb 11, 2016 at 7:55 AM, George Kadianakis <desnacked@xxxxxxxxxx>
> wrote:
>
>> Chelsea Komlo <ckomlo@xxxxxxxxxxxxxxxx> writes:
>>
>> > Hi George,
>> >
>> > Thanks for your help with this!
>> >
>> > We wrote up our high-level understanding of the current Tor guard
>> selection
>> > algorithm here:
>> >
>> > https://gist.github.com/chelseakomlo/2acbe15314b5a809c6f4
>> >
>> > This has more than our python simulation, but less than the actual Tor
>> > implementation. For example, it is missing conditions like prioritization
>> > by uptime, capacity, etc.
>> >
>> >
>> https://github.com/twstrike/tor_guardsim/blob/develop/lib/original_client.py
>> >
>> > If you wouldn't mind taking a look at this and letting us know anything
>> > that is missing/should change, that would be really helpful.
>> >
>>
>> Your pseudocode looks pretty accurate based on what I remember from the
>> guard
>> algorithm and from quickly skimming the code.
>>
>> One inaccuracy might be that if IIRC in RECEIVE_NEW_CONSENSUS we don't
>> remove
>> guards that are not listed in the latest consensus. Instead we mark them
>> as 'bad'
>> which rules them out of retries etc. till they reappear on the consensus.
>> See entry_guard_set_status() and its caller for how this works.
>>
>
> <snip>
>
> See:
> https://github.com/twstrike/tor_guardsim/commit/1fb7400c0c8e167508753ede15b8fe82bd08ecdd
Hmm, looks pretty good!
One note: I feel that you are hiding information behind the simple phrase
"Build LIVE_GUARDS". Interesting things happen in populate_live_entry_guards()
that are not documented by your algo. For example, in entry_is_live() we call
entry_is_time_to_retry(), which periodically retries guards based on time:
struct guard_retry_period_s periods[] = {
{ 6*60*60, 60*60 }, /* For first 6 hrs., retry hourly; */
{ 3*24*60*60, 4*60*60 }, /* Then retry every 4 hrs. until the
3-day mark; */
{ 7*24*60*60, 18*60*60 }, /* After 3 days, retry every 18 hours until
1 week mark. */
{ TIME_MAX, 36*60*60 } /* After 1 week, retry every 36 hours. */
};
Also, another function that I'm not sure if you have seen (and whether it fits
with the algorithm) is entries_retry_all().
BTW, I like the way you have splitted the algo into various events
(RECEIVE_NEW_CONSENSUS, BUILD_NEW_CIRCUIT, CHOOSE_A_GUARD, CONNECT_ENTRY_GUARD,
etc.). We should maybe try to shape Ola's new algorithm to fit this event
structure exactly since it resembles the actual Tor networking API.
Cheers!
_______________________________________________
tor-dev mailing list
tor-dev@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev