Why does using all the upstream cause lag?

/wp-content/2007/upstream.png

It's a common story. A housemate starts torrenting some American television series of dubious artistic quality and/or legality, or perhaps starts calling their girlfriend on Skype and your SSH sessions start to lag. Why does this happen?

When the upstream channels become saturated, data must overflow into the modem's buffers. This causes TCP acknowledgement (ACK) packets originating from your SSH client to be delayed, resulting in an increase in the overall round trip time. This phenomena is usually worse on cable connections as their modems' buffers are generally larger.

Avoiding the problem can be pretty simple - limiting your upstream bandwidth just below its maximum helps, and some smarter solutions involving prioritising ACK packets work even better. Although these are best achieved at your router, a number of applications have their own limiting features: every BitTorrent client will have one, and other tools such as scp (via the '-l' option) have them too.

Comments (3)

Anonymous

Considered traffic shaping?

Sept. 15, 2007, 2:59 a.m. #
lamby

Um. Try reading more than the post title next time.

Sept. 16, 2007, 9:41 p.m. #

If you have access to the router, you could try removing buffers (if it's allowed). I have a similar problem which is caused by (well you guessed it already) the router queuing packages for delivery over the slower DSL link.

A tech once said that they were able to remove the effects by making the buffer smaller, which moves the congestion to the local network, which shouldn't be so bad.

In any case, i haven't tried it but it might be worth a shot.

Sept. 23, 2007, 2:48 p.m. #