Sunteți pe pagina 1din 13

A Framework for Automatic Reconfigurations of Protocol Stacks in

Ubiquitous Computing Systems

Mahdi Niamanesh, Rasool Jalili


Department of Computer Engineering
Sharif University of Technology, Tehran, Iran
niamanesh@mehr.sharif.edu, jalili@sharif.edu

Abstract

Ubiquitous computing environment includes wireless networks, autonomic networked systems and devices with
heterogeneous standards and protocols for different contexts and situations. Autonomic networked systems require
mechanisms for automatic on-the-fly reconfigurations in their protocol stacks to be able to operate in different
situations and contexts. Automatic reconfigurations allow the system to continue its normal operation without
any need for human intervention. Since every protocol in a protocol stack has at least one peer protocol in another
system, a dynamic reconfiguration of a protocol may raise the need for a reconfiguration in the peer stack. Depending
on the reconfiguration type, the reconfiguration maybe carried out in a single or in both peer systems. For an assured
dynamic (run-time) reconfiguration of a protocol, the execution of the protocol component is stopped in a safe state,
a new protocol is initialized, and stacks switch to the new protocol at the same time. This paper proposes a protocol
stack framework to support automatic and assured reconfigurations of protocol components. Our evaluation and
performance measurement show the feasibility of automatic reconfigurations and an acceptable level of transparency
in dynamic reconfigurations.

Keywords: Protocol Stack, Automatic Reconfigurations, Dynamic Reconfiguration


1 Introduction defined the safe state of a running component as a
state where the component has no data and is not in
Ubiquitous computing environment includes wire- any interaction with the other components [8, 12]. In
less networks, autonomic networked systems and de- the Software Radio and Cognitive Radio domains, re-
vices with heterogeneous standards and protocols for lated work has mainly concentrated on device protocol
different contexts and situations [25]. The Software Ra- stack reconfigurations [9] and cognitive engine devel-
dio [3, 9] and Cognitive Radio [14, 23] offer dynamic re- opment for software radio (e.g., [16]). In the Internet
configurability for protocol stacks of such systems and domain, related work such as [24, 28] have concentrated
devices in order to facilitate applications such as chang- on changing the communication protocol between two
ing routing algorithms of switches, changing security systems. These works limit safe states to states in
modules in protocol stacks, bug fixing, and customizing which the old protocol execution has been completed
the protocol stack of a device for better performance. and the new protocol should start a new execution from
In general, in a software system, dynamic reconfig- an initial state.
uration of a component to a new one includes such In this paper, the reconfiguration problem is defined
phases as freeze (stopping the current execution of the as changing the protocol between two peer protocol com-
component), change (adding/binding a new component ponents at run-time automatically. The reconfigura-
and unbinding/removing the unnecessary old compo- tion maybe performed in a single peer (single recon-
nent from the system), state transfer (finding and ini- figuration) or in both peers (distributed reconfigura-
tializing a proper state in the new component in order tion)1 . Our idea is to keep enough information about
to resume the execution), and re-execution (resuming protocols to perform automatic and assured reconfigu-
the execution from a non-initial state in the new com- rations. Based on our knowledge about two communi-
ponent) [17]. In order to have assured reconfiguration, cating protocol components, the reconfiguration type
the old component should be frozen in a “safe state” is detected, and is carried out in a safe state. We
and the new component should resume the execution do not limit safe states to the end of protocol execu-
from a “reachable” state [7]. tions. For such reconfigurations, we propose a software
In the context of protocol stack reconfigurations, framework including mechanisms for dynamic reconfig-
since each protocol is defined at least between two uration management and control for both types of re-
peer components, reconfiguration of a running proto- configuration. Through the framework, each stack can
col component may require a corresponding reconfig- request a reconfiguration from its peer while they are
uration in the peer component(s). For example, con- communicating. Our framework for automatic recon-
sider a reconfiguration that changes TCP component in figurations guarantees smooth change of the old proto-
a TCP/IP protocol stack into SCTP component [27]. col to the new one autonomously.
Both TCP and SCTP have the same role, as trans- The rest of this paper is organized as follows. Sec-
port protocol. For this reconfiguration, both peers tion 2 describes background about protocol executions,
should be synchronized in terms of the change (e.g., protocol reconfigurations, and reconfiguration assur-
from TCP to SCTP) and freeze state. However, in ance in protocol stacks. In Section 3, we explain the
reconfiguring TCP component into TCP-Nice compo- proposed framework. Mechanisms for reconfiguration
nent [29], since TCP-Nice is backward-compatible with management and control for single and distributed re-
TCP, the reconfiguration can be performed in a sender configurations are presented. In Section 4, we describe
stack transparently and independent of its peer stack. implementation and evaluation of the proposed frame-
As a result, reconfigurations can be categorized into work. In Section 5, we discuss related work and Section
single reconfigurations (involving a single stack) and 6 concludes the paper.
distributed reconfigurations (involving changes in two
or more stacks). 2 Background
Autonomic systems in ubiquitous computing envi-
ronment should have dynamic protocol stacks that can In this section, we describe a simple model for proto-
automatically detect reconfiguration types and perform col execution. Afterwards, two types of protocol stack
the assured reconfigurations. Related work for dy- reconfigurations are explained and finally, we state as-
namic protocol stacks only address single or distributed surance in reconfigurations of two communicating stacks.
reconfigurations. For example [10, 12] suppose a run-
1 In this paper, we do not consider reconfigurations of more
ning protocol stack as a stand-alone system (not in a
than two peers
network) and perform a single reconfiguration. In or-
der to provide an assured reconfiguration, they have

2
2.1 Protocol Execution single and distributed reconfigurations. Figure 2-(a)
depicts a situation in which in one of the stacks (e.g.,
We consider a simple model for describing the recon- Stack1 ), a protocol changes into another variation that
figuration problem in communicating protocol stacks. is supported by the peer protocol component (in Stack2 ).
Figure 1 shows two communicating protocol stacks, According to the figure, the old protocol component,
Stack1 and Stack2 . In each layer of the stacks, one P1 , is replaced by a new component P3 , which can
component, which we refer to as protocol component, “safely” interoperate with the old peer component, P2 ,
implements functionality of its corresponding protocol. in the peer stack. In this case, the new component, P3 ,
For instance, in the figure, components P1 and P2 pro- is “backward-compatible” with the old one. Therefore,
vide functionality of protocol P . A protocol compo- the reconfiguration can be carried out in the changing
nent is a set of rules as well as a processing entity that stack without disrupting the peer stack.
governs communication between communicating peers. Figure 2-(b) depicts a scenario in which two peer
The protocol components interact with each other by components in the two stacks are synchronously re-
exchanging protocol messages. placed with new protocol components. For two commu-
nicating TCP/IP protocol stacks, changing TCP pro-
tocol of two stacks into SCTP protocol [27] can be an
example of this type.

Figure 1. An example of two communicating


protocol stacks

State of a protocol component describes all useful


information about the protocol in a point of execu-
tion. Such information includes values of all variables
and contents of all input/output buffers, related to the
component. For simplicity, we split states of a pro-
tocol component into macro-states and micro-states
[4]. Macro-states describe states of the protocols’ finite
state machines. Examples of macro-states in the TCP
protocol are CLOSED and ESTABLISHED. Micro-states
describe states of protocols at run-time, to maintain in-
formation for operations such as reliability, error han- Figure 2. Types of dynamic reconfigurations
dling, and congestion control. We use macro-states of for protocol stacks: (a) single reconfigura-
components in specification levels and micro-states in tion, (b) distributed reconfiguration
execution levels.

2.2 Reconfigurations in Protocol Stacks For single reconfigurations, the goal is to reconfigure
a running protocol component independent of its peer,
With two communicating protocol stacks, a dynamic transparently (in point of its peer component view).
reconfiguration in a component may lead to a corre- However, the goal of distributed reconfigurations is to
sponding reconfiguration in its peer component. In our reconfigure two peer components synchronously.
perspective, protocol stack reconfigurations are cate-
gorized into two types, single reconfiguration and dis-
tributed reconfiguration. Figure 2 depicts scenarios for

3
2.3 Reconfiguration Assurance 3 DRAPS Framework
Intuitively, a dynamic reconfiguration that changes DRAPS (Dynamic-Reconfigurable Architecture for
a running component into a new one is assured if after Protocol Stack) is an extendable framework4 that presents
the changing phase, the new component can be exe- assured and synchronous dynamic reconfiguration for
cuted just as if it has been executed from its initial two communicating protocol stacks5 . Without losing
state [7]. Based on this notion, if the new component the generality, we assume that each protocol in DRAPS,
starts re-execution from a reachable state 2 , then the re- is implemented as a distinct component. A protocol
configuration will be assured. Based on [7], to achieve component is a set of rules as well as a processing en-
such a reachable state, the running component should tity that governs the communication between commu-
be frozen in a safe state, and its state should be trans- nicating peers.
ferred into the new component. Considering two com- Architectural components of DRAPS are shown in
municating components as a distributed component, Figure 3. As shown, DRAPS is built out from a core
its state is the global state 3 of the two components and framework and some plug-in components. The core
the reconfiguration of two communicating components framework is responsible to perform assured dynamic
is assured if after the reconfiguration, the execution reconfigurations and consists of two components, namely,
resumes from a reachable global state. Reconfiguration Management and Control (RMC), and
We explain requirements for assured reconfigurations Protocol Knowledge Base (PKB). RMC provides mech-
(both single and distributed reconfigurations) in the anisms for automatic reconfiguration management of
following: two peer stacks. PKB is a knowledge base component,
Safe state A safe state for a reconfiguration has been responsible for initializing protocols specifically when
defined as a state that has no interaction with they are resumed from non-initial states.
the other components [8, 12]. A component in Plug-in components in DRAPS present extendabil-
a safe state does not accept new requests, does ity for the framework by providing supplementary re-
not initiate new operations, and all its initiated quirements of dynamic reconfigurations. For instance,
operations have been completed [22]. However, a repository of reconfigurable components is not an es-
for two communicating stacks, the global state sential requirement in a reconfiguration; however, it is
should be safe. Accordingly, two communicat- a supplementary requirement in every reconfiguration
ing components should be frozen in a safe global framework. DRAPS provides a plug-in type for such a
state, and two new components should resume component repository.
the execution from a reachable global state.
State transfer Execution of the new component maybe
resumed from a non-initial state, which we refer
to as the restarting state. The old component’s
state should be transferred to the restarting state.
In a reconfiguration of two peer components, the
restarting states of both peers should be initial-
ized. An important point in the state transfer
is the possible dependency of the states of two
peers upon each other. For example, a UDP
sender component should know the port number
of the peer UDP receiver. For the state transfer,
Figure 3. Architecture of DRAPS including
firstly, it is necessary to find the restarting state
core framework and plug-ins
in the new component; secondly, the new restart-
ing state should be initialized to resume the ex-
ecution; thirdly, some parts of the new compo-
4 An implemented prototype of the framework is available at
nent’s state may require to be initialized based
http://mehr.sharif.edu/∼niamanesh/RG.htm.
on its peer component. 5 The initial versions of DRAPS have been published in [18]
2 State s in component C is said reachable state, if and only if and [20].
an execution of component C starting from an initial state can
reach s at some time for some inputs.
3 Global state for communicating components is defined in the

same manner as that for the global state in distributed systems.

4
3.1 The Protocol Knowledge Base peers, have the weak peer-compatibility, whereas TCP
and TCP-Nice possess strong peer-compatibility [21].
We introduce a knowledge base component, called The PKB component keeps all types of peer-compatible
Protocol Knowledge Base (PKB), to support assured protocols. Figure 6 shows examples of peer-compatible
and dynamic reconfigurations for protocol stacks of au- protocols with TCP.
tonomic systems. Theses systems should detect re- The commitment on the freeze state necessitates two
configuration types and perform assured reconfigura- peer components to start the reconfiguration in a safe
tions without any need for human intervention. For global state. For this purpose, the PKB component
this reason, we keep a protocol knowledge in the PKB keeps all peer-compatible macro-states for each pair of
component. Specifically, PKB contains three types peer-compatible protocols. By peer-compatible macro-
of knowledge, namely, peer-compatibility of protocols, states, we mean two “compatible” macro-states from
role-compatibility of protocols, and protocol state in- two peer-compatible protocols6 . For example, when a
formation (Figure 4) all explained in the following. TCP sender component is in the ESTABLISHED state,
its peer component, which is a TCP receiver, can not
be in the CLOSED state.

3.1.2 Role-Compatible Protocols


In a reconfiguration of an existing component into a
new component, the new one should play the same role
as the existing one. For example, we may reconfigure
TCP into SCTP or UDP, but it is not possible to re-
configure TCP into IP. In fact, the role of TCP and
IP differs completely. We define role-compatibility re-
lationship between two protocol components that can
be reconfigured to each other. A pair of protocol and
Figure 4. PKB consists of 1) Knowledge of its backward-compatible version is a well-known exam-
role-compatibility of protocols, 2) Knowledge ple of role-compatible protocols. We define three types
of peer-compatibility of protocols, and 3) of role-compatibility relationship between two protocol
Knowledge of protocols states components, which are determined based on the peer-
compatibility of new component and the peer compo-
nent. Considering a component, P1 , and its peer, P2 ,
which are strongly peer-compatible components, we de-
3.1.1 Peer-Compatible Protocols scribe types of role-compatibility as follows.
We call a component, P3 , as fully backward-compatible
Every protocol reconfiguration requires commitment of (FBC, in short) with P1 , if P3 can be strongly peer-
its endpoint components on a change and a freeze state. compatible with P2 . For two communicating peer com-
Commitment on the change means the two compo- ponents, we can perform a single reconfiguration by
nents change into compatible protocols. For example, changing a component to one of its FBC components.
when a peer component changes into the TCP pro- For a protocol component, its FBC protocols are those
tocol, the other peer can not choose UDP protocol that inherently require changes to only one endpoint
for its transport protocol. For this reason, we define component. For example, both the Fast Recovery mod-
peer-compatibility relationship between two protocol ification to the sender-side TCP [1] and TCP-Nice are
components as follows. Two components have peer- transparent to the receiver.
compatibility relationship (are peer-compatible) if they Not Backward-Compatible role-compatibility (NBC,
can inter-operate with each other as two peer compo- in short) relationship is held between P1 and P3 , if
nents. We introduce two types of peer-compatibility. P3 can not have any peer-compatibility with P2 . In
i.e., Strongly peer-compatible if they can inter-operate this case, the reconfiguration necessitates a distributed
in such a way that all their functionalities can be poten- reconfiguration. For example, SCTP can be regarded
tially used in the communication, Weak ly peer-compatible
6 In [19], we have formally defined two compatible states. We
If parts of functionalities of the components can not
have proposed protocol automata specifying the communication
be used, due to problems such as version mismatch- of two communicating components. Each state of protocol au-
ing. For example, TCP and TCP-NewReno [5] (or tomaton is composed of two compatible states from the two com-
TCP-SACK [11]) components, as two communicating ponents.

5
as a role-compatible protocol with TCP and UDP. But
changing SCTP into TCP or UDP should be synchronously
carried out in both peer components to be of value.
Partially Backward-Compatible role-compatibility (PBC,
in short) relationship is hold between P1 and P3 , if
P3 can have weak peer-compatibility with P2 . In this
case, any reconfiguration from P1 into P3 can be car-
ried out either single or distributed. For a protocol,
PBC protocols are those that have the potential to be
either more effective if both peer components could be
reconfigured and the new functionality could be opera-
Figure 5. Examples of Role-Compatible
tional between the sender and receiver. If we reconfig-
Protocols with TCP
ure only one peer, we will have partial or no new value
in the communication. For example, for two commu-
nicating TCP components, changing one of them into
TCP-NewReno, which uses a heuristic interpretation
of duplicate acknowledgments to avoid timeouts, does
prove useful. However, by changing the peer compo-
nent into TCP-NewReno, the communication will have
more useful. Through changing one of the components
into TCP-SACK, which provides better recovery from
losses, the communication will serve no benefit unless
the peer component is TCP-SACK enabled or we re-
configure the peer component into TCP-SACK as well.
In these cases, we can perform either a single or dis- Figure 6. Examples of Peer-Compatible
tributed reconfiguration. Figure 5 shows examples of Protocols with TCP
role-compatible protocols with TCP.
For each pair of role-compatible protocols, PKB con-
tains their role-compatibility type. Moreover, it con- PCB handlers are used to set values of PCB pa-
tains role-compatible macro-states of the two proto- rameters during a state transfer. They are also used
cols. A pair of role-compatible macro-states of two in distributed reconfigurations to set values of the re-
role-compatible protocols consists of two corresponding mote PCBs in peer systems. In this case, we call them
states that can play the same role in the two protocols7 . remote PCB handlers. As an example of the appli-
This helps reconfigurations as follows; when a protocol cation of remote PCB handlers, consider a reconfigu-
stops in a state (freeze state), a corresponding state ration in UDP protocol. In UDP protocol, the UDP
(restarting state) is found through its role-compatible sender should know the port number of the UDP re-
macro-states to resume the execution. ceiver; therefore, the receiver should send its port num-
ber to the sender. PKB contains PCB parameters and
3.1.3 Protocol State Information formats for different protocols.
In the state transfer, the old PCB is used to valuate
All required knowledge for finding safe states and ini-
the same parameters in the new PCB. Then, the PCB
tializing restarting states is kept in PKB.
handlers are used to complete the state transfer and
We present a model for state representation of pro-
finally the remote PCB handlers from the peer (only
tocol components by introducing protocol control block
in distributed reconfigurations) are applied.
(PCB) that contains state information. This informa-
tion includes addressing parameters, buffers (sent, re-
ceived, un-acknowledged, etc.), protocol segment vari- 3.1.4 Example: TCP-SACK State Initializa-
ables, counters, timers, send variables, receive vari- tion
ables, and the other required parameters. Protocol de- Here we give an example for building a PCB. Consider
velopers should implement one PCB data structure for TCP-SACK [11], a selective acknowledgment extension
each protocol component. for TCP, which uses two TCP options, namely, SACK-
7 Based on [19], we define two role-compatible states in two PERMIT and SACK. These options are added to the
substitutable components as two bisimilar states. header part of TCP. The first is an enabling option,

6
which may be sent in a SYN segment to indicate that
the SACK option can be used once a connection is es-
tablished. The second may be sent over an established
connection, once permission has been given by SACK-
permitted. The SACK option is sent by a data receiver
to inform the data sender that non-contiguous blocks of
data have been received and queued. The data receiver
awaits the receipt of data to fill the gaps in sequence
space between received blocks. When missing parts
are received, the data receiver acknowledges the data
by advancing the left window edge in the Acknowledge-
Figure 7. Reconfiguration supports for a pro-
ment Number Field of the TCP header.
tocol component
PCB for TCP-SACK can be built by adding two pa-
rameters, SACK-PERMIT and SACK, to TCP PCB.
For state initialization in TCP-SACK, the TCP PCB
is copied into the TCP-SACK PCB and the SACK- packet into the output buffer or before reading a packet
PERMIT parameter in the PCB is set through a PCB from the input buffer are SRPs. In such states, either
handler. Since the SACK parameter is calculated based no operation is started on the packet or all the opera-
on the received data, it is not necessary to be initial- tions are completed. Usually, macro states of protocols
ized. are like this and we use them as SRPs. This definition
is consistent with [8, 12, 30], where all operations of
3.2 Reconfiguration supports for Protocol the component in SRP should be completed.
Components Generally, finding a SRP in an execution of a com-
ponent is a reachability problem, which is undecidable
Reconfigurable protocol components should provide [7]. To cope with this problem, we ask protocol de-
some extra functionalities to support dynamic recon- velopers to “mark” some SRPs (macro states) in the
figurations. For each protocol component, protocol source code of protocols. Therefore, protocol develop-
developers should implement reconfiguration interface ers are asked to put some pieces of code in the source
including saveState() and restoreState() methods code of protocol components to enable them to report
for state transfer, start() and stop() methods to macro-states during the execution if requested. In a
start and stop execution of the component. Finally, normal execution mode, a component does not report
the semiFreeze() method should be implemented for SRPs. However, we introduce a semi-freeze mode in
each component in order to support freezing the com- which the component reports every SRP (like in debug
ponent in a proper state. mode) upon reaching its execution. The RMC com-
Moreover, dynamic reconfigurations of protocol com- ponent monitors the reported states of the component
ponents require indirect communication between two in the semi-freeze mode and stops its execution upon
adjacent protocol components (layers) in order to present reaching the proper SRP for a dynamic reconfiguration.
transparent run-time reconfigurations [6]. For this rea- For distributed reconfigurations, the global state of
son, a wrapper component is used between two adja- two peer components should be safe. A global state
cent protocol components. For a protocol component, (s, r) for two communicating components is a safe global
the wrapper presents interface of the protocol compo- state if s and r are locally SRP and their role-compatible
nent and manages the incoming requests to the com- states, denoted as s0 and r0 respectively, are peer-compatible
ponent, by buffering them during the freeze periods. with each other. Figure 8 depicts the scenario of finding
a safe global state for a distributed reconfiguration. For
3.2.1 Finding a Safe State each SRP state, say s, RMC checks whether its role-
compatible state in the new component, e.g., s0 , has a
Due to the independence of protocol stack components peer-compatible state in the new peer component. If
(layers), finding a safe state for a dynamic reconfigu- so, the pair of reported state and its peer-compatible
ration can be carried out in a simple way. We define a state in the peer component is the safe global state for
safe reconfiguration point (SRP) as a point of execution the reconfiguration.
of a protocol component where the component is at the
beginning or at the end of the processing of an input
packet. In other words, the states just after writing a

7
• There is only one reconfiguration at a time. No
concurrent reconfigurations are started.

The reconfiguration preparation is started upon re-


ceiving a reconfiguration command by a RMC. The
goal is to check preconditions for assured reconfigura-
tions. Therefore, RMC checks SRPs for the currently
running component. The component should have at
least one SRP and its role-compatible states, with re-
spect to the reconfiguration, in the PKB component.
Moreover, RMC checks the existence of new compo-
nent’s PCB and PCB handlers.

Figure 8. The sequence of finding a safe 3.3.2 Reconfiguration Synchronization


global state
The goal of reconfiguration synchronization is to deter-
mine a compatible reconfiguration for two peer stacks.
Thus, the initiator RMC detects the received recon-
3.3 Automatic Reconfiguration Management figuration type, as depicted in Figure 9. If the role-
and Control compatibility between the old and new components is
FBC then the reconfiguration type is single, and is car-
We offer automatic reconfiguration management and ried out in the initiator stack. If the role-compatibility
control (RMC) through a software component (RMC is PBC and the peer-compatibility of the new compo-
component) for protocol stacks. The RMC component nent and the peer component is strong then, the re-
can receive reconfiguration commands from different configuration will be single in the initiator stack. Oth-
sources including system administrators, monitoring erwise, the reconfiguration can be either single or dis-
components in the system, or peer system RMCs. A re- tributed.
configuration command asks replacing an old protocol Three types of messages (START, RECON, and Eo-
component with a new one. REC) are exchanged by two RMCs to determine and
We provide automatic reconfigurations in three phases; perform a compatible reconfiguration. The START
in the reconfiguration preparation phase, conditions for message is a command for reconfiguration start and
an assured reconfiguration are checked. In reconfigura- indicates the current (old) component and a set of all
tion synchronization, two peer stacks synchronize on a possible options for the peer stack. Each option in-
dynamic reconfiguration. In reconfiguration execution dicates an alternative component and a proper freeze
the new component is installed and executed. In the state for the peer. Alternative components are deter-
following subsections, we explain automatic reconfigu- mined through the peer-compatibility relation with the
ration phases. new component in the initiator stack. The freeze state
is determined based on safe global state. In addition,
3.3.1 Reconfiguration Preparation the START message includes a list of PCB values for
remote PCB initialization. During the synchroniza-
Considering two communicating protocol stacks, we tion, the initiator RMC sends a START message to
would like to reconfigure one of the stacks by sending a the peer RMC. The peer RMC, based on the received
reconfiguration command indicating the currently run- options, prepares a corresponding START message (in-
ning protocol component (old component) and a new cluding its running protocol name and options for the
component. We describe how RMC and PKB com- peer) and sends back to the initiator RMC. Now, the
ponents can manage an automatic reconfiguration for initiator RMC can decide on the reconfiguration type.
these protocol stacks. Each protocol stack contains its For distributed reconfigurations, the initiator RMC
own RMC and PKB components. Moreover, we have selects two peer-compatible protocols for the initia-
the following assumptions to simplify the problem: tor and the peer stacks. The peer’s reconfiguration
is determined in a RECON (RECONfigure) message.
• The communication channel between the two com-
Each RMC sends the EoREC (End of REConfigura-
ponents is FIFO (First-In, First-Out), error-free,
tion) message to its peer RMC after finishing a recon-
and having bounded communication delay.
figuration. It only indicates that the reconfiguration

8
has been successfully finished and that the new pro-
tocol is operational. Therefore, the EoREC message
does not play any critical role in the reconfiguration of
the two peers. The sequence of exchanging messages
between two stack during a synchronization is depicted
in Figure 10. Note that RECON and EoREC messages
are not used in single reconfigurations.
An important point in dynamic reconfigurations of
two communicating protocol stacks is that, every re-
configuration causes communication inside the stacks
to become limited or even blocked. For a synchronous
reconfiguration of two peer stacks, this can lead to
the problem in communication of their RMCs during
Figure 10. The reconfiguration synchroniza-
the synchronization. However, as explained, the RMC
tion
components in the two stacks are synchronized in such
a way that peer RMCs do not require any communica-
tion in the blocked period.
For single reconfigurations, the initiator RMC starts conditions for an assured reconfiguration, the RMC
the reconfiguration execution, as described in the next component installs the new component (Figure 11-(b))
subsection. and then, invokes the semiFreeze() method of the
currently running component to start its semi-freeze
mode (Figure 11-(c)). In this mode, RMC monitors
the component execution and freezes it by invoking its
stop() method in a SRP determined in the RECON
message. Afterwards, the RMC uses saveState() and
restoreState() methods to transfer the state values
in the old component’s PCB into the new component’s
PCB (Figure 11-(d)). Later, the new component is re-
executed through its start() method (Figure 11-(e)).
Now the new component is available for its user com-
ponents and the application can send data through the
new protocol.
It is worth noting that when two peers enter into
the freeze mode, there maybe some packets inside the
communication channel (packets that have been sent
by a component but not delivered to the peer compo-
nent yet). In this case, although the macro-states of
two peers are compatible, their micro-states (run-time
states) are not consistent. If the old protocol is reli-
able, after changing into another reliable protocol, the
new one can resend these packets. If the old or new
protocol is unreliable, these packets maybe lost in the
communication.

Figure 9. Reconfiguration type detection 4 Implementation and Evaluation

In this section, we evaluate the proposed framework


3.3.3 Reconfiguration Execution for automatic dynamic reconfigurations. Overhead of
using wrappers in protocol stack performance has been
The reconfiguration execution includes installation, freeze, evaluated in related work such as [6, 24].
and re-execution steps. Figure 11 depicts the steps for Java is chosen as the programming language due
a component replacement in the reconfiguration exe- to its platform independence. To load and reconfig-
cution phase. In the case of satisfaction of all pre- ure protocol components at run-time, we use dynamic

9
In our experiments, reconfiguration commands are
sent to the RMC in Stack1 to initiate the reconfigu-
rations. Each stack contains 5 role-compatible compo-
nents with the running TCP, namely, TCP-CA (TCP
with Congestion Avoidance), SecureTCP (TCP with
encryption capability), UDP, TCP-Nice, TCP-SACK.
They have been implemented such that all their macro-
states are SRPs. We have tested scenarios for FBC,
PBC, and NBC role-compatibilities to demonstrate all
cases of reconfiguration type detection.
Figure 13 shows duration of reconfiguration phases.
Numbers in the chart are averaged over a large num-
ber of iterations. The preparation phase takes 71 mil-
liseconds; the synchronization phase, which includes
the times for sending and receiving START and RE-
CON messages, takes 112 milliseconds; it depends on
the round trip time. The execution phase takes 56 mil-
liseconds. The maximum total time for an automatic
reconfiguration takes 239 milliseconds in average.

Figure 11. Component replacement in the re-


configuration execution

class loading. The configuration of the experimental


environment includes two Centrino 1.5 and 1.7 GHz
IBM personal computers with 256 and 512 MB mem-
ory. Linux (Debian 3.1 distribution) is used as the
operating system.
Figure 13. Time spent in preparation, syn-
chronization, and execution phases

Figure 12. The experimentation environment

Two communicating peer protocol stacks are con-


sidered, Stack1 and Stack2 (Figure 12). Both stacks
are based on the DRAPS framework. Applications on Figure 14. Time spent in execution
the top of stacks exchange data with each other. Both
applications use a light-weight version of TCP proto- Figure 14 shows the performance of execution phase
col, which we have implemented for the transport layer. of TCP (with empty buffer) reconfigurations accord-
The IP layer is simulated using two Linux FIFOs, one ing to the steps explained in the reconfiguration execu-
for outgoing data and the other for incoming data. tion. The measured times for component installation,
Wrappers for TCP and IP layers have also been im- PKB operations, semi-freeze, and freeze are shown in
plemented. the chart. PKB operations include the time for find-

10
ing SRPs and the peer-compatible macro-state. In the protocol users (generally the upper layer protocol
addition, it includes the time to verify assurance of users). As the timeout value for most of the commu-
the reconfiguration through examining the possibility nication protocols is much more than a second, we can
of complete initialization of new PCB. In our exper- expect that the presented framework can transparently
iments, it takes around 3 milliseconds. According to reconfigure other protocols as well. In our experiments
the definition of SRP, the semi-freeze time depends on for the TCP protocol, the freeze period takes 5 mil-
the processing time for input/output data in the TCP liseconds for the default size of “send buffer”, which is
component. For the implemented TCP, in which all much less than the TCP socket timeout in the applica-
macro-states are SRPs, the semi-freeze time is 3 mil- tion layer.
liseconds.
The freeze time includes the time for state trans- 5 Related Work
fer, which takes up 17 milliseconds (5 milliseconds for
copying the old PCB into the new one, and 12 millisec-
In the context of reconfigurable protocol stacks, re-
onds for invoking PCB-handlers). It is important to
lated work mainly focuses on implementing frameworks
note that, the freeze time is the only period in which
supporting reconfigurable protocol stacks. Reconfigu-
both old and new protocol components are unavail-
rations in protocol stacks can be either at deployment-
able. The total reconfiguration execution time, which
time, at run-time with idle protocols, or at run-time
includes installation, PKB operations, semi-freeze, and
with running protocols.
freeze times, is 56 milliseconds in DRAPS.
Ioana Sora et al. propose the “protocol building
Table 1 shows a comparison of DRAPS and two re-
block” description and protocol selection algorithms
lated frameworks, which are implemented and evalu-
in [26]. They provide automatic stack composition
ated in a similar environment with DRAPS. To be com-
through an algorithm to select building blocks in case
parable, we do not include preparation time, in which
all specified features are provided and all dependencies
we check preconditions for an assured reconfiguration
of selected components are satisfied. This paper offers
in calculating the time for a single or distributed re-
protocol stack compositions at deployment-time.
configuration. In DRAPS, the single reconfiguration
In [15], a framework called OPtIMA is introduced
time is lower than the others because of using PCB
for protocol stacks of software-radio based systems.
and PCB handlers in state transfer. In [10], for state
The goal is to reconfigure protocol stacks built within
transfer, authors use Java serialization technique [13],
the framework. OPtIMA presents the definition and
which takes around 190 milliseconds. In DRAPS, dis-
provision of a library of classes, which can be used
tributed reconfigurations takes up 112 milliseconds for
to build reconfigurable protocol stacks. However, the
stacks synchronization and reconfiguration type detec-
framework does not support dynamic reconfiguration
tion. Whereas, DPF [2] does not support reconfigura-
of protocols. It only presents customizibility of proto-
tion type detection.
col stacks at deployment-time.
The DiPS/CuPS framework [12] is intended for the
development of customizable system software. This re-
Table 1. Comparison of reconfiguration times
search mainly concentrates on a component model for
in the related frameworks (”-” = Not Sup-
protocol components. Reflection points in DiPS/CuPS,
ported)
which perform packet switching within a protocol stack,
can only support run-time reconfigurations. Safe states
Framework/Time(ms) single distributed
for reconfigurations are defined based on protocol trans-
DPF [2] 77 200 actions; when the protocol execution is completed and
Yueh-Feng Lee et. al. [10] 214 - buffers are empty, the state is safe for a reconfiguration.
DRAPS 56 168 Specifically, DiPS/CuPS presents dynamic reconfigu-
rations for protocol stacks with idle protocols. It does
For the TCP protocol, since the timeout of TCP not provide flexible enough mechanisms for reconfig-
sockets is usually more than ten seconds on different urations of running protocols (reconfiguration during
machines, the reconfiguration is performed transpar- protocol transactions).
ently from the application point of view. In general, Dynamic Protocol Framework (DPF) [2] mainly con-
it is important to demonstrate that, our framework centrates on building an adaptive protocol stack by
can transparently reconfigure other protocols (besides automatic discovery and selection of protocol compo-
TCP) as well. Therefore, the duration of the freeze nents. It supports on-the-fly reconfigurations of proto-
period in a protocol should be less than the timeout of col stacks and provides a synchronization mechanism to

11
ensure the compatibility of protocol stacks on commu- component, the whole stack containing the component
nication peers. In DPF, safe states for reconfigurations has to be replaced. They propose a stack switching
are restricted to be at the end of protocol transactions. module installed on each machine to dynamically re-
Moreover, supporting mechanisms for state transfer are place stacks. The main role of the module is to syn-
not clearly defined and addressed. While the automa- chronize the start of the new stack. Protocols are de-
tion in DPF helps to select proper protocol compo- veloped within the Ensemble framework. They are de-
nents for a stack reconfiguration, DRAPS detects the composed into micro-protocols, each specialized to do
reconfiguration types automatically. Based on the pro- a specific task. Since Maestro performs reconfigura-
vided services of protocol components, DPF selects and tions for the whole stack, the applications on top of
composes a proper protocol stack. In contrast, DRAPS the stack are blocked. In Maestro, a dynamic recon-
uses PKB to select proper protocol components. More- figuration is started when the transaction of the old
over, through the synchronization, DRAPS detects the protocol has been completed and no data is exchanged
reconfiguration type and proposes proper components between peers.
for the peer stack as well. Whereas DPF does not sup- In DRAPS, dynamic reconfigurations can take place
port protocol selection for the peer stack. during the protocol transactions. Therefore, for long
In [10], authors propose a Java-based framework running servers DRAPS does not wait until the end of
that allows programmers to create, remove, and re- protocols executions. Distributed reconfigurations in
place protocol modules at run-time. Programmers im- DRAPS require freezing of both peer components in
plement their components using the component frame- a safe global state; however, in related frameworks re-
work. The framework can dynamically reconfigure com- configurations take place at the end of protocols trans-
ponents in safe states. To find a safe state, the frame- actions and there is no need for safe global state. The
work uses lock management techniques to access a pro- shortening of the freeze time in DRAPS is achieved
tocol module. When a reconfiguration command is re- through the PCB model, which incurs one-time de-
ceived, the framework attempts to access the “write” velopment overhead for each protocol and presents a
lock to start the reconfiguration. Lock management necessarily short time for the freeze period.
adds complexity in programming protocol modules and
also in the application layer. In contrast, we have im- 6 Conclusion
plemented lock management in wrappers and so there
is no extra overhead for the protocol programmer. For
Ubiquitous computing environment includes auto-
the state transfer, authors use the Java synchroniza-
nomic networked systems requiring automatic dynamic
tion technique as a direct state transfer mechanism.
reconfigurations in their protocol stacks. This paper
However, we have used the PCB model for the indirect
proposes a framework for automatic reconfigurations
state transfer that causes a short freeze time.
of protocol stacks. Although dynamic reconfiguration
In the context of distributed reconfiguration of com-
is not new, the proposed framework is novel in that it
municating peers, there are quite a number of imple-
supports automatic reconfigurations of protocol stacks.
mentations that support distributed reconfigurations.
We introduce two types of relationship between proto-
In [24], authors propose an algorithm and a model for
cols, role-compatibility and peer-compatibility. Based
distributed reconfigurations of peers. A replacement
on these relationships, the type of reconfiguration is
module is responsible for reconfiguration control and
detected and an assured reconfiguration is performed
management. It provides indirect access to the chang-
without the need for human intervention. Test sce-
ing module, like the wrappers in DRAPS. In this pa-
narios for automatic single and distributed reconfig-
per, authors identify two properties of dynamically up-
urations of TCP protocol in TCP/IP protocol stack
dateable systems, i.e. stack well-formedness and proto-
are realized through the framework. The experimental
col operationability. Preserving these properties dur-
results show that an acceptable transparency can be
ing a dynamic update guarantees the transparent up-
maintained using the proposed framework.
dates. An algorithm, which can switch between dif-
ferent distributed agreement protocols (e.g., consensus
and atomic broadcast), is proposed in that paper. As References
safe states are at the end of protocol transactions, they
provide no mechanisms for finding global states or state [1] M. Allman, V. Paxson, and W. Stevens. Tcp conges-
transfer. tion control. RFC 2581, 99(7):1–100, April 1999.
Maestro [28] supports only the replacement of whole [2] L. An, H. K. Pung, and L. Zhou. Design and imple-
protocol stacks; that is, in order to replace a protocol mentation of a dynamic protocol framework. Journal

12
of Computer Communications, 29(9):1309–1315, May neering (Theory and Practice) FSEN 2005, ENTCS,
2006. 159(7):227–239, May 2006.
[3] V. G. Bose, A. B. Shah, and M. Ismert. Software [18] M. Niamanesh and R. Jalili. A dynamic-reconfigurable
radios for wireless networking. In Proc. of INFOCOM architecture for protocol stacks of networked systems.
1998, 3:1030–1036, 1998. 31st Annual IEEE International Computer Software
[4] D. Comer and D. Stevens. Internetworking with tcp/ip and Applications Conference (COMPSAC07), 1:609–
v2. Prentice-Hall, NJ, 1991. 612, July 2007.
[5] S. Floyd. The newreno modification to tcps fast re- [19] M. Niamanesh and R. Jalili. Formalizing compatibility
covery algorithm. RFC 2582, April 1999. and substitutability in communication protocols using
[6] N. Georganopoulos, T. Farnham, R. Burgess, T. S. J. i/o-constraint automata. In Arbab, F., Sirjani, M.
Sessler, P. Warr, Z. Golubicic, F. Platbrood, B. Sou- (eds.) FSEN07, LNCS, pages 49–64, April 2007.
ville, and S. Buljore. Terminal-centric view of soft- [20] M. Niamanesh, S. Sabetghadam, R. Y. Rahaghi, and
ware reconfigurable system architecture and enabling R. Jalili. Design and implementation of a dynamic-
components and technologies. IEEE Communications reconfigurable architecture for protocol stack. In
Magazine, 42(4):100–110, May 2004. IPM International Workshop on Foundations of Soft-
[7] D. Gupta. On-line software version change. PhD the- ware Engineering (Theory and Practice) FSEN07, In
sis, Department of Computer Science and Engineer- Arbab, F., Sirjani, M. (eds.) FSEN07, LNCS, pages
ing, Indian Institute of Technology, 1994. 396–403, 2007.
[8] C. Hofmeister and J. M. Purtilo. Dynamic reconfigura- [21] P. Patel, A. Whitaker, D. Wetherall, J. Lepreau, and
tion in distributed systems: Adapting software mod- T. Stack. Upgrading transport protocols using un-
ules for replacement. In Intl. Conf. on Distributed trusted mobile code. In Proc. of the 19th ACM Sympo-
Computing Systems, (7):101–110, January 1993. sium on Operating Systems Principles, pages 684–693,
[9] M. Laddomada. Reconfiguration issues of future mo- 2003.
bile software radio platforms. WIRELESS COMMU- [22] J. Paula, A. Almeida, M. Wegdam, M. van Sinderen,
NICATIONS AND MOBILE COMPUTING, 2:815– and L. Nieuwenhuis. Transparent dynamic reconfig-
826, 2002. uration for corba. In Proceedings of the 3rd Interna-
[10] Y. Lee and R. Chang. Developing dynamic- tional Symposium on Distributed Objects and Applica-
reconfigurable communication protocol stacks using tions, 2001.
java. Software Practice Experience, 6(35):601–620, [23] P. Pawelczak. Protocol requirements for cognitive ra-
January 2005. dio networks freeband-aaf-d4.11. Enschede: Freeband,
[11] M. Mathis, J. Mahdavi, S. Floyd, and A. Romanow. 2005.
Tcp selective acknowledgment options. RFC 2018, [24] O. Rutti, P. T. Wojciechowski, and A. Schiper.
Sun Microsystems, October 1996. Structural and algorithmic issues of dynamic proto-
[12] S. Michiels, F. Matthijs, D. Walravens, and P. Ver- col update. In the Proc. of the 20th IEEE Interna-
baeten. Dips: A unifying approach for developing sys- tional Parallel and Distributed Processing Symposium
tem software. In A. D. Williams, editor, Proceedings - (IPDPS06), April 2006.
The Eight Workshop on Hot Topics in Operating Sys- [25] M. Satyanarayanan. Pervasive computing: Vision and
tems, IEEE Computer Society, 2001. challenges. IEEE PCM, pages 10–17, January 2001.
[13] S. Microsystems. Java object serialization specifica- [26] I. Sora, S. Michiels, and F. Matthijs. Policies for
tion. 2001. dynamic stack composition. Technical Report, Dept.
[14] J. Mitola. Cognitive radio- an integrated agent archi- Computer Science, Leuven, Belgium, November 2000.
tecture for software defined radio. PhD Dissertation, [27] R. Stewart, Q. Xie, K. Morneault, C. Sharp,
Royal Institute of Technology (KTH), Stockholm, Swe- H. Schwarzbauer, T. Taylor, I. Rytina, M. Kalla,
den, June 2000. L. Zhang, and V. Paxson. Stream control transmis-
[15] K. Moessner, S. Vahid, and R. Tafazolli. Termi- sion protocol. RFC 2960, October 2000.
nal reconfiguration: The optima framework. Second [28] R. van Renesse, K. Birman, M. Hayden, A. Vaysburd,
International Conference on 3G Mobile Communica- and D. Karr. Building adaptive systems using ensem-
tion Technologies, IEE-3G2001, pages 241–246, March ble. Software Practice and Experience, 28(9):963–979,
2001. February 1998.
[16] T. R. Newman, B. A. Barker, A. M. Wyglinski, [29] A. Venkataramani, R. Kokku, and M. Dahlin. Tcp
A. Agah, J. B. Evans, and G. J. Minden. Cogni- nice: A mechanism for background transfers. In Proc.
tive engine implementation for wireless multicarrier of the Fifth Symposium on Operating Systems Design
transceivers. Wiley Journal on Wireless Communica- and Implementation, December 2002.
tions and Mobile Computing, 7(9):1129–1142, Novem- [30] M. A. Wermelinger. Specification of software architec-
ber 2007. ture reconfiguration. PhD thesis, Universidade Nova
[17] M. Niamanesh, F. H. Dehkordi, N. F. Nobakht, and de Lisboa, September 1999.
R. Jalili. On validity assurance of dynamic reconfig-
uration in component-based program. In IPM Inter-
national Workshop on Foundations of Software Engi-

13

S-ar putea să vă placă și