Input traffic shaping
- by whitequark
I know that I can shape output traffic with tc or a similar tool. However, I want to shape the input traffic now—actually, I want to prioritize downloading of files of certain type through a slow lossy connection.
I know the reason tc can only shape output traffic: the host itself has no direct control over the amount of input traffic. On the other hand, TCP has some measures built in it which prevent the TCP traffic from overflowing a slow connection. So, can I mangle something in TCP header so that the remote host will think my connection is slower than it thinks?
Suppose that I am able to set the corresponding mark on both types of connections with iptables. Is there any way to reduce the input bandwidth of connections of first type, but only if connections of second type are present?