Packet Scheduling - PowerPoint PPT Presentation

About This Presentation
Title:

Packet Scheduling

Description:

Decides which packet should get resources ... Self Clocked Fair Queueing (SCFQ)? Start Time Fair queueing. Worst Case fair WFQ (WF2Q) ... – PowerPoint PPT presentation

Number of Views:95
Avg rating:3.0/5.0
Slides: 42
Provided by: anirudhsa
Category:

less

Transcript and Presenter's Notes

Title: Packet Scheduling


1
Packet Scheduling
  • IT610
  • Prof. A. Sahoo
  • KReSIT

2
Packet Scheduling
  • Responsible for enforcing resource allocation to
    individual flows
  • Decides which packet should get resources
  • Intuitively works like a dispatcher it keeps
    track of how many packets each flow has sent and
    compares that with the amount of resources the
    flow has reserved.
  • Arriving packets from a flow are sent only when
    the flow has not used up the reserved resources

3
Basic Requirement
  • Isolation and sharing
  • Allow sharing of common resources in a controlled
    way
  • In circuit switched network full isolation, no
    sharing
  • Under-utilization of resources
  • In datagram based internet (FCFS) resources are
    shared on a per-packet basis
  • No isolation

4
Basic Requirement (Contd)?
  • Delay Bounds
  • Scheduler should provide some delay bound
  • Either deterministic (guaranteed service) or
    statistical
  • Deterministic bounds give the best isolation
  • Statistical delay bound allow more efficient
    sharing, less isolation
  • Bandwidth allocation
  • When there is a contention for resources, bw must
    be allocated fairly to all competing flows.

5
Types of scheduler
  • Work Conserving
  • Scheduler is idle only when there are no packets
    waiting for transmission
  • Example FCFS
  • Non-work-conserving
  • Transmits packet when it is eligible for
    transmission
  • If no packets are eligible, scheduler will be
    idle even when there are packets in the queue.
  • Example Rate controlled scheduler

6
Max-Min Fairness
  • An allocation is fair if it satisfies max-min
    fairness
  • each connection gets no more than what it wants
  • the excess, if any, is equally shared

7
Max-Min Fairness
  • N flows share a link of rate C.
  • Flow f wishes to send at rate W(f), and is
    allocated rate R(f).
  • Pick the flow, f, with the smallest W(f).
  • If W(f) lt C/N, then set R(f) W(f).
  • If W(f) gt C/N, then set R(f) C/N.
  • Set N N 1. C C R(f).
  • If N gt 0 goto 1.

8
Max-Min Fairness example
W(f1) 0.1
1
W(f2) 0.5
C
R1
W(f3) 10
W(f4) 5
  • Round 1 Set R(f1) 0.1
  • Round 2 Set R(f2) 0.9/3 0.3
  • Round 3 Set R(f4) 0.6/2 0.3
  • Round 4 Set R(f3) 0.3/1 0.3

9
Simple Priority scheduling
  • Number of priority levels
  • Packet is served from a given priority level only
    if no packets exist at higher levels (multilevel
    priority with exhaustive service)?
  • Higher priority will always have precedence over
    lower priority
  • May lead to starvation of lower priority packets

10
Deadline based scheduler
  • Deadline based scheduler schedules packets based
    on the earliest deadline (EDF) principle.
  • Flow with lowest deadline gets scheduled first
  • Delay and bw requirements are decoupled flow
    requiring small bandwidth can get small delay.
  • Admission control is more complex has to do
    schedulability test and also make sure that total
    bw capacity is not exceeded

11
Rate based scheduler
  • Two components regulator and a scheduler.
  • Regulator determines eligibility time for the
    packet.
  • The result is that the traffic is shaped by the
    regulator before it arrives at the scheduler.
  • Examples token bucket regulator
  • Scheduler can do FCFS or fair queueing.

12
Token bucket
13
Round robin scheduling
  • Scan class queues serving one from each class
    that has a non-empty queue
  • Assumption Fixed packet length
  • Pros and cons
  • Provides Max-min fairness and Protection within
    contending flows
  • More complex than FIFO per flow queue/state

14
Weighted round robin
  • Round robin
  • Unfair if packets are of different length or
    weights are not equal
  • Weighted round robin
  • Serve more than one packet per visit
  • Number of packets are proportional to weights

15
Weighted round robin
  • Normalize the weights so that they become integer

WA1.4 WB0.2 WC0.8
16
Weighted RR variable length packet
  • If different connection have different packet
    size, then divide the weight of each connection
    with connections mean packet size before
    normalizing
  • weights 0.5, 0.75, 1.0,
  • mean packet sizes 50, 500, 1500
  • normalize weights 0.5/50, 0.75/500, 1.0/1500
    0.01, 0.0015, 0.000666,
  • normalize again 60, 9, 4

17
Generalized Processor Sharing
  • For best effort service main requirement is
    fairness, protection.
  • GPS can provide fairness and protection.
  • Visit each non-empty queue in turn
  • Serve infinitesimal from each
  • GPS is not implementable we can serve only
    packets

18
GPS
  • Generalized Processor Sharing (GPS) is an ideal
    fair-queuing algorithm based on the fluid model.
  • If there are N flows served by a server with
    service rate R and the ith flow is assigned a
    weight Fi and let S(i, t, t) be the amount of
    data served for flow i, which is continuously
    backlogged during an interval (t, t) then

19
GPS (cont.)?
  • In interval (t, t) the flow i receives a min fair
    share proportional to its weight
  • Where V is the set of flows that are backlogged.

20
GPS (cont.)?
  • If traffic source is constrained by a token
    bucket with burst size b and token rate r
  • GPS can guarantee a delay bound of b/r.

21
Weighted Fair Queuing (WFQ)?
  • WFQ is approximation of GPS does not assume
    infinitesimal packet size
  • Scheduler needs to find the finish time of a
    packet if packet was processed in fluid model
    (this is known as the finish number).
  • Then packets are scheduled in the increasing
    order of their finish number.

22
WFQ (cont.)?
  • In effect, WFQ simulates GPS on the side and uses
    the result to determine service order.
  • WFQ supports bandwidth allocation and delay
    bounds
  • Have been widely used in routers to support QoS.

23
WFQ details
  • Uses notions of round number and finish number
  • Suppose, in each round, the server served one bit
    from each active connection
  • Round number is the number of rounds already
    completed
  • can be fractional
  • also called virtual time

24
Weighted Fair Queueing (WFQ)?
  • Deals better with variable size packets and
    weights
  • Also known as packet-by-packet GPS (PGPS)?
  • Find finish time of a packet, had we been doing
    GPS (this is the finish number) serve packets in
    order of their finish number

25
WFQ (cont.)?
  • Computation of finish number complex for a
    general case.
  • For a simple case where all flows are backlogged
    all the time, the finish number of packet k from
    flow i is equal to the finish number of the
    previous packet from the same flow plus the time
    for transmitting the current packet (in GPS)

26
WFQ (Cont.)?
  • But in a more general case flows may move back
    and forth between backlogged and non-backlogged
    so there will be idle time between packets. The
    finish number in this case
  • R(t) round number at the arrival of packet k
    virtual time of the system at time t

27
WFQ (Cont.)?
  • Due to packetization effect, the worst-case delay
    for WFQ is more than GPS and the worst case delay
    when a flow goes through K WFQ schedulers is
  • Lmax is the max packet size in the system, ri is
    the reserved rate of flow i, Rm is the service
    rate of hop m. Li is the max packet size of flow i

28
WFQ (Cont.)?
  • First term GPS delay for leaky bucket traffic
  • Second term Worst case delay of a packet of
    flow i which has a guaranteed rate ri
  • Third term packet may have to wait after the
    current packet to be served (packet may be
    blocked by a max size packet)?

29
WFQ Example
t0 Packets of sizes 1,2,2 arrive at connections
A, B, C. t4 Packet of size 2 arrives at
connection A
30
Example (contd.)?
  • At time 0, slope of 1/3,
  • Finish number of A 1, Finish number of B, C 2
  • At time 3, connection A become inactive, slope
    becomes 1/2
  • At time 4,
  • second packet at A gets finish number 2 1.5
    3.5, Slope decreases to 1/3

31
Example (contd.)?
  • At time 5.5,
  • round number becomes 2 and connection B and C
    become inactive, Slope becomes 1
  • At time 7,
  • round number becomes 3.5 and A becomes inactive.

32
WFQ Evaluation
  • Protection
  • The rate provided to each flow is not affected by
    the sending rate of other flows.
  • This firewalling property is desirable by public
    networks.
  • Requires per connection scheduler state
  • Computing round numbers with iterated deletion is
    costly
  • Bound on end to end delay for a regulated (e.g.,
    token bucket) source.

33
Iterated Deletion Problem in WFQ
  • The main problem in computing packets finish
    number is determining the current round number
    (virtual time) of the simulated GPS server
  • Due to iterated deletion problem
  • Rate of increase of round number changes as flows
    becomes active or inactive
  • Example
  • Rate is 1/3 (three connections active)?
  • One would think the round number will be 1 at
    time t3
  • But a flow may become inactive at t2. Thus the
    round number at t3 would be 1/3 2 1/2 1
    1.167
  • Another connection may have finish number less
    than 1.167, then the above calculation would have
    to be redone.
  • Hence a WFQ server has to check if round number
    should be recalculated on every packet arrival
    and departure
  • It has to do a fairly complex computation every
    few microseconds!!

34
Variants of WFQ
  • There are less expensive variants of WFQ
  • Self Clocked Fair Queueing (SCFQ)?
  • Start Time Fair queueing
  • Worst Case fair WFQ (WF2Q)?
  • WRR

35
SCFQ
  • Avoid the costly computation of round number
  • The finish number of a packet is given by
  • Where CF finish number of the packet currently
    being served
  • The worst case latency in this case could be
  • All the (N-1) connections may have a tie (finish
    number) with the currently served packet.

36
Start Time Fair Queuing
  • SCFQ has simpler finish number calculation, but
    at the cost of increased worst case delay
  • STFQ has finish number and start number
  • Start number of a packet arriving into inactive
    connection is the current round number
  • Otherwise it is the finish number of the previous
    packet
  • Round number is set to start number of the
    current packet
  • Packets scheduled in the increasing order of
    start number

37
WF2Q
  • WFQ can result in bursty service for a flow (many
    packets of a flow is served before other flows
    are served)?
  • In WF2Q, instead of choosing the packet with
    smallest finish number among all packets, the
    scheduler chooses smallest finish number among
    all packet that would have started service in the
    GPS system.

38
WF2Q Example
  • Every packet is of length 1
  • 1 flow with weight 0.5 (flow A)?
  • 10 flows each with weight 0.05
  • 10 packets from flow A arrives at t0
  • 1 packet each from the other 10 flows arrive
    at t0

39
WF2Q Example
10
1
2
Flow A
20
WFQ
40
WF2Q Example
20
2
4
Flow A
GPS
41
WF2Q Example
1
3
2
Flow A
WF2Q
Write a Comment
User Comments (0)
About PowerShow.com