When to add flags to network status vs adding new items

Nick Mathewson nickm at freehaven.net
Sun Dec 17 02:03:17 UTC 2006

On Sat, Dec 16, 2006 at 07:31:25PM -0500, Roger Dingledine wrote:
> This is mainly for Nick, but maybe we'll get back into the habit of
> making design discussions more public. :)

Nice idea. :)

> I'm in the process of implementing PreferTunnelledDirConns, which makes
> you pick a directory server that supports BEGIN_DIR cells if one is
> available. But the routerstatus_t or local_routerstatus_t structs don't
> say what version the server is running, so I can't know. (And I can't
> just fetch all the descriptors to learn the versions, because the whole
> point is to fetch them using BEGIN_DIR when possible.)
> One option is to add another flag to the status lines:
> supports_dir_tunnels or the like, which is set when we believe the server
> is running Tor or later.

Actually, NoDirTunnels would be a better option.  That way it could
eventually go away, and we wouldn't have to bloat the networkstatuses
with this nonsense forever.

> Another option is to extend the router line in the status list to include
> the version we think it's running, and then clients can make this decision
> (and future decisions) themselves.
> Both of these would be fine with me in this case. What's the right habit
> down the road? Should we add new flags whenever there's a new capability,
> or should we reserve flags for situations where the judgement is more
> complex than a call to tor_version_as_new_as()?

I'd like to reserve flags for things deduced by the authorities, and
include the first part of the platform string (i.e., "Tor") in the networkstatus for each router.

I would initially have worried about the space bloat, but I decided to
do an experiment to see how bad it would be: I took a current
networkstatus and wrote a script to either add a flag "NoDirTunnel" to
every router without BEGIN_DIR, or to include a router's platform in
a separate networkstatus line.  On disk, this increased networkstatus
size by 6-10%, but fortunately the increase was very compressible: an
extra flag would add only 0.4% to networkstatus on the wire, whereas
the full version string would add only about 1.7%.  Since we're
planning to reduce networkstatus traffic in the next series with
voting consensus directories, I think adding a platform string would
be pretty darned safe...

...but is this really something we should be using version numbers
for?  It would be way cleaner to use numbered versions of the
protocol for this, so that other implementations don't need to pretend
to be a given version in order to be compatible.

[Warning: I am sick.  If this message makes no sense, my cold may be
the reason why. :) ]

Nick Mathewson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: not available
URL: <http://lists.torproject.org/pipermail/tor-dev/attachments/20061216/76125e7f/attachment.pgp>

More information about the tor-dev mailing list