% $Id: globecom-vr.tex,v 1.16 2005/08/23 21:21:59 gokhale Exp $
%
% This paper can be formatted using the peerreviewca
% (instead of conference) mode.
\documentclass[conference]{IEEEtran}
%\documentclass[peerreviewca]{IEEEtran}
% If the IEEEtran.cls has not been installed into the LaTeX system files,
% manually specify the path to it:
% \documentclass[conference]{../sty/IEEEtran}
\usepackage{epsfig}
\usepackage{times}
\usepackage{graphicx}
\usepackage{url}
\usepackage{epsfig}

\input{macros}

%\usepackage{cite}

\begin{document}

\title{Response Time Analysis of a Middleware Event Demultiplexing
  Pattern for Network Services} 


% author names and affiliations
% use a multiple column layout for up to three different
% affiliations
\author{\authorblockN{Swapna S. Gokhale}
\authorblockA{Dept. of CSE\\
University of Connecticut  \\
Storrs, CT 06269\\
Email: ssg@engr.uconn.edu } \and
\authorblockN{Aniruddha S. Gokhale}
\authorblockA{Dept. of EECS\\
Vanderbilt University  \\
Nashville, TN\\
Email: a.gokhale@vanderbilt.edu } \and
\authorblockN{Jeff Gray}
\authorblockA{Dept. of CIS\\
U. of Alabama at Birmingham  \\
Birmingham, AL 35294\\
Email: gray@cis.uab.edu }}


% use only for invited papers
%\specialpapernotice{(Invited Paper)}

% make the title area
\maketitle

\begin{abstract}
Society is becoming increasingly reliant on the services provided 
by distributed, performance sensitive software systems. These systems
demand multiple simultaneous quality of service (QoS) properties. 
A key enabler in recent successes in the development of such systems  
has been middleware, which comprises reusable building blocks. 
Typically, a large number of configuration options 
are available for each building block when composing a system end-to-end. 
The choice of the building blocks and their configuration options have
an impact on the performance of the services provided by the
systems. Currently, the effect of these choices can be determined only very 
late in the lifecycle, which can be detrimental to system development
costs and schedules. In order to enable the right design choices, 
a systematic methodology to analyze the performance of these systems 
at design time is necessary. Such a methodology may 
consist of models to analyze the performance of individual 
building blocks comprising the middleware and the composition of 
these building blocks. As a first step towards building this 
methodology, this paper introduces a model of the 
Reactor pattern, which provides important 
synchronous demultiplexing and dispatching capabilities to network
services and applications.
The model is based on the 
Stochastic Reward Net (SRN) modeling paradigm. 
We illustrate how the model could be used to obtain the response 
time of a Virtual Private Network (VPN) service provided by a 
Virtual Router (VR). 
\end{abstract}

% no keywords

% For peer review papers, you can put extra information on the cover
% page as needed:
% \begin{center} \bfseries EDICS Category: 3-BBND \end{center}
%
% for peerreview papers, inserts a page break and creates the second title.
% Will be ignored for other modes.
\IEEEpeerreviewmaketitle

\section{Introduction}
Society is increasingly reliant on the services provided by 
distributed, performance-sensitive software systems. These systems 
demand multiple simultaneous quality of service (QoS) properties 
including predictability, controllability, and adaptability of 
operating characteristics for applications with respect to such
features as time, throughput, accuracy, confidence, security 
and synchronization. A key enabler in recent successes in the 
development of such systems is {\em QoS-enabled middleware}~\cite{Schmidt:01o}. 
Middleware comprises software layers that provide platform-independent
execution semantics and reusable services that coordinate how application
components are composed and interoperate. The flexibility and configurability
offered by middleware is manifested in the large number of reusable software
building blocks and configuration options, which can be used to compose
and build large systems end-to-end. These building blocks embody good
design practices called patterns~\cite{Vlissides:94,Schmidt:00a}. 
The choice of the patterns
and their configuration options is driven by the context of the
application. These choices have a profound impact on 
the performance of the provided service. 

Current {\em ad hoc} techniques based on manually choosing the right
set of building blocks and their configuration options are error-prone
and may adversely impact performance, system costs and schedules, since
most errors are caught very late in the lifecycle of the system development. 
It is desirable to have the ability to analyze the performance of 
individual building blocks and the composed system much earlier in the
system lifecycle, thereby significantly lowering system testing costs 
as well as improving the correctness of the final developed system. 

To address the challenge of system performance evaluation in the 
design phase, a systematic performance analysis methodology is necessary.
This methodology would comprise developing performance models of the
individual building blocks and their composition. The performance 
models are based upon well-known analytical/\-numerical modeling 
paradigms~\cite{evol-spn,mrspn,fspn-1} and 
simulation techniques~\cite{NS-2}. As a first step
towards the development of such a methodology, this paper presents a 
model of the Reactor pattern~\cite{Vlissides:94,Schmidt:00a}, 
which provides important synchronous demultiplexing and dispatching 
capabilities to network services and applications. The model is based
on the Stochastic Reward Net (SRN) modeling paradigm~\cite{evol-spn}. 
We illustrate how the model can be used to obtain an estimate of the
response time of a Virtual Private Network (VPN) service provided by a Virtual 
Router (VR)~\cite{Knight:04}.  

\noindent {\bf Paper organization:}
The paper is organized as follows: Section~\ref{sec:perf_model} 
presents the performance model of the Reactor pattern. Section~\ref{sec:ill}
illustrates how the performance model of the Reactor pattern 
can be used to obtain the response time of a VPN service provided 
by a VR. Section~\ref{sec:concl} offers concluding
remarks and directions for future research. 

\section{Performance Model of the Reactor Pattern}
\label{sec:perf_model}
In this section, we first provide an overview of the Reactor 
pattern followed by the SRN model of the Reactor pattern. 
The section also describes how the response time can 
be obtained from the SRN model.

\subsection{Reactor Pattern in Middleware Implementations}
\label{sec:reactor}

Figure~\ref{fig:mw-demux} depicts a typical event demultiplexing and
dispatching mechanism documented in the Reactor pattern. The
application registers an event handler with the event demultiplexer
and delegates to it the responsibility of listening for incoming
events. On the occurrence of an event, the demultiplexer dispatches the
event by making a callback to its associated application-supplied event
handler. This is the idea behind the Reactor pattern, which provides
synchronous event demultiplexing and dispatching capabilities.

\begin{figure}[htb]
\begin{center}
\includegraphics[width=2.3in]{../Sigmetrics-2005/eps/demux.eps}
\bfcaption{Event Demultiplexers in Middleware}
\label{fig:mw-demux}
\end{center}
\end{figure}

The Reactor pattern can be implemented in many different ways
depending on the event demultiplexing capabilities provided by the
underlying operating system and the concurrency requirements of the
applications. For example, the demultiplexing capabilities of a
Reactor could be based on the {\tt select ()} or {\tt poll ()} system calls
provided by POSIX-compliant operating systems, or {\tt
WaitForMultipleObject ()} as found in the different flavors of Win32 operating
systems. Moreover, the handling of the event in the event handler
could be managed by the same thread of control that was listening for
events leading to a single-threaded Reactor
implementation. Alternatively, the event could be delegated to a pool of
threads to handle the events leading to a thread-pool
Reactor. 

\subsection{Characteristics of the Reactor Pattern}
\label{sec:reactor_modeling}
We consider a single-threaded, {\em select}-based implementation of
the Reactor pattern with the following characteristics:

\begin{itemize}%\crunchlist
\item The Reactor receives two types of input events with one
      event handler for each type of event registered with the Reactor.
\item Each event type has a separate queue, which holds the incoming
      events of that type. The buffer capacity for the queue of type
      \#1 events is denoted $N_1$ and of type \#2 events is denoted $N_2$.
\item Event arrivals for both types of events follow a Poisson
      process with rates $\lambda_1$ and $\lambda_2$, while the
      service times of the events are exponentially distributed with
      rates $\mu_1$ and $\mu_2$. 
\item In a snapshot, an event of type \#1 is serviced with a higher
      priority over an event of type \#2. In other words, when event handles 
      corresponding to both event types are enabled in a snapshot, the 
      event handle corresponding to type \#1 is serviced with a 
      priority that is higher than the event handle of type \#2. 
\end{itemize}

\subsection{SRN Model}
\label{sec:srn}
In this section we present the SRN model of the Reactor pattern. 
A Stochastic Reward Net (SRN) substantially extends the modeling 
power of Generalized Stochastic Petri Nets (GSPNs)~\cite{evol-spn}, 
which are an extension of Petri nets~\cite{peterson81}. A SRN is a modeling
technique that is concise in its specification and closer
to a designer's intuition about what a model should look like. 
SRNs have been extensively used for performance,
reliability and performability analysis of a variety of
systems~\cite{corba-perf,avail-vax,poll-perf,man-perf,queue-perf,rel-srn}.
The work closest to the proposed research is reported by Ramani {\em
et al.}~\cite{corba-perf}, where SRNs are used for the performance
analysis of the CORBA event service. A detailed overview of SRNs
can be obtained from~\cite{evol-spn}. 

\begin{figure*}[htb]
\centering
\includegraphics[width=4.5in]{../Sigmetrics-2005/eps/srn.eps}
\bfcaption{SRN model for the Reactor pattern}
\label{fig:srn}
\end{figure*}

Figure~\ref{fig:srn} shows the 
SRN model for the Reactor pattern with the characteristics described 
in Section~\ref{sec:reactor_modeling}. Table~\ref{table:enable} 
summarizes the enabling/\-guard functions for the transitions in the net. 
The net on the left-hand side models the arrival, 
queuing and service of the two types 
of events. Transitions $A1$ and $A2$
represent the arrival of the events of type \#1 and \#2, respectively. 
Places $B1$ and $B2$ represent the queue for the two
types of events. Transitions $Sn1$ and $Sn2$ are immediate transitions
that are enabled when a snapshot is taken. Places $S1$ and $S2$ 
represent the enabled handles of the two types of events, whereas 
transitions $Sr1$ and $Sr2$ represent the execution of
the enabled event handlers of the two types of events. An inhibitor
arc from place $B1$ to transition $A1$ with multiplicity $N1$ prevents 
the firing of transition $A1$ when there are $N1$ tokens in 
place $B1$. The presence of $N1$ tokens in place $B1$ indicates
that the buffer space to hold the incoming input events of the first
type is full, and no additional incoming events can be accepted.
The inhibitor arc from place $B2$ to transition $A2$ achieves
the same purpose for type \#2 events. The inhibitor arc from place 
$S1$ to transition $Sr2$
prevents the firing of transition $Sr2$ when there is a token in 
place $S1$. This models the prioritized service for an event of
type \#1 over event of type \#2 in a given snapshot.

The net on the right of Figure~\ref{fig:srn} models the process of 
taking successive snapshots and prioritized service of the event handle 
corresponding to type \#1 events in each snapshot. Transition $Sn1$ 
is enabled when there is a token in place $StSnpSht$, 
at least one token in place $B1$, and no tokens in place $S1$. 
Similarly, transition $Sn2$ is enabled when there is a token 
in place $StSnpSht$, at least one token in place $B2$, and 
no tokens in place $S2$. Transition $T\_SrvSnpSht$ is enabled 
when there is a token in either one of the places $S1$ and 
$S2$, and the firing of this transition deposits a token in
place $SnpShtInProg$. 

The presence of a token in the place 
$SnpShtInProg$ indicates that the event handles that were enabled 
in the current snapshot are being serviced. After these event
handles complete execution, the current snapshot is 
complete and it is time to take another snapshot.
This is accomplished by enabling the transition $T\_EndSnpSht$.
Transition $T\_EndSnpSht$ is enabled when there are no tokens
in both places $S1$ and $S2$. Firing of the transition $T\_EndSnpSht$
deposits a token in place $StSnpSht$, indicating that the service
of the enabled handles in the present snapshot is complete,
which marks the initiation of the next snapshot.    

\begin{table*}[htb]
\begin{center}
\caption{Enabling/\-Guard functions}
\label{table:enable}
\begin{tabular}{|c|c|} \hline
Transition & Guard function \\ \hline 
$Sn1$ & $((\#StSnpShot == 1) \&\& (\#B1 >= 1) \&\& (\#S1 == 0)) ? 1:0$ \\ \hline 
$Sn2$ & $((\#StSnpShot == 1) \&\& (\#B2 >= 1) \&\& (\#S2 ==0)) ? 1:0$ \\ \hline 
$T\_SrvSnpSht$ & $((\#S1 == 1) || (\#S2 == 1)) ? 1:0$ \\ \hline 
$T\_EndSnpSht$ & $((\#S1 == 0) \&\& (\#S2 == 0)) ? 1:0$ \\ \hline 
\end{tabular}
\end{center}
\end{table*}

We now describe how the process of taking a single snapshot is
modeled by the SRN model presented in Figure~\ref{fig:srn}. 
We consider a scenario where there is one token 
in each one of the places $B1$ and $B2$, and there is a token in the place 
$StSnpSht$. Also, there are no tokens in places $S1$ and $S2$.
In this scenario, transitions $Sn1$ and $Sn2$ are enabled. Both of
these transitions are assigned the same priority, and any
one of these transitions can fire first. Also, since these 
transitions are immediate, their firing occurs instantaneously. 
Without loss of generality, it can be assumed that transition $Sn1$ 
fires before $Sn2$, which deposits a token in place $S1$. 

When a token is deposited 
in place $S1$, transition $T\_SrvSnpSht$ is enabled. In addition, 
transition $Sn2$ is already enabled. If transition $T\_SrvSnpSht$ were
to fire before transition $Sn2$, it would disable transition
$Sn2$, and prevent the handle corresponding to the second event
type from being enabled. In order to prevent transition $T\_SrvSnpSht$
from firing before transition $Sn2$, transition $T\_SrvSnpSht$
is assigned a lower priority than transition $Sn2$. Because transitions
$Sn1$ and $Sn2$ have the same priority, this also implies that 
the transition $T\_SrvSnpSht$ has a lower priority than transition
$Sn1$. This ensures that in a given snapshot, event handles corresponding
to each event type are enabled when there is at least one event in
the queue. 

After both event handles are enabled, transition 
$T\_SrvSnpSht$ fires and deposits a token in place $SnpShtInProg$. 
The presence of a token in the place 
$SnpShtInProg$ indicates that the event handles that were enabled 
in the current snapshot are being serviced.
The event handle corresponding to type \#1 event is serviced first,
which causes transition $Sr1$ to fire and the removal of the token
from place $S1$. Subsequently, transition $Sr2$ fires and the event
handle corresponding to the event of type \#2 is serviced. This
causes the removal of the token from place $S2$. After both events
are serviced and there are no tokens in places $S1$ and $S2$, transition
$T\_EndSnpSht$ fires, which marks the end of the present snapshot and
the beginning of the next one. 

We obtain the response times of the events denoted $R_1$ and 
$R_2$ using the tagged customer
approach~\cite{melamed84}. In the tagged customer approach, an arriving event
is tagged and its trajectory through the system is followed from entry to
exit. The response time of the tagged event is then determined conditional
to the state in which the system lies when the event arrives. The 
unconditional response time can be obtained as the weighted sum of
the conditional response times, with the weights given by the 
steady state probabilities of being in each one of the states. 
Typically, the response time of an event consists of two pieces; namely,
the time taken to service the event hereafter referred to as the 
``service time,'' and the time that the event must
wait in the system before its service commences, hereafter referred to
as ``waiting time.'' In our case, the average service time of
an incoming type \#1 and type \#2 event 
is given by $1/\mu_1$ and $1/\mu_2$, irrespective of
the state in which the system lies when the event arrives. The waiting
time, however, will depend on the system state. Next, we discuss
how the conditional waiting time of each event type is determined.

The conditional waiting time for a tagged event
of type \#1 will depend on the state of the system,
where the state is given by the number of tokens or markings of 
places $S1$, $S2$, $B1$ and $B2$. Of these four places, the markings
of the places $S1$ and $S2$ determine the progress of the current
snapshot, whereas, the markings of places $B1$ and $B2$ determine
the state of the queue. The mean time taken to complete the current
snapshot is given by the sum of two terms, the first term is 
the product of the number of tokens in place $S1$ and $1/\mu_1$,
and the second term is the product of the number of tokens in
place $S2$ and $1/\mu_2$. Even if there are no additional events 
in the queues, the current snapshot must be completed before
the service of an incoming event of type \#1 can begin. Hence, 
the time taken to complete the current snapshot contributes to the 
waiting time of the incoming or tagged type \#1 event. In order to obtain
the entire waiting time of a tagged type \#1 event, the contribution 
of the queued events of type \#1 and type \#2 needs to be determined. 

Let $n_1$ be the number of events of type \#1 in the queue, 
and $n_2$ be the number
of events of type \#2 in the queue, when the tagged event of type \#1 
arrives. This implies that after $n_1$ snapshots the tagged event
will be serviced. The following three possibilities arise between
the relative values of $n_1$ and $n_2$. 
If $n_1 \leq  n_2$, then only $n_1$ of the type \#2 events
need to be serviced before the service of the tagged type 
\#1 event can commence,
and hence the waiting time is given by $n_1(1/\mu_1 + 1/\mu_2)$. If 
$n_1 = n_2$, then $n_1$ events of type \#1 and type \#2 need to be serviced
before the service of the incoming type \#1 event can commence, 
and hence the waiting time is given by $n_1(1/\mu_1 + 1/\mu_2)$. 
If $n_1 > n_2$, then in the optimistic case, 
$n_1$ events of type \#1 and $n_2$ events of type \#2 need to be 
serviced before the service of the tagged event can commence. The
optimistic case assumes that no additional events of type \#2 arrive in
the first $n_1$ snapshots. In the pessimistic case, however, $n_1 - n_2$ 
events of type \#2 will arrive while the first $n_2$ events 
are being serviced. Thus,
in the optimistic case, the waiting time will be  $n_1/\mu_1 + n_2/\mu_2$,
and in the pessimistic case, the waiting time will be $n_1(1/\mu_1 + 1/\mu_2)$.
We consider the pessimistic case since that provides an upper bound on
the response time. The pessimistic contribution of the queued events 
to the waiting time is given by the product of the number of tokens in
place $B1$ and the sum of the reciprocals of $\mu_1$ and $\mu_2$.
Thus, the overall response time of the tagged event will be given
by the sum of two terms, the first term is $1/\mu_1$
times the sum of the tokens in places $S1$, $B1$ and $1$, and the 
second term is given by the product of $1/\mu_2$ and the sum
of the number of tokens in place $S2$ and $B1$. 
The contribution of the queued events to the waiting time of
the tagged event of type \#2 can also be determined using
similar reasoning, with an additional consideration given to
the prioritized service provided to event of type \#1 over an 
event of type \#2 in each snapshot. 
The reward rates to obtain the response time of the events of type \#1 
and type \#2 are summarized in 
Table~\ref{table:rr}. 

\begin{table*}[htb]
\begin{center}
\caption{Reward assignments for response time}
\label{table:rr}
\begin{tabular}{|c|c|c|} \hline
Event type & Reward rate \\ \hline 
\#1 & return($\#B1 < N1 ? 1/\mu_1*(\#S1+\#B1+1) + 1/\mu_2*(\#S2+\#B1):0$) \\ \hline 
\#2 & return($\#B2 < N2 ? 1/\mu_2*(\#S2+\#B2+1) + 1/\mu_1*(\#S1+\#B2+1):0$) \\ \hline 
\end{tabular}
\end{center}
\end{table*}

In the model of the reactor pattern described above, the arrival, 
service and failure distributions are assumed to be 
exponential. For certain types of applications, this assumption
may not hold. For example, for safety-critical applications, 
events may occur at regular intervals, in which case the arrival
process is deterministic. In addition to the deterministic
distribution, the arrival, service and failure
processes may also follow
any other non-exponential or general distribution. 
There are two ways to consider non-exponential distributions in
the SRN model. In the first method, a non-exponential 
distribution can be approximated 
using a phase-type approximation~\cite{evol-spn}, and the resulting SRN 
model can then be solved using SPNP~\cite{spnp-new}. In the second
method, the model can be simulated using discrete-event simulation
incorporated in SPNP.

\section{Case Study: VPN Service using Virtual Router}
\label{sec:ill}
In this section we describe how the SRN model of the Reactor pattern
presented in Section~\ref{sec:srn} can be used to estimate the response 
time of a Virtual Private Network (VPN) service provided by a 
Virtual Router (VR). 

Figure~\ref{fig:vpn-arch} illustrates the architecture of a
provider-provisioned virtual private network
(PPVPN)~\cite{Nagarajan:04} using a VR. A VR is a
software/\-hardware component that is 
part of a physical router called the provider edge (PE) router. A VR
contains the mechanisms to provide highly scalable, differentiated
levels of services in VPN architectures. Multiple VRs can reside on a
PE device. VRs can be arranged in a hierarchical fashion within a
single PE as shown in Figure~\ref{fig:vpn-arch}. Moreover, an entity
acting as a service provider for an end customer might itself be a
customer of a larger service provider. VRs may also use different
backbones to improve reliability or to provide differentiated levels
of service to customers.  

\begin{figure*}[!ht]
\center{\includegraphics[width=\columnwidth]{../../proposals/NSF_CyberTrust_VU_UConn05/eps/VPN-VR-arch.eps}}
%\steal{0.2in}
\bfcaption{VPN Architecture using Virtual Routers}
\label{fig:vpn-arch}
\end{figure*}

Customer edge (CE) devices wishing to join a VPN connect to a VR on
the PE device. A VR can multiplex several distinct CEs belonging to
the same VPN session. A VR may use tunneling mechanisms to use
multiple routing protocols and link layer protocols, such as IPSec,
GRE, and IP-in-IP, to connect with the CEs. A totally different set of
protocols and tunneling mechanisms could be used for inter-VR or
VR-backbone communication. These tunneling mechanisms can also be the
basis for differentiated levels of service as well as to provide
improved reliability. A VR also comprises firewall capabilities.

We consider a scenario where a VR is used to provide VPN services
to two organizations, with each organization having a customer edge 
(CE) router connected to the VR. The employees of each organization
issue VPN set up and tear down services to the VR via CEs. Also, the
VR offers differentiated levels of service, with organization \#1
receiving prioritized service over organization \#2. 
It is important that these requests be
serviced in a reasonable amount of time. Additionally, it is 
also critical to obtain an estimate of what the response time
might be at the time the VPN service is provisioned. 

In order to implement the VPN service, a Reactor pattern with
the characteristics described in Section~\ref{sec:reactor_modeling}  
can be used to (de)multiplex the events.
The SRN model of the Reactor pattern can be 
used to obtain an estimate of the response time of the requests. 
Towards this end, we designate the requests 
originating from organization \#1 as events of type \#1 and requests
originating from organization \#2 as events of type \#2. 
We set the buffer capacities for both types of events to five, and
the service rates of both types of events to $2.0$/sec. The arrival
rate of both types of events were set to $0.4$/sec. The expected 
response times for type \#1 and type \#2 events 
obtained by solving the SRN model using SPNP~\cite{spnp-new}
are $0.83$ seconds and $1.33$ seconds, respectively. It can be observed 
that the response time for set up and tear down requests for
organization \#2 is higher than the response time for requests from 
organization \#1 due to the prioritized service provided to 
organization \#1 in each snapshot. 

In this case study, estimates of the expected response times were obtained 
for fixed settings of the parameters. At design time, however, it is
rarely the case that the exact values of the parameters are known. 
As a result, in the design phase it becomes necessary to 
analyze the sensitivity of the estimates to the values of the parameters.
Sensitivity analysis can also be used to establish bounds on the 
performance estimates and for the provisioning of resources. We 
now demonstrate how the SRN model could be used for sensitivity 
analysis with relative ease. For the sake of illustration, we 
analyze the sensitivity of the response time estimates to
the arrival rates of the events. Towards this end, we vary
the arrival rates of the events from $0.4$/sec to $2.0$/sec one 
at a time, and obtain the expected response time estimates for each value
of the arrival rate. Figures~\ref{fig:resp1} and~\ref{fig:resp2} show
the expected response times as a function of event arrival rates. 

\begin{figure}[htb]
\centering
\includegraphics[width=2.5in,angle=270]{eps/resplam1.ps}
\bfcaption{Response Time as a function of $\lambda_1$}
\label{fig:resp1}
\end{figure}

\begin{figure}[htb]
\centering
\includegraphics[width=2.5in,angle=270]{eps/resplam2.ps}
\bfcaption{Response Time as a function of $\lambda_2$}
\label{fig:resp2}
\end{figure}

\iffalse
\begin{figure*}[h]
\centerline{\hbox{
\psfig{file=../Globecom-2005/eps/resplam1.ps,height=2.5in,angle=270}
\hspace*{0.0in}
\psfig{file=../Globecom-2005/eps/resplam2.ps,height=2.5in,angle=270}
}}
\label{fig:resp}
\end{figure*}
\fi

The plot in Figure~\ref{fig:resp1} shows the expected response time as a function of
$\lambda_1$, and the plot in Figure~\ref{fig:resp2} shows the expected response time as a 
function of $\lambda_2$. Figure~\ref{fig:resp1} indicates that as $\lambda_1$
increases, the expected response times for both types of events increase. 
At approximately $\lambda_1=1.0$, the expected response times for both types
of events is close. However, as $\lambda_1$ increases beyond $1.0$/sec
the expected response time of type \#1 events is higher than the 
expected response time of type \#2 events. Thus, in effect, 
requests from organization 
\#2 are receiving better service than requests from organization \#1. 
On the other hand, Figure~\ref{fig:resp2} indicates that the expected 
response time of both types of events increases as $\lambda_2$ increases, 
for the entire range of $\lambda_2$. In this case requests from
organization \#1 continue to receive better service than requests
from organization \#2, although the absolute value of the expected 
response time increases as $\lambda_2$ increases. 

\section{Conclusions and future research}
\label{sec:concl}
In this paper we presented a performance model of the Reactor pattern
which offers the important synchronous demultiplexing and dispatching
capabilities in middleware. The model was based on the 
Stochastic Reward Net (SRN) modeling paradigm. We 
illustrated how the performance model could be 
used to obtain an estimate of the response time of a VPN service 
provided by a Virtual Router (VR). Our future research 
consists of empirically validating 
the response time estimates obtained from the performance model. Developing
and validating the performance models of other middleware building blocks
and the composition of these building blocks is also a topic of future
research. 

\section*{Acknowledgments}

This research was supported by the following grants from the National
Science Foundation (NSF): Univ. of Connecticut (CNS-0406376 and
CNS-SMA-0509271), Vanderbilt Univ. (CNS-SMA-0509296) and Univ. of Alabama
at Birmingham (CNS-SMA-0509342).

\bibliographystyle{IEEEtran}
{\small\ls{0.9}
\raggedright
\bibliography{networks,analysis,perf-id}
}

\end{document}
