QoS / VoIP


  1. Classification
  2. Queueing
  3. Congestion avoidance
IP Precedence = 3 bits (0..7)
DSCP = 6 bits (0..63)


  • Dropped packets
  • Delay
  • Jitter
  • Out-of-order delivery
  • Error/corrupt packets
Traffic Shaping
  • Token bucket:
    • remove token in order to transmit
    • tokens added at certain time intervals
  • Leaky bucket:
    • shape bursty traffic into steady stream
    • excess is discarded
  • TCP rate control:
    • window size
    • ACK rate control


  • FIFO = first in first out
  • FQ = equal treatment of each flow (i.e. TDM)
  • WFQ = FQ + priority (IP Precedence)
  • CBWFQ = WFQ + user-defined classes (e.g. protocols, ACL, input interface)
  • LLQ = CBWFQ + strict priority

Congestion Avoidance

  • RED:
    • drop packets prior to peak congestion (throttle TCP window)
    • no traffic differentiation
  • WRED:
    • RED + IP Precedence
  • Tail drop:
    • drop packets when congestion occurs
  • Policing:
    • rate limiting
  • Shaping:
    • excess traffic is buffered for later transmission

IOS Configuration Example

ip access-list extended <ACL-name>
  deny <...>
  permit <...>

class-map match-all <class-name>
  match access-group <ACL-name>

policy-map <pol-name>
  class <class-name>
    set dscp [ef|cs3|af41|...]
      police x exceed-action [drop|policed-dscp-transmit]

interface <...>
  service-policy input <pol-name>

JUNOS Configuration Example

!--- Classification ---!

  filter <filter-name>
    term <term-name>
      from <...>
      then accept
    term final
      then forwarding-class [default|medium|high|netcontrol]

interface <...>
  unit <...>
    family inet
      filter [input|output] <filter-name>

!--- Queueing and congestion avoidance ---!

  classifier inet-precedence <class-name>
    forwarding-class [default|medium|high|netcontrol]
      loss-priority high code-points <...>

drop-profiles <drop-name>
  forwarding-classes queue [0-default|1-medium|2-high|3-netcontrol]

schedulers [default|medium|high|netcontrol]
  transmit rate <%>
  buffer size <%>
  priority [high|low|strict-high]
  drop-profile-ma <drop-name>

scheduler-maps <sched-name>
  forwarding-class netcontrol scheduler netcontrol
  forwarding-class high scheduler high
  forwarding-class medium scheduler medium
  forwarding-class default scheduler default

interface <...>
  scheduler-map <sched-name>
  unit *
      inet-precedence <filter-name>

Useful Articles

  • QoS overview.  [ipCisco]
    • Classification and marking.  [ipCisco]
    • Policing and shaping.  [ipCisco]
  • QoS best practices for better bandwidth management.  [Network Computing]
  • Another DMVPN routing question.  [ipSpace]
  • QoS marking is an application problem.  [Russ White]  [ipSpace]
  • Cisco and Apple agree: QoS marking is an application problem.  [ipSpace]
  • Quick post on LLQ.  [Lost In Transit]
  • The basics of QoS.  [Network Computing]
  • TCP/IP is a lossy protocol.  [EtherealMind]
  • The future of multicast and QoS.  [ipSpace]
  • General behaviour of QoS queues on Cisco IOS.  [Lost In Transit]
  • QoS terminology – comparing Cisco to MEF and RFC terminology.  [Lost In Transit]
  • IPv6 QoS markings calculator.  [PacketMischief]
  • Do we need QoS in the data center?  [ipSpace]
  • QoS design for CCDE.  [Lost In Transit]
  • Book review: End-to-End QoS Network Design: QoS for Rich-Media & Cloud Networks.  [Lost In Transit]
  • How does MPLS-TE interact with QoS?  [ipSpace, video]
  • I want to prioritise video traffic -- what protocols and port numbers should I add to my QoS design?  [StackExchange]
  • Verifying end-to-end QoS marking.  [Route Reflector]
  • What does TCP Fast Open mean for DDoS and QoS?  [Reddit]
  • Mice, elephants, and virtual switches.  [ipSpace]
  • Queuing mechanisms in modern switches.  [ipSpace]
  • QoS on a dedicated VoIP network.  [StackExchange]
  • Auto-QOS configuration for Cisco network.  [StackExchange]
  • How are WFQ and WRED releated?  [StackExchange]
  • The case for more granular QoS.  [Network Computing]
  • VoIP planning: three critical steps.  [Network Computing]
  • Challenges of QoS in VPLS networks.  [PacketU]
  • The benefits of multiple classes of service for Ethernet mobile backhaul.  [Ethernet Academy]
  • The best of RIPE65 -- the concept of QoS by Geoff Huston.  [ipSpace]  [RIPE]  [RIPE PDF]
  • How to stop network traffic fighting like cat and dog.  [The Register]
  • QoS marking with Scapy.  [PacketLife]
  • Some more QoS basics.  [IOS Hints]
  • Understanding single-rate and dual-rate traffic policing.  [CCIE Blog]
  • Incomplete thought: just-in-time QoS.  [Brad Hedlund]
  • Optimum bandwidth allocation for VoIP traffic.  [CCIE Blog]
  • Did Internet founders actually anticipate paid, prioritised traffic?  [Wired]
  • DSCP QoS over MPLS thoughts.  [EtherealMind]
  • Do you need the new QoS class?  Answers and explanations.  [CCIE Blog]