Commit Graph

63 Commits

Author SHA1 Message Date
Kim De Mey 26212c881b
Use results.Opt instead of option in discv5, utp and nat (#705)
+ some other minor cleanups
2024-06-18 18:09:27 +02:00
Kim De Mey 207244c2db
Add more missing async raises in uTP (#702) 2024-06-12 18:01:23 +02:00
Kim De Mey c3f9160fd2
Add async raises annotations for uTP code (#692)
* Add async raises annotations for uTP code

* Avoid compiler error + further clean-up
2024-06-11 13:56:37 +02:00
Kim De Mey 21f3014f54
Remove usage of stew/shim/net (#670)
* Remove usage of stew/shim/net and replace with std/net where needed

* Remove chronosStrictException compile flag
2024-01-24 09:09:11 +01:00
Kim De Mey 19965bab95
Fix chronos related deprecated warnings in uTP code part II (#669)
This also makes the uTP SendCallBack not returning a Future any
more as it is not used in sendData anyhow. And in case of uTP
over discv5, discv5 send call is already not async.

This gives quite a noticable throughput benchmark improvement over
with uTP over UDP, and a slightly noticable with uTP over discv5
2024-01-23 18:41:38 +01:00
Kim De Mey 496bcdab74
Fix chronos related deprecated warnings in discv5 and uTP (#667)
* Fix chronos related deprecated warnings in discv5

* Fix chronos related deprecated warnings in uTP code

* Improve discv5 closeWait order of events and add noCancel
2024-01-22 17:08:08 +01:00
Kim De Mey 974a995b21
Add uTP over discv5 test and small uTP performance improvements (#663)
- Add a multiple sockets use test for uTP over discv5
- Use assign2 for the biggest consumer of genericAssignAux in uTP
- Avoid calling exists on the growable buffer when there is no
place in the socket window.
2024-01-18 12:07:03 +01:00
Kim De Mey d4927593a1
Add data over multiple sockets uTP test (#662) 2024-01-17 22:45:20 +01:00
Kim De Mey e52f5fac0a
Clean-up, correct and clarify utp_protocol tests (#660) 2024-01-16 18:10:26 +01:00
Kim De Mey cbcd1fd307
Fix for uTP issues with latest chronos (#655)
* Fix for uTP issues with latest chronos

* Fix for discv5 issue with latest chronos

* Increase amount of data send in uTP and uTP over discv5 tests
2024-01-12 17:35:44 +01:00
Kim De Mey 11049fb87d
Fix a bunch of compiler hints and warnings in uTP and discv5 (#652)
* Fix a bunch of compiler hints and warnings in uTP and discv5

* Leave in the cancel() for now
2024-01-12 09:49:06 +01:00
tersec 957d8491af
fix XDeclaredButNotUsed warnings in tests/ (#645) 2023-10-29 04:06:48 +00:00
Kim De Mey d74dc40bee
Style fixes and comment improvements on uTP code (#623) 2023-06-22 11:31:30 +00:00
Kim De Mey d57a1094b1
Remove all Defect raises to avoid unnecessary warnings (#607)
As this module dropped support for Nim versions < 1.6, all Defect
raises can be removed to avoid unnecessary warnings
2023-05-10 15:50:04 +02:00
Kim De Mey 29b14749fa
Improve uTP decoded packet logs + style and comment clean-up (#593)
* Improve uTP decoded packet logs + style and comment clean-up

* Don't test for the exact error strings in uTP decode + clean-up
2023-03-14 16:17:39 +00:00
KonradStaniec 22d0ac81e1
Fix defect when writing over send buffer (#564)
* Fix defect when writing over send buffer
2022-11-30 09:34:08 +01:00
Justin Traglia e7d3de6ebf
Fix some typos (#557) 2022-11-16 17:44:00 +01:00
Kim De Mey 86b37bf72e
Default compile all tests and binaries with TRACE log level (#549)
In order to avoid unused warning and more importantly to make
sure all log statements work.
2022-11-10 09:01:58 +01:00
KonradStaniec 2556b090ea
Add user data to utp (#525) 2022-08-12 15:09:59 +02:00
KonradStaniec a5ea6a9a90
Add connection limits to utp (#522) 2022-08-04 15:55:39 +02:00
tersec 92b14b43eb
--styleCheck:error (#520)
* --styleCheck:error

* testcase -> testCase

* more testcase -> testCase

* remove unused imports

* MessageKind enum name consistency in tests

* rest of fuzz_decode_message

* rlpEncodeEIP155 -> rlpEncodeEip155
2022-07-21 08:58:17 +00:00
KonradStaniec cbb233d8a9
Increase tests speed to avoid hangs (#511) 2022-07-11 08:24:03 +02:00
Kim De Mey 9d7e4b031a
Clean-up of several compiler warnings (#519) 2022-07-09 10:55:15 +02:00
Jacek Sieka 1b516682bd
bearssl: use split api (#510) 2022-06-17 22:45:37 +02:00
KonradStaniec dffaa78cbe
Install cancel callback on whole connection future (#508) 2022-05-30 10:28:10 +02:00
KonradStaniec eb785207ae
Make packet size configurable (#497)
* Make packet size configurable
2022-04-04 13:44:32 +02:00
KonradStaniec c28597fee5
Change closing proc (#492) 2022-03-28 12:35:08 +02:00
KonradStaniec f79b79f826
Fix defect in uTP buffer (#493) 2022-03-24 15:56:00 +01:00
KonradStaniec 0e20fd6565
Utp improvements (#489)
* Move connection finalization to separate function

* Do not process data unless in correct state
2022-03-18 08:13:17 +01:00
KonradStaniec dff9040cc1
Fix bug when reading till eof (#483) 2022-03-03 22:38:13 +01:00
KonradStaniec 8ef6b13b1b
Add event loop to socket (#475)
- add eventLoop to control all incoming events
- change semantic of write to asynchronously block only when send buffer is full, and not when bytes do not fit into send window
- change handling of receive buffer, to start dropping packets if the reorder buffer and receive buffer are full. Old behaviour was to async block unless there is space which could lead to resource exhaustion attacks
2022-02-24 18:22:44 +01:00
KonradStaniec 779d767b02
Add more tests stressing conccurent reading and writing on utp socket (#474)
* Add more tests stressing concurrent reading and writing

* Fix bug when remote window dropped below packet size
2022-02-10 08:05:44 +01:00
Kim De Mey 41edd4a3f2
Add DiscoveryConfig to tune routing table ip limits and bitPerHops (#471) 2022-02-02 15:29:45 +01:00
KonradStaniec 5791afccc3
Implement fast resend logic for selective acks (#468)
* Implement fast resend logic for selective acks
2022-01-27 11:07:40 +01:00
KonradStaniec 7afd44d33e
Implement fast resend logic (#466) 2022-01-26 09:49:34 +01:00
KonradStaniec 9a7b1afe9b
Add custom talkreq implementation (#464)
* Add custom talkreq implementation to utp over discv5
2022-01-24 11:58:35 +01:00
KonradStaniec 4e2b340af6
Fix sudden window drop bug (#465)
Fixes problem which caused drop of maxWindow to the size of
only one packet in case of only one packet hitting timeout.
2022-01-21 14:48:01 +01:00
KonradStaniec b2dab4be08
Re-send acks for old duplicated packets (#462)
* Re-send acks for old duplicated packets
2022-01-20 09:22:53 +01:00
Kim De Mey 26ab9b078e
Minor adjustments in utp_discv5_protocol (#459)
- Move SocketConfig parameter location
- Reuse rng from disc5 protocol
- add exports
- Some whitespace clean-up
2022-01-10 13:49:36 +01:00
KonradStaniec 0f18272315
Test vectors upt decoding/encoding (#458) 2022-01-07 10:38:36 +01:00
KonradStaniec 9c8e9d9f64
Handle selective acks (#456)
* Handle selective acks
2022-01-04 09:52:38 +01:00
Kim De Mey 2c236f6495
Style fixes according to --styleCheck:usages (#452)
Currently only setting `--styleCheck:hint` as there are some
dependency fixes required and the compiler seems to trip over the
findnode MessageKind, findnode Message field and the findNode
proc. Also over protocol.Protocol usage.
2021-12-20 13:14:50 +01:00
KonradStaniec 0cfe7df817
Handle packets with selective acks (#451)
* Handle packets with selective acks
2021-12-15 13:35:17 +01:00
Ștefan Talpalaru 2088d7568d
CI: test with multiple Nim version (#429)
* CI: test with multiple Nim version

* clean up the testing tree a little

* replace "unittest" with "unittest2"
2021-12-11 19:12:55 +01:00
Kim De Mey 41d2d3c991
Utp top level raises & some clean-up (#445)
* Add few missing top level raises Defect in uTP

- Add top level {.push raises: [Defect].}
- remove some local raises, including some unneeded
CatchableErrors.
- Don't export messageHandler (avoiding annoying naming collisions)
- export utp_router as those connection callbacks are in the API

* Add some missing copyright clauses

* Some ident and max line length cleanup

* Rename utp_discv5_protocol.nim to be more consistent
2021-12-10 11:12:24 +01:00
KonradStaniec 09959d2a3f
Update timestamp and ackNr on packet resend (#444)
* Update timestamp and ackNr on packet resend
2021-12-10 10:18:00 +01:00
KonradStaniec b4066a5688
Ledbat congestion control (#443)
* Return delay to remote peer

* Initial ledbat window calculation

* Add tests for window grow and decay

* Add delay histograms

* Add calculation of clock drift
2021-12-09 10:52:21 +01:00
KonradStaniec e7bc10ab00
Add config for max snd buffer size (#440)
* Add config for max snd buffer size
2021-12-02 16:51:44 +01:00
KonradStaniec 3c8915cae1
Track send buffer and properly handle back pressoure when window is to small to process data (#437)
* Add separate datastructure to keep track of window

* Asynchronously block write until until new space in snd buffer

* Introduce write loop

* Properly handle write cancellation

* Proper handling of sending fin packet

* Reset remote window after configured amount of time
2021-12-02 15:46:18 +01:00
KonradStaniec 139c6fa2a8
Track current bytes in flight (#434) 2021-11-24 17:49:13 +01:00