Traffic shaping

I am working on a traffic shaping system that will achieve several objectives:

  1. Classify egress traffic into 4 different bands - VoIP, interactive, standard and bulk. Traffic will be rated and bandwidth allocated according to which “speed lane” it is classified into.
  2. Control traffic at each end of a DSL link to allow latency and traffic flow to be managed. In effect download to the client will be shaped at the head-end on egress interface and vice versa for upload traffic.
  3. Control buffering in the ADSL router by maintaining the buffers in the RouterBoard and ensuring the ADSL router buffers do not come into play and affect the ability of RoS to prioritise traffic.

To address part 1 I have a simple classifier that mangles the traffic and assigns packet marks. e.g. VoIP is selected based on TOS or protocol e.g. IAX. Interactive will be tagged by TOS or protocol e.g. SSH or RDP. Bulk will be FTP and standard is the rest. Simple but effective. In this case I assume that I assign the queue to the egress interface. My egress interface will be an EoIP tunnel mostly so that I can open a connection to the data centre and provide transit routing from there.

To address 2 I use a RB at each end of the connection. One is installed after the DSL central line and between DSLAM and transit switch, the other is installed at the client end (tail end). I thus have egress control on interfaces at each end of the connection and should thus have full traffic flow control. I can also use this to bond connections and route a single block of IP across the bonded set.

To address 3 I am applying a simple queue that restricts the egress speed at each end. At the client end I set the egress speed to around 80% of the raw DSL sync rate (see below). I control upload from the client at the client end and I control download by controlling the egress at the head-end router. I set the speed to 80% of the DSL sync speed to allow for the ATM overhead, the L2TP central line delivery overhead then allow 10% margin to ensure the buffers in the DSL router are not allowed to fill.

I have a couple of questions that I have not been able to identify conclusive answers for:

  1. If I use simple queues how do I limit the upload and download speed. My understanding is that I can control egress traffic but not ingress and thus I wonder why there are options to set both. I assume if the download limit is reached the RB will drop packets and assume the sending device will throttle back to reduce speed.

  2. Can I control upload and download at a single end or is it advisable to use both ends?

  3. In simple queue there is an option for prority and I assume packets are routed according to priority. As such this would seem to be a simple way to implement the 4 levels of traffic priority I had discussed above.

Any help anyone can offer would be most welcome. I am quite happy to completely document my settings for everyone to use if I can come up with a standard document and process.

Hi tucker -
This is gettingto be a regular occurance… :slight_smile:

On to your questions…

  1. If I use simple queues how do I limit the upload and download speed. My understanding is that I can control egress traffic but not ingress and thus I wonder why there are options to set both. I assume if the download limit is reached the RB will drop packets and assume the sending device will throttle back to reduce speed.

Both are available because you can control how fast the client receives data - but you are right in that you can’t control how fast the MT box receives the data. MT will queue the data until the (queue) buffer is full and then start dropping packets. If the host is ‘smart’ it will throttle back some. So - what I have done seems to help this is, set the queue buffer to a large value, say 200 to 500 packets… What this does for me is it queues the data at the head end, helping prevent retransmissions from the main feeds, and sends the data to the receiving MT at the queue level set - in your case keeping the dsl buffers from getting overrun.

  1. Can I control upload and download at a single end or is it advisable to use both ends?

I personally only use the end I can control - egress. I leave the ingress alone - no sense in double queuing…

  1. In simple queue there is an option for prority and I assume packets are routed according to priority. As such this would seem to be a simple way to implement the 4 levels of traffic priority I had discussed above.

It would be but there are issues - you still want to keep from overrunning your dsl line buffers - so you need a ‘master’ queue for each dsl line.
I don’t have the config in front of me right at the moment but… You set the queues for the dsl lines. Then set queues for the type of traffic separately - not aligning them with the dsl queues (parent / child). This ensure the dsl line ‘master’ queues are keeping the dsl lines from getting overrun. It also prioritizes the data as it enters the queue.

Queue buffers…that takes some tuning based of your particular network. For me at the head end I generally have large interface queues. At the tail end, when the clients ‘connect’ I have small outgoing queue buffers, this help tremendously with VoIP. Because once you queue that data - that is how ‘it is’ until it is transmitted.

Thom