Why bonding usually needs special infrastructure
A TCP connection follows a single path through the network, so a transfer is limited to the bandwidth of one link even when several are available. Combining links, known as link aggregation or channel bonding, is traditionally done below the application. Bonding routers and SD-WAN appliances tunnel all traffic to an aggregation server in the network, Multipath TCP requires kernel support on both endpoints and a network path that lets it through, and interface bonding on Linux requires all links to terminate at the same switch. All of these approaches bond the whole machine's traffic and involve infrastructure that you may not control.
However, when both endpoints run your own software, no such infrastructure is needed and the aggregation can be done by the applications themselves.
Bonding between two applications
Aggligator establishes a link over every usable path between the two endpoints and distributes the connection's data across them. Data is handed to whichever link is ready to accept more, so faster links carry more data and the distribution adapts as link conditions change. Links whose latency would delay overall delivery are set aside and retested periodically. At the receiving end the data is reordered and delivered as one ordered byte stream.
Since unacknowledged data of a failed link is resent over the remaining links, bonding also provides failover. When one uplink is lost, the bandwidth is reduced but the connection continues. Additionally, latency, throughput and backlog of each link are available to your application and can be displayed with the interactive terminal monitor.
Links of different kinds in one connection
A Connector combines transport types. This client reaches the
server over all network interfaces and a USB cable at the same time.
let mut connector = Connector::new();
connector.add(TcpConnector::new(["server"], 5900).await?);
connector.add(UsbConnector::new(|dev, _| dev.vendor_id() == 0x1209)?);
let stream = connector.channel().unwrap().await?.into_stream();
Use agg-tunnel to forward TCP
ports of existing applications over the bonded connection →
Questions
Do both ends need to run Aggligator?
Yes. The links are recombined into one ordered stream at the other endpoint, so the server must run Aggligator or agg-tunnel as well. Bonding a connection to an arbitrary website or service that you do not control is not possible, since that would require an aggregation endpoint in the network. This is what commercial bonding services provide.
Can links with very different speeds be combined?
Yes. Data is sent on whichever link is ready to accept more, so each link carries as much as its current capacity allows. Links whose latency would delay overall delivery are set aside and retested periodically, so a slow link does not hold back the rest.
Is this the same as Multipath TCP?
It serves the same purpose. Multipath TCP is implemented in the kernel and requires support from both operating systems and a network path that lets it through. Aggligator is completely implemented in user space and works over ordinary TCP, TLS, WebSocket, USB or Bluetooth links, so no cooperation from the operating system or the network is needed.
Do the links have to be of the same kind?
No. One connection can combine links of different transports, for example TCP over two internet uplinks together with a direct USB cable. Links can also be added and removed while the connection is running.
Where to go next
The Aggligator overview explains how unequal links are balanced and lists the available transports. If you are interested in resiliency rather than bandwidth, see keeping connections alive while switching networks.