use ipv6 #867
Labels
No labels
c/code
c/code-dirnodes
c/code-encoding
c/code-frontend
c/code-frontend-cli
c/code-frontend-ftp-sftp
c/code-frontend-magic-folder
c/code-frontend-web
c/code-mutable
c/code-network
c/code-nodeadmin
c/code-peerselection
c/code-storage
c/contrib
c/dev-infrastructure
c/docs
c/operational
c/packaging
c/unknown
c/website
kw:2pc
kw:410
kw:9p
kw:ActivePerl
kw:AttributeError
kw:DataUnavailable
kw:DeadReferenceError
kw:DoS
kw:FileZilla
kw:GetLastError
kw:IFinishableConsumer
kw:K
kw:LeastAuthority
kw:Makefile
kw:RIStorageServer
kw:StringIO
kw:UncoordinatedWriteError
kw:about
kw:access
kw:access-control
kw:accessibility
kw:accounting
kw:accounting-crawler
kw:add-only
kw:aes
kw:aesthetics
kw:alias
kw:aliases
kw:aliens
kw:allmydata
kw:amazon
kw:ambient
kw:annotations
kw:anonymity
kw:anonymous
kw:anti-censorship
kw:api_auth_token
kw:appearance
kw:appname
kw:apport
kw:archive
kw:archlinux
kw:argparse
kw:arm
kw:assertion
kw:attachment
kw:auth
kw:authentication
kw:automation
kw:avahi
kw:availability
kw:aws
kw:azure
kw:backend
kw:backoff
kw:backup
kw:backupdb
kw:backward-compatibility
kw:bandwidth
kw:basedir
kw:bayes
kw:bbfreeze
kw:beta
kw:binaries
kw:binutils
kw:bitcoin
kw:bitrot
kw:blacklist
kw:blocker
kw:blocks-cloud-deployment
kw:blocks-cloud-merge
kw:blocks-magic-folder-merge
kw:blocks-merge
kw:blocks-raic
kw:blocks-release
kw:blog
kw:bom
kw:bonjour
kw:branch
kw:branding
kw:breadcrumbs
kw:brians-opinion-needed
kw:browser
kw:bsd
kw:build
kw:build-helpers
kw:buildbot
kw:builders
kw:buildslave
kw:buildslaves
kw:cache
kw:cap
kw:capleak
kw:captcha
kw:cast
kw:centos
kw:cffi
kw:chacha
kw:charset
kw:check
kw:checker
kw:chroot
kw:ci
kw:clean
kw:cleanup
kw:cli
kw:cloud
kw:cloud-backend
kw:cmdline
kw:code
kw:code-checks
kw:coding-standards
kw:coding-tools
kw:coding_tools
kw:collection
kw:compatibility
kw:completion
kw:compression
kw:confidentiality
kw:config
kw:configuration
kw:configuration.txt
kw:conflict
kw:connection
kw:connectivity
kw:consistency
kw:content
kw:control
kw:control.furl
kw:convergence
kw:coordination
kw:copyright
kw:corruption
kw:cors
kw:cost
kw:coverage
kw:coveralls
kw:coveralls.io
kw:cpu-watcher
kw:cpyext
kw:crash
kw:crawler
kw:crawlers
kw:create-container
kw:cruft
kw:crypto
kw:cryptography
kw:cryptography-lib
kw:cryptopp
kw:csp
kw:curl
kw:cutoff-date
kw:cycle
kw:cygwin
kw:d3
kw:daemon
kw:darcs
kw:darcsver
kw:database
kw:dataloss
kw:db
kw:dead-code
kw:deb
kw:debian
kw:debug
kw:deep-check
kw:defaults
kw:deferred
kw:delete
kw:deletion
kw:denial-of-service
kw:dependency
kw:deployment
kw:deprecation
kw:desert-island
kw:desert-island-build
kw:design
kw:design-review-needed
kw:detection
kw:dev-infrastructure
kw:devpay
kw:directory
kw:directory-page
kw:dirnode
kw:dirnodes
kw:disconnect
kw:discovery
kw:disk
kw:disk-backend
kw:distribute
kw:distutils
kw:dns
kw:do_http
kw:doc-needed
kw:docker
kw:docs
kw:docs-needed
kw:dokan
kw:dos
kw:download
kw:downloader
kw:dragonfly
kw:drop-upload
kw:duplicity
kw:dusty
kw:earth-dragon
kw:easy
kw:ec2
kw:ecdsa
kw:ed25519
kw:egg-needed
kw:eggs
kw:eliot
kw:email
kw:empty
kw:encoding
kw:endpoint
kw:enterprise
kw:enum34
kw:environment
kw:erasure
kw:erasure-coding
kw:error
kw:escaping
kw:etag
kw:etch
kw:evangelism
kw:eventual
kw:example
kw:excess-authority
kw:exec
kw:exocet
kw:expiration
kw:extensibility
kw:extension
kw:failure
kw:fedora
kw:ffp
kw:fhs
kw:figleaf
kw:file
kw:file-descriptor
kw:filename
kw:filesystem
kw:fileutil
kw:fips
kw:firewall
kw:first
kw:floatingpoint
kw:flog
kw:foolscap
kw:forward-compatibility
kw:forward-secrecy
kw:forwarding
kw:free
kw:freebsd
kw:frontend
kw:fsevents
kw:ftp
kw:ftpd
kw:full
kw:furl
kw:fuse
kw:garbage
kw:garbage-collection
kw:gateway
kw:gatherer
kw:gc
kw:gcc
kw:gentoo
kw:get
kw:git
kw:git-annex
kw:github
kw:glacier
kw:globalcaps
kw:glossary
kw:google-cloud-storage
kw:google-drive-backend
kw:gossip
kw:governance
kw:grid
kw:grid-manager
kw:gridid
kw:gridsync
kw:grsec
kw:gsoc
kw:gvfs
kw:hackfest
kw:hacktahoe
kw:hang
kw:hardlink
kw:heartbleed
kw:heisenbug
kw:help
kw:helper
kw:hint
kw:hooks
kw:how
kw:how-to
kw:howto
kw:hp
kw:hp-cloud
kw:html
kw:http
kw:https
kw:i18n
kw:i2p
kw:i2p-collab
kw:illustration
kw:image
kw:immutable
kw:impressions
kw:incentives
kw:incident
kw:init
kw:inlineCallbacks
kw:inotify
kw:install
kw:installer
kw:integration
kw:integration-test
kw:integrity
kw:interactive
kw:interface
kw:interfaces
kw:interoperability
kw:interstellar-exploration
kw:introducer
kw:introduction
kw:iphone
kw:ipkg
kw:iputil
kw:ipv6
kw:irc
kw:jail
kw:javascript
kw:joke
kw:jquery
kw:json
kw:jsui
kw:junk
kw:key-value-store
kw:kfreebsd
kw:known-issue
kw:konqueror
kw:kpreid
kw:kvm
kw:l10n
kw:lae
kw:large
kw:latency
kw:leak
kw:leasedb
kw:leases
kw:libgmp
kw:license
kw:licenss
kw:linecount
kw:link
kw:linux
kw:lit
kw:localhost
kw:location
kw:locking
kw:logging
kw:logo
kw:loopback
kw:lucid
kw:mac
kw:macintosh
kw:magic-folder
kw:manhole
kw:manifest
kw:manual-test-needed
kw:map
kw:mapupdate
kw:max_space
kw:mdmf
kw:memcheck
kw:memory
kw:memory-leak
kw:mesh
kw:metadata
kw:meter
kw:migration
kw:mime
kw:mingw
kw:minimal
kw:misc
kw:miscapture
kw:mlp
kw:mock
kw:more-info-needed
kw:mountain-lion
kw:move
kw:multi-users
kw:multiple
kw:multiuser-gateway
kw:munin
kw:music
kw:mutability
kw:mutable
kw:mystery
kw:names
kw:naming
kw:nas
kw:navigation
kw:needs-review
kw:needs-spawn
kw:netbsd
kw:network
kw:nevow
kw:new-user
kw:newcaps
kw:news
kw:news-done
kw:news-needed
kw:newsletter
kw:newurls
kw:nfc
kw:nginx
kw:nixos
kw:no-clobber
kw:node
kw:node-url
kw:notification
kw:notifyOnDisconnect
kw:nsa310
kw:nsa320
kw:nsa325
kw:numpy
kw:objects
kw:old
kw:openbsd
kw:openitp-packaging
kw:openssl
kw:openstack
kw:opensuse
kw:operation-helpers
kw:operational
kw:operations
kw:ophandle
kw:ophandles
kw:ops
kw:optimization
kw:optional
kw:options
kw:organization
kw:os
kw:os.abort
kw:ostrom
kw:osx
kw:osxfuse
kw:otf-magic-folder-objective1
kw:otf-magic-folder-objective2
kw:otf-magic-folder-objective3
kw:otf-magic-folder-objective4
kw:otf-magic-folder-objective5
kw:otf-magic-folder-objective6
kw:p2p
kw:packaging
kw:partial
kw:password
kw:path
kw:paths
kw:pause
kw:peer-selection
kw:performance
kw:permalink
kw:permissions
kw:persistence
kw:phone
kw:pickle
kw:pip
kw:pipermail
kw:pkg_resources
kw:placement
kw:planning
kw:policy
kw:port
kw:portability
kw:portal
kw:posthook
kw:pratchett
kw:preformance
kw:preservation
kw:privacy
kw:process
kw:profile
kw:profiling
kw:progress
kw:proxy
kw:publish
kw:pyOpenSSL
kw:pyasn1
kw:pycparser
kw:pycrypto
kw:pycrypto-lib
kw:pycryptopp
kw:pyfilesystem
kw:pyflakes
kw:pylint
kw:pypi
kw:pypy
kw:pysqlite
kw:python
kw:python3
kw:pythonpath
kw:pyutil
kw:pywin32
kw:quickstart
kw:quiet
kw:quotas
kw:quoting
kw:raic
kw:rainhill
kw:random
kw:random-access
kw:range
kw:raspberry-pi
kw:reactor
kw:readonly
kw:rebalancing
kw:recovery
kw:recursive
kw:redhat
kw:redirect
kw:redressing
kw:refactor
kw:referer
kw:referrer
kw:regression
kw:rekey
kw:relay
kw:release
kw:release-blocker
kw:reliability
kw:relnotes
kw:remote
kw:removable
kw:removable-disk
kw:rename
kw:renew
kw:repair
kw:replace
kw:report
kw:repository
kw:research
kw:reserved_space
kw:response-needed
kw:response-time
kw:restore
kw:retrieve
kw:retry
kw:review
kw:review-needed
kw:reviewed
kw:revocation
kw:roadmap
kw:rollback
kw:rpm
kw:rsa
kw:rss
kw:rst
kw:rsync
kw:rusty
kw:s3
kw:s3-backend
kw:s3-frontend
kw:s4
kw:same-origin
kw:sandbox
kw:scalability
kw:scaling
kw:scheduling
kw:schema
kw:scheme
kw:scp
kw:scripts
kw:sdist
kw:sdmf
kw:security
kw:self-contained
kw:server
kw:servermap
kw:servers-of-happiness
kw:service
kw:setup
kw:setup.py
kw:setup_requires
kw:setuptools
kw:setuptools_darcs
kw:sftp
kw:shared
kw:shareset
kw:shell
kw:signals
kw:simultaneous
kw:six
kw:size
kw:slackware
kw:slashes
kw:smb
kw:sneakernet
kw:snowleopard
kw:socket
kw:solaris
kw:space
kw:space-efficiency
kw:spam
kw:spec
kw:speed
kw:sqlite
kw:ssh
kw:ssh-keygen
kw:sshfs
kw:ssl
kw:stability
kw:standards
kw:start
kw:startup
kw:static
kw:static-analysis
kw:statistics
kw:stats
kw:stats_gatherer
kw:status
kw:stdeb
kw:storage
kw:streaming
kw:strports
kw:style
kw:stylesheet
kw:subprocess
kw:sumo
kw:survey
kw:svg
kw:symlink
kw:synchronous
kw:tac
kw:tahoe-*
kw:tahoe-add-alias
kw:tahoe-admin
kw:tahoe-archive
kw:tahoe-backup
kw:tahoe-check
kw:tahoe-cp
kw:tahoe-create-alias
kw:tahoe-create-introducer
kw:tahoe-debug
kw:tahoe-deep-check
kw:tahoe-deepcheck
kw:tahoe-lafs-trac-stream
kw:tahoe-list-aliases
kw:tahoe-ls
kw:tahoe-magic-folder
kw:tahoe-manifest
kw:tahoe-mkdir
kw:tahoe-mount
kw:tahoe-mv
kw:tahoe-put
kw:tahoe-restart
kw:tahoe-rm
kw:tahoe-run
kw:tahoe-start
kw:tahoe-stats
kw:tahoe-unlink
kw:tahoe-webopen
kw:tahoe.css
kw:tahoe_files
kw:tahoewapi
kw:tarball
kw:tarballs
kw:tempfile
kw:templates
kw:terminology
kw:test
kw:test-and-set
kw:test-from-egg
kw:test-needed
kw:testgrid
kw:testing
kw:tests
kw:throttling
kw:ticket999-s3-backend
kw:tiddly
kw:time
kw:timeout
kw:timing
kw:to
kw:to-be-closed-on-2011-08-01
kw:tor
kw:tor-protocol
kw:torsocks
kw:tox
kw:trac
kw:transparency
kw:travis
kw:travis-ci
kw:trial
kw:trickle
kw:trivial
kw:truckee
kw:tub
kw:tub.location
kw:twine
kw:twistd
kw:twistd.log
kw:twisted
kw:twisted-14
kw:twisted-trial
kw:twitter
kw:twn
kw:txaws
kw:type
kw:typeerror
kw:ubuntu
kw:ucwe
kw:ueb
kw:ui
kw:unclean
kw:uncoordinated-writes
kw:undeletable
kw:unfinished-business
kw:unhandled-error
kw:unhappy
kw:unicode
kw:unit
kw:unix
kw:unlink
kw:update
kw:upgrade
kw:upload
kw:upload-helper
kw:uri
kw:url
kw:usability
kw:use-case
kw:utf-8
kw:util
kw:uwsgi
kw:ux
kw:validation
kw:variables
kw:vdrive
kw:verify
kw:verlib
kw:version
kw:versioning
kw:versions
kw:video
kw:virtualbox
kw:virtualenv
kw:vista
kw:visualization
kw:visualizer
kw:vm
kw:volunteergrid2
kw:volunteers
kw:vpn
kw:wapi
kw:warners-opinion-needed
kw:warning
kw:weapi
kw:web
kw:web.port
kw:webapi
kw:webdav
kw:webdrive
kw:webport
kw:websec
kw:website
kw:websocket
kw:welcome
kw:welcome-page
kw:welcomepage
kw:wiki
kw:win32
kw:win64
kw:windows
kw:windows-related
kw:winscp
kw:workaround
kw:world-domination
kw:wrapper
kw:write-enabler
kw:wui
kw:x86
kw:x86-64
kw:xhtml
kw:xml
kw:xss
kw:zbase32
kw:zetuptoolz
kw:zfec
kw:zookos-opinion-needed
kw:zope
kw:zope.interface
p/blocker
p/critical
p/major
p/minor
p/normal
p/supercritical
p/trivial
r/cannot reproduce
r/duplicate
r/fixed
r/invalid
r/somebody else's problem
r/was already fixed
r/wontfix
r/worksforme
t/defect
t/enhancement
t/task
v/0.2.0
v/0.3.0
v/0.4.0
v/0.5.0
v/0.5.1
v/0.6.0
v/0.6.1
v/0.7.0
v/0.8.0
v/0.9.0
v/1.0.0
v/1.1.0
v/1.10.0
v/1.10.1
v/1.10.2
v/1.10a2
v/1.11.0
v/1.12.0
v/1.12.1
v/1.13.0
v/1.14.0
v/1.15.0
v/1.15.1
v/1.2.0
v/1.3.0
v/1.4.1
v/1.5.0
v/1.6.0
v/1.6.1
v/1.7.0
v/1.7.1
v/1.7β
v/1.8.0
v/1.8.1
v/1.8.2
v/1.8.3
v/1.8β
v/1.9.0
v/1.9.0-s3branch
v/1.9.0a1
v/1.9.0a2
v/1.9.0b1
v/1.9.1
v/1.9.2
v/1.9.2a1
v/cloud-branch
v/unknown
No milestone
No project
No assignees
6 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: tahoe-lafs/trac#867
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Shawn Willden points out that IPv6 is a likely way to deal with the servers-behind-NAT problem (#169, #445, #49, #50), since a lot of ISPs offer v6 tunnel services these days, which effectively gives the server host a publically-reachable v6 address.
To make this work, we need a couple of things, probably in the following order:
socket
moduleIPv4Address
class must grow a correspondingIPv6Address
partner.Let's collect pointers to other tickets (especially the twisted ones) and progress reports here.
twisted#3014 looks to be the main v6-in-Twisted ticket, and is moving very slowly (created two years ago). It looks like there's a bunch of v6 address lookup code already in place, but perhaps the actual make-a-TCP-connection code is not.
Foolscap#155 is the new v6-in-Foolscap ticket. Doesn't look too hard once the twisted ticket is done. That twisted ticket is still open, although I think there's been some good progress on it in the last month.
The relevant Twisted ticket now seems to be http://twistedmatrix.com/trac/ticket/5085, which is fixed.
With progress by Marcus Wanner on Foolscap#155 I felt some motivation to work on IPv6 inside of Tahoe. Right now I've just done some of the ip_utils that are specific to IPv4 including some test cases that were missing. If my IPv6 work never makes it into Tahoe, my test cases would be useful to pull in.
You can follow my progress at and send pull requests to github. It's nothing much right now, but it's where I'm putting my work, so if anybody has anything to add, send it my way.
I asked on IRC and nobody else seems to be working on this, so let me know if you have something already done.
There may be some point to document a way to tunnel IPv4 over IPv6 until this work is done so that people can take advantage of IPv6 without the platform support within Tahoe. Something as simple as nc and some pipes.
Thanks! I don't think anyone else is working on this at the Tahoe end, so feel free to continue.
Attachment 32.png (161874 bytes) added
Screenshot from 2013-02-14
ClashTheBunny wrote on tahoe-dev:
Yay!
Re: the screenshot, the "Connected?" column should probably show IPv6 addresses in the same format they appear in furls.
Excellent.
How time flies. I've made some good progress on the IPv6 implementation and now need some good advice as to what to write new tests for. I could also use some code review. Everything implemented as far as I can tell:
/10 addresses are silently dropped
Things not complete that may be good to include in this:
Things required:
Remember, there are probably still bugs, so treat this as dangerous with data. I don't think I touched anything mission critical though, and all the old tests pass, so I wouldn't be too scared either.
I converted preferv6 to a tri-state of ipversion = v4, ipversion = preferv4, and ipversion = preferv6. In a 7 node network with two nodes only reachable via IPv6, the upload succeeds on a "preferv4" host and a "preferv6" host, but fails on the "v4" host. So I know that v4 works as expected. I'm happy with the way preferv6 and preferv4 work. They advertise the right version first, but still work with either version.
I need to get some real testing done with Windows before 7 or another operating system that has a separate ipv4 stack from an ipv6 stack. If anybody is willing to try this, I would greatly appreciate it.
A few comments:
** the URL of your git repo/branch should probably be in this ticket
1 (and presumably then the CLI interface could use that next, another ticket).
Replying to gdt:
It's listed in my first comment, but it's here (for easier grep-ability): https://github.com/ClashTheBunny/tahoe-lafs/commits/ipv6
Yeah, I'm thinking that either we should make three tickets with this as the parent, or create two more tickets with those parts of the process. If we did three tickets, I would call mine "Tahoe-LAFS transport over IPv6" or something like that. I'll let zooko or David-Sarah figure that out, because they know more about the management of the project.
Agreed. I'll look into how that works in foolscap. The problem is that there aren't many controls that I have. Right now I can specify which addresses are advertised and in which order. I can also specify if the listen port is TCPv4 or TCPv6. I don't think I can tell foolscap not to make connections to a certain address family, but as I said, I'll look into that.
I don't know if the first case exists. I think I can specify INADDR_ANY and INADDR6_ANY. Linux automatically makes INADDR6_ANY also receive IPv4 connections if /proc/sys/net/ipv6/bindv6only is set to the default value of 0. In NetBSD I think this would be sysctl -w net.inet6.ip6.v6only=0. This INADDR_ANY and INADDR6_ANY translate to this in a tub entry:
0 or tcp:0 is any free port the OS will give us on only INADDR_ANY
tcp6:0 is any free port the OS will give us on INADDR6_ANY, if your OS listens on INADDR6_ANY for INADDR_ANY connections also, you get both. This is Linux's default, I think every BSD, and I've heard that Windows 7 also, but Windows XP/Vista have seperate V6 and V4 stacks, so it only listens on INADDR6_ANY.
or tcp: listens on INADDR_ANY on that specific port
tcp6: listens on INADDR6_ANY on that specific port, with the above caveats about stacks and listening on both.
Either way, I'll set up bindv6only on a test machine I'm running to make sure that the expected behavior works (or that ipv4 connections don't work!).
This is essentially what I did with ipversion above. I don't know if there is a real way of asking foolscap to actually prefer one over the other, but I do know that if I list IPv6 addresses at the end of the list of addresses advertised to the introducer, I, more often than not, get IPv6 connections. The opposite is also true, if I list them first, I rarely get IPv6 connections. If you look at the code that includes ipversion it's kinda a combination of these last two comments. I now understand that they can be split into two variables:
IncomingFamily = inet or inet6, implementation details would then state that, depending on your OS and settings this will give you v4, v6, or both.
and PreferredOutgoingFamily would do the previous reordering of addresses when advertising to the introducer my addresses.
I don't think I can tell the introducer that I support one type of address or another, but that would have to happen in foolscap. Also, it would be nice to file a bug against foolscap to have a true preference of family be possible. The bug tracker is currently down, so I keep making comments on Marcus Wanner's latest commit to his ipv6 branch of foolscap on github (https://github.com/marcuswanner/foolscap/commit/d890c7739008103ebdd2ecdb5dab971ef9cee484). Right now I'm going to split my tri-state variable 'ipversion' into the two you suggested. We'll hope that foolscap is able to either be fixed or keeps it current behavior. I'll also make a comment in the code about how it works for me but there is no official way of doing this yet.
Greg Troxel helped me understand some things about dual stack vs split stack v4/v6 implementations, it should now work in both cases. The configuration options are now outgoingfamily as either preferv6 or preferv4 and incomingfamily as inet, inet6, or both.
I still don't think that I can stop foolscap from connecting to IPv6 addresses that are advertised to it if I have IPv6 connectivity to that node. Outgoingfamily still chooses to advertise IPv6 addresses first or last based off of my experience with foolscap, but it still doesn't prevent connections over IPv6 or IPv4.
I just pushed these changes to github, so keep testing away everyone!
I forgot about foolscap's try-them-all-first-one-wins plan. Given that, I don't think it makes sense to fight the foolscap way. The usual reasons to try v6 first are to promote v6 adoption and to avoid NAT pain. The reasons to configure v4 first instead are because v6 is flaky or slow (due to infrastructure/routing, not protocol).
Longer term, foolscap should become aware of AF preference and support that somehow.
Given foolscap's try-them-all-first-one-wins behaviour, is there any real need for the
preferv4
option? If the required v6 connectivity isn't available, then the attempted v6 connections should fail quickly (or am I wrong about that?) So the only reason to usepreferv4
would be if the v6 connections can succeed but are not reliable in some way. But, in that case it would still be possible for a v6 connection to be made ifpreferv4
is set, and so setting that wouldn't solve the unreliability.In a multi-AF world, foolscap not having a "only use this AF" runtime config is at least a misfeature if not a bug.
But until foolscap gets that, I don't see the point in sorting.
Updated branch to include tests for IPv6 in client tests and introducer tests.
Added option to include fe80::/10 addresses but is off by default and should not be documented. In the future, it will allow more flexibility with fewer changes. If somebody really wants an fe80 address to show up, they can read the source code and enable the option.
An option for end to end testing would be to turn off IPv4 in all of the regular tests. This would allow all of the other tests to be tested over IPv6, thereby testing IPv6.
All my new tests pass, including the tests that I added for IPv4 addresses.
Replying to ClashTheBunny:
I think we prefer all options to be documented.
Replying to [davidsarah]comment:21:
I think the point here is that including fe80::/10 is basically broken but there are perhaps reasons why someone would want to experiment. I think clashthebunny is talking about a variable to set in the sources, not command-line support. I would say that if there's a requirement to expose this in command-line and docs, then the option shouldn't exist. I haven't seen a valid use-case for it yet.
Seems like the ticket regarding IPv6 support in Twisted got closed 10 months ago:
https://twistedmatrix.com/trac/ticket/3014
Does anyone know what else might still be missing? (and could update the ticket description with that?)
The main remaining issue is that Foolscap needs to support it: http://foolscap.lothar.com/trac/ticket/155
The last time I looked at this, Foolscap was blocked on a different Twisted bug (twisted#8014), which is preventing us from using a HostnameEndpoint to connect. We really want to use HostnameEndpoint because they handle A or AAAA records in DNS, so you can publish a normal hostname in your FURL and have clients connect over whichever of v4/v6 both ends support.
The consequence is that the process emits unhandled
AlreadyCalledError
failures when there are multiple connection hints and some of them don't answer right away. This happens all the time with automatically-generated FURLs, since they include non-routable (local) addresses and other unconnectable things. The errors cause Foolscap's unit tests to fail, and would show up as errors in the logs for a real application (probably causing Tahoe's unit tests to fail too, although maybe there we can constraint the FURLs to not hit this case).I haven't seen any movement on that ticket since I filed it 5 months ago, but it's possible that other changes in Twisted may have fixed the problem. The next step will be to re-introduce the HostnameEndpoint change and see if the Foolscap tests pass or fail with the latest version of Twisted.
There are probably some other cosmetic things that need updating: we need to make sure the FURL parser can handle dotted-quad IP addresses, and Tahoe has a handful of places that want to display IP addresses that may need changes.
Now that the Tahoe-LAFS server side supports endpoints and we have transport handlers for the client side it should be easy to get IPv6 working. I think the simplest possible solution would be:
write a IPv6 handler (client side) which uses TCP6ClientEndpoint
configure the node's tub.port= to be set to an endpoint string which uses TCP6ServerEndpoint
I've updated foolscap#155 with notes about the new
DefaultTCP
parser plan. Twisted's HostnameEndpoint works now, and current Foolscap uses it by default. So the following should work right now:tub.port = tcp6:12345
tub.location = tcp:HOSTNAME:12345
(where HOSTNAME has a valid AAAA record)When foolscap#155 is done, the following should work too:
tub.port = tcp6:12345
tub.location = tcp:[2600:3c01::f03c:91ff:fe93:d272]:12345
We're not planning to enhance the (legacy) automatic-IP-address detection routine to include IPv6 addresses, since we've deprecated that in favor of human-provided hostnames. So I think once the foolscap ticket is closed and a new release made, (and any cosmetic status displays fixed), we can declare our ipv6 support as complete and close this ticket.
Sorry for me not being sure about all the consequences of this: Does this mean foolscap can then – given IPv6 is configured properly – overcome NAT barriers?
Thanks for any clarifying comments.
Only if the machine has a publically-reachable IPv6 address. I suspect most home computers that have v6 addresses will still be blocked by a firewall of some sort. So unfortunately, no, I don't think enabling IPv6 will significantly help with the NAT barrier.
Alright, thanks. So with full administrative control, it should be possible. At least – let's see!
foolscap#155 is done. I plan to make a new Foolscap release in the next couple of days (either named 0.12.4 or 0.13.0): once that's out, we can close this ticket.
Oh, actually, this might need more work. I'm doing some manual testing, and it looks like our default behavior of listening on
tcp:PORT
only makes an IPv4 listening socket. I tried connecting to that (on a host with both IPv4 and IPv6 addresses bound to en0) withnc -6 IPV6ADDR PORT
and it wouldn't connect. If I listen ontcp6:PORT
thennc -6
works butnc -4
doesn't.I think we might need to listen on both
tcp:PORT
andtcp6:PORT
to allow A+AAAA hosts to accept both v4 and v6 connections.If so, we need tahoe.cfg's
tub.port=
to accept multiple ports (or second-guess the user and automatically addtcp6:
every time we seetcp:
, which feels a bit wrong). We either need a delimiter (whitespace? comma?) or to accept multiple config keys (liketub.1.port=
andtub.2.port=
or something). And we need the default create-node behavior to produce both kinds.And we need to see what happens if you try to listen on
tcp6:1234
on a box that doesn't have IPv6 support: either catch+ignore the error, or test ahead of time and avoid it.I bet we should avoid using commas as delimiters in the
tub.port=
string. I can't find any existing Endpoints that use commas internally, but I wouldn't be surprised if some endpoint author down the line decides to use them, and then we'll have some parsing confusion. Whitespace seems like a better option right now.Replying to warner:
Although I am not sure to what extend we're willing to change the semantics of the config file but it's an option to rename
tcp:
totcp4:
, introducetcp6:
and usetcp:
for trying IPv4 and IPv6.IMHO, most people probably don't care with which IP version data is carried.
For those who do, there is the flexibility to configure it.
Well, staying with the semantics above,
tcp:
(or any other auto-detected thing) could fail silently if at least one IP version works.Explicit configurations should fail loudly.
Good points. Twisted's endpoint language uses
tcp:
for IPv4-based TCP ports, andtcp6:
for IPv6-based ones.. they didn't add atcp4:
for anything, which is a bit inconsistent, I guess. I kind of like the idea of redefiningtub.port=
'stcp:
to mean both, but I wonder if it'd be confusing, since then we can no longer claim it's exactly an Endpoint string.Oh also, maybe we should only do the dual-
tcp:
+tcp6:
thing when we're automatically setting up the listener (withtahoe create-node --hostname=ABC
). In other cases, let the user be explicit (which might mean that the--port=
argument totahoe create-node
needs to accept multiple ports too.. maybetahoe create-node --port "tcp:1234 tcp6:1234"
?).Also also, endpoint strings can include paths (to TLS certificates, and unix-domain sockets), and on a sufficiently ill-advised system, those might include spaces. So maybe whitespace as a delimiter isn't such a great idea after all.
I thought of another use case where you might want multiple listening ports (listening on a public v4/v6 address and a Tor hidden-service's locally-forwarded port), except that in that case I think we decided the Tor/I2P listeners would be added independently, instead of being listen in
tub.port
.Replying to warner:
I see, interesting. I can't judge on this. 0.02:
Does it actually matter to have proper Endpoints (as a user: never cared)?
Do Tahoe users ever come in direct contact with Twisted (as a user: don't want to)?
But your point is definitely to consider and maybe a show stopper for
tcp4:
.Yes, IMHO the automatic mode should always be default unless explicitly configured otherwise.
tahoe create-node --port …
could use the same delimiter astub.port
for consistency.Speaking of file system paths (mind Windows), there are not much delimiters we can use while maintaining full compatibility with all possible paths. It's probably inevitable to choose "just any".
Replying to [lpirl]comment:37:
Well, it's nice to be able to say "for more complex situations, read the Twisted endpoint docs, because --port is really just an endpoint string", and delegate all that documentation job to the Twisted folks.
Yeah. Ok, so I think we can say that
--listen=tcp
(which is the default) will mean "listen on both v4 and v6, whichever is available", and it can cause multiple endpoint strings to get written into tahoe.cfg.Good point. We'll just document that some unusual endpoint strings won't work, if their internal characters are mistaken as
tub.port
delimiters.comma separated endpoint descriptor strings in tub.port; pull-request for your review https://github.com/tahoe-lafs/tahoe-lafs/pull/348
looks good, I'll land it in a minute.
Still to do for this ticket:
tahoe create-node --hostname=
should detect if v6 is available, then write out atub.port =
with bothtcp:PORT
andtcp6:PORT
. Or maybe we don't need to detect anything first? We must make sure the node won't crash at startup if v6 is not available, which means we need a host without v6 support to learn what sort of exception might get raised.In b00c2d2/trunk:
I was testing out the IPv4 + IPv6 on a couple of servers... running an introducer + storage node on one and another storage node on the other. I noticed that it dOES NOT work to specify the following:
However it works fine if i specify the interfaces in both endpoint descriptor strings like so:
i've posted a PR to fix the configuration docs here:
https://github.com/tahoe-lafs/tahoe-lafs/pull/352
IPv6 essentially works in Tahoe-LAFS now, as of dawuud's 2016 changes. There are some remaining usability nits but they don't block any actual functionality.
Also, I had to read 40+ comments on this ticket to figure that out.
So I'm closing this as fixed. If someone is concerned with the usability nits, they can file new tickets for them.
One ticket, one feature, one PR, one master merge, please. ;)