250 likes | 345 Views
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. Contents:. Introduction A Real-Time USB System Architecture A Real-Time USB Device Driver
E N D
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
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
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
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)
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
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
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
A Real-Time USB System Architecture • 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 Device driver hierarchy of the USB subsystem
A Real-Time USB System Architecture(Queue list structure) Queue list structure of the OHCI USB Schedule The USB communication channel
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
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
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
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.
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
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
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)
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.
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)
Performance Evaluation(Part 1 of the experiment) - Results Acceptance Ratio: Ratio of the number of accepted workloads to the total number of workloads Acceptance ratios under different period ranges Optimal Algorithm: Exhaustive-search-based which tries all possible combinations exhaustively to insert ED/TD’s into the polling binary tree
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
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
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
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
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.
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)