Commit Graph

264 Commits

Author SHA1 Message Date
Lee Smet 8fcb8aaff3 Update x25519-dalek dependency to v2.0.0
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-07 16:07:03 +02:00
Lee Smet 5ec9ed8a58 Remove console-subscriber dependency
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-07 14:57:29 +02:00
Lee Smet 7d4cfd801f Remve leftover useless clone
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-07 14:29:35 +02:00
Lee Smet 97d073f918 Use synchronous routing method to send from TUN
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-07 14:02:33 +02:00
Lee Smet 40b5f9cd14 Refactor routing logic to a sync method as well
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-07 14:01:17 +02:00
Lee Smet 4c566957b3 Update tokio dependencies to latest version
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-07 11:56:16 +02:00
Lee Smet 06843b646a Remove commented line of code
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-07 11:38:47 +02:00
Lee Smet 2ec5274380 Clean up route priting
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-06 16:34:25 +02:00
Lee Smet 0b5d86835d Close #20: Implement dedicated subnet type
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-06 15:29:58 +02:00
Lee Smet 4ed14440f2 Implement a basic subnet module
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-06 15:27:28 +02:00
Lee Smet be06e5c0a0 Add IpNet dependency
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-06 13:20:32 +02:00
Lee Smet e1fadc1842 Disable Nagle's algorithm
Set TCP_NODELAY on TCP streams. By default, Nagle's algorithm is
enabled, which caused rather large latency spikes from time to time.
Making sure this is disabled leads to smooth latency graphs without
outliers

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-05 15:46:44 +02:00
Lee Smet 63aa5cd696 Change erronous return to continue
Leftover return after this was refactored from a closure to a while
loop, caused router exit in case invalid data was received.

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-01 16:49:06 +02:00
Lee Smet db2b99da04 Remove some useless clones
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-01 16:15:43 +02:00
Lee Smet fccb20ae6a Code cleanup
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-01 15:50:09 +02:00
Lee Smet bfa8e5d452 Rework code to avoid Sync requirement on router
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-09-01 15:47:08 +02:00
Lee Smet 4b36322a35 Switch router concurrency to left-right
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-31 18:35:36 +02:00
Lee Smet 3e27fbd484 Only wrap updates when sending
This avoids a needless match statement and allows proper type checking
for sending updates

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-31 17:23:17 +02:00
Lee Smet a253d9ddb3 Remove unused imports
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-28 17:10:22 +02:00
Lee Smet 437476b3ff Apply clippy suggestion
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-28 17:07:44 +02:00
Lee Smet 1576a061c0 Send all ready packets to a peer in one go
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-28 15:12:30 +02:00
Lee Smet 905001deff Rework TUN stream driver to feed into router sink
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-28 15:12:30 +02:00
Lee Smet 03cf4010df Remove broken reexports in tun.rs
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-28 15:12:30 +02:00
Lee Smet cc1f48ea53 Remove wrapper Sink and Stream structs for tun
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-28 15:12:30 +02:00
Lee Smet 524f18cb80 Don't process packets concurrently from tun
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-28 15:12:30 +02:00
Lee Smet d40842fa6f Stream for data packets in router
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-28 15:12:30 +02:00
Lee Smet 18ff3503cf General code cleanup
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-28 15:12:30 +02:00
Lee Smet 010e149404 Remove obsolete node_setup.rs file
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-28 15:12:30 +02:00
Lee Smet 700bc4c950 Delete obsolete IpPacketCodec
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-28 15:12:30 +02:00
Lee Smet 40b09214d5 Extract immutable fields from router inner
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-28 15:12:30 +02:00
Lee Smet d9d4b22e82 Move immutable fields outside of peer inner lock
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-28 15:12:30 +02:00
Lee Smet 60bab930b9 Use multithreaded packet reading from tun
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-28 15:12:30 +02:00
Lee Smet 7abfd482c7 Don't use multiqueue for tun interface
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-25 15:20:25 +02:00
Lee Smet 6b95950963 Enable tokio console for better debugging
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-25 12:10:16 +02:00
Lee Smet d6ffe758ec Buff start len is always 0 when reading a tun
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-25 12:08:38 +02:00
Lee Smet 7f3fe75840 Fix Tun Stream implementation
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-25 11:59:24 +02:00
Lee Smet d7e957a887 Manually implement Sink and Stream on tun halves
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-24 17:13:06 +02:00
Lee Smet 15354c17ee Add intermediate task between router <-> tun read
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-24 11:40:01 +02:00
Lee Smet b2b19702d5 Add script to setup test network in netns
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-23 19:02:27 +02:00
Lee Smet a3424ddda9 Add missing target config on tun reexport
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-23 13:24:26 +02:00
Lee Smet 76fe1ea9b7 Implement tun code in specific submodule
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-22 17:32:29 +02:00
Lee Smet cc7282181a Extract nexthop ip from route entry neighbor
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-21 16:41:53 +02:00
Lee Smet 3171f061ef Clippy fixes and code cleanup
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-21 16:21:20 +02:00
Lee Smet c6f435ef2d Print routes on SIGUSR1
Remove the handler which reads from stdin to trigger the printing of the
peers and routes as debug info. This caused unwanted side effects. The
current functionality will be moved to an API in the future, but for now
it is a sufficiently minor change which solves a couple of open issues.
Also trap SIGTERM for quitting. Functionally this does not change the
behavior of the application, but it might be useful in the future.

Fixes #16
Fixes #17

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-21 15:57:16 +02:00
Lee Smet 5f6569871f Add profile.json and reorder .gitignore
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-21 15:09:00 +02:00
Rob Van Mieghem 9d97ecd18c Correct the peers parameter in the readme example 2023-08-09 15:35:23 +02:00
Rob Van Mieghem f77f353d75 Explain the private key file format in the readme 2023-08-08 12:23:32 +02:00
Lee Smet a893d4e484 Add some logging to router
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
v0.0.2
2023-08-04 15:40:09 +02:00
Lee Smet 416b452e1e Type alias ControlPacket to babel::Tlv
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-04 15:13:04 +02:00
Lee Smet ba3cdd4baa Remove obsolete BabelPacketBody type
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2023-08-04 13:34:49 +02:00