thombashi / tcconfig

A tc command wrapper. Make it easy to set up traffic control of network bandwidth/latency/packet-loss/packet-corruption/etc. to a network-interface/Docker-container(veth).
https://tcconfig.rtfd.io/
MIT License
790 stars 84 forks source link

Distinguish upload and download #162

Closed felixshing closed 2 years ago

felixshing commented 2 years ago

Describe the solution you'd like

Hi, if there any way to distinguish upload and download? Especially for latency and packet loss. I found another tc-based tool that can distinguish between uploads and downloads, but it can only limit the bandwidth. And I don't understand the principle of its code...

Additional context

I actually found that both Windows and macOS have weak network emulation tools that can differentiate between uplink and downlink, and they both work on bandwidth, latency and packet loss. But it seems that Linux doesn't have such a tool yet

felixshing commented 2 years ago

Okay, I found a tutorial that teaches me how to shape the downlink.

thombashi commented 2 years ago

You can use --direction option

  --direction {outgoing,incoming}
                        the direction of network communication that imposes traffic control. 'incoming' requires ifb kernel module and Linux kernel 2.6.20 or later. (default = outgoing)
felixshing commented 2 years ago

Oh I see! I miss that option. Thanks!