QoS / VoIP


Basics

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

Issues

  • 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

Scheduling/Queueing

  • 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 ---!

firewall
  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 ---!

class-of-service
  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 *
    classifiers
      inet-precedence <filter-name>


Useful Articles


VoIP