Commit Graph

49 Commits

Author SHA1 Message Date
Jeff
26c8063fc9
convert priority queues 2022-05-02 15:27:08 -04:00
Jeff
8960ca08f3
propagate link layer message priority to link layer so it can order retransmissions with that in mind 2022-05-02 15:27:07 -04:00
Jeff
a76acd4956 fix wire protocol race condition
only send close packet once, before we were sending a close after we got a close causing excess log spam.
include handshake phase when checking for connection timeouts.

when we change our rc make sure to put it into nodedb too when we are a service node to prevent weirdness in dht lookups.
2022-03-05 21:08:53 -05:00
Jason Rhinelander
74215fc44c Fix link layer delivery race condition (fix random ping delays)
We trigger a pump immediately, but this is racey because we add to our
plaintext data in a worker thread; if the worker thread runs after the
pump then it ends up leaving plaintext to be handled, but there's no
wakeup until the next one.

This was the cause of seeing a random +1s and bunching added to ping
responses sometimes: it wasn't until the *next* ping goes through the
network that the plaintext queue gets processed, at which point it
flushes the old one and often the new one together.

The fix here gets rid of the map of sessions needing wakeups and instead
adds an atomic flag to all of them to let us figure out which ones
need to be flushed.
2021-11-15 13:36:28 -04:00
Jason Rhinelander
9113a6b36b Triggered pumping
This redoes how/when we pump so that we should only be calling the
idempotent PumpLL() when we actually have (or may have) something to
pump.
2021-11-15 13:35:57 -04:00
Thomas Winget
7caa87862e standardize include format and pragma once
All #ifndef guards on headers have been removed, I think,
in favor of #pragma once

Headers are now included as `#include "filename"` if the included file
resides in the same directory as the file including it, or any
subdirectory therein.  Otherwise they are included as
`#include <project/top/dir/relative/path/filename>`

The above does not include system/os headers.
2021-03-09 19:01:41 -05:00
Jeff Becker
c9ff917e0d
revert priority queue ordering change 2021-03-04 15:21:51 -05:00
Jeff Becker
5cffc3b0f8
consolidate rx message handling in iwp
* add toggle flag for using multi ack
* check replay filter before processing message
2021-03-04 15:21:51 -05:00
Jeff Becker
e6ac7e721d
use a std::map instead of a std::unordered_map for holding message buffers by their sequentially increasing message id.
when retransmissions happen, they will be executed in a deterministic order by their delivery id.
this reduces the jitter from delayed message delivery on link layer as with an unordered map the order of iteration is "random",
so when we iterate all messages for retransmission we do it lowest id first (the messages queued first).
2021-03-04 15:21:51 -05:00
Jeff Becker
d7842d18ee
add missing header 2021-02-23 05:53:48 -05:00
Jeff Becker
bb9bd25059
get rid of use of llarp::IpAddress from hotpaths 2021-02-22 10:01:05 -05:00
Jeff Becker
42ffbcca0a
try coleasing inbound packets from iwp 2021-02-22 08:26:32 -05:00
Stephen Shelton
d897099e1d
Track traffic peerstats 2020-07-02 10:13:24 -06:00
Jeff Becker
d7ff6c579c
address feedback from jason
* split up ipv6 netmask
* revert iwp ack interval change
* c++17-isms in ip range map
* lambda-ize nodedb
* mutable lambdas in transit hops
* perfect forwarding of args in abstract router
* mutable lambdas in lokid rpc client
* notes in readme about nproc
2020-07-02 11:13:32 -04:00
Jeff Becker
f4971a88fd
use lokimq workers instead of llarp:🧵:ThreadPool 2020-07-02 11:07:34 -04:00
Stephen Shelton
91a2af0eda
Sanity checks around shared_from_this() 2020-06-01 14:56:58 -06:00
Jeff Becker
db00d080f6
use std::list instead of std::vector because idfk man 2020-05-24 08:36:46 -04:00
Stephen Shelton
aee96e53a3
Refactor Addr -> IpAddress/SockAddr 2020-05-06 14:38:44 -06:00
Stephen Shelton
273270916e
The Great Wall of Blame
This commit reflects changes to clang-format rules. Unfortunately,
these rule changes create a massive change to the codebase, which
causes an apparent rewrite of git history.

Git blame's --ignore-rev flag can be used to ignore this commit when
attempting to `git blame` some code.
2020-04-07 12:38:56 -06:00
Jeff Becker
bf0416cab8
remove Time_t, add operator overload for printing llarp_time_t and add to_json function for serializing llarp_time_t to json 2020-02-25 12:05:13 -05:00
Jeff Becker
ecdab10dac
explictly use std::chrono::milliseconds 2020-02-25 11:05:54 -05:00
Jeff Becker
df427ffa0e
use llarp_time_t instead of auto 2020-02-25 11:02:14 -05:00
Jeff Becker
d2d109e92c
llarp_time_t is now using std::chrono 2020-02-24 15:25:03 -05:00
Stephen Shelton
3d00feb08a
Make format 2020-02-10 12:51:54 -07:00
Stephen Shelton
7f0972d48e
Use name 'StateToString()' instead of ambiguous 'toString()' 2020-02-10 09:27:12 -07:00
Stephen Shelton
2279ebeb40
Add IWP session stats to JSON API 2020-02-07 11:43:40 -07:00
Jeff Becker
9efd796145
initial wack at 0.7.0 dht fixes 2020-01-27 11:54:51 -05:00
Jeff Becker
0f6c5958ba
add bw stats to iwp sessions 2019-12-17 09:36:56 -05:00
Jeff Becker
fc55469cfe
change interval such that FEC is less often done 2019-12-14 15:55:36 -05:00
Jeff Becker
a93e0a735b
fix typo, reduce delivery timeout 2019-12-14 13:50:36 -05:00
Jeff Becker
ac686a9329
remove valgrind access errors 2019-11-22 16:23:20 -05:00
Jeff Becker
b207db626f
please the gods of valgrind 2019-11-22 16:23:20 -05:00
Stephen Shelton
ef2670dfb4 Drop new inbound IWP sessions when the first packet can't be handled 2019-11-19 09:24:29 -07:00
jeff
3c1d5518d8 fix windows port and make it compile 2019-10-02 09:06:14 -04:00
Jeff Becker
327c545530
finish multithread cryptography first pass 2019-09-16 12:12:05 -04:00
jeff
14c9ef15ed try calling stuff in logic thread from event loop 2019-09-16 06:21:12 -04:00
jeff
ac2a2aed1d gut libutp and finish making things compile and pass tests 2019-09-12 14:19:25 -04:00
Jeff Becker
d04762ab49
unstaged changed 2019-09-12 10:34:27 -04:00
Jeff Becker
3c0245f8b3
Merge remote-tracking branch 'github/master' into iwp-multi-ack 2019-09-05 13:40:04 -04:00
Jeff Becker
88cde21b9b
multithreaded iwp cryptography 2019-09-05 10:57:01 -04:00
Jeff Becker
a4160006ab
make it compile 2019-09-05 09:34:59 -04:00
Jeff Becker
3b1a0b2835
add multi-ack and change protocol handshake to pin identity key 2019-09-05 09:21:35 -04:00
Jeff Becker
e9f01923d9
dont nack replayed messages, tweak transmission parameters.
this yields more efficient througput. probably.
2019-09-03 16:22:52 -04:00
Jeff Becker
83432d7567
make format 2019-08-29 08:05:29 -04:00
Jeff Becker
4c569d83b7
make it compile 2019-08-29 08:04:46 -04:00
Jeff Becker
ba2aaa68c6
add short data fragments and rx replay filter 2019-08-28 07:02:00 -04:00
Jeff Becker
6a48a3b402
code review fixes:
* use std::unordered_set
* use default for ctor/dtor
* don't crash on short packet with nack
2019-08-26 07:16:46 -04:00
Jeff Becker
acf5f78949
update iwp , add NACK 2019-08-23 07:32:52 -04:00
Jeff Becker
426ee41c46
initial iwp 2019-08-22 16:53:27 -04:00