E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
1
EE 586 Communication andSwitching Networks
Lecture 5
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
Queuing Delay
Occurs at the router when the output link iscongested
Analogy
An accident down the road may have the traffic backup over an entire area
Significance
A significant source of delay
If there is not enough space in a router to storeincoming packets, they will be dropped.
Quantitative Analysis
How is queuing delay related to the input and outrates?
(modified by Cheung for EE586; based on K&R original)
2
underline_base
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
Model of a Router
Router = input buffer + CPU
Assume fixed-size packet of 𝐿 bits
Random packet arrivals and clearance
Let 
Average arrival rate = 𝑎 packets/second
Average departure rate = 𝑏 packets/second =  𝑅 𝑏𝑖𝑡𝑠/𝑠 𝐿 𝑏𝑖𝑡𝑠/𝑝𝑎𝑐𝑘𝑒𝑡 
Length of queue =  𝑋 packets
Goal: Queuing Delay ∝ Average of 𝑋 or E(𝑋)
(modified by Cheung for EE586; based on K&R original)
3
underline_base
CPU
𝑎 pkt/s
𝑏 pkt/s
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
Traffic intensity
  arrival rate
departure rate
Queueing delay Formula
1-4
(modified by Cheung for EE586; based on K&R original)
underline_base
queueDelay
traffic intensity
= La/R
average  queuengdelay
E X = 𝐿𝑎/𝑅 1−𝐿𝑎/𝑅
= 𝑎 𝑅/𝐿 = 𝐿𝑎 𝑅
=
𝐸 𝑋 = 𝐿𝑎/𝑅 1−𝐿𝑎/𝑅
Queuing Delay Formula :
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
queueDelay
traffic intensity
= La/R
average  queuengdelay
E X = 𝐿𝑎/𝑅 1−𝐿𝑎/𝑅
Interpretation
(modified by Cheung for EE586; based on K&R original)
5
underline_base
La/R ~ 0
La/R  1
La/R ~ 0: avg. queuingdelay non-existence
La/R  1: avg. queuingdelay large
La/R > 1: more workarriving than can beserviced, average delayinfinite!
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
Queuing Delay (Advanced)
Partition time into short time intervals  𝑡,𝑡+Δ𝑡 
Δ𝑡 is small enough so either nothing happens or a single packet arrives/leaves but not both
(modified by Cheung for EE586; based on K&R original)
6
underline_base
CPU
𝑎 pkt/s
𝑏 pkt/s
Time
0
X(t)
Arr
X
X
X
X
X
Clear
X
X
X
1
2
1
2
2
1
2
3
2
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
Queuing Delay (Advanced)
What is the probability of an arrival in [𝑡,𝑡+Δ𝑡]?
Know 
Probability of more than one arrivals = 0
Average number of arrivals = 𝑎Δ𝑡
Thus 
1∙𝑃(𝑜𝑛𝑒 𝑝𝑎𝑐𝑘𝑒𝑡 𝑎𝑟𝑟𝑖𝑣𝑒𝑑)+0∙𝑃(𝑛𝑜 𝑝𝑎𝑐𝑘𝑒𝑡 𝑎𝑟𝑟𝑖𝑣𝑒𝑑) = 𝑎Δ𝑡
or 𝑃(𝑜𝑛𝑒 𝑝𝑎𝑐𝑘𝑒𝑡 𝑎𝑟𝑟𝑖𝑣𝑒𝑑) = 𝑎Δ𝑡
(modified by Cheung for EE586; based on K&R original)
7
underline_base
CPU
𝑎 pkt/s
𝑏 pkt/s
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
Queuing Delay (Advanced)
What is the probability of a departure in [𝑡,𝑡+Δ𝑡]?
Know 
Probability of more than one departure = 0
Average number of departure = bΔ𝑡
Thus 
1∙𝑃(𝑜𝑛𝑒 𝑝𝑎𝑐𝑘𝑒𝑡 departed)+0∙𝑃(𝑛𝑜 𝑝𝑎𝑐𝑘𝑒𝑡 departed) = 𝑏Δ𝑡
or 𝑃(𝑜𝑛𝑒 𝑝𝑎𝑐𝑘𝑒𝑡 departed) = bΔ𝑡
(modified by Cheung for EE586; based on K&R original)
8
underline_base
CPU
𝑎 pkt/s
𝑏 pkt/s
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
Queuing Delay (Advanced)
What is the probability that 𝑋 𝑡 =𝑘 AND 𝑋 𝑡+Δ𝑡 =𝑘+1 ?
(modified by Cheung for EE586; based on K&R original)
9
underline_base
CPU
𝑎 pkt/s
𝑏 pkt/s
Conditional Probability:  
Probability of 𝑋 𝑡+Δ𝑡 =𝑘+1 given 𝑋 𝑡 =𝑘
i.e. Probability of an arrival
𝑃 𝑋 𝑡+Δ𝑡 =𝑘+1, 𝑋 𝑡 =𝑘 
    =𝑃 𝑋 𝑡+Δ𝑡 =𝑘+1|𝑋 𝑡 =𝑘 ∙𝑃 𝑋 𝑡 =𝑘
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
Queuing Delay (Advanced)
What is the probability that 𝑋 𝑡 =𝑘 AND 𝑋 𝑡+Δ𝑡 =𝑘+1 ?
(modified by Cheung for EE586; based on K&R original)
10
underline_base
CPU
𝑎 pkt/s
𝑏 pkt/s
𝑃 𝑋 𝑡+Δ𝑡 =𝑘+1, 𝑋 𝑡 =𝑘 
    =𝑃 𝑋 𝑡+Δ𝑡 =𝑘+1|𝑋 𝑡 =𝑘 ∙𝑃 𝑋 𝑡 =𝑘
=𝑎Δ𝑡𝑃 𝑋 𝑡 =𝑘
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
Queuing Delay (Advanced)
What is the probability that 𝑋 𝑡 =𝑘+1 AND 𝑋 𝑡+Δ𝑡 =𝑘?
(modified by Cheung for EE586; based on K&R original)
11
underline_base
CPU
𝑎 pkt/s
𝑏 pkt/s
Probability of 𝑋 𝑡+Δ𝑡 =𝑘 given 𝑋 𝑡 =𝑘+1
i.e. Probability of a departure
𝑃 𝑋 𝑡+Δ𝑡 =𝑘, 𝑋 𝑡 =𝑘+1 
    =𝑃 𝑋 𝑡+Δ𝑡 =𝑘|𝑋 𝑡 =𝑘+1 ∙𝑃 𝑋 𝑡 =𝑘+1
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
Queuing Delay (Advanced)
What is the probability that 𝑋 𝑡 =𝑘 AND 𝑋 𝑡+Δ𝑡 =𝑘+1 ?
(modified by Cheung for EE586; based on K&R original)
12
underline_base
CPU
𝑎 pkt/s
𝑏 pkt/s
=𝑏Δ𝑡𝑃 𝑋 𝑡 =𝑘+1
𝑃 𝑋 𝑡+Δ𝑡 =𝑘, 𝑋 𝑡 =𝑘+1 
    =𝑃 𝑋 𝑡+Δ𝑡 =𝑘|𝑋 𝑡 =𝑘+1 ∙𝑃 𝑋 𝑡 =𝑘+1
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
Time Reversibility
X(t) is “time-reversible” 
Statistics stay the same if we reverse the time arrow!

    𝑃 𝑋 𝑡+Δ𝑡 =𝑘+1, 𝑋 𝑡 =𝑘 

  		𝑃 𝑋 𝑡+Δ𝑡 =𝑘, 𝑋 𝑡 =𝑘+1
(modified by Cheung for EE586; based on K&R original)
13
underline_base
CPU
𝑎 pkt/s
𝑏 pkt/s
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
Queuing Delay (Advanced)
𝑃 𝑋 𝑡+Δ𝑡 =𝑘+1, 𝑋 𝑡 =𝑘  
            =𝑎Δ𝑡𝑃 𝑋 𝑡 =𝑘 

𝑃 𝑋 𝑡+Δ𝑡 =𝑘, 𝑋 𝑡 =𝑘+1 
         = 𝑏Δ𝑡𝑃 𝑋 𝑡 =𝑘+1 
⟹𝑃 𝑋 𝑡 =𝑘+1 =𝑃 𝑋 𝑡 =𝑘 ∙ 𝑎 𝑏
(modified by Cheung for EE586; based on K&R original)
14
underline_base
CPU
𝑎 pkt/s
𝑏 pkt/s
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
Queuing Delay (Advanced)
𝑃 𝑋 𝑡 =𝑘+1 =𝑃 𝑋 𝑡 =𝑘 ∙ 𝑎 𝑏   implies that
𝑃 𝑋 𝑡 =1 =𝑃 𝑋 𝑡 =0   𝑎 𝑏  
𝑃 𝑋 𝑡 =2 =𝑃 𝑋 𝑡 =1   𝑎 𝑏  =𝑃 𝑋 𝑡 =0     𝑎 𝑏   2 
…
𝑃 𝑋 𝑡 =𝑘 =𝑃 𝑋 𝑡 =0     𝑎 𝑏   𝑘 
Also 
𝑃 𝑋 𝑡 =0 +𝑃 𝑋 𝑡 =1 +…=1
(modified by Cheung for EE586; based on K&R original)
15
underline_base
CPU
𝑎 pkt/s
𝑏 pkt/s
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
Queuing Delay (Advanced)
⟹ 𝑃 𝑋 𝑡 =𝑘 =  1− 𝑎 𝑏       𝑎 𝑏    𝑘 =  1− 𝐿𝑎 𝑅       𝐿𝑎 𝑅    𝑘 

This is called geometric distribution

Mean: E X = 𝐿𝑎/𝑅 1−𝐿𝑎/𝑅
(modified by Cheung for EE586; based on K&R original)
16
underline_base
CPU
𝑎 pkt/s
𝑏 pkt/s
𝑏= 𝑅 𝐿