Professional Documents
Culture Documents
Lecture 10 IP Traffic Management-QoS Concepts
Lecture 10 IP Traffic Management-QoS Concepts
IP Traffic Management
& QoS Concepts
Dr. Le Chung Tran
Email: LCTRAN@UOW.EDU.AU
Room: 35.G32. Ext: 3846
Consultation: Mon 09.30am – 11.30am (via email)
Tue 09.30am – 11.30am
(Students are advised to email for an appointment)
1
This lecture
• Traffic parameters
• Policing mechanisms
- Leaky bucket
- Token bucket
• Scheduling algorithms
- FIFO
- Priority queuing
- Round robin, and Weighted round robin
- Fair queuing, and Weighted fair queuing
• Two main architectures to provide QoS guarantees:
IntServ and DiffServ
2
QoS and IP networks
• QoS:
– network ability to provide better service to selected traffic over various underlying
technologies, incl., ATM, Ethernet, WiFi, IP-routed networks
– collection of techniques allows applications to request and receive predictable service
levels (e.g., bandwidth, delay, jitter, loss)
• IP was originally designed to provide a ‘best effort’ service (default QoS)
– IP routers do not distinguish between different packets and treat all the same
– Other people’s traffic can affect the QoS perceived by a particular user
– No encouragement for any user to limit traffic for the good of all
• Solution: multiple classes of service (‘best effort’ is not enough)
– partition traffic into multiple classes
– network treats different traffic classes differently, based on
– three main principles of treatment (see next slides)
• Implementation: IETF defines 2 architectures for providing QoS
– Integrated Service (IntServ) and
– Differentiated Service (DiffServ)
3
Scenario 1: mixed FTP + audio
• An IP phone flow & a FTP flow share a 2 Mbps link
– FTP bursts can congest routers, causing audio loss
– How to give priority to audio?
Principle 1
R1 R2
- packet marking is required for
routers to distinguish between
different traffic classes; and
- new router policy is needed to
treat packets accordingly
4
Scenario 2: Traffic Isolation
• what if applications misbehave (audio sends higher than declared
rate, causing FTP user starves)
– Policing is needed to force source to obey its bandwidth allocations
• marking and policing are done at network edge
1 Mbps
phone
R1 R2
2 Mbps link
2 Mbps link
Principle 3
while providing isolation, it is desirable to use resources as efficiently
as possible (i.e., a common resource pool can be shared between
multiple flows – via scheduling)
6
Basic concepts – traffic flow
• Flow: a chain of pkts from a sending application to a
receiving application (one direction) traversing network
elements, all covered by the same request of QoS*.
– a video stream is a traffic flow
– all the packets belonging to the same http request are in a traffic flow
Ave Rate
Time
Max Burst Size (pkts)
8
Policing Mechanisms
9
Leaky Bucket
10
Leaky Bucket Implementation
Remove packets at
b a constant rate
Arrival N
Full? Departure
Queue
Y
Discard
Data rate
12 Mbps
• Shapes bursty traffic into fixed-
rate traffic
2 Mbps
• Assume: Leak rate = 3 Mbps;
bucket depth = b (Mb) 0 1 2 3 4 5 6 7 8 9
Input: Bursty data
10 Time (s)
Data rate
• Peak rate at the output never 3 Mbps
exceeds 3 Mbps
0 1 2 3 4 5 6 7 8 9 10 Time (s)
• What is bmin in this case? Output
11
Token Bucket - 1
r tokens / sec (long term rate)
bucket holds up to b
Token Bucket Implementation } tokens
* Upperbound might be achieved if the input and output links of the token bucket mechanism have infinite
capacity
13
Token Bucket Example -1
Verify the formula rt + b by yourself
Time 0
5 pkts 5 pkts
14
Token Bucket Example -2
Time 2 Time 4
Time 0
5 pkts 4 pkts
15
Scheduling Techniques
• Scheduling: mechanisms to determine the order of packets leaving
the queue
– E.g.: FIFO (First In First Out), Priority queuing, Round robin, Weighted round
robin, Fair queuing, Weighted fair queuing
16
Priority Queuing
• Multiple queues (classes) with different priorities
– Type of Service, Source/dest IP Addresses, Source/dest TCP Port numbers, etc.
• Transmit highest priority packets in the queue first
• Simple, but may lead to starvation of lower priority classes
– If server is too busy serving the higher priority class
17
Round Robin & WRR
• Round Robin (RR): maintains one queue for each class of traffic,
cyclically scans queues, serving one pkt from each class (if available)
• Weighted Round Robin (WRR): generalized RR, each class has a
weight, scheduler may serve a number of packets from each queue
– If a queue at its turn does not have enough data for transmission, all pkts available at
that time in this queue will be transmitted before the scheduler changes to another
queue
– Priority can be given to a certain queue by changing its weight
18
Packet Size Problem
19
Fair Queuing
• Overcomes the problem with different pkt sizes
• Allows to approximate the behaviour of a bit-by-bit round robin
• Determines when a pkt would finish as if it was transmitted
using a bit-by-bit robin
F1(t)
– Each pkt is tagged with the time its last bit would be transmitted F2(t)
as if a bit-by-bit round robin scheduler was used
20
Why Virtual Time?
21
Real Time vs Virtual Time
Real clock
3 3 1
Flow 1 0 1 2 3 4 5 6 7 8 Time (sec)
real
2 5
time
Flow 2 0 1 2 3 4 5 6 7 8 Time (sec)
5
Flow 3 0 1 2 3 4 5 6 7 8 Time (sec)
Virtual time V(t) 0 1 1.5 1.83 2.83 3.33 3.66 4 5 5.5 6.5
Virtual clock
virtual time
22
Real Time vs Virtual Time
1
Real clock
3 3 1
Flow 1 0 1 2 3 4 5 6 7 8 Time (sec)
2 5
Flow 2 0 1 2 3 4 5 6 7 8 Time (sec)
5
Flow 3 0 1 2 3 4 5 6 7 8 Time (sec)
1
Virtual time V(t) 0 1 1.5 1.83 2.83 3.33 3.66 4 5 5.5 6.5
Virtual clock
23
Real Time vs Virtual Time
2
Real clock
3 3 1
Flow 1 0 1 2 3 4 5 6 7 8 Time (sec)
2 5
Flow 2 0 1 2 3 4 5 6 7 8 Time (sec)
5
Flow 3 0 1 2 3 4 5 6 7 8 Time (sec)
1.5
Virtual time V(t) 0 1 1.5 1.83 2.83 3.33 3.66 4 5 5.5 6.5
Virtual clock
24
Real Time vs Virtual Time
Real clock 3
3 3 1
Flow 1 0 1 2 3 4 5 6 7 8 Time (sec)
2 5
Flow 2 0 1 2 3 4 5 6 7 8 Time (sec)
5
Flow 3 0 1 2 3 4 5 6 7 8 Time (sec)
1.83
Virtual time V(t) 0 1 1.5 1.83 2.83 3.33 3.66 4 5 5.5 6.5
Virtual clock
25
Real Time vs Virtual Time
Real clock
4
3 3 1
Flow 1 0 1 2 3 4 5 6 7 8 Time (sec)
2 5
Flow 2 0 1 2 3 4 5 6 7 8 Time (sec)
5
Flow 3 0 1 2 3 4 5 6 7 8 Time (sec)
2.83
Virtual time V(t) 0 1 1.5 1.83 2.83 3.33 3.66 4 5 5.5 6.5
Virtual clock
26
Real Time vs Virtual Time
Real clock
3 3 1 5
2 5
Flow 2 0 1 2 3 4 5 6 7 8 Time (sec)
5
Flow 3 0 1 2 3 4 5 6 7 8 Time (sec)
3.33
Virtual time V(t) 0 1 1.5 1.83 2.83 3.33 3.66 4 5 5.5 6.5
Virtual clock
27
Real Time vs Virtual Time
Real clock
3 3 1 6
Flow 1 0 1 2 3 4 5 6 7 8 Time (sec)
2 5
Flow 2 0 1 2 3 4 5 6 7 8 Time (sec)
5
Flow 3 0 1 2 3 4 5 6 7 8 Time (sec)
Virtual time V(t) 0 1 1.5 1.83 2.83 3.33 3.66 4 5 5.5 6.5 3.66
Virtual clock
28
Fair Queuing
Definitions
Fik - Virtual finish time of packet k of flow i
Lki - Length of packet k of flow i
V(t) - Virtual time when packet k of flow i arrives at the router
29
Fair Queuing - Example
3 6 7
3 3 1
F1 0 1 2 3 4 5 6 7 8 Time (sec)
3 8.33
2 5
F2 0 1 2 3 4 5 6 7 8 Time (sec)
6.5
5
Fik max(Fik 1 , V(t)) Lki F3 0 1 2 3 4 5 6 7 8 Time (sec)
All possible delivery orders are F11 , F21 , F12 , F31 , F13 , F22
• Output of FQ: A, D, B, F, C, E
• Output of WFQ: D, A, E, B, F, C (flow F2 tends to be served first)
31
Integrated Services Model - IntServ
32
Integrated Services
Application can request for 1 of 3 levels of guarantee in IntServ
• Best effort service: normal internet service, no guarantee
• Controlled-load: flow receives QoS with
– delay and rate ≈ the desired values,
– but no firm bounds
• Guaranteed services: provides firm bounds on data throughput & delays
Important components in the IntServ architecture:
• Classifier
• Packet scheduler
• Admission control (or Call admission)
• Reservation protocol (RSVP)
33
IntServ Architecture
• Classifier Background functions
– maps each incoming pkt into some flowspec
Routing Reservation Admission Management
class Control Agent
protocols protocol
34
IntServ Architecture
• RSVP Background functions
– signaling protocol used by each flowspec
Routing Reservation Admission Management
host and router along the path Control Agent
protocols protocol
35
Integrated Services - Signaling
• routers must maintain state info, i.e., records of allocated resources
routers must refresh the state info regularly
• based on state info & the request, routers respond to new call setup
requests
• all routers on the path must participate, to ensure QoS to be met
• what must client application send?
36
Flowspec = Tspec + Rspec
• The followings must be sent to all routers on the path to reserve
resources
– required QoS service class (best effort, controlled-load or guaranteed services),
– required guarantees (called Rspec – Reservation Specifications), and
– required traffic specifications (called Tspec-Traffic Specifications)
• Rspec: service requested from network – what guarantee does the flow
need?
– Bandwidth required
– Tolerable delay
• Tspec: flow’s traffic characteristics – what does the traffic look like?
– Sending rate + burst size: these parameters are typically the token bucket parameters:
including
• Token rate r (decides the average rate)
• Bucket depth b (decides the burst size)
• Peak-rate
37
Call Admission
Each router:
• Receives Flowspec from RSVP
• ‘Compares’ Flowspec and the current
state info (resource allocated to other
calls) and decides to admit or reject
calls
• Refreshes regularly the state info to
cope with dynamic behaviour of the
Internet (change of routes etc.)
– Typically every 30 seconds
38
Differentiated Services – DiffServ
39
Diffserv Architecture
Edge router: r
marking
• per-flow traffic management
• marking packets as well as
b
policing flows
Core router:
• per-class traffic management
• scheduling based on marking at
edge routers
scheduling
Simple in network core,
relatively complex at edge
routers (or hosts) ..
.
40
Edge Routers
• Marking pkts based on rules (by admin, or
by determined protocol)
– i.e. setting the 6-bit Differentiated Service Code Rate r
Point (DSCP) in the field ToS (IPv4), Traffic Class
(IPv6)
• Policing the flow, typically using the token b
bucket mechanism with pre-negotiated rate
r and bucket size b User pkts
• decide either delay and then forward, or
discard pkts if pkts do not conform declared
parameters.
41
Core Routers
• forward pkts, based on their marks
• same marks - same forwarding manner,
though they might belong to different flows
– if flows H2→H4 & H1→H3: same marks, R3
treats these pkts as an aggregate flow (one
class)
42
Example of Edge Routers
Source: http://www.cs.stir.ac.uk/~kjt/servprov/sample.html
43
Example of Core Routers
44
Summary
This lecture Next lecture
• Traffic parameters
• Policing mechanisms • Application Layer
- Leaky bucket – Web
– HTTP
- Token bucket
• In-class quiz
• Scheduling algorithms
- FIFO
- Priority queuing
- Round robin, and
Weighted round robin
- Fair queuing, and
Weighted fair queuing
• IntServ and DiffServ
45