Description
The sidecar currently only supports egress bandwidth/latency restrictions. Only supporting egress latency restrictions is fine because network-wide latencies can be emulated by setting the same egress latency on all nodes.
However, egress bandwidth restrictions are not sufficient, we also need ingress bandwidth restrictions. For example, if egress bandwidth is limited to 1MiB/s and 10 nodes send traffic to one node, that one node will receive data at 10MiB/s. We should be able to limit that.
Motivation:
- Duplicate blocks (in bitswap) don't matter significantly less when we have infinite ingress bandwidth. We don't care how much data our peers are sending us.
- There's no backpressure.
Note: Ingress traffic shaping with tc
is a little bit complicated. It looks like we need to create a special device and do a bunch of traffic redirection so we can use egress shaping on ingress traffic: https://wiki.gentoo.org/wiki/Traffic_shaping, https://wiki.archlinux.org/index.php/Advanced_traffic_control#Example_of_ingress_traffic_shaping_with_SNAT