The internet treats all packets alike, on a best-effort basis. Voice, video and critical applications need some traffic to be treated better. QoS provides this.

Need for QoS

Applications differ in their needs. File transfer needs reliability but tolerates delay. Voice and video calls need low delay (latency, under about 150 ms one way), low jitter (variation in delay) and modest bandwidth, but tolerate a little loss. Online games need low delay; streaming needs steady bandwidth. When links are congested, best-effort delivery hurts real-time traffic first. Quality of Service is the set of techniques that give different traffic classes different treatment, measured by bandwidth, delay, jitter and packet loss.

Definition: Quality of Service. The ability of a network to give different traffic classes different levels of service, in bandwidth, delay, jitter and loss, rather than treating all packets equally.

QoS Mechanisms

Classification and marking identify traffic (by port, protocol or application) and label it. Queuing and scheduling decide which packet is sent next: FIFO, priority queuing (urgent queues served first), weighted fair queuing (WFQ) (each class gets a share), and low-latency queuing. Traffic shaping smooths bursts by buffering, using a leaky bucket (constant output rate) or token bucket (tokens arrive at rate r, and a packet needs a token, allowing bursts up to the bucket size). Policing drops or remarks traffic above an agreed rate. Admission control refuses new flows that the network cannot support.

Integrated Services (IntServ)

IntServ gives per-flow guarantees. Before sending, an application uses the Resource Reservation Protocol (RSVP) to request resources along the whole path; each router checks whether it can meet the request (admission control) and keeps state for each flow. Service classes are guaranteed service (firm bounds on delay) and controlled load (service like an unloaded network). IntServ gives strong guarantees but does not scale, since core routers would have to keep state for millions of flows.

Differentiated Services (DiffServ)

DiffServ gives per-class treatment. Packets are marked at the network edge with a 6-bit DSCP (Differentiated Services Code Point) value in the IP header, and each router applies a per-hop behaviour (PHB) to each class: Expedited Forwarding (EF), DSCP 46, for low delay and jitter, used for voice; Assured Forwarding (AF) classes, with drop priorities, for business data; and Default (best effort), DSCP 0. Core routers keep no per-flow state, so DiffServ scales well and is widely used; but it gives relative priority rather than hard guarantees. MPLS networks often combine with DiffServ to engineer traffic.

Table 3.7: IntServ and DiffServ

Feature IntServ DiffServ
Granularity Per flow Per class
Signalling RSVP reservations DSCP marking
Router state For every flow None in the core
Guarantee Hard Relative priority
Scalability Poor Good

Example 3.7: A token bucket

Problem: A token bucket holds at most 4 tokens, adds 2 tokens per tick and starts full. Packets arrive: 3, 3, 0, 5, 1 in ticks 1 to 5. How many are sent and dropped in each tick?

Solution:

  1. Tick 1: tokens 4 (full), send 3, left 1; then +2 = 3.
  2. Tick 2: send 3, left 0; then +2 = 2.
  3. Tick 3: nothing arrives; +2 = 4 (cap 4).
  4. Tick 4: 5 arrive, send 4, drop 1; left 0, then +2 = 2.
  5. Tick 5: send 1, left 1.

Result: 11 packets sent and 1 dropped; bursts up to 4 pass, but the long-run rate is limited to 2 per tick.

cap, rate, tokens = 4, 2, 4
arrivals = [3, 3, 0, 5, 1]
sent_total = dropped_total = 0
for tick, n in enumerate(arrivals, 1):
    sent = min(n, tokens)
    tokens -= sent
    dropped = n - sent
    sent_total += sent
    dropped_total += dropped
    print(f"tick {tick}: arrive {n}, sent {sent}, dropped {dropped}")
    tokens = min(cap, tokens + rate)
print("total sent", sent_total, "dropped", dropped_total)

Output

tick 1: arrive 3, sent 3, dropped 0
tick 2: arrive 3, sent 3, dropped 0
tick 3: arrive 0, sent 0, dropped 0
tick 4: arrive 5, sent 4, dropped 1
tick 5: arrive 1, sent 1, dropped 0
total sent 11 dropped 1

Common mistakes

  • Thinking QoS creates extra bandwidth. It only shares existing bandwidth differently.
  • Expecting IntServ to scale to the internet core.
  • Confusing jitter (variation of delay) with delay itself.

Key takeaways

  • QoS parameters: bandwidth, delay, jitter and loss.
  • Mechanisms: classification, queuing, shaping (leaky and token bucket), policing, admission control.
  • IntServ: per-flow RSVP reservations, hard guarantees, poor scalability.
  • DiffServ: DSCP marking per class (EF, AF, default), scalable.

Practice questions

  1. What is jitter?
  2. Which protocol does IntServ use for reservations?
  3. Which DiffServ class is used for voice?

Answers to the practice questions

  1. Variation in packet delay.
  2. RSVP.
  3. Expedited Forwarding (EF), DSCP 46.

Sources

  • Official BCA syllabus Computer Networks, course code 26BCA404DS02, Unit III