Adaptive QoS Middleware Framework for Complex Flexible Applications Baochun Li, Klara Nahrstedt Department of Computer Science University of Illinois at Urbana-Champaign b-li@cs.uiuc.edu, klara@cs.uiuc.edu 1. Background and Motivation The next generation Internet will provide differentiated services with provision of minimal QoS guarantees to complex and distributed applications. These applications will concurrently share and compete for both end systems resources and transmission bandwidth of heterogeneous multi-protocol networks provided by the next generation Internet infrastructure. Most of these applications are flexible, in the sense that they can tolerate a QoS range of input quality and resource availability beyond a certain minimum level, and can improve its performance if given a larger share of resources. If resources above the minimum requirements are shared among all applications, statistical multiplexing gain can be improved. In addition, for the flexible applications that involve interactive activities that cannot be predicted beforehand, it may be hard or impossible to specify a maximum demand for QoS. If these applications specify their QoS requirements with a range representation, adaptation is then desirable to cope with the load and throughput fluctuations beyond the minimal QoS guarantees by the next generation Internet. Our goal is to control the behavior of these applications so that they can adapt themselves to fluctuations in resource availability, and their adaptation paths offer graceful degradation facing resource limitations, and graceful upgrades when resources become available again. 2. An Adaptive QoS Middleware Framework Our objective is to control the adaptation behavior of these applications and fully cope with the dynamics in resource availability over next generation Internet, as well as fluctuations in QoS requirements of the applications themselves. In order to control the behavior of flexible applications, our approach is to embed the control into an adaptive QoS middleware between the OS and applications. This middleware framework interacts closely with Internet II protocol stack (e.g., IPv6) residing in the OS through well-defined interfaces, and monitors the bandwidth allocation to each application in order to make adaptation control decisions. There are several advantages for placing the adaptation control in the middleware layer: First, it leverages its ability to interact with all applications in the system to ensure fairness and other global properties; second, it is able to enforce different adaptation policies on the applications, based on user's preferences; finally, by using on-the-fly measurements and observation in the middleware framework, the applications can concentrate on major functionalities. In summary, the adaptive QoS middleware framework takes the responsibility of adaptation from flexible applications, which concentrate on processing input and generating output, given a certain amount of resources available. In our approach, we distinguish clearly adaptation policies from adaptation mechanisms. Adaptation mechanisms are outside of the scope of the middleware. Adaptation policies, which make choices among mechanisms and decide the degree of adaptation, are determined by the middleware framework. Our approach focuses on the distinctive properties of adaptation policies independent of mechanisms. We propose adaptation policies that are (1) stable so that the adaptation behavior does not oscillate, (2) configurable in terms of adaptation agility to respond fast towards performance disturbances, and (3) fair for all applications so that none of them will starve for resources. 3. Adaptation Tasks in the Middleware Framework If we examine the interaction between the applications and adaptive QoS middleware framework in a more detailed fashion, it is very natural to map it to a typical control system. In a control system, there is a target system to be controlled. This target system takes appropriate actions to process the input. The input is determined by a controller according to a control algorithm, which monitors the states inside the target system, and compares them to the desired values referred to as the reference. Similarly, adaptation also needs to identify the current states of the target application based on any parameters that can be observed, and to decide input values to the target application in the future. In order to leverage this analogy between control theory and application adaptation, we use a Task Flow Model [1] to model the structure of the application, with each functional unit modeled as a task. Using this model, we propose Adaptation Tasks that execute adaptation algorithms and control the Target Tasks in the application, as well as Observation Tasks to monitor or estimate the internal states of the Target Task. Based on the above model, it is possible to apply results in control theory to the design and analysis of adaptation algorithms. The control-theoretical framework allows us to quantitatively analyze system properties such as stability, adaptation agility and equilibrium values for the adaptation behavior. For example, we applied a PID control algorithm in our active adaptation middleware framework and showed the above properties easily [2]. With pre-assigned weights for each application, we were also able to prove that the adaptation algorithm that we have derived satisfied the weighted max-min fairness properties. 4. Distributed Visual Tracking Application: A Testbed We implemented a testbed based on a complex flexible application, a distributed visual tracking system. The Tracking Server grabs live video and feeds them in real time over a heterogeneous network to the Tracking Client, which performs complex tracking algorithms to track individual objects when they are moving. The middleware framework has been developed to support the adaptation of this tracking system. These adaptation decisions are decided by the Adaptation Task, executing a PID control algorithm. For the reason that the middleware framework needs to interact with different applications, the interaction goes through a service enabling platform such as CORBA. In our implementation, the middleware framework and the Visual Tracking application interact with each other through well-defined interfaces written in CORBA IDL. This enables freedom of implementation choices for both middleware and applications. Implemented in Windows NT, the middleware framework runs above the Windows Sockets 2 interface, which encapsulates the Internet protocol stack on the end systems. Our experiences on implementing the middleware framework to support the adaptation to the complex tracking application have been positive. The output quality, tracking precision, of the tracking algorithms can be kept in a desired range without losing track, when Internet bandwidth availability fluctuates. 5. Conclusions The objective our adaptive QoS middleware framework is to provide control and direction towards adaptation of complex distributed applications, running over the next generation Internet protocols and services. Adaptation is desired to cope with possible resource fluctuations beyond a minimal QoS level. Based on the adaptation framework that we developed, we are able to quantitatively analyze the stability and adaptation agility of adaptive behavior, leveraging its analogy with control systems. We present experimental results in a distributed Visual Tracking application over Internet networks, in order to demonstrate the effects of adaptation in real systems. [1] D. Hull, A. Shankar, K.Nahrstedt and J. W.S. Liu, An End-to-End QoS Model and Management Architecture, in Proceedings of IEEE Workshop on Middleware for Distributed Real-time Systems and Services, December 1997. [2] B. Li, K. Nahrstedt, A Control Theoretical Model for Quality of Service Adaptations, In Proceedings of 1998 Sixth IEEE International Workshop on Quality of Service, pp. 145 - 153. May 1998.