Copyright 1998 IEEE. Published in the Proceedings of ISORC'98, 20-22 April 1998 in Kyoto, Japan.
Joseph P. Loyall
Richard E. Schantz
John A. Zinky
David E. Bakken
BBN Technologies
10 Moulton Street, Cambridge, Mass. 02138 U.S.A.
Email: jloyall@bbn.com, schantz@bbn.com, jzinky@bbn.com, dbakken@bbn.com
Distributed applications are difficult to build and maintain and are even more difficult when the applications are distributed over wide-area networks. Distributed Object Computing middleware has emerged to simplify the building of distributed applications by hiding implementation details behind functional interfaces. However, critical applications have non-functional requirements, such as real-time performance, dependability, or security, that are as important as the functional requirements, but are also hidden by the middleware. Because current distributed object middleware doesn't support these aspects of critical applications, application developers often find themselves bypassing the distributed object systems, effectively gaining little or no advantage from the middleware. We have developed Quality Objects (QuO), a framework for including Quality of Service (QoS) in distributed object applications. QuO supports the specification of QoS contracts between clients and service providers, runtime monitoring of contracts, and adaptation to changing system conditions. A crucial aspect of QuO is a suite of Quality Description Languages for describing states of QoS, system elements that need to be monitored to measure the current QoS, and notification and adaptation to trigger when the state of QoS in the system changes. This paper gives a brief overview of QuO and describes the syntax and semantics of CDL, the component of QDL for describing QoS contracts.
This work is sponsored by by the Defense Advanced Research Projects Agency under Contracts No. N66001-96-C08529 monitored by NRaD, No. F30602-96-C-0315 monitored by US Air Force Research Laboratory, and No. F30602-97-C-0276 monitored by US Air Force Research Laboratory.
Keywords: CORBA, quality of service, QoS, distributed object computing
However, there are increasingly more distributed applications that have quality of service (QoS) requirements along with functional requirements. Applications such as multimedia, video-on-demand, national security, military, health care, medical, and financial systems often have critical requirements, such as real-time performance, synchronization of data, security, dependability, and fault tolerance. Distributed object middleware falls short in providing support for QoS requirements because it hides the details necessary to specify, measure, and control QoS and does not provide support for building systems that can adapt to different levels of QoS. Because of this, developers of critical applications often find themselves programming around the distributed object systems, effectively gaining little or no advantage from the middleware. The problem gets worse when an application is distributed over a WAN, which is inherently more dynamic, unpredictable, and unreliable than a LAN.
We have developed Quality Objects (QuO), a framework for including QoS in distributed object applications [16]. QuO provides an environment in which a programmer can specify possible QoS states, the system elements that need to be monitored and controlled to measure and provide QoS, and behavior for adapting to changes in QoS. In this way, QuO opens up distributed object implementations [4, 7], providing control of both the functional aspects of a program and its implementation strategies, which are often hidden behind IDL interfaces. QuO also supports aspect-oriented programming [5], in which a program is divided into aspects of concern, each of which are programmed separately in a suitable language and then weaved together into a single application. QuO provides a suite of description languages for describing aspects of the QuO application and code generators that weave them together.
In this paper, we give an overview of the QuO framework and describe one of its main components, the Contract Description Language for describing QoS contracts. Section 2 introduces and describes the QuO framework. Section 3 describes QuO's Contract Description Language (CDL) component. Section 4 illustrates CDL and QuO with an application requiring resource reservation. Section 5 describes work related to QDL. Finally, Section 6 provides some concluding remarks.

Figure 1: A remote method invocation in a QuO application

Figure 2: Example remote method call in a QuO application
Contract evaluation can also be triggered by changes in some system condition objects, i.e., those that are observed by the contract. Other system condition objects, especially those whose values change frequently, are non-observed and do not trigger contract evaluation. Regardless of how contract evaluation is triggered (by a method call/return or change in a system condition), a transition from one active region to another can trigger transition behavior, which consists of client callbacks or method calls on system condition objects.
The QuO kernel is multi-threaded, with a single thread that evaluates contracts and snapshots the values of system condition objects serially. Many system condition objects and remote method calls run in other, separate threads. The current prototype implementation of QuO runs under Linux and Solaris, using Visigenic's Java ORB, Visibroker.
To support the added role of QoS developer, the QuO framework consists of the following components:
QDL currently consists of a Contract Description Language (CDL), a Structure Description Language (SDL), and a Resource Description Language (RDL). CDL is used to describe the QoS contract between a client and an object, including the QoS that the client desires from the object; the QoS that the object expects to provide; regions of possible levels of QoS; system conditions that need to be monitored; and behavior to invoke when client desires, object expectations, or actual QoS conditions change. The CDL syntax and semantics are described in Section 3. The CDL code generator generates Java code for contract classes and instances from CDL descriptions.
SDL describes the internal structure of remote objects' implementations, such as implementation alternatives, and the adaptive behavior of object delegates. We currently have an object delegate generator that generates client-side and server-side object delegate code from SDL, CDL, and IDL code. RDL describes the resources available in the system and their status. SDL and RDL are currently under development.
Continuing work on contracts and CDL will address translation between low-level information into application-level information, e.g., network packets into message invocations; negotiation of QoS attributes, e.g., when the client and object have different expectations; and implementation optimizations.
Information in a QuO application is bound at the following different times, according to when it is available and when it is needed:
The contract organizes the possible states of QoS, the information needed to monitor and control it, the actions to take when QoS changes, and the times at which information is available. The nesting of regions can be used to arrange regions according to logical groupings of information or time. For example, the contract in Figure 3 contains two sets of nested regions, an outer nesting called negotiated regions and an inner nesting called reality regions. The negotiated regions represent the QoS desired by the client and the QoS that the remote object expects to provide and their predicates consist of system condition objects that interface to the client and object. The reality regions represent the QoS measured in the system and have predicates consisting of system condition objects that interface to system resources. This grouping distinguishes the QoS associated with operating modes of the client and object, which will likely change infrequently, from the measured QoS of the system, which will probably change more frequently.
A programmer programs a contract class in CDL, similar to the way a C++ or Java programmer programs an object class instead of an object instance. At runtime, a connection between a client and an object is established, creating an object delegate instance, and creating a contract instance and passing in pointers to the client's expectations, client's callbacks, and any other necessary system condition objects or callbacks. If necessary, relevant system condition objects, i.e., system condition objects local to the contract instance, are created and/or connected to the contract instance.
contract repl_contract(
syscond ValueSC ValueSCImpl ClientExpectedReplicas,
callback AvailCB ClientCallback,
syscond ValueSC ValueSCImpl MeasuredNumberReplicas,
syscond ReplSC ReplSCImpl ReplMgr ) is
negotiated regions are
region Low_Cost : when ClientExpectedReplicas == 1 =>
reality regions are
region Low : when MeasuredNumberReplicas < 1 =>
region Normal : when MeasuredNumberReplicas == 1 =>
region High : when MeasuredNumberReplicas > 1 =>
transitions are
transition any->Low : ClientCallback.availability_degraded();
transition any->Normal : ClientCallback.availability_back_to_normal();
transition any->High : ClientCallback.resources_being_wasted();
end transitions;
end reality regions;
region Available : when ClientExpectedReplicas >= 2 =>
reality regions are
region Low : when MeasuredNumberReplicas < ClientExpectedReplicas =>
region Normal : when MeasuredNumberReplicas >= ClientExpectedReplicas =>
transitions are
transition any->Low : ClientCallback.availability_degraded();
transition any->Normal : ClientCallback.availability_back_to_normal();
end transitions;
end reality regions;
transitions are
transition Low_Cost->Available :
ReplMgr.adjust_degree_of_replication(ClientExpectedReplicas);
transition Available->Low_Cost :
ReplMgr.adjust_degree_of_replication(ClientExpectedReplicas);
end transitions;
end negotiated regions;
end repl_contract;
The negotiated region predicates use the client's expectation system condition object, ClientExpectedReplicas. It is passed as an argument to the contract because it is probably shared by all the contracts in which the client is involved, and therefore must be created outside the contract. The reality region predicates use a system condition object called MeasuredNumberReplicas, which observes the actual number of replicas.
The reality region transitions notify the client about changes in the number of replicas. The negotiated region transitions access mechanism routines to control the level of replication. A transition to either of the Low regions notifies the client via the callback method availability_degraded. A transition to either of the Normal regions notifies the client via the callback method availability_back_to_normal. The keyword any is used to indicate that the contract and client don't care in which region the transition originated. Callback behavior is specified in the callback code (probably in the client or a separate object).
The negotiated region transitions use a replication policy manager system condition object, ReplMgr, that is passed into the contract. This system condition object provides methods to suggest to the replication policy manager changes in the amount of replication. When the client changes its desired replication, causing a transition between negotiated regions, the method adjust_degree_of_replication is called to suggest a new level of replication.
syscond [nowatch] idl_type impl_type name
callback idl_type name
The tag syscond or callback indicates whether the parameter is a system condition object or a callback object; idl_type is the IDL class of the object; and name is the name by which the object is referenced in the contract. If the parameter is a system condition object, the name of the implementation class must also be specified (impl_type). System condition objects can also be observed (i.e., a change in the system condition object triggers contract evaluation) or not (i.e., changes in the system condition object go unnoticed until the next contract evaluation). The default is for each system condition object to be observed. The optional keyword nowatch tags the system condition object as non-observed.
contract contract_name (
syscond idl_type impl_type sc_name,
syscond nowatch idl_type impl_type sc_name,
callback idl_type cb_name, ... ) is
syscond idl_type impl_type name( arg, ... );
static syscond idl_type impl_type name( arg, … );
...
tag regions are
region_name : when predicate =>
tag regions are
region_name : when predicate =>
...
precedences region_name ...;
transitions are
transition region_name->region_name :
synchronous
cb_name.callback(arg, ...);
...
asynchronous
cb_name.callback( arg, ... );
...
transition any->name :
...
transition name->any :
...
transition inactive->name :
...
transition name->inactive :
...
end transitions;
end tag regions;
region_name : when predicate =>
tag regions are separate;
precedences region_name ...;
transitions are
...
end tag regions;
end contract_name;
separate tag regions for region_name are
...
end tag regions;
Each set of regions will have at most one active region at a time. However, the region predicates in a set can overlap and it is possible for the predicates of more than one region to be true at any given time. The precedences statement is a way for the programmer to specify which regions should be active if more than one's predicates are true. The precedences statement is optional; the default precedence is the order in which the regions are listed.
For each set of regions, a set of transitions specifies behavior that is invoked when the active region changes. A transition need not be specified for every possible region change and the set of transitions can be empty. A transition is specified using the keyword transition followed by two region names separated by the keyword ->, indicating a transition from the first region to the second region. One of the region names, but not both, can be replaced with one of the keywords any or inactive. The transition declarations are interpreted as follows:
Each transition must have at least one region name in its declaration, i.e., any->any, inactive->any, any->inactive, and inactive->inactive are not allowed.
The body of a transition contains a list of methods to be invoked when the transition is triggered. Each of these must be a method on a callback object passed into the contract or a system condition object. The methods can be separated into synchronous and asynchronous sets. These sets and keywords are optional and synchronous is the default. The contract will wait for synchronous callbacks to finish before it can be evaluated again. Asynchronous callbacks are spawned; the contract does not care whether they finish or not.
For example, assume that a contract has a set of topmost regions containing a region A. Inside A is a set of regions, including a region B. Now assume that B contains the statement:
regions are separate;
Somewhere after this contract definition, perhaps in a separate file, there must be the following declaration:
separate regions for A.B are
end regions;
We could interface to any of a number of resource reservation mechanisms [2, 13, 15]. In this example, we use the Internet ReSerVation Protocol (RSVP) [14], which allows a process to reserve resources along a path from the client to the object. QuO adds the power of allowing a client and object to adapt according to their changing modes of operations, alternate implementations, and success or failure of the resource reservation. In other words, our QuO application utilizing the contract in Figure 5 includes the following:
contract ManagedCommunication(
syscond nowatch RsvpSC RsvpSCImpl session, // Conn. Mgr to setup the RSVP Session object
syscond ValueSC ValueSCImpl RSVPAvailable, // True when RSVP manager is available
callback ClientCB ClientCallback,
syscond ValueSC ValueSCImpl ClientDesiresManagedCommunication ) is
ClientMode regions are
region CriticalMode : when ClientDesiresManagedCommunication =>
ReservationMode regions are
region ReservationAvailable : when RSVPAvailable =>
SessionMode regions are
// Session syscond returns 1 if up, 0 if down
region ReservationUp : when session == 1 =>
region ReservationDown : when session == 0 =>
transitions are
transition inactive -> ReservationDown : session.start();
transition ReservationUp -> ReservationDown:
ClientCallback.lost_rsvp_session();
session.start();
end transitions;
end SessionMode regions;
region NoReservation : when not RSVPAvailable =>
transitions are
transition inactive -> NoReservation : ClientCallback.rsvp_not_available();
transition ReservationAvailable -> NoRSVP : ClientCallback.rsvp_not_available();
end transitions;
end ReservationMode regions;
region NormalMode : when not ClientDesiresManagedCommunication =>
transitions are
transition CriticalMode -> NormalMode : session.stop();
end transitions;
end ClientMode regions;
end ManagedCommunication;
The example contract in Figure 5 illustrates a different nesting of regions than that provided by the negotiated and reality region grouping in the contract in Figure 3. When the client is running in critical mode, as indicated by the CriticalMode region, there are two subregions, indicating whether resource reservation capabilities are available or not. When resource reservation is available, further subregions indicate whether a session has been started or not (ReservationUp and ReservationDown). This grouping clearly overlaps the negotiated and reality grouping, as both the ReservationMode and SessionMode regions could be seen as reality regions. As we develop more QuO applications we intend to examine more programming styles and grouping metaphors to develop a set of programming guidelines for CDL.
When the client switches to critical mode, this is observed by the ClientDesiresManagedCommunication system condition object and triggers a transition into the CriticalMode region, with its subregions inactive. The keyword inactive indicates that no region in the current nesting is active. This could occur in any of the following cases:
Immediately upon transitioning into the CriticalMode region, the ReservationMode regions will be evaluated to determine which is active. One of them will be, since the RSVPAvailable system condition object must be either true or false. If the RSVPAvailable system condition object is true, the region ReservationAvailable is active with a subregion of inactive. The contract then evaluates the subregion predicates of ReservationAvailable, to determine whether a session has been started (ReservationUp) or not (ReservationDown). If a session has not already been started the transition from inactive to ReservationDown will attempt to start a new session. Once a session has been started, the SessionMode regions will transition to ReservationUp, with no corresponding transition behavior. If the session is lost for any reason, the session system condition object will notice and cause a transition from ReservationUp to ReservationDown, triggering transition behavior that notifies the client through its callback and attempts to restart the RSVP session.
If resource reservation is not available, e.g., because RSVP doesn't exist on the system or it has failed, when the contract is in the CriticalMode region, it will trigger a transition to the NoReservation region. This transition might come from the inactive region (if CriticalMode were just entered) or from the ReservationAvailable region (if RSVP failed while it was being used). In either case, the client desires managed communication, but the mechanisms to provide it are not available. The transition notifies the client through its callback, to enable the client to adapt. In the worst case, the client will have to notify the user that managed communication is not possible and proceed without it. In other cases, the client might be able to establish different connections, utilizing other managed communication mechanisms, other contracts, or other remote objects, to get the performance it desires.
The use of QuO and CDL in this example provides the following feedback, adaptation, and portability that would otherwise have to be directly handcoded into the application code:
QuO also represents an example of Aspect-Oriented Programming (AOP) [5], in which a program is divided into aspects of concern, each of which are programmed separately in a language suitable for expressing the particular aspect. The application is constructed by weaving (using code generators) the aspects together into a single, executable application. QuO allows an application developer to separate the aspects of functional behavior, QoS contracts, system state monitoring and control, and alternate implementation and adaptation which would traditionally be interleaved throughout a critical application. QuO's code generators weave these together into a single application.
There are several other groups that have developed or are developing languages for describing aspects of QoS. The QUASAR project is working on techniques for specifying application-level QoS using the Z specification language and translating it into resource reservation requests [10, 12]. [6] describes the use of other formal specification languages, specifically Specification and Description Language (SDL), Message Sequence Charts (MSCs), and temporal logic, to specify QoS.
Frølund and Koistinen describe a specification language, QoS Modeling Language (QML), for specifying QoS [3]. QML is an extension of the Unified Modeling Language (UML) [1]. QML includes concepts of QoS contract types and contracts, similar to QuO's QDL, although QML's contract type and contract concerns a particular dimension of QoS, such as performance or availability. In contrast, a contract in QDL represents more of an application client's view of QoS, combining the QoS desires of the client, the service that an object expects to provide, the resources throughout the system that must be monitored and controlled, and adaptations to adjust to changes in QoS. A contract in QDL does not have to be limited to only one QoS dimension, e.g., a contract might describe aspects of both availability and security, and it does not have to fully describe a QoS dimension, e.g., performance might be captured fully in several contracts describing managed communication, algorithm processing time, and response time.
BeeHive provides a set of service-specific application programming interfaces (APIs), through which objects can request QoS from an underlying resource manager [11]. They are currently developing APIs for real-time, fault-tolerance, and security requirements. Each API allows an object to request a requirement in application terms, e.g., Mean Time to Failure for fault-tolerance. The resource manager translates each request into low-level resource requests.
[8] describes a technique for specifying QoS for congestion in networks. The technique involves selecting a set of quantifiable parameters that comprise the QoS. Then the upper and lower bounds for a correct operating interval are selected, followed by the upper and lower values of an interval in which service is degraded, but the degradation is acceptable. These values are combined into a matrix which defines the service contract between a client and a service provider. The contracts they describe map naturally into CDL; we simply use a programming language syntax in contrast to their matrix notation. The concept of operating regions is implicit in their notion of intervals, but they only support three intervals, normal operating range, degraded but acceptable, and unacceptable (implicit), whereas QuO does not limit the number or types of regions. In addition, there doesn't seem to be any provision for adaptation to changing levels of service.
[2] Domenico Ferrari, Anindo Banerjea, and Hui Zhang, "Network Support for Multimedia: A Discussion of the Tenet Approach," Computer Networks and ISDN Systems, July 1994, pp. 1267-1280.
[3] Svend Frølund and Jari Koistinen, "Quality of Service Specification in Distributed Object Systems Design," submitted to COOTS 98.
[4] Gregor Kiczales, "Beyond the Black Box: Open Implementation," IEEE Software, January 1996.
[5] Gregor Kiczales, John Irwin, John Lamping, Jean-Marc Loingtier, Cristina Videria Lopes, Chris Maeda, and Anurag Mendhekar, "Aspect-Oriented Programming," ACM Computing Surveys, 28(4es), December 1996, http://www.acm.org/pubs/citations/journals/surveys/1996-28-4es/a154-kiczales/.
[6] Stefan Leue, "QoS Specification based on SDL/MSC and Temporal Logic," in: G. v. Bochmann, J. de Meer, and A. Vogel (eds.), Proceedings of the Montreal Workshop on Multimedia Applications and Quality of Service Verification, Montreal, May 31 - June 2, 1994.
[7] Chris Maeda, Arthur Lee, Gail Murphy, and Gregor Kiczales, "Open Implementation Analysis and Design".
[8] Edmundo Monteiro, Fernando Boavida, GonValo Quadros, and Vasco Freitas, "Specification, Quantification and Provision of Quality of Service and Congestion Control for New Communication Services," Proceedings of the 16th AFCEA Europe Symposium, AFCEA(Association for Communications, Electronics, Intelligence & Information Systems Professionals)/IEEE COMSOC/IEE, October 18-20, Brussels, Belgium, pp. 58-68, 1995.
[9] Object Management Group, CORBA 2.0, July 96 revision, OMG Document 96-08-04, July 1996.
[10] www.cse.ogi.edu/DISC/projects/quasar/.
[11] John A. Stankovic, Sang H. Son, Joerg Liebeherr, "BeeHive: Global Multimedia Database Support for Dependable, Real-Time Applications," Computer Science Report No. CS-97-08, University of Virginia, April 21, 1997.
[12] Richard Staelhli, Jonathan Walpole, and David Maier, "Quality of Service Specification for Multimedia Presentations," Multimedia Systems, November, 1995, volume 3, number 5/6.
[13] C. Topolcic. Experimental Internet Stream Protocol, Version 2 (ST-II). Request for Comments (Experimental) RFC 1190, Internet Engineering Task Force, October 1990.
[14] Lixia Zhang, Steve Deering, Deborah Estrin, Scott Shenker, and Daniel Zappala, "RSVP: A New Resource ReSerVation Protocol," IEEE Network, September 1993.
[15] Wei Zhao and Satish K. Tripathi, "A Resource Reservation Scheme for Synchronized Distributed Multimedia Sessions," 1st Annual Advanced Telecommunications/Information Distribution Research Program Conference, January 21-22, 1997.
[16] John A. Zinky, David E. Bakken, and Richard E. Schantz, "Architectural Support for Quality of Service for CORBA Objects," Theory and Practice of Object Systems, 3(1), 1997