> Probably there is some nice package to wrap up the whole “generate a virtual network and add latency + packet loss between these two end points”, I just never found it.
trickle is clever, but when I've tried to use it for "use no more than this" bandwidth shaping (basically going for "rsync --bwlimit" but for a set of "related" rsync processes) the arguments given had very little to do with the amount of bandwidth actually consumed. (We found another way but definitely look at tc instead.)
Linux has a built-in command: trickle
https://linux.die.net/man/1/trickle
https://stackoverflow.com/questions/10328568/simulate-limite...