aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/discover
Commit message (Collapse)AuthorAgeFilesLines
* p2p/discover: bond with seed nodes too (runs only if findnode failed)Péter Szilágyi2015-05-271-7/+4
|
* p2p/discovery: fix a cornercase loop if no seeds or bootnodes are knownPéter Szilágyi2015-05-271-5/+9
|
* p2p/discover: force refresh if the table is emptyPéter Szilágyi2015-05-271-13/+41
|
* p2p/discover: permit temporary bond failures for previously known nodesPéter Szilágyi2015-05-271-12/+15
|
* p2p/discover: watch find failures, evacuate on too many, rebond if failedPéter Szilágyi2015-05-271-8/+47
|
* p2p/discover: add support for counting findnode failuresPéter Szilágyi2015-05-272-3/+25
|
* p2p/discover: add ReadRandomNodesFelix Lange2015-05-252-1/+83
|
* p2p/discover: fix #838, evacuate self entries from the node dbPéter Szilágyi2015-05-223-25/+99
|
* p2p/discover: fix database presistency test folderPéter Szilágyi2015-05-221-3/+3
|
* p2p/discover: limit open files for node databaseFelix Lange2015-05-141-2/+3
|
* p2p/discover: bump maxBondingPingPongs to 16Felix Lange2015-05-141-1/+1
| | | | | This should increase the speed a bit because all findnode results (up to 16) can be verified at the same time.
* p2p/discover: fix out-of-bounds slicing for chunked neighbors packetsFelix Lange2015-05-142-32/+49
| | | | | The code assumed that Table.closest always returns at least 13 nodes. This is not true for small tables (e.g. during bootstrap).
* fix test.subtly2015-05-141-1/+1
|
* Manual send of multiple neighbours packets. Test receiving multiple ↵subtly2015-05-142-3/+19
| | | | neighbours packets.
* UDP Interop. Limit datagrams to 1280bytes.subtly2015-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't have a UDP which specifies any messages that will be 4KB. Aside from being implemented for months and a necessity for encryption and piggy-backing packets, 1280bytes is ideal, and, means this TODO can be completed! Why 1280 bytes? * It's less than the default MTU for most WAN/LAN networks. That means fewer fragmented datagrams (esp on well-connected networks). * Fragmented datagrams and dropped packets suck and add latency while OS waits for a dropped fragment to never arrive (blocking readLoop()) * Most of our packets are < 1280 bytes. * 1280 bytes is minimum datagram size and MTU for IPv6 -- on IPv6, a datagram < 1280bytes will *never* be fragmented. UDP datagrams are dropped. A lot! And fragmented datagrams are worse. If a datagram has a 30% chance of being dropped, then a fragmented datagram has a 60% chance of being dropped. More importantly, we have signed packets and can't do anything with a packet unless we receive the entire datagram because the signature can't be verified. The same is true when we have encrypted packets. So the solution here to picking an ideal buffer size for receiving datagrams is a number under 1400bytes. And the lower-bound value for IPv6 of 1280 bytes make's it a non-decision. On IPv4 most ISPs and 3g/4g/let networks have an MTU just over 1400 -- and *never* over 1500. Never -- that means packets over 1500 (in reality: ~1450) bytes are fragmented. And probably dropped a lot. Just to prove the point, here are pings sending non-fragmented packets over wifi/ISP, and a second set of pings via cell-phone tethering. It's important to note that, if *any* router between my system and the EC2 node has a lower MTU, the message would not go through: On wifi w/normal ISP: localhost:Debug $ ping -D -s 1450 52.6.250.242 PING 52.6.250.242 (52.6.250.242): 1450 data bytes 1458 bytes from 52.6.250.242: icmp_seq=0 ttl=42 time=104.831 ms 1458 bytes from 52.6.250.242: icmp_seq=1 ttl=42 time=119.004 ms ^C --- 52.6.250.242 ping statistics --- 2 packets transmitted, 2 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 104.831/111.918/119.004/7.087 ms localhost:Debug $ ping -D -s 1480 52.6.250.242 PING 52.6.250.242 (52.6.250.242): 1480 data bytes ping: sendto: Message too long ping: sendto: Message too long Request timeout for icmp_seq 0 ping: sendto: Message too long Request timeout for icmp_seq 1 Tethering to O2: localhost:Debug $ ping -D -s 1480 52.6.250.242 PING 52.6.250.242 (52.6.250.242): 1480 data bytes ping: sendto: Message too long ping: sendto: Message too long Request timeout for icmp_seq 0 ^C --- 52.6.250.242 ping statistics --- 2 packets transmitted, 0 packets received, 100.0% packet loss localhost:Debug $ ping -D -s 1450 52.6.250.242 PING 52.6.250.242 (52.6.250.242): 1450 data bytes 1458 bytes from 52.6.250.242: icmp_seq=0 ttl=42 time=107.844 ms 1458 bytes from 52.6.250.242: icmp_seq=1 ttl=42 time=105.127 ms 1458 bytes from 52.6.250.242: icmp_seq=2 ttl=42 time=120.483 ms 1458 bytes from 52.6.250.242: icmp_seq=3 ttl=42 time=102.136 ms
* removed redundant newlines in import blockBas van Kervel2015-05-121-1/+1
|
* replaced several path.* with filepath.* which is platform independentBas van Kervel2015-05-121-2/+2
|
* p2p/discover: bump packet timeouts to 500msFelix Lange2015-05-071-2/+2
|
* p2p/discover: new distance metric based on sha3(id)Felix Lange2015-05-066-106/+354
| | | | | | | The previous metric was pubkey1^pubkey2, as specified in the Kademlia paper. We missed that EC public keys are not uniformly distributed. Using the hash of the public keys addresses that. It also makes it a bit harder to generate node IDs that are close to a particular node.
* p2p/discover: track sha3(ID) in NodeFelix Lange2015-04-308-99/+166
|
* p2p, p2p/discover: protocol version 4Felix Lange2015-04-301-1/+1
|
* p2p/discover: new endpoint formatFelix Lange2015-04-307-119/+150
| | | | | | This commit changes the discovery protocol to use the new "v4" endpoint format, which allows for separate UDP and TCP ports and makes it possible to discover the UDP address after NAT.
* p2p/discover: fix api issues caused by leveldb updatePéter Szilágyi2015-04-281-4/+6
|
* p2p/discover: fix goroutine leak due to blocking on sync.OncePéter Szilágyi2015-04-282-13/+24
|
* p2p/discover: add node expirer and related testsPéter Szilágyi2015-04-273-4/+116
|
* p2p/discover: parametrize nodedb version, add persistency testsPéter Szilágyi2015-04-273-11/+62
|
* p2p/discover: drop a superfluous warningPéter Szilágyi2015-04-271-1/+1
|
* p2p/discover: wrap the pinger to update the node db tooPéter Szilágyi2015-04-271-4/+15
|
* p2p/discover: use iterator based seeding, drop old protocol testPéter Szilágyi2015-04-272-45/+118
|
* p2p/discover: write the basic tests, catch RLP bugPéter Szilágyi2015-04-273-8/+150
|
* p2p/discovery: fix issues raised in the nodeDb PRPéter Szilágyi2015-04-272-36/+32
|
* cmd/bootnode, eth, p2p, p2p/discover: use a fancier db designPéter Szilágyi2015-04-246-156/+273
|
* cmd/bootnode, eth, p2p, p2p/discover: clean up the seeder and mesh into eth.Péter Szilágyi2015-04-246-137/+154
|
* p2p/discovery: fix broken tests due to API updatePéter Szilágyi2015-04-242-4/+4
|
* p2p/discovery: use the seed table for finding nodes, auto drop stale onesPéter Szilágyi2015-04-242-5/+38
|
* cmd, eth, p2p, p2p/discover: init and clean up the seed cachePéter Szilágyi2015-04-243-7/+21
|
* p2p/discover: store nodes in leveldbFelix Lange2015-04-242-13/+73
|
* p2p/discover: use rlp.DecodeBytesFelix Lange2015-04-171-1/+1
|
* p2p/discover: improve timer handling for reply timeoutsFelix Lange2015-04-141-2/+3
|
* p2p/discover: remove unused field Node.activeStampFelix Lange2015-04-132-16/+0
|
* p2p/discover: don't log packet contentFelix Lange2015-04-101-3/+4
|
* p2p/discover: make packet processing less concurrentFelix Lange2015-04-101-6/+4
|
* Updated loggingobscuren2015-04-071-10/+9
|
* p2p/discover: fix off by one error causing buckets to contain duplicatesFelix Lange2015-04-012-1/+43
|
* p2p/discover: implement node bondingFelix Lange2015-04-015-383/+649
| | | | | | | | | | | | | | | | This a fix for an attack vector where the discovery protocol could be used to amplify traffic in a DDOS attack. A malicious actor would send a findnode request with the IP address and UDP port of the target as the source address. The recipient of the findnode packet would then send a neighbors packet (which is 16x the size of findnode) to the victim. Our solution is to require a 'bond' with the sender of findnode. If no bond exists, the findnode packet is not processed. A bond between nodes α and β is created when α replies to a ping from β. This (initial) version of the bonding implementation might still be vulnerable against replay attacks during the expiration time window. We will add stricter source address validation later.
* p2p/discover: add version number to ping packetFelix Lange2015-04-011-0/+8
| | | | | | The primary motivation for doing this right now is that old PoC 8 nodes and newer PoC 9 nodes keep discovering each other, causing handshake failures.
* %#x => %xobscuren2015-03-201-2/+2
|
* p2p: server>discover table Self=Node exportedzelig2015-03-151-3/+3
|
* p2p/discover: add NodeID.PubkeyFelix Lange2015-03-042-0/+33
|
* p2p/discover: fix pending replies iterationFelix Lange2015-02-171-1/+2
| | | | | | Range expressions capture the length of the slice once before the first iteration. A range expression cannot be used here since the loop modifies the slice variable (including length changes).
* p2p/discover: fix race in ListenUDPFelix Lange2015-02-131-24/+17
| | | | | udp.Table was assigned after the readLoop started, so packets could arrive and be processed before the Table was there.
* p2p/discover: map listening port using configured mechanismFelix Lange2015-02-132-13/+24
|
* p2p/discover: code review fixesFelix Lange2015-02-133-7/+9
|
* p2p/discover: deflake UDP testsFelix Lange2015-02-094-59/+123
|
* cmd/ethereum, cmd/mist: add flag for discovery bootstrap nodesFelix Lange2015-02-071-2/+2
|
* p2p/discover: add node URL functions, distinguish TCP/UDP portsFelix Lange2015-02-076-321/+527
| | | | | The discovery RPC protocol does not yet distinguish TCP and UDP ports. But it can't hurt to do so in our internal model.
* p2p/discover: add some helper functionsFelix Lange2015-02-064-20/+41
|
* p2p/discover: new package implementing the Node Discovery ProtocolFelix Lange2015-02-064-0/+1428