For downloading speed, see Implementing TCP Traffic Control.