From 481d19e3034e810e99492fa760f3b04a141a5a34 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Tue, 7 Aug 2018 15:02:02 +0700 Subject: [PATCH] add QUIC support License: MIT Signed-off-by: Marten Seemann --- core/core.go | 5 +++++ docs/experimental-features.md | 34 ++++++++++++++++++++++++++++++++-- package.json | 10 ++++++++-- 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/core/core.go b/core/core.go index f59ab754a..2c41a349c 100644 --- a/core/core.go +++ b/core/core.go @@ -59,6 +59,7 @@ import ( exchange "gx/ipfs/QmWw71Mz9PXKgYG8ZfTYN7Ax2Zm48Eurbne3wC2y7CKmLz/go-ipfs-exchange-interface" ipld "gx/ipfs/QmX5CsuHyVZeTLxgRSYkgLSDQKb9UjE8xnhQzCEJWWWFsC/go-ipld-format" smux "gx/ipfs/QmY9JXR3FupnYAYJWK9aMr9bCpqWKcToQ1tz8DVGTrHpHw/go-stream-muxer" + quic "gx/ipfs/QmYfvQoJCUTCJ54Rog3zWSCDWAkwLWFTMKzcwaNMpXYSQT/go-libp2p-quic-transport" ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" cid "gx/ipfs/QmZFbDTY9jfSBms2MchvYM9oYRbAF19K7Pby47yDBfpPrb/go-cid" pnet "gx/ipfs/QmZaQ3K9PRd5sYYoG1xbTGPtd3N7TYiKBRmcBUTsx8HVET/go-libp2p-pnet" @@ -248,6 +249,10 @@ func (n *IpfsNode) startOnlineServices(ctx context.Context, routingOption Routin libp2pOpts = append(libp2pOpts, libp2p.EnableRelay(opts...)) } + if cfg.Experimental.QUIC { + libp2pOpts = append(libp2pOpts, libp2p.Transport(quic.NewTransport)) + } + peerhost, err := hostOption(ctx, n.Identity, n.Peerstore, libp2pOpts...) if err != nil { diff --git a/docs/experimental-features.md b/docs/experimental-features.md index 34bc13954..b4c590157 100644 --- a/docs/experimental-features.md +++ b/docs/experimental-features.md @@ -435,5 +435,35 @@ run your daemon with the `--enable-namesys-pubsub` flag; enables pubsub. - [ ] Needs more people to use and report on how well it works - [ ] Add a mechanism for last record distribution on subscription, - so that we don't have to hit the DHT for the initial resolution. - Alternatively, we could republish the last record periodically. + so that we don't have to hit the DHT for the initial resolution. + Alternatively, we could republish the last record periodically. + + + +## QUIC + +### In Version + +0.4.18 + +### State + +Experiment, disabled by default + +### How to enable + +Modify your ipfs config: + +``` +ipfs config --json Experimental.QUIC true +``` + +For listening on a QUIC address, add it the swarm addresses, e.g. `/ip4/0.0.0.0/udp/4001/quic`. + + +### Road to being a real feature + +- [ ] The IETF QUIC specification needs to be finalised. +- [ ] Make sure QUIC connections work reliably +- [ ] Make sure QUIC connection offer equal or better performance than TCP connections on real world networks +- [ ] Finalize libp2p-TLS handshake spec. diff --git a/package.json b/package.json index a060d69da..4ab03eba9 100644 --- a/package.json +++ b/package.json @@ -47,9 +47,9 @@ "version": "0.1.3" }, { - "hash": "Qma3W91Bv19pWABzgjhdCM2PrTWcdS41bp52kp4Bd3xZYk", + "hash": "QmZfgNhC8E8ys86AeJb2QuRXbq5HK3gPott2df5PgsSsJh", "name": "iptb", - "version": "1.3.8" + "version": "1.3.9" }, { "hash": "QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8", @@ -545,6 +545,12 @@ "hash": "QmfXU2MhWoegxHoeMd3A2ytL2P6CY4FfqGWc23LTNWBwZt", "name": "go-multiaddr-dns", "version": "0.2.4" + }, + { + "author": "marten-seemann", + "hash": "QmYfvQoJCUTCJ54Rog3zWSCDWAkwLWFTMKzcwaNMpXYSQT", + "name": "go-libp2p-quic-transport", + "version": "0.2.3" } ], "gxVersion": "0.10.0",