Expand description
Combines one or more links into one logical connection.
Aggligator combines network links (for example TCP connections) between two endpoints. When several links are available, data is distributed across their combined capacity. Links can fail, return, be added or be removed while the connection runs.
If every link disappears, transport connectors keep trying to re-establish one while the logical connection remains open for a configurable time. A device can therefore switch between Wi-Fi, mobile data and Ethernet, even with an IP address change, without restarting the application connection.
It serves the same purpose as Multipath TCP and SCTP but works over existing, widely adopted protocols such as TCP, HTTPS, TLS and WebSockets and is completely implemented in user space without the need for any support from the operating system. In networking terms, Aggligator provides link aggregation (also known as channel bonding), failover between links and roaming between networks, all for a single application connection rather than the whole machine.
Aggligator is written in 100% safe Rust and builds upon the Tokio asynchronous runtime. It works on all major native platform as well as WebAssembly.
§Link requirements
A link can either be stream-based (implementing the AsyncRead and AsyncWrite traits) or packet-based (implementing the Sink and Stream traits). In both cases the implementation of the link must ensure data integrity and deliver data in the same order as it was sent. If data has been lost or corrupted underway, the link must handle retransmission and, if that is unsuccessful, fail by disconnecting itself.
In the case of TCP this is handled by the operating system and thus a TcpStream or protocols building on top of that (such as TLS or WebSockets) can be directly used as links.
Other then the requirements stated above, Aggligator makes no assumption about the type of links and can work over any networking methodology such as TCP/IP, Bluetooth, and serial links. It never interfaces directly with the operating system and only uses links provided by the user.
§Connection security
Aggligator does not perform cryptographic authentication of the remote endpoint or encryption of data. If you are sending sensitive data over an untrusted connection you should encrypt it and authenticate the remote endpoint, for example using TLS. The implementation provided in the tokio-rustls crate works nicely with Aggligator.
However, the unique identifier of each connection is encrypted using a shared secret that is exchanged via Diffie-Hellman key exchange. Thus, an eavesdropper cannot inject fake links to an existing connection by using the spoofed connection identifier. This provides the same security level against insertion of malicious data and connection termination by an adversary as you would have when using a single unencrypted TCP connection.
§Basic usage and utility functions
See the connect module on how to accept incoming connections and establish outgoing connections. This is agnostic of the underlying protocol.
Useful functions for working with TCP-based links, encryption and authentication using TLS, can be found in the aggligator-transport-tcp crate. A collection of transports for Aggligator is provided on crates.io.
Command line utilites, that also serve as fully worked out examples, are provided in the aggligator-util crate.
Re-exports§
pub use cfg::Cfg;pub use cfg::LinkCfg;pub use connect::Incoming;pub use connect::Listener;pub use connect::Outgoing;pub use connect::Server;pub use connect::connect;pub use control::Control;pub use control::Link;pub use transport::Acceptor;pub use transport::Connector;
Modules§
- alc
- Aggregated link connection.
- cfg
- Connection configuration.
- connect
- Establishing new incoming and outgoing connections.
- control
- Connection and link control.
- dump
dump - Dump data for performance analysis.
- id
- Unique identifiers.
- io
- Wrapper types for stream-based links.
- transport
- Connection and link management for various transports.
Structs§
- Task
- Task managing a connection of aggregated links.
Enums§
- Task
Error - Error indicating why a connection of aggregated links failed.