Here is a crazy idea I had about interface limiting for half and full duplex links.
Lets say we take the sync rate for a wireless interface, or maybe this is a static entry in the interface. For instance, configure Ethernet5 to be half duplex, 70Mb.
create a token bucket and fill it at a rate to match the 70Mb. The change to the typical token bucket is that instead of just a transmit only bucket, also remove tokens for received packets on the interface. Now every packet, tx or rx, on the interface pulls a token which suits half duplex radio links. If tx is 35Mb and rx is 35Mb, the bucket will have no tokens and will hold packets in the queue. This would only need to be done on one side if the link, assuming it is a ptp link or at least the token bucket only has one source and one dest.
Now we can limit a half duplex wireless interface based on it’s measured or expected capacity and not worry about the rx traffic saturating the link and blindly trying to tx, which may overuse the link.
If the link is full duplex, dont count the rx packets, this is just a standard token bucket queue at that point. rx packets wont use up the tx link.
For bonding, use the same kind of method. Identify links as full or half duplex so that tokens can be removed appropriately. Now, in the bond, simply send the next packet out the interface with the highest token count. example:
ether5 is connected to a half duplex wireless link at 54Mb
ether6 is connected to a half duplex wireless link at 130Mb.
for easy math, lets say a token = 1Mb and tokens are added at 1 second intervals.
so ether5 gets 54 tokens each second and ether6 gets 130 tokens.
The first 76Mb will go out ether6. Then the buckets will match. The rest of the second (until more tokens are added) the links would be 54/54 then 53/54, then 53/53, then 52/53 and so on. ether6 will get roughly 3 tokens for every 2 on ether5 based on the 54:130 ratio.
Since the links are half duplex and we watch inbound packets and pull tokens out of the interfaces bucket, we dont over utilize the half duplex links and they are well balanced.
With the bonding interface, both sides would have to be configured identically. Or the config on one side would need to be automatically replicated to the other side.
the math would need to be adjusted as a token = 1 ethernet frame = MTU and the interval that tokens are added to the buck is the kernel tickets (100hz default on openwrt for instance).
The current bonding method in routeros is pure round robin (to aggregate two+ links) so the lowest speed link decides the speed. This isn’t ideal.
I realize that OSPF is great for L3 ‘bonding’ on two interfaces, but when you are talking about 3+ interfaces, OSPF wont utilize all for aggregate speed and L2 bonding is effectively the option. With 3 or more wireless interfaces, it is likely that different frequencies (900, 2.4, 5.
will be used for each link and different channel widths. a 5Mhz 900 + 10Mhz 2.4Ghz + 20Mhz 5.8Ghz bond would be reliable but slow because a 5Mhz channel is realistically <16Mb/s so this would be at most 48Mb/s. Better to do a 20Mhz 5.8Ghz and failover to the others…