Commit Graph

60 Commits

Author SHA1 Message Date
Kleissner
35f50230cd Add 2 root peers. New seed list auto update. 2021-04-25 04:40:45 +02:00
Kleissner
f13695709f Kademlia: Initial bucket refresh implementation. This might be improved down the road. 2021-04-25 04:22:10 +02:00
Kleissner
611dfa3b1c RefreshBuckets: Use self ID on bucket 0. 2021-04-25 03:44:52 +02:00
Kleissner
1c03afd63b Fix: Check if channel is closed. 2021-04-25 00:07:53 +02:00
Kleissner
63e736486a Implement auto refresh of buckets. Close #11 2021-04-24 23:06:08 +02:00
Kleissner
6693d442a6 Add function dht.RefreshBuckets. Use RW mutex for accessing hash table. 2021-04-24 22:42:39 +02:00
Kleissner
146bb6991e Proper ShouldEvict implementation 2021-04-22 06:11:39 +02:00
Kleissner
27152cb145 Provide old and new peer in ShouldEvict. New comparison function IsNodeCloser.
Remove unused code (which was likely buggy anyway).
2021-04-22 05:45:46 +02:00
Kleissner
4b905f4eab Enable local peer discovery for public IPv4s for now. 2021-04-21 03:42:46 +02:00
Kleissner
ec809029d8 Sequences add pointer to high-level data. Proper mapping of sequences to information requests. 2021-04-21 03:27:03 +02:00
Kleissner
e432696ad1 dht.Get return sender's nodeID 2021-04-21 03:06:30 +02:00
Kleissner
8a33f19986 Remove unnecessary ListIR. Removes complexity. 2021-04-21 02:49:31 +02:00
Kleissner
0dd9ef028b Fix race condition in sequence validation and invalidation. Once they are now checked, they can be immediately invalidated. 2021-04-20 17:20:55 +02:00
Kleissner
8269219cf0 Fix sendAllNetworks: New sequence number per packet 2021-04-20 07:18:46 +02:00
Kleissner
62c4b370fc New announcementPacket structure to report back values up the chain 2021-04-20 05:25:56 +02:00
Kleissner
8bb1a3bdf7 GetRTT function 2021-04-19 15:32:14 +02:00
Kleissner
1eb4f4083b Implement SEQUENCE_LAST flag 2021-04-19 15:05:17 +02:00
Kleissner
b2db81143e Proper message sequence implementation for Response and Pong messages. Record round-trip time at connection level! Reply timeout. Close #13 #5
Fixes.
2021-04-19 05:18:07 +02:00
Kleissner
00db57aed8 Provide the new sequence number in responses. New message Local Discovery to be sent instead of Announcement via IPv4 Broadcast and IPv6 Multicast.
Detecting IPv6 link-local addresses as local ones. Fixes.
2021-04-18 21:50:30 +02:00
Kleissner
703e40c947 Add Sequence field #13 to packet header according to latest Whitepaper 0.7.1
The field is yet to be used.
2021-04-18 05:22:19 +02:00
Kleissner
a82f575816 Embed IsLast indicator in bit 15 of count of peer records field 2021-04-18 03:18:59 +02:00
Kleissner
ce2d3309af Update seed list. New function LoadConfigOut to parse main config into custom structure.
Remove reuseport module file (not needed).
2021-04-15 12:59:06 +02:00
Kleissner
6a9d167177 Module update 2021-04-10 16:06:55 +02:00
Kleissner
ff9804bf6d Start with the store code. Properly handle announcement requests.
Add core data functions: Data2Hash, GetData, GetDataLocal, GetDataDHT, StoreDataLocal, StoreDataDHT
2021-04-10 16:00:43 +02:00
Kleissner
96213d4ed9 Minor fixes. dht.Store and Get work now! 2021-04-10 15:43:56 +02:00
Kleissner
27ec231e14 Moving store code to nested module 2021-04-09 22:41:08 +02:00
Kleissner
e69589c5c8 Kademlia: Use information requests from updated DHT library. More testing & fixes upcoming. 2021-04-09 16:36:35 +02:00
Kleissner
c44e57a0a0 Add information request list to DHT structure. It keeps track of requests and matches responses.
Break up SendRequest into individual functions SendRequestStore and SendRequestFindNode, which improves readability.
Alpha parameter must be now passed. MarkNodeAsSeen is exported.
Breaking up dht.iterate and embedding into 3 functions Get, FindNode, and FindValue.
2021-04-09 16:07:20 +02:00
Kleissner
7927e18572 Add Connectivity documentation 2021-04-05 18:43:59 +02:00
Kleissner
b2cbe2d066 Support for feature bits: IPv4_LISTEN and IPv6_LISTEN
Share IPv4/IPv6 peer connections only if supported by the remote peer.
2021-04-05 14:58:47 +02:00
Kleissner
d83123bf46 dht.GetClosestContacts introduce custom filter function 2021-04-05 14:45:33 +02:00
Kleissner
f4473c6139 Add MIT license. Close #12
Note: This applies and affects only the core library.
2021-04-05 11:01:58 +02:00
Kleissner
b8e408048c Add byte to Announcement/Response to inform about sender's feature support. According to Whitepaper 0.7. 2021-03-17 11:40:20 +01:00
Kleissner
ddd3f65187 Fix in msgEncodeResponse when multiple peers are returned in a Response message 2021-03-17 02:56:17 +01:00
Kleissner
75c0d12850 Adding initial 2 root peers. The Peernet network is live! 16.03.2021 2021-03-16 23:04:28 +01:00
Kleissner
8d2a94d078 Add go module for core package 2021-03-16 22:31:22 +01:00
Kleissner
8b329f7258 Enable go module for sub packages 2021-03-16 22:19:15 +01:00
Kleissner
caf3a4f11c initSeedList skip if self 2021-03-16 19:59:54 +01:00
Kleissner
81fd372b0a contactArbitraryPeer only if not already in peer list.
Remove nodes from Kademlia structure when appropriate.
2021-03-16 15:55:13 +01:00
Kleissner
e8b53051f2 Convert tabs to white spaces 2021-03-16 14:36:17 +01:00
Kleissner
842d5c7c7b Add use paragraph to readme 2021-03-16 14:35:16 +01:00
Kleissner
cfb0129152 Forking dependency reuseport. Close #8 2021-03-16 14:24:37 +01:00
Kleissner
3080119fc1 Initial working Kademlia network - peer list exchange is working!
Using the announcement and response messages to exchange peer lists. Fixes in encoding.
Add arbitrary Info structure to DHT Lite/Node.
2021-03-15 22:25:05 +01:00
Kleissner
323f379ee7 Message encoding of announcement and response messages.
More changes coming.
Rename of organization to Peernet s.r.o.
InformationRequest proper termination signal.
2021-03-14 04:30:57 +01:00
Kleissner
f120971944 Initial code of DHT Lite. Requires more testing and iterations (pun intended). 2021-03-08 03:15:52 +01:00
Kleissner
b5395d9186 DHT: Add in-memory store. 2021-03-06 12:45:20 +01:00
Kleissner
5ff6b5ccc1 DHT: Starting with the fork, initially only the hash table.
The distributed part follows.
2021-03-06 11:55:37 +01:00
Kleissner
73e1643548 Network detection proper action on IP new and remove. Close #2 2021-03-02 13:40:29 +01:00
Kleissner
76e4114be9 Network start listening on new interfaces #2
Removal from listening IP map
2021-03-02 04:48:08 +01:00
Kleissner
56a24b8b64 Termination of networks upon removal of their network adapter. 2021-03-02 04:14:22 +01:00