25
A Cyclic-Executive- Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan

A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

Embed Size (px)

Citation preview

Page 1: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

A Cyclic-Executive-Based QoS Guarantee over USB

Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei KuoDepartment of Computer Science and Information Engineering

National Taiwan University, Taipei, Taiwan

Page 2: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

Contents:

• Introduction• A Real-Time USB System Architecture• A Real-Time USB Device Driver

– Cyclic-Executive-Based Method

– Period Modification Policy and Admission Control

• Performance Evaluation– Surveillance system prototype

• Conclusion

Page 3: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

Introduction

• Computer systems are very modularized• Various I/O devices can be connected to few

common interfaces (SCSI, USB, IEEE-1394)• Need for resource allocation no longer remains at

the kernel• I/O subsystems can provide QoS guarantee for

applications• Further, various subsystems are interconnected

with proper interface definitions

Page 4: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

Introduction (USB)

• USB supports many types of devices:– HID (keyboard, mouse)– Block devices (disks)– Stereo speakers, video cameras etc

• Data transfer modes on the USB bus:– Periodic (Isochronous, Interrupt transfers)– Aperiodic (Control, Bulk transfers)

Page 5: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

Introduction (USB issues)

• Varying bandwidth requirement for different devices; interaction with USB host controllers vary.

• Example: – HID demands periodic, but light workload

– Storage device requires best-effort-service from the corresponding host controller

• Also, the OS has to manage a number of USB devices at the same time; devices compete for limited bus bandwidth

• Hence management of USB bandwidth is important if QoS requirements are considered

Page 6: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

Introduction(bandwidth reservation scheme)• USB 1.1 bandwidth

reservation scheme in each 1ms time frame (fig)

• No QoS guarantee for each device (i.e. lower bound on the number of bytes per device in a 1ms time frame); but upper bound exists

Start of Frame

Page 7: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

Introduction(Main idea of this paper)

• A real-time USB driver architecture, in which a bus bandwidth reservation and scheduling mechanism is proposed to reserve and allocate USB bandwidth according to QoS requirements

• Design a real-time scheduling layer inside the USB driver to let the system comply with the USB specifications

Page 8: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

A Real-Time USB System Architecture

Device driver hierarchy of the USB subsystem

• USB subsystems on Linux is a layered architecture

• Provides a better abstraction of USB device drivers; hence kernel has a transparent view over the devices

• USB Core functions: – provides a set of consistent, abstracted

API’s to the upper-level client drivers

– Translates requests by device drivers into host-controller-awared data structures

Page 9: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

A Real-Time USB System Architecture(Queue list structure)

The USB communication channel

Queue list structure of the OHCI USB Schedule

Page 10: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

A Real-Time USB System Architecture(some significant terms)

• Transfer descriptors (TD): Data structures constructed by the OS to manage devices; USB host controller exercises TDs

• Endpoint descriptor (ED): Present at the head of TD list for each device; records the transfer info abt the device (device # of the host controller)

• USB Schedule: Memory resident table handled by the host controller; consists of a number of queues of TDs

Page 11: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

A Real-Time USB System Architecture(USB communication channel)

• For bulk, control data transfers, host controller maintains a pointer to the head of the TD list, for each type

• For interrupt data transfers, the subsystem maintains 32 interrupt entries forming a tree structure

• List of TDs for isochronous transfers are hooked up at the root of the tree

• Each interrupt entry is visited every 32ms; all devices with a TD list are serviced b/w the interrupt entry and root within 1ms

• Isochronous queue will be serviced in every 1ms• Done Queue: specifical queue for TDs after being serviced

Page 12: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

A Real-Time USB Device Driver(Cyclic-Executive-Based method)

• Allocate USB bandwidth for USB devices• Service requests of devices are intelligently

hooked up on the tree structure based on their QoS requirements

• Propose period modification policy; corresponding admission control policy to determine if the system can satisfy the QoS requirements of new, existing requests

• Scheduling of ED/TD’s; Insertion of ED/TD’s into queues such that the USB protocol overheads are minimized

Page 13: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

A Real-Time USB Device Driver(Period modification, Admission control)

•Period modification: move and modify all EDs to the root node•Linux USB OHCI driver restricts periodic service requests to a set of fixed periods(1, 2, 4…..32ms)

Comparison of two USB driver architecture.(a) Original USB driver architecture.(b) Real-time USB driver architecture.

Page 14: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

A Real-Time USB Device Driver(Period modification, Admission control)

• The tree structure of the TD lists determines the frequencies of the traversing of nodes on paths to the root; device is serviced in 1ms corresponding to the path.

• 32 leaf nodes; 63 internal/leaf nodes; 63 different nodes to hookup EDs.• Nodes at ith level are serviced at every 2i ms.• When ED is moved from any node to root node extra protocol overheads will occur• Ex: 50 byte transfer for per 16ms can be translated to [50/16] + overhead within 1ms

Page 15: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

A Real-Time USB Device Driver(How to choose proper nodes to insert EDs?)

• Move and modify EDs to nodes of larger heights to minimize the protocol overheads and additional bandwidth requirements due to period modification policy.

• Follow two guidelines:– Destination node of an original ED, must have a polling period

shorter than the period pi of the corresponding request (For a 4096byte; 8ms cam transfer, if data is not transferred within 8ms to OHCI, cam buffer may be overwritten)

– Since 1500 bytes can be transferred within 1ms. Total number of bytes for the services of all EDs on a path < = 1500bytes

Page 16: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

A Real-Time USB Device Driver(How to choose proper nodes to insert EDs?)

•Consider the original workload: T1 = (1400bytes; 2ms),T2 = (1400bytes; 2ms), and T3 = (120bytes; 2ms).•New revised workload: T1

’ = (700bytes; 1ms), T2’ =

(700bytes; 1ms), and T3’ = (60bytes; 1ms)

•ED/TD reinsertion problem is a combinational problem (Greedy algorithm is used to solve this)

Page 17: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

Performance Evaluation(Experimental Environments)

• USB based surveillance system (server, client architecture)

• Server managed several USB digital video cams• Client- several PDA’s in a 802.11b n/w• Two part experiment:

– Part 1) Evaluated the effectiveness of bandwidth reservation method in terms of the number of accepted workloads and bandwidth utilizations

– Part 2) Evaluated different workload configurations over the cyclic-executive-based scheduler to verify if the QoS requirements were satisfied or not.

Page 18: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

Performance Evaluation(Part 1 of the experiment) - Request sets and metrics

• A number of workloads, with 20 requests per workload were generated to evaluate the performance of the admission control policy

• Periods of requests were among:– [1ms, 8ms], [8ms, 32ms], [1ms, 32ms]

• 1000 workloads for each period range• Payload size of a request was determined based on

utilization and period (USB bus was stressed to 93% capacity, excluding protocol overheads)

Page 19: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

Performance Evaluation(Part 1 of the experiment) - Results

Acceptance Ratio: Ratio of the number of accepted workloads to the total number of workloads

Optimal Algorithm: Exhaustive-search-based which tries all possible combinations exhaustively to insert ED/TD’s into the polling binary tree

Acceptance ratios under different period ranges

Page 20: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

Performance Evaluation(Part 1 of the experiment) - Results

• Acceptance ratio of the admission control policy was close to that of the optimal algorithm when the period ranges are between [1, 8], [1, 32]ms.

• Because of protocol overheads (period transformation of admission control policy), admission control policy rejects more workloads when the period range is [16, 32]ms

Page 21: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

Performance Evaluation(Part 1 of the experiment) – USB bandwidth utilizations

Y-axis: bandwidth utilizations after the reinsertions of requests were done

Root-Resident Utilization: USB bandwidth utilization assigned to a request. If request is moved away from root, RR Utilization can be reduced because of less protocol overheads

Page 22: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

Performance Evaluation(Part 1 of the experiment) – Results

• Represents the amount of protocol overheads saving due to ED/TD reinsertion algorithm

• Saving was best achieved for longer periods of request [16, 32]ms

• Because of higher possibility in inserting the ED/TD’s of requests with long periods into nodes with lower levels of the polling tree

Page 23: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

Performance Evaluation(Part 2 of the experiment) – Different workload configurations

• Evaluated the scheduler under two different workload configs; different polling periods, payload sizes, ratios of bandwidth utilizations (Table1, Sec 4.3.1)

• Two metrics:– Service time points of the two cameras– # of bytes received from each camera

Page 24: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

Performance Evaluation(Part 2 of the experiment) – Results

The distributions of service time points of each camera over time.

The number of bytes received from a camera to the total number of bytes received from the two cameras.

Page 25: A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering

Conclusions

• Paper proposed a cyclic-executive-based methodology to guarantee the QoS requirements of USB devices

• A bandwidth reservation algorithm to partition the available bandwidth

• Explore USB 2.0 (transfer rate of 480 bits/sec)