Docsity

Real-Time Systems: Rate Matching and Feedback-Based CPU Scheduling - Prof. Calton Pu, Study notes of Computer Science

Toggle sidebar
bg1
•1
CS4220 Embedded Systems
CS6235 Real-Time Systems
5A: Rate Matching
Instructor: Calton Pu
calton.pu@cc
TAs: Jason Parekh (jparekh@cc)
Jinpeng Wei (weijp@cc)
2
Network
Client
Decoder
Server
Filter
Media
Server
FB-Based CPU Scheduling
zReal-rate applications
♦Real-world performance demands
zAutomated rate matching
♦fine-grain adjustment of allocation
♦dynamic response to variable rates
♦low programming complexity
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Real-Time Systems: Rate Matching and Feedback-Based CPU Scheduling - Prof. Calton Pu and more Study notes Computer Science in PDF only on Docsity!

CS4220 Embedded Systems

CS6235 Real-Time Systems

5A: Rate Matching

Instructor: Calton Pu

calton.pu@cc

TAs: Jason Parekh (jparekh@cc)

Jinpeng Wei (weijp@cc)

Network Client

Decoder

Server

MediaServer Filter

FB-Based CPU Scheduling

z Real-rate applications

♦ Real-world performance demands

z Automated rate matching

♦ fine-grain adjustment of allocation ♦ dynamic response to variable rates ♦ low programming complexity

3

Feedback Approach

Dynamic Allocator

Progress Monitor

Scheduling Mechanism Feedback Scheduler

Application-specific progress information

Allocation based on proportion and period

Threads

Simple Idea

z Real-rate task model

♦Known CPU requirements

♦Known deadline

z Dynamic scheduler

♦Monitors task progress towards deadline

♦Insufficient CPU: increase allocation

♦Do it fast enough before miss

7

Consumer

Queue Example

Producer

Application

Feedback Scheduler

Monitor Progress

Assign Allocation to Producer, Consumer

Pressure = Fa - Fb

Incoming queue

Outgoing queue Thread

Fa Fb

Progress Monitor

z Fill levels show data flow pressure

♦ High pressure: increase CPU allocation/priority ♦ Low pressure: decrease allocation/priority ♦ Goal: keep data flowing smoothly

9

Real-Rate Applications

z Real-Rate applications

♦ IP telephony ♦ Videoconferencing ♦ Remote sensors over network

z Common aspects:

♦ Delay-sensitive z data must be delivered from sender to receiver in bounded time. ♦ Self-rate-regulated z e.g. live video source from camera z break our infinite source assumption

Data Encoding

Data Decoding

Sender-Side

Real-Rate Applications in the Internet

z A real-rate application using a congestion control protocol.

Sender of Congestion Control

Network

Congestion Control Feedback

Receiver of Congestion Control Buffer Buffer

Receiver-Side

13

If Input Rate is Higher Than Output

z Assumptions:

♦ CBR input ♦ AIMD saw-tooth output ♦ Input rate is higher than the average of the output Rate.

z Result:

♦ Buffering delay builds up

z Solution:

Application Adaptations

0 Time

Rate

Average Output

0 Time

Buffer Fill-level (Bytes)

Buffering Data

Input Output

QoS Adaptation Based on Local Buffer

z Adaptation: Reducing input rate to be less than the average of output. z System goes to the finite source case!

Real-rate Application Sender Network Buffer

Congestion Control Protocol

Input Rate

Output Rate

Buffering Delay Feedback

0 Time

Rate Average Output Limit

Input

Output Limit

15

Packet Scheduler

App1 App2 App

Manages outgoing network interface bandwidth Buffers & multiplexes different streams Determines inter-packet intervals and overall bandwidth allocation for each stream Conventional End-Host OS uses FCFS policy

FCFS Packet Scheduling

Problems

z Unpredictable delays

♦ Many FTP packets may be inserted between consecutive video packets ♦ FCFS scheduling does not guarantee service intervals

FTP Video

19

Specifying Reservations

z Informed

♦ Too complex for programmers or users to specify ♦ Bandwidth requirements are not constant

z Inferred

♦ Current schedulers use only resource-level information

z Our Solution

♦ Packet scheduler dynamically infers application requirements from protocol state

Inferring Requirements

z Monitor sender and receiver socket buffer fill-

levels

z Receiver’s socket buffer is on a remote host!

z Data rate requirements change dynamically

Network Interface

Socket Layer Protocols Transport Layer Protocols

Applications

Sender-Host Receiver-Host

Network

Sender-side socket buffer

Receiver-side socket buffer

Sender Process Receiver Process

Packet Scheduler

21

Packet Scheduler

Architecture

z Packet dispatcher - reservation-based

mechanism

z Proportion and period controller - progress-

driven policy

Proportion and Period Controller

Reservation-Based Packet Dispatcher Stream-n

Proportion & Period values Socket &Transport Layer Protocols

Buffer Fill-levels Data Stream-1 Packets Network

RAMP in Kernel

25

RAMP Response

System Responsiveness Results

Buffer Fill-Levels Variations

0

100

200

300

400

500

600

1 51 101 151 201 251

Bandwidth Allocation Bandwidth Requirement

Time (10ms)

Rate (Kbytes/Sec)

0

20

40

60

80

100

120

1 51 101 151 201 251

SendBuf Fill-Level Advertise Window Fill-Level Fill-Level Difference

Time (10ms)

Buffer Fill-Level (Percentage)

Step-Input Response

  • Rise time 100ms, Overshoot 25% and Settling Time 470ms.

•Controller’s setting: PID parameters (4.0, 0.4, 1.0) and Sampling time (10ms).

27

Competition for Bandwidth

Progress-driven Packet Scheduler Linux Packet Scheduler

(^1000)

200300

400 500 600700

800 900 1000

1 11 21 31 41 51 61 71 81 91 101 111 121 131 141 151 0 100 200 300 400 500 600 700 800 900 1000

1 51 101 151 201 251 301 351 401 451 501 Time (10ms) Time (10ms)

Rate (Kbytes/Sec) Rate (Kbytes/Sec)

Bandwidth Allocations Bandwidth Allocations (Estimated by the Receive Data Rate)

Real-Rate Stream’s Bandwidth Requirement

Best-effort Stream’s Bandwidth Allocation

Real-Rate Stream’s Bandwidth Allocation

Allocation versus Usage

0 100 200 300 400500

600 700 800 900 1000

1 51 101 151 201 251 301 351 401 451 501

Best-Effort Stream Real-Rate Stream (800kBytes/Sec)

Time (10ms) Time (10ms)

Rate (Kbytes/Sec) Rate (Kbytes/Sec)

Bandwidth Allocations Real Usage

(^1000) 200 300400

500600

700800

900 1000

1 51 101 151 201 251 301 351 401 451 501

Best-Effort Stream Real-Rate Stream (800KBytes/Sec)

RAMP Scheduler (TCP)