Skip to content

Queues Management

Nogah Frankel edited this page Jan 31, 2018 · 18 revisions
Table of Contents
  1. RED
    1. About RED
    2. Offloading RED
    3. Statistics
  2. Further Resources

RED

About RED

RED is a queueing discipline designated for congestion control.
It drops packets based on statistical probabilities. The probability to drop a packet is zero until the queue's average size reaches the minimum limit. From there, the probability will rise linearly until it reaches the maximum probability for dropping, when the queue's average size reaches the maximum limit. When the queue's average size is above the maximum, the probability to drop a packet is 1 (See figure below).
These drops are called early drops.

figure 1

The RED qdisc has the option to mark packets with the ECN flag instead of dropping them.
This mode only affects packets which indicate that their hosts honor ECN. When set, the queue's size might reach its maximum size. In this case, packets that cannot be enqueued will be tail dropped.

Offloading RED

RED parameters:

  • limit – Hard limit for the queue's size. Not offloaded.
  • avpkt – Average queue size calculation parameter. Not offloaded. 1000 is recommended.
  • min (optional) – The minimum limit.
  • max (optional) – The maximum limit.
  • probability (optional) – The probability to drop a packet when the average queue size is at maximum limit.
  • burst (optional) – Allowed burst size. Not offloaded.
  • bandwidth (optional) – Used for average queue size calculation (and not to enforce queue's bandwidth). Not offloaded.
  • ecn (optional) – If set, indicates ECN mode is on.
  • hard-drop – If set, when the queue's average size is above the maximum limit, packets will be dropped even if they are ECN enabled and ECN mode is on. Not offloaded.

When offloading RED it is recommended to specify min, max and probability and not rely on the default values.

Note: RED is only supported on top of physical ports and only as a root qdisc.
Note: Configuring both DCB and RED on the same port is not supported.

Example:

tc qdisc add dev sw1p1 root handle 4: red limit 1000000 avpkt 10000 probability 0.1 min 500000 max 1500000

Statistics

The show command will show the current configuration as well as the offloaded state. The -s flag will also display the statistics:

$ tc -s qdisc show dev sw1p1
qdisc red 4: root refcnt 2 limit 1000000b min 500000b max 15782272b offload
 Sent 9962 bytes 29 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  marked 0 early 0 pdrop 0 other 0

The statistics represent both the hardware and software statistics.

  • dropped – The number of packets that were dropped by this queue. A packet can be either early dropped or tail dropped.
  • overlimits – The number of packets that were early dropped or ECN marked.
  • backlog – The queue's size in bytes and packets. Only the bytes count reflects the hardware status.
  • marked - The number of packets that were ECN marked.
  • early - The number of packets that were early dropped.
  • pdrop – The number of packets that were tail dropped.
  • other – The number of packets that were dropped for other reasons. Not in use.

Further Resources

  1. man tc
  2. man tc-red
Clone this wiki locally