Commit Graph

35 Commits

Author SHA1 Message Date
Kleissner
f7e8f1821b New flag Firewall in the Features field to inform uncontacted peers that a Traverse message might be required to establish a connection. Close #61
This flag can be activated via the config setting LocalFirewall.
The Features field exists in Announcement/Response messages and was now added to peer records.
2021-11-20 04:28:03 +01:00
Kleissner
a8592e9975 Fix #46: Transfer receive data function must be started in go routine since it is blocking. 2021-10-25 06:10:12 +02:00
Kleissner
b5266b1c52 File Transfer: Add header to file transfer to indicate file size and transfer size. This is important to know when to stop reading. It will also help when reading only ranges (which is important for video streaming).
New function FileTransferReadHeaderUDT to read the header.
Warehouse: ReadFile return count bytes read
2021-10-25 03:34:28 +02:00
Kleissner
f6bbd02a01 Transfer: Change virtual connection from net.PacketConn to channels which is faster and less complex.
Improve termination behavior and documentation of it.
2021-10-24 06:27:23 +02:00
Kleissner
75e3d9a42e Initial UDT implementation for file transfer.
New function RequestFileTransferUDT to download files from other peers.
2021-10-24 04:26:30 +02:00
Kleissner
c9d9be2972 Refactor message encoding into protocol package. User Agent must be now provided in the Init function. 2021-10-18 04:37:02 +02:00
Kleissner
be7b596551 Rename field sequence in MessageRaw due to name collision in PacketRaw 2021-10-17 19:42:19 +02:00
Kleissner
93f10fd3b5 Untangle connection from MessageRaw, paving the way for refactoring the message code into the protocol package. 2021-10-17 16:39:41 +02:00
Kleissner
0c7b1e0e03 Start refactoring protocol code into sub package. Move Packet Encoding and list of Commands. Change SetSelfReportedPorts parameters.
More related commits to follow!
2021-10-17 16:28:19 +02:00
Kleissner
2937154c8d Add filters for low-level packet and high-level message interception for debugging purposes. Close #4 2021-07-31 17:29:14 +02:00
Kleissner
3233bf5c1b New Filters.IncomingRequest to intercept incoming information requests of all types 2021-07-29 04:10:53 +02:00
Kleissner
96ee35ebf9 Finalize filter for log messages. Close #26 2021-06-29 00:48:22 +02:00
Kleissner
1a44b9c5e7 Include both IPv4/IPv6 addresses in peer records in Response message. This makes peer list sharing more efficient and speeds up discovery. Close #24 2021-05-21 02:33:32 +02:00
Kleissner
82033e124a Finalize Traverse message implementation. Close #23
Remove createVirtualAnnouncement function, no longer needed.
2021-05-19 14:56:39 +02:00
Kleissner
db46b80e3f Move ping code to separate file (no changes) 2021-05-09 15:37:32 +02:00
Kleissner
f084edc316 New function record.IsBadQuality to make sure bad peers returned in the Response message are not considered.
Improved remote peer NAT detection. Placeholder for sending the Traverse message.
Fix in handling incoming FIND_PEER request. Do not return self as closest node.
Do not share peers for which the internal port is not known.
2021-05-09 00:49:34 +02:00
Kleissner
530cd541c1 Add new fields Port Internal and Port External to the exchanged peer record according to the latest Whitepaper 0.7.3.
This allows peers to detect each other's NAT and port forwarding status.
2021-05-08 13:03:45 +02:00
Kleissner
eb0afce3f9 Fix race condition in cmdResponse. 2021-05-06 14:54:28 +02:00
Kleissner
0fe2ce60ec Add reported internal and external port to Connection. New function peer.IsBehindNAT.
PeerlistAdd is now called on every incoming message. User Agent fixes.
2021-05-04 01:13:11 +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
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
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
e69589c5c8 Kademlia: Use information requests from updated DHT library. More testing & fixes upcoming. 2021-04-09 16:36:35 +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
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
213c724016 Detect network changes, initial code. Actions to be developed. #2 2021-03-02 00:28:03 +01:00
Kleissner
fec5644b9f Connections: Introduce Redundant type to lower ping overhead. 2021-03-01 03:41:26 +01:00
Kleissner
dcc7464f46 New function IsNetworkErrorFatal to invalidate connections on fatal network errors. Use connection.Expires field to trigger removal of inactive connections after a while. 2021-03-01 01:05:37 +01:00
Kleissner
b53ab7c7b3 Reworked connection code. Pings are now regularly sent out to every connection to check if it remains valid.
Invalid connections are moved to a second list, and eventually dropped if they don't become active.
2021-02-28 20:59:39 +01:00
Kleissner
ea05439262 No code changes; export some functions/struct. 2021-02-26 14:45:16 +01:00
Kleissner
fec65603f5 Initial commit. 2021-02-26 05:57:42 +01:00