begin to revise path-spec

svn:r8511
This commit is contained in:
Roger Dingledine 2006-09-28 15:03:01 +00:00
parent 95132f836a
commit 7e4acf1655

View File

@ -22,13 +22,14 @@ should cover, but not an exhaustive list. -NM
Tor begins building circuits as soon as it has enough directory Tor begins building circuits as soon as it has enough directory
information to do so (see section 5.1 of dir-spec.txt). Some circuits are information to do so (see section 5.1 of dir-spec.txt). Some circuits are
built preemptively because we expect to need them later (for user built preemptively because we expect to need them later (for user
traffic), and some are build because of immediate need (for user traffic traffic), and some are built because of immediate need (for user traffic
that no current circuit can handle, for testing the network or our that no current circuit can handle, for testing the network or our
availability, and so on). reachability, and so on).
When a client application creates a new stream (by opening a SOCKS When a client application creates a new stream (by opening a SOCKS
connection or launching a resolve request), we attach it to an appropriate connection or launching a resolve request), we attach it to an appropriate
open (or in-progress) circuit if one exists, and launch a new circuit only open circuit if one exists, or wait if one is in-progress. We launch
a new circuit only
if no current circuit can handle the request. We rotate circuits over if no current circuit can handle the request. We rotate circuits over
time to avoid some profiling attacks. time to avoid some profiling attacks.
@ -57,10 +58,6 @@ should cover, but not an exhaustive list. -NM
A "clean" circuit is one that has not yet been used for any traffic. A "clean" circuit is one that has not yet been used for any traffic.
A "stable" node is one that we believe to have the 'Stable' flag set on
the basis of our current directory information. A "stable" circuit is one
that consists entirely of "stable" nodes.
A "fast" or "stable" node is one that we believe to have the 'Fast' or A "fast" or "stable" node is one that we believe to have the 'Fast' or
'Stable' flag set on the basis of our current directory information. A 'Stable' flag set on the basis of our current directory information. A
"fast" or "stable" circuit is one consisting only of "fast" or "stable" "fast" or "stable" circuit is one consisting only of "fast" or "stable"
@ -93,7 +90,7 @@ should cover, but not an exhaustive list. -NM
Additionally, when a client request exists that no circuit (built or Additionally, when a client request exists that no circuit (built or
pending) might support, we cannibalize an existing circuit (2.1.4) or pending) might support, we cannibalize an existing circuit (2.1.4) or
create a new circuit to support the request. We do so by picking a create a new circuit to support the request. We do so by picking a
request at random, building or cannibalizing a circuit to support it, and request arbitrarily, building or cannibalizing a circuit to support it, and
repeating until every unattached request might be supported by a pending repeating until every unattached request might be supported by a pending
or built circuit. or built circuit.
@ -101,17 +98,20 @@ should cover, but not an exhaustive list. -NM
2.1.2. When servers build circuits 2.1.2. When servers build circuits
At start and whenever the IP address changes, for testing reachability
of their ORPort.
XXXX XXXX
2.1.3. When authorities build circuits 2.1.3. When directory authorities build circuits
There are no authority-specific circuits, I think.
XXXX XXXX
2.1.4. Hidden-service circuits 2.1.4. Hidden-service circuits
See section 4 below. See section 4 below.
2.1.4. Cannibalizing circuits 2.1.5. Cannibalizing circuits
When Tor has a request (either an unattached stream or unattached resolve When Tor has a request (either an unattached stream or unattached resolve
request) that no current circuit can support, it looks for an existing request) that no current circuit can support, it looks for an existing
@ -123,7 +123,12 @@ should cover, but not an exhaustive list. -NM
might support a stream, we begin building a new circuit that might support might support a stream, we begin building a new circuit that might support
the stream. the stream.
[XXXX always? really?] 2.1.6. Rate limiting of failed circuits
If we fail to build a circuit N times in a X second period (see Section
2.3 for how this works), we stop building circuits until the X seconds
have elapsed.
XXX
2.2. Path selection and constraints 2.2. Path selection and constraints
@ -132,16 +137,19 @@ should cover, but not an exhaustive list. -NM
we generate obey the following constraints: we generate obey the following constraints:
- We do not choose the same router twice for the same path. - We do not choose the same router twice for the same path.
- We do not choose any router in the same family as another in the same - We do not choose any router in the same family as another in the same
circuit. path.
- We do not choose any router in the same /16 subnet as another in the - We do not choose any router in the same /16 subnet as another in the
same circuit. same path.
- We don't choose any non-running or non-valid router unless we have - We don't choose any non-running or non-valid router unless we have
been configured to do so. been configured to do so. By default, we are configured to allow
non-valid routers in "middle" and "rendezvous" positions.
- If we're using Guard nodes, the first node must be a Guard (see 5 - If we're using Guard nodes, the first node must be a Guard (see 5
below) below)
- XXXX Choosing the length - XXXX Choosing the length
When choosing among multiple candidates for a path element, we choose For circuits that are not "fast", when choosing among multiple
candidates for a path element, we choose randomly. For "fast" circuits,
we choose
a given router with probability proportional to its advertised bandwidth a given router with probability proportional to its advertised bandwidth
[the smaller of the 'rate' and 'observed' arguments to the "bandwidth" [the smaller of the 'rate' and 'observed' arguments to the "bandwidth"
element in its descriptor]. If a router's advertised bandwidth is greater element in its descriptor]. If a router's advertised bandwidth is greater
@ -157,12 +165,12 @@ should cover, but not an exhaustive list. -NM
- All connection requests for connections that we think will need to - All connection requests for connections that we think will need to
stay open a long time require Stable circuits. Currently, Tor decides stay open a long time require Stable circuits. Currently, Tor decides
this by examining the request's target port, and comparing it to a this by examining the request's target port, and comparing it to a
list of "long-lived" ports. (Default: 21, 22, 706, 1863, 5050, 5190, list of "long-lived" ports. (Default: 21, 22, 706, 1863, 5050,
5222, 5223, 6667, 8300, 8888.) 5190, 5222, 5223, 6667, 6697, 8300.)
- DNS resolves require an exit node whose exit policy is not equivalent - DNS resolves require an exit node whose exit policy is not equivalent
to "reject *:*". to "reject *:*".
- Reverse DNS resolves require a version of Tor with advertised eventdns - Reverse DNS resolves require a version of Tor with advertised eventdns
support, running 0.1.2.1-alpha-dev or later. support (available in Tor 0.1.2.1-alpha-dev and later).
- All connection requests require an exit node whose exit policy - All connection requests require an exit node whose exit policy
supports their target address and port (if known), or which "might supports their target address and port (if known), or which "might
support it" (if the address isn't known). See 2.2.1. support it" (if the address isn't known). See 2.2.1.
@ -170,8 +178,9 @@ should cover, but not an exhaustive list. -NM
2.2.1. Choosing an exit 2.2.1. Choosing an exit
If we know what IP we want to resolve, we can trivially tell whether a If we know what IP address we want to resolve, we can trivially tell
given router will support it by simulating its declared exit policy. whether a given router will support it by simulating its declared
exit policy.
Because we often connect to addresses of the form hostname:port, we do not Because we often connect to addresses of the form hostname:port, we do not
always know the target IP address when we select an exit node. In these always know the target IP address when we select an exit node. In these
@ -190,7 +199,7 @@ should cover, but not an exhaustive list. -NM
and StrictExitNodes is false, then Tor treats that request as if and StrictExitNodes is false, then Tor treats that request as if
ExitNodes were not provided.) ExitNodes were not provided.)
- "EntryNodes" and "StrictEntryNodes" behave analagously. - "EntryNodes" and "StrictEntryNodes" behave analogously.
- If a user tries to connect to or resolve a hostname of the form - If a user tries to connect to or resolve a hostname of the form
<target>.<servername>.exit, the request is rewritten to a request for <target>.<servername>.exit, the request is rewritten to a request for
@ -205,9 +214,10 @@ should cover, but not an exhaustive list. -NM
supported by the pending circuit thus become unsupported, and a new supported by the pending circuit thus become unsupported, and a new
circuit needs to be constructed. circuit needs to be constructed.
If we fail to being a circuit with an EXITPOLICY error, we decide that the If a stream "begin" attempt fails with an EXITPOLICY error, we
exit node's exit policy is not correctly advertised, so we treat the exit decide that the exit node's exit policy is not correctly advertised,
node as if it were a non-exit until we retrieve a fresh descriptor for it. so we treat the exit node as if it were a non-exit until we retrieve
a fresh descriptor for it.
XXXX XXXX
@ -216,11 +226,11 @@ should cover, but not an exhaustive list. -NM
A Tor client tracks how much time has passed since it last received a A Tor client tracks how much time has passed since it last received a
request for a connection on each port. (For the purposes of this section, request for a connection on each port. (For the purposes of this section,
requests for hostname resolves are considered requests to a separate requests for hostname resolves are considered requests to a separate
port). Tor forgets about ports that haven't been used for an hour "special" port). Tor forgets about ports that haven't been used for
[PREDICTED_CIRCS_RELEVANCE_TIME]. an hour [PREDICTED_CIRCS_RELEVANCE_TIME].
The ports that have been used in the last hour are considered "predicted", The ports that have been used in the last hour are considered "predicted",
and Tor will try to maintain a clean circuits to them as described in 2.1. and Tor will try to maintain a clean circuit to them as described in 2.1.
For bootstrapping purposes, port 80 is treated as used at startup time. For bootstrapping purposes, port 80 is treated as used at startup time.
@ -234,14 +244,14 @@ should cover, but not an exhaustive list. -NM
considers the reason given in the CLOSE relay cell. [XXX yes, and?] considers the reason given in the CLOSE relay cell. [XXX yes, and?]
After a request has remained unattached for [XXXX retries? interval?], Tor After a request has remained unattached for [XXXX interval?], Tor
abandons the attempt and signals an error to the client as appropriate abandons the attempt and signals an error to the client as appropriate
(e.g., by closing the SOCKS connection). (e.g., by closing the SOCKS connection).
XXX Timeouts and when Tor auto-retries. XXX Timeouts and when Tor auto-retries.
* What stream-end-reasons are appropriate for retrying. * What stream-end-reasons are appropriate for retrying.
XXX What if no reply to BEGIN/RESOLVE? If no reply to BEGIN/RESOLVE, then the stream will timeout and fail.
4. Hidden-service related circuits 4. Hidden-service related circuits
@ -258,24 +268,6 @@ should cover, but not an exhaustive list. -NM
(From some emails by arma) (From some emails by arma)
Hi folks,
I've gotten the codebase to the point that I'm going to start trying
to make helper nodes work well. With luck they will be on by default in
the final 0.1.1.x release.
For background on helper nodes, read
http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#RestrictedEntry
First order of business: the phrase "helper node" sucks. We always have
to define it after we say it to somebody. Nick likes the phrase "contact
node", because they are your point-of-contact into the network. That is
better than phrases like "bridge node". The phrase "fixed entry node"
doesn't seem to work with non-math people, because they wonder what was
broken about it. I'm sort of partial to the phrase "entry node" or maybe
"restricted entry node". In any case, if you have ideas on names, please
mail me off-list and I'll collate them.
Right now the code exists to pick helper nodes, store our choices to Right now the code exists to pick helper nodes, store our choices to
disk, and use them for our entry nodes. But there are three topics disk, and use them for our entry nodes. But there are three topics
to tackle before I'm comfortable turning them on by default. First, to tackle before I'm comfortable turning them on by default. First,