454 12 Scheduling Algorithms
Switches or routers employing FQ have to classify each incoming packet to as-
sign it to the proper queue. Furthermore, the switch or router has to perform some
operations on each queue to determine its instantaneous flow λ
i
.
12.17 Packet-by-Packet GPS (PGPS)
Packet-by-packet GPS (PGPS) is a packetized approximation of the GPS algorithms
for fluid flow [34, 35]. This algorithm is also known as weighted fair queuing
(WFQ). Thus in PGPS, data are served in terms of complete packets and only one
packet can be served at a time.
A PGPS/WFQ server works on incoming flows in a static priority fashion based
on a timestamp calculation. The flows or sessions are assigned separate queues
based on packet header information. The scheduler scans the backlogged queues or
sessions to select a packet for service. The packet with the highest priority (least
timestamp) is selected and the output link capacity is dedicated to sending that
packet without sharing the resource with any other queued packets. After a packet
has moved out of a FIFO queue, all packet in that queue move ahead by one position
and the head of the line (HOL) packet enters the pool of selection from among all
other HOL packets belonging to other sessions.
PGPS requires the computation of three quantities:
1. Virtual time, V (t): Indicates the share of the outgoing link capacity for each
backlogged session.
2. Finish number, F
i
: Determines the priority of serving the packet in flow i.The
packet with the least finish number is the one that will be served by the scheduler.
3. Completion time, T
i
: Determines the service time required by the packet based
on the packet length and outgoing link bandwidth.
12.17.1 Virtual Time Calculation for PGPS/WFQ
Assuming B(t) to the set of backlogged sessions at time t,thevirtual time V (t)is
defined using the differential equation
V (0) = 0 (12.40)
dV (t)
dt
=
1
i∈B
w
i
(12.41)
where w
i
≥ 1 is the weight assigned to session i. Figure 12.6 shows the time devel-
opment of V (t) as packets arrive and sessions become backlogged.
When all sessions are idle, the virtual time is reset to zero
V (t) = 0 when all sessions are idle (12.42)