Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Tor Tor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 325
    • Issues 325
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 30
    • Merge requests 30
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • TorTor
  • Issues
  • #17835
Closed
Open
Issue created Dec 12, 2015 by teor@teor

Make ClientPreferIPv6ORPort smarter

It's hard for users on dual-stack machines to know whether their IPv4 or IPv6 connections provides better connectivity or censorship-resistance.

Tor could help with this by:

  • Making ClientPreferIPv6ORPort/DirPort into an autobool, and setting the default to auto (infer), rather than 0 (IPv4)
  • Infer initial IPv4/IPv6 preference by looking at the machine's network interfaces, and:
    • Ignoring localhost (tor_addr_is_localhost) and link-local addresses (a new tor_addr_is_link_local)
    • Checking for (other) private addresses (tor currently considers link-local addresses private, this shouldn't change in the rest of the codebase, but it is important to distinguish here, as IPv4/IPv6 hosts with no IPv6 connectivity still auto-configure a link-local IPv6 address)
    • Checking for publicly routable addresses
    • Preferring IP versions that have a public address, over those that have a private address
    • (I'd also say to avoid IP versions that only have localhost or link-local addresses, and don't use IP versions that have no addresses, but that might cause issues with proxies, or with machines that prohibit enumeration of local addresses.)
    • Repeat these checks every N minutes in case the network interfaces have changed (relays do this every 20 minutes at the moment)
  • Infer a preference for IPv4 or IPv6 based on the number of failed connections
    • Globally track counts of attempted IPv4 and IPv6 connections
    • Globally track failures of attempted IPv4 and IPv6 connections
    • If there have been at least M attempts (2? 3?) on (one? each?) IP version, then:
      • If an IP version has 100% failure, avoid it
      • IP an IP version has a significantly (2x?) larger failure rate, avoid it

I'm deferring this to 0.2.9 because:

  • IPv4/IPv6 Tor clients might work fine without any of these changes.
  • It's complex code, and it's not clear that it's the best way to determine preferred IP versions. (Let's get some experience with dual-stack clients first.)
  • We only have 4/9 authorities and ~25% of fallback directory mirrors on IPv6, so let's prefer IPv4 by default at the moment for load-balancing reasons. (For similar reasons, ClientUseIPv6 could default to 1 in future, but now might not be a good time to do that. However, Tor Browser sets it to 1 at the moment.)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking