1
0
mirror of https://github.com/matrix-org/pinecone.git synced 2026-10-24 11:59:18 +03:00

45 Commits

Author SHA1 Message Date
Devon Hudson
3998bafccc Swap broadcast and traffic frame ids for backwards compatibility 2022-11-18 12:20:25 -07:00
devonh
218c39e0cd Add broadcast & hop limiting functionality (#65)
* Add optional hop limiting to overlay traffic

* Cleanup commented code

* Add optional broadcast functionality for wakeup messages

* Update simulator to better handle changing network connections.

* Update wireshark plugin

* Fix frame tests

* Fix incorrect broadcast signature verification

* Move broadcast consts to consts file

* Only send broadcasts on the best connection to a peer

* Send broadcast immediately to newly added peer

* Fix broadcast frame marshalling

* Move keepalive timeouts to consts file

* Hook broadcasts into the sim logic

* Add broadcast info to sim ui

* Fix sim broadcast timestamps

* Add proper timestamps to broadcast events

* Drain timer when disabling broadcasts

* Update licensing comments for new broadcast files

* Remove unnecessary logging

* Filter broadcasts based on time since last seen broadcast

* Fix traffic forwarding comment

* Only send broadcasts to peer using best connection

* Ensure bootstraps have same root key and sequence

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-11-17 21:45:03 +00:00
devonh
3adc85477d Fix wireshark plugin for new hybrid routing (#71)
* Fix wireshark plugin for new hybrid routing

* Reorder forwarding frame types
2022-10-07 14:54:26 +00:00
Neil Alexander
d0beb180f4 Hybrid routing (#67)
* Hybrid routing

* Clear the coords cache when the root changes

* Define `coordsCacheLifetime`

* Refactor sim pings to use router FilterFn for hop counting

* Various tweaks, fix stretch calc, two packet types again temporarily

* Back to a single packet type again

* Speed up sim, link prioritisation for tree routing

* Put consts together

* Preamble pings so `simws` peers don't cause panics

* Don't drop things that aren't pings

* Smaller tree announcements

* Don't send a watermark when tree-routing

* Fix frame test and add new test for hybrid routing variants

* Cleanup sim adversaries to match new protocol types

* Refactor sim stretch reporting

* Start ping hop count at 1 since dest node doesn't increment count

* Move coords cache timer interval to a constant

* Add TODO

Co-authored-by: Devon Hudson <devonhudson@librem.one>
2022-09-27 11:15:13 +01:00
Neil Alexander
608215eb1b Watermark tweaks 2022-09-14 14:15:22 +01:00
devonh
565beccfeb Fix logic for bootstrap payload protection (#64) 2022-09-01 13:34:33 +00:00
Neil Alexander
1ce778fcde Soft-SNEK (#43)
* Initial soft-state testing

* Fix `pineconeip`

* Try raising the intervals a bit

* Tighter expiry

* Tweaks

* Try to speed up convergence but reduce idle noise

* More tweaks

* Handle disconnections on destination ports, tweak next-hops

* All traffic is either bootstrap or not, more tweaking

* Protocol calming, loop detection, bootstrap signatures

* Tidy up sim

* Fix unit test

* Don't drop pong responses as looping traffic

* Remove unused snake path id

* Remove unused variable from nextHopsSNEK

* Unassign setup acks capability from soft state capabilites

* Cleanup comments to reflect new softstate logic

* Remove unused candidate variable from state

* Update sim and events to reflect softstate changes

* Update wireshark dissector to match softstate frames

* Add unit test for snake bootstrap

* Fix incorrect comment about bootstrap forwarding conditions

* Add `queue` interface

* Initial docs update for softstate algorithm

* Softstate doc updates

* Fix logic for selecting lowest latency links

* Update docs with watermark information (#52)

* Update docs with watermark information

* Further clarifications to watermark docs

* Fix `pinecone.lua`

Co-authored-by: Devon Hudson <devonhudson@librem.one>
2022-07-08 14:52:11 +01:00
devonh
32c8e0c090 Remove pings from base protocol (#47)
* Remove pings from base protocol

* Add new sim ping file

* Remove unnecessary pointer redirects

* Cleanup peer coords logic

* Rename peer lookup function

* Add comment describing peer lookup
2022-05-11 16:19:45 +00:00
devonh
76d7c8b1a8 Remove duplicate coordinate info from frames (#39)
* Remove duplicate coordinate info from frames

* Update unit tests to match new frame layouts

* Remove frame ID offset for ping frames

* Update wireshark dissector to match new frame layouts
2022-04-26 15:27:01 +00:00
Neil Alexander
f1264b0e66 Logger interface, more queue metrics 2022-04-04 14:10:24 +01:00
Neil Alexander
b1a19b452f Add debugging manhole, fix packet priority, queue sizes 2022-03-30 12:39:11 +01:00
devonh
a7eba83007 Fix buffer size checks for un/marshal snake bootstrap (#32)
* Fix buffer size checks for un/marshal snake bootstrap

* Move root length calculations to a common location
2022-02-24 15:40:10 +00:00
devonh
65e7965c06 Add functionality to control the simulator from the UI (#21)
* Sim - display keys as capital hex

* Sim - add more details to node hover text

* Sim - add basic sim commands into ws api

* Sim - use an actor for running simulator event sequences

* Sim - handle AddNode command

* Fully reset state when all peers disconnect

* Sim - implement AddPeer and RemovePeer functionality

* Sim - Add state debug command to log all node state

* Sim - add remove node functionality to sim server

* Sim - use enums in ui code for update/command message IDs

* Sim - extract api enums into a separate file

* Sim - refactor server api so other modules can send commands

* Sim - swap letters for icons and add tool panel to ui

* Sim - bump up ui button margins

* Sim - unify approach to ui overlay buttons

* Sim - add multiselect and hook up node removal

* Sim - handle edge cases when removing node from ui

* Sim - fully stub out toolbox ui

* Sim - small UI tweaks

* Sim - show all selected nodes in the right panel

* Sim - hook up node and peer creation ui

* Sim - add feature to remove peer connections from ui

* Sim - fix edge case when trying to delete the same peering twice

* Sim - stub out play/pause commands

* Sim - add feature to import and play event sequence from a file

* Sim - fix ui bug where removing nodes didn't update stats panel

* Sim - add feature to play/pause event sequences

* Sim - log when a user event listener closes

* Sim - improve event sequence import validation

* Sim - refactor event sequence validation to own function

* Sim - Add adversary configuration commands to sim api

* Sim - Add node type select to node creation form

* Sim - work towards adversarial nodes

* Sim - fix handling of adversary peer settings command

* Sim - update drop rates with chosen adversary template

* Sim - add node type information to simulator state

* Sim - set adversary node colour to red

* Sim - adversary node work

* Sim - adversary now drops packets appropriately

* Sim - fix bug where disconnected peer state wasn't updated properly

* Sim - add adversary configuration options to ui

* Sim - refactor peer option override checkbox

* Sim - update example sequences to show more full use cases

* Sim - fix unsanitized logging

* Sim - escape html meta-characters for ui sliders

* Sim - parse slider inner value as number

* Sim - refactor ui by breaking out forms into separate files

* A few minor tweaks to reduce duplicate timers, letting GC do some work for us

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-01-18 16:28:41 +00:00
Neil Alexander
8c13d0fded Setup ACKs (#18)
* Activate paths on receipt of a Setup ACK message

* Signature enforcement for setup ACKs

* Track ascending  node replacement candidates
2021-12-13 13:28:21 +00:00
Neil Alexander
dc9349c5ca Don't convert to string for no reason in announcement sanity checks 2021-11-08 17:02:08 +00:00
Neil Alexander
f3e750b80c Cryptographically secured bootstraps/setups (#14)
* Add signature fields to SNEK protocol messages

* Bootstrap and setup signature verification

* Teardowns don't need signatures as they are already port-scoped

* Update protocol capabilities

* Add comments
2021-10-21 13:28:55 +01:00
Neil Alexander
48fd523450 Common types.Root type 2021-10-20 15:34:27 +01:00
Neil Alexander
9cf54dd77e Send bootstraps only on interfaces with good announcements 2021-10-20 11:57:50 +01:00
Neil Alexander
8c49b82792 Fix offset in tree distance calculations 2021-10-15 11:12:15 +01:00
Neil Alexander
c25021e7ba Clean up API 2021-10-12 16:35:18 +01:00
Neil Alexander
d568c31638 Improved mobility performance, optimised marshalling, various code clean-up and fixes 2021-10-12 14:46:09 +01:00
Neil Alexander
4af0f697ba Remove unnecessary EqualTo function which calls the bytes package unnecessarily 2021-10-11 17:51:01 +01:00
Neil Alexander
20fa55c7b7 Mild clean-up 2021-10-11 17:13:23 +01:00
Neil Alexander
8b5be54cad Complete rewrite of the Pinecone router 2021-10-08 13:43:44 +01:00
Neil Alexander
f8e2900e3a Stronger assertions around frame reference counting, missing FrameType string 2021-09-22 13:18:22 +01:00
Neil Alexander
4ec11c22f2 Various tree tweaks, return to 15 minute spanning tree interval + peering timeouts (#12)
* Parent tweaks

* Remove separate root record

* Fix bugs in spanning tree

* Other bug fixes

* Tweaks

* Some light refactoring to see if we can improve de-parenting performance (although still not functioning as well as I'd like...)

* Detect ancestor parent changes, tweaks

* Various refactoring, fixes and tweaks that might hopefully make parent selection less horrible

* Simplify parent selection again (extra iterations are ultimately unnecessary)

* Reuse port numbers if possible, bug fixes

* Well this isn't an improvement at all

* Refactor announcements a bit

* Refactor peer management

* Refactor root sequence

* Various tweaks

* Well that was incredibly tedious

* Tuning

* Check direct peers in default case

* Bootstrap faster if we lose the port that our ascending node was reachable via

* De-race SNEK a bit

* The moment a peer is cancelled, it should be marked as no longer started

* This is backward-incompatible
2021-09-10 14:46:25 +01:00
Neil Alexander
bf248f7f7c Support partial DHT searches for greedy routing 2021-06-18 12:10:27 +01:00
Neil Alexander
9580d89f64 Fix manhole 2021-06-14 11:35:44 +01:00
Neil Alexander
4eb4130c71 Update frame format, remove buffered RWC, add manual keepalives, various other race fixes 2021-06-11 15:32:58 +01:00
Neil Alexander
73dc22e6ae Various tweaks 2021-06-10 17:20:40 +01:00
Neil Alexander
0250a298c5 Functioning hard state 2021-06-08 15:08:13 +01:00
Neil Alexander
68ee3feb3c Guarantee payloads a are copied 2021-06-03 13:17:01 +01:00
Neil Alexander
364a1c5cfe Protocol changes to sSNEK bootstraps/path setups 2021-06-02 12:05:16 +01:00
Neil Alexander
ba112a2e39 Fix another reference counting bug 2021-05-28 11:10:12 +01:00
Neil Alexander
64376ccd24 Fix bootstrap offsets, other tweaks 2021-05-28 09:56:18 +01:00
Neil Alexander
c8b1d4e185 Send random path ID in bootstraps 2021-05-27 16:06:48 +01:00
Neil Alexander
538e4d757a Tree routing tweaks 2021-05-27 15:28:05 +01:00
Neil Alexander
d3c64d06ac Add payload for path bootstrap and setup types 2021-05-27 12:08:16 +01:00
Neil Alexander
2cad60202f Tree forwarding tweaks 2021-05-26 12:27:54 +01:00
Neil Alexander
0432c1e0c0 Improve spanning tree behaviour, improve convergence, update sim 2021-05-21 17:20:17 +01:00
Neil Alexander
9b2a548eac Some rework 2021-05-19 14:33:39 +01:00
Neil Alexander
dc2b22ad36 Try to send teardowns in right direction in all cases 2021-05-18 17:24:23 +01:00
Neil Alexander
e76e9ddb89 Hard state
Squashed commit of the following:

commit c29b258604
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Tue May 18 15:34:21 2021 +0100

    Don't specify min TLS version

commit 4623f6ae7c
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Tue May 18 15:24:29 2021 +0100

    Fix crash in sessions

commit 09156ea436
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Tue May 18 14:31:36 2021 +0100

    Optimise forwarding rules

commit 61fb765164
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Tue May 18 12:58:19 2021 +0100

    Try to stabilise spanning tree some more

commit e0ca9fb57e
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Tue May 18 10:00:00 2021 +0100

    Various spanning tree and forwarding fixes

commit a2fc7a85da
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Mon May 17 16:12:21 2021 +0100

    Speed up convergence, hopefully

commit cb5d0e20ed
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Mon May 17 12:21:25 2021 +0100

    Store tree updates properly

commit 8b51cec6d6
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Fri May 14 14:10:29 2021 +0100

    Use NODELAY for pineconesim connections

commit 2c9fed1d0c
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Fri May 14 14:10:10 2021 +0100

    Handle spanning ttree announcements outside of protocol queue

commit 52aa52afe0
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Fri May 14 13:40:46 2021 +0100

    Fix bug in getVirtualSnakeTeardownNextHop

commit fc8ca27180
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Fri May 14 12:10:25 2021 +0100

    Don't send teardowns to router

commit e92d7756c4
Merge: 8be51d7 fb4948b
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Fri May 14 12:03:20 2021 +0100

    Merge branch 'main' into neilalexander/hardstate

commit 8be51d7606
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Fri May 14 11:42:36 2021 +0100

    Send teardowns instead of paths expiring automatically
2021-05-18 15:46:23 +01:00
Neil Alexander
fb4948bc62 Add pineconeip for meshnet-lab testing
Squashed commit of the following:

commit 8fa2d4dbe76ffe20c49c5319b290c0a6543da6ae
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Thu May 13 14:47:37 2021 +0100

    Clear stale routing entries from previous ascending/descending nodes

commit b6394239e3
Merge: e41358c fce69f7
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Thu May 13 14:08:12 2021 +0100

    Merge branch 'main' into neilalexander/pineconeip

commit e41358c16a
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Wed May 12 17:24:19 2021 +0100

    Tweaks to TCP timeouts in pineconeip

commit 1870724388
Merge: 5b4be7a 103f27c
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Wed May 12 16:07:55 2021 +0100

    Merge branch 'main' into neilalexander/pineconeip

commit 5b4be7a27a
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Wed May 12 14:57:44 2021 +0100

    Fix pineconeip

commit 8fe3e14cdd
Merge: b6ba203 6c05ae4
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Wed May 12 14:14:15 2021 +0100

    Merge branch 'neilalexander/bootstrap' into neilalexander/pineconeip

commit b6ba2038e2
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Tue May 11 16:03:33 2021 +0100

    Reinstate mutex

commit a04f3f8a96
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Tue May 11 15:43:17 2021 +0100

    Ordering/dupe fixes, other tweaks

commit 932953dc4a
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Tue May 11 13:43:14 2021 +0100

    Add pineconeip
2021-05-14 12:02:53 +01:00
Neil Alexander
30c2fbab2c Initial commit 2021-05-05 15:49:58 +01:00