Commit Graph

37 Commits

Author SHA1 Message Date
Jeromy
a19ad97ea5 make ping its own protocol
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-13 19:19:25 -07:00
Juan Batiz-Benet
500bb51759 p2p/net/identify: clump addr observers into groups
Different mutliaddrs is not enough. Nodes may share transports.
NAT port mappings will likely only work on the base IP/TCP port
pair. We go one step further, and require different root (IP)
addrs. Just in case some NATs group by IP. In practice, this is
what we want: use addresses only if hosts that are on different
parts of the network have seen this address.
2015-06-07 17:00:56 -07:00
Juan Batiz-Benet
96ed20bffe p2p/protocol/identify: dont double count observers
If the same peer observed the same address twice, it would be
double counted as different observations. This change adds a map
to make sure we're counting each observer once.

This is easily extended to require more than two observations,
but i have not yet encountered NATs for whom this is relevant.
2015-06-07 16:48:02 -07:00
rht
3547f7ae33 Replace 'var * bytes.Buffer' with '\1 := new(bytes.Buffer)' 2015-05-26 23:18:04 +07:00
Henry
5fff7742f3 godeps: move (go)goprotobuf to github location 2015-04-28 13:42:22 +02:00
Jeromy
2c8cb9fc75 bandwidth metering on streams
humanize bandwidth output

instrument conn.Conn for bandwidth metrics

add poll command for continuous bandwidth reporting

move bandwidth tracking onto multiaddr net connections

another mild refactor of recording locations

address concerns from PR

lower mock nodes in race test due to increased goroutines per connection
2015-03-31 19:58:08 -07:00
Ho-Sheng Hsiao
bf22aeec0a Reorged imports from jbenet/go-ipfs to ipfs/go-ipfs
- Modified Godeps/Godeps.json by hand
- [TEST] Updated welcome docs hash to sharness
- [TEST] Updated contact doc
- [TEST] disabled breaking test (t0080-repo refs local)
2015-03-31 12:52:25 -07:00
Henry
92d08db7a5 rewrote import paths of go.net/context to use golang.org/x/context
- updated go-ctxgroup and goprocess
ctxgroup: AddChildGroup was changed to AddChild. Used in two files:
- p2p/net/mock/mock_net.go
- routing/dht/dht.go

- updated context from hg repo to git
prev. commit in hg was ad01a6fcc8a19d3a4478c836895ffe883bd2ceab. (context: make parentCancelCtx iterative)
represents commit 84f8955a887232b6308d79c68b8db44f64df455c in git repo

- updated context to master (b6fdb7d8a4ccefede406f8fe0f017fb58265054c)

Aaron Jacobs (2):
net/context: Don't accept a context in the DoSomethingSlow example.
context: Be clear that users must cancel the result of WithCancel.

Andrew Gerrand (1):
go.net: use golang.org/x/... import paths

Bryan C. Mills (1):
net/context: Don't leak goroutines in Done example.

Damien Neil (1):
context: fix removal of cancelled timer contexts from parent

David Symonds (2):
context: Fix WithValue example code.
net: add import comments.

Sameer Ajmani (1):
context: fix TestAllocs to account for ints in interfaces
2015-02-25 11:58:19 +01:00
Jeromy
2309266f73 allow removal of stream handlers 2015-02-18 19:11:37 +00:00
Brian Tiger Chow
0db1a94862 misc: suppress logs to Debug (from Info) 2015-02-14 14:13:53 -08:00
Juan Batiz-Benet
ee4a9a2711 p2p/protocol/identity: smarter tracking observed addrs
- time them out (already was doing that with addrbook)
- keep count to counter symmetric nats
2015-02-05 10:15:16 -08:00
Juan Batiz-Benet
58f39687cf logs: removed all log.Errors unhelpful to users
Let's save log.Error for things the user can take action on.
Moved all our diagnostics to log.Debug. We can ideally reduce them
even further.
2015-02-03 01:06:07 -08:00
Juan Batiz-Benet
37007b9c2b p2p/protocol/id: log version mismatch disconnects 2015-02-02 21:05:33 -08:00
Juan Batiz-Benet
690619145a p2p/protocol/id: break on version mismatch.
TODOs:
- need to consolidate all the versioning stuff into one package
- need to do the version check as a handshake, before further
  communication happens. we used to do this.
2015-02-02 21:05:32 -08:00
Juan Batiz-Benet
e908effb4b AddrManager: use addr manager with smarter TTLs
This addr manager should seriously help with the addrsplosion
problem.
2015-02-02 21:04:14 -08:00
Brian Tiger Chow
b47241a762 doc(p2p/mux) rm stale comment 2015-02-01 21:54:20 -08:00
Brian Tiger Chow
ecddbd3a56 fix(mux) hold lock when reading default handler field 2015-02-01 21:49:39 -08:00
Jeromy
97e99ca167 fix nil pointer panic on version strings in ID message 2015-01-29 23:07:32 +00:00
Brian Tiger Chow
a58f3c3bfe remove message 2015-01-27 16:24:36 -08:00
Juan Batiz-Benet
3118777a5e p2p/id: SET listen addrs, clearing old ones. 2015-01-26 19:23:42 -08:00
Juan Batiz-Benet
45e4352c9c dropped down log.Errors 2015-01-26 19:13:44 -08:00
Juan Batiz-Benet
76d9d89aff user friendliness in logs + output 2015-01-26 17:01:00 -08:00
Juan Batiz-Benet
158f5061e0 p2p: own addresses gotten from host 2015-01-26 14:00:00 -08:00
Juan Batiz-Benet
773ee2e25d p2p/proto/id: more helpful log 2015-01-23 02:08:29 -08:00
Juan Batiz-Benet
8e9413bd57 p2p/proto/mux: make log more useful 2015-01-23 02:08:29 -08:00
Juan Batiz-Benet
e59b88dace p2p/proto/identify: use observed listen addrs
This commit finally makes use of the sent observed addrs.
If the connection's local address is from one of our
listen addrs, then the remote's observed addr is its
natted mapping, which is useful to us. For now, we add
it directly to our address book. (a future commit should
make addressbook addresses expire)
2015-01-19 23:18:51 -08:00
Brian Tiger Chow
aec0b31d44 eventlog: rm noisy low-signal statement 2015-01-18 14:41:42 -08:00
Brian Tiger Chow
884143bf9c move generic packages to thirdparty (see thirdparty/README.md) 2015-01-18 14:04:45 -08:00
Brian Tiger Chow
c341df0a4c fix(mux) expose method to SetDefaultHandler 2015-01-14 16:26:21 -08:00
Brian Tiger Chow
2678795dac fix: privatize Mux fields 2015-01-14 16:18:01 -08:00
Brian Tiger Chow
5b3164de5c refactor(repo/config) move config under repo 2015-01-13 03:09:30 -08:00
Juan Batiz-Benet
85e3024731 vendor identify pb
not sure how it wasnt an error
2015-01-02 08:46:47 -08:00
Juan Batiz-Benet
8fb5cf9578 swap net2 -> net 2015-01-02 08:46:46 -08:00
Juan Batiz-Benet
dadb8b775b host interface + services
The separation of work in the p2p pkg is as follows:

- net implements the Swarm and connectivity
- protocol has muxer and header protocols
- host implements protocol muxing + services
- identify took over handshake completely! yay.
- p2p package works as a whole
2015-01-02 08:46:46 -08:00
Juan Batiz-Benet
ba09447251 mux: close stream on error
remove comment about spdystream. this is now
superceded by go-peerstream interface.
2015-01-02 08:46:46 -08:00
Juan Batiz-Benet
0ef035ef08 combined protocol and mux 2015-01-02 08:46:45 -08:00
Juan Batiz-Benet
e0b9a368b8 protocol and muxer pkg 2015-01-02 08:46:45 -08:00