Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

2009 Eighth International Conference on Networks

Specifications of Secure and Safe Embedded System Networks


Miroslav Sveda and Radimir Vrba
Brno University of Technology, Faculty of Information Technology
Bozetechova 2, CZ-612 66 Brno, Czech Republic
Phone: +420 54114 1288; Fax: +420 54114 1270; E-Mail: sveda@fit.vutbr.cz

Abstract that allows reliance to be justifiably placed on the


service it delivers. Dependability measures consist of
The paper focuses on behavioral specifications of reliability, availability, security, safety and
reactive and real-time activities of embedded system survivability, from which this project focuses on
networks utilizing either structured or object-oriented safety, which is the ability to deliver service under
approach depending on application design given conditions with no catastrophic affects, and
requirements. The design stemming from such security, which is the ability to deliver service under
requirements can eliminate not only behavioral and given conditions for a given time without unauthorized
structural faults but also security and safety flaws disclosure or alteration of sensitive information. Safety
caused by design errors. Reflecting current trends in attributes add requirements to detect and avoid
system and software engineering, this contribution catastrophic failures. Security attributes add
presents executable specifications and rapid requirements to detect and avoid intentional faults.
prototyping using Asynchronous Specification This paper discusses an approach to executable
Language for structured design, and object specifications and rapid prototyping for structured
specifications and verifications using Class design, and to structural and behavioral specifications
Specification Language for object-oriented design of and verifications for object-oriented design. The work
embedded system network applications presented in this paper focuses on a class of networked
systems embedded in industrial applications.
1. Introduction
2. Formal specification tools
Requirements on current embedded system network
applications include both functional and non-functional This section discusses tools that enable to utilize
constraints on real-time, safety and security properties. behavioral and structural specifications of networked
They should be formally specified and verified or, at embedded systems in frame of industrial applications.
least properly explored before they are designed in The developed dedicated methods and tools, which can
detail and implemented [1]. Moreover, the complement well-known and broadly available means,
specification approach should either conform or cover front-end phases of the related design cycles.
suitably complement anticipated design methods, Formal specification concepts employed respect both
namely structured or object-oriented techniques [2]. structured and object-oriented design approach
This paper discusses an approach to rapid prototyping depending on the target implementation support or on
for structured specifications, and to object the role of a tool in the development process.
specifications and verifications. For structured behavioral specifications of reactive
The design of well thought-out applications should systems, process algebra CSP, temporal logic LTL and
consider namely functionality and dependability related transition systems in frame of the model
measures, see e.g. [3]. Functionality means services checker SPIN [4] and the prover PVS [5] have been
delivery in the form and time fitting requirement employed. Additionally for real-time systems, model
specifications, where the service specification is an checker UPPAAL [6] and related timed automata have
agreed description of the expected service. been used. In addition to the above mentioned well-
Functionality properties should be realized efficiently known means, the following tools have been developed
and cost-effectively, so reachable performance and in frame of the presented research: (i) Asynchronous
simplicity of implementation belongs to the checked Specification Language, ASL, with rapid prototyping
properties. Dependability is that property of a system technique for structured design [7], [8]; and (ii) Class
Specification Language, CSL, for object-oriented

978-0-7695-3552-4/09 $25.00 © 2009 IEEE 220


DOI 10.1109/ICN.2009.14

Authorized licensed use limited to: Satya Koneru. Downloaded on July 26,2010 at 08:47:00 UTC from IEEE Xplore. Restrictions apply.
design [9], [10]. The next subsections introduce main abstraction introduced above: in this case, an event is
concepts of those tools. every tick of the local clock, so the related operation is
AWAIT(local_ticks, timeout_value). For the primitive
2.1. Structured specifications wait(event, _), which suspends a process until the
specified event (external signal or message) appears,
The Asynchronous Specification Language (ASL) the model operation is AWAIT(event_type, 1). The
employs distributed sequential processes with message semantics of the combined statement wait(event, timeout,
passing. The real-time operational semantics of the test) requires two event-counts: the first anticipates the
language stems from the event-count model of local specified event and the second, with a lower priority,
time, which represents a concept of physical timing monitors the local clock. The reason of process
stemming from some periodic physical oscillation activation can be checked through the value of the
whose frequency fits measurements of the duration of logical variable test: when the value is true, the event
local process actions. Timing semantics can be derived occurred within the interval timeout.
from logical time, which is a partial ordering of events The primitive send(message, destination) implements
in the system, and from a physical generator of asynchronous communication with non-blocking
periodic events, which implements a real-time clock. semantics. To respect different local clocks, a special
An event-count, E, counts the number of a specific clocking that is common for the source and the
type of events that have occurred during execution. destination controls the information transfer. However,
Each event occurrence invokes the implicit operation the nodes communicate asynchronously by message
ADVANCE(E): E := E + 1. The explicitly callable passing through an input buffer at the destination. The
operation AWAIT(E, s) suspends the calling process input of a message induces the event for the related
until the value of E is at least s. The call AWAIT(E, s) operation AWAIT(message,1). If any synchronization
can reset the current value of E, enabling relative is required, it must be described explicitly using wait
counting. An event-count monitors either a prescribed statements.
type of asynchronous external events or periodic The control structure primitives loop ... endloop
internal events that an internal timer circuit implements delimit an indefinite cycle, which is exited upon a true
as local-time clock ticks. The following primitives result of testing the condition following the primitive
relate to process specification, timing, communication, when. Consequently, the statements, which occur
and control. between the action and exit primitives and which follow
the endloop primitive, are executed. This structured
process_name(is: list_of_s_inputs; os: list_of_s_outputs; statement enables to extend the language with
ic: list_of_m_inputs; oc:list_of_m_outputs):
... endprocess;
additional control structures by simple macro-like text
replacements such as
wait(_, timeout); wait(event, _); wait(event, timeout, test);
send(message, destination); if <cond> then <s1> else <s2> fi;
loop ... [... when <cond> action ... exit;]* ... endloop; ~ loop when <cond> action <s1> exit;
<s2> when true exit; endloop;
Each of asynchronous processes can be equipped by
its individually timed local clock, can receive messages timeloop(timeinterval) ... endloop;
~ loop ... wait(_, interval); endloop;
through input buffer, and can send messages to other,
directly or indirectly addressable processes. Process Actually, the control structure timeloop(timeinterval) ...
header contains in parentheses lists labeled by is, os, ic, endloop specifies an isochronous loop, which is
and oc that act as the interface with the process' periodically initiated whenever the timeinterval expires
environment. The language distinguishes between and which can be exited like the indefinite cycle. The
signal inputs or outputs, which denote communication operation AWAIT(local_ticks, timeinterval_value)
events signaling their occurrence, and message inputs defines the exact semantics of timing these initiations.
or outputs as typed asynchronous channels between The associated rapid prototyping, which makes ASL
processes. Those signals and messages provide inter- specifications executable, arises from attribute
process synchronization and communication, whose grammar and Prolog deployment. Any Prolog
operations are driven by the statements wait(_, timeout), interpreter can drive expansion of an ASL specification
wait(event, _), wait(event, timeout, test), and send(message, into the related executable code. This expansion is
destination). based on an attribute grammar specifying both syntax
The primitive wait(_, timeout) suspends a process for and static semantics by a definite clause grammar and
the interval defined by the value timeout. Operational Prolog rules. It provides a simple language translator
semantics can be obtained through the event-count prototype, which tackles the ASL as the input

221

Authorized licensed use limited to: Satya Koneru. Downloaded on July 26,2010 at 08:47:00 UTC from IEEE Xplore. Restrictions apply.
language, and a target executable language as the functions, they can be easily inferred as simple objects.
output language. A function abstraction λ(x : A).a of type A → B denotes
The resulted prototyping technique uses the structure [x = ζ(s : T)s.x, val = ζ(s : T) a {x ← s}]
interconnected node prototype boards with provided that T ≡ [x : A, val : B]. Then a function
microprocessors equipped with a simple real-time application MN is directly given as (M:x ← N).val.
operating system kernel. While the timing and Instances of bool type represent conditional expressions
communication primitives are mapped onto relevant and serve as constants of propositional types. The
real-time executive services and communication propositional connectives are introduced as a set of
services of the operating system kernel, the rest of ASL constants with usual meanings. Moreover, quantifiers
specification is prototyped by the executable code and predicates are introduced inside the object
generated with the help of the Prolog translator language. To model classes, predicates allow writing
prototype presented in more detail by [7]. constraints on types that delimit sets of objects
satisfying intended conditions. Subtype creation uses
2.2. Object specifications operator + for denoting that a new type is obtained by
adding new attributes to the old type.
The Class Specification Language, CSL, enables to The logic calculus of objects provides a suitable
describe definitions and assumptions on specification formal environment for specifying and logical
in the form of logical formulas. The specifications and reasoning with properties of objects. However, writing
assumptions provide for the proof system that verifies specifications directly in this calculus is tedious. More
whether a specification is valid under the given practical notation CSL enables to write compact
assumptions. The specification means consists, from specifications, but preserves possibility to transform
the structural point of view, of the language of any specification straightforwardly to the object
predicate logic and the language of object calculus. calculus whenever required for reasoning.
Their synthesis provides a base language with A class is defined by specifying all of its visible
expressive power of higher-order logics. In terms of properties. The term property means in this case a field
logic, this language contains standard predicate logic that represents the state of an object. An observer
symbols, i.e. quantifiers and propositional connectives, serves for read-only access to an object. On the
and constants as objects defined by terms of object contrary, modifier’s execution can change the state of
calculus. The language allows quantification over the an object. A field declaration includes the field name
set of constants. The Gentzen deduction system can be and class. Specification of a field may be refined using
used as a formal proof system for this language. A invariant statement:
specification consists of a set of classes that forms a
Field fieldName : fieldClass
model of the specified system. Inv fieldInv = formula
The logic represents a higher-order theory based on
typed object calculus. It consists of a small set of Modifier and observer methods include definitions
primitive syntactic forms. An object is defined as a consisting of method’s name, arguments, and a pair of
collection of attributes. The following two operations constraints. Declarations differ for modifiers that
only can operate on objects: (i) attribute selection a.l disable a user to specify a result of the method. Due to
that results in the term obtained as an evaluation of the modifiers, declarations always evaluate to the object
attribute body, and (ii) attribute update that has the reflecting performed changes. Constraints may involve
form a.l ← b. The letters a, b represent terms of the variables referencing actual objects and variables
language and l is a label. Computational semantics of denoting specified arguments of the method.
the calculus for both operations arise from the rules for observer methodName(, arg : argClass, …) : retClass
reduction relation. A select operation provides pre methodPre = formulaPre
reduction to a term that arises from the body of a post methodPost = formulaPost
selected attribute in which all occurrences of the bind
variable are replaced by the object supplying the The language CSL enables to define a new class by
selected attribute. The result of update operation application of simple inheritance. An inherited class
defined by reduction relation provides a new object automatically receives all fields and methods of its
identical with the target object up to the update parent class. Proper definition of inheritance
attribute, which body is that of the updating term. constraints enables method overriding. The
The logic includes a type theory constraining the set precondition of the overridden method relaxes
of well-formed terms. Typing rules of the calculus constraints of method execution, contrary to post-
permit subtyping while providing for special treatment conditions that involve additional constraints.
with bool type. Although the language does not contain The logic calculus defines directly certain common

222

Authorized licensed use limited to: Satya Koneru. Downloaded on July 26,2010 at 08:47:00 UTC from IEEE Xplore. Restrictions apply.
classes. Especially, the class Bool is defined as a All classes in the model have an abstract or root
predicate on propositional type. The logic evaluates all class from which they are derived. This abstract class
possible instances of this class to T and F objects includes several attributes and methods that are
declared previously as abbreviations. common to all classes in the model and provide a
definition facility for instantiation and deletion of
3. Case study concrete classes including attributes. Block classes
form the major blocks of functionality that can be
This section demonstrates the above-introduced plugged into an abstract card-cage to create various
tools applied to development of pressure sensors types of devices. One Physical Block is mandatory as it
interconnected by Internet. The architecture of this defines the card-cage and abstracts the hardware and
application is based on the IEEE 1451 family of software resources that are used by the device. All
standards, which is introduced in the following other block and base classes can be referenced from the
subsection. Physical Block.
The Transducer Block abstracts all the capabilities
3.1. IEEE 1451.1 of each transducer that is physically connected to the
NCAP I/O system. During the device configuration
The IEEE 1451 consists of the family of standards phase, the description is read from hardware device
for a networked smart transducer interface that include what kind of sensors and actuators are connected to the
namely (i) a smart transducer software architecture, system. The Transducer Block includes an I/O device
1451.1 (IEEE 1451.1 Standard for a Smart Transducer driver style interface for communication with the
Interface for Sensors and Actuators -- Network hardware. The I/O interface includes methods for
Capable Application Processor Information Model, reading and writing to the transducer from the
IEEE, New York, April 2000), targeting software- application-based Function Block using a standardized
based, network independent, transducer applications, interface. The I/O device driver provides both plug-
and (ii) a standard digital interface and communication and-play capability and hot-swap feature for
protocol, 1451.2, for accessing the transducer or a transducers.
group of transducers via a microprocessor modeled by The Function Block provides a skeletal area in
the 1451.1. The next three standards extend the which to place application-specific code. The interface
original hard-wired parallel interface 1451.2 to serial does not specify any restrictions on how an application
multidrop 1451.3, mixed-mode (i.e. both digital and is developed. In addition to the variable State, which all
analog) 1451.4, and wireless 1451.5 interfaces. The block classes maintain, the Function Block contains
1451.1 software architecture provides three models of several lists of parameters that are typically used to
the transducer device environment: (i) an object model access network-visible data or to make internal data
of a network capable application processor (NCAP), available remotely. The Network Block abstracts all
which is the object-oriented embodiment of a smart access to a network employing network-neutral, object-
networked device; (ii) a data model, which specifies based programming interface supporting both client-
information encoding rules for transmitting server and publish-subscribe paradigms for
information across both local and remote object configuration and data distribution.
interfaces; and (iii) network communication model,
which supports client/server and publishers/subscribers 3.2. Application
paradigms for communicating information among
NCAPs. The standard defines a network and transducer The case study, based on a real-world application is
hardware neutral environment in which a concrete used in this paper to demonstrate basic features of
sensor/actuator application can be developed. deployment of the specification languages ASL and
The object model definition encompasses a set of CSL discussed in subsections 3.2 and 3.3.
object classes, attributes, methods, and behaviors that The application architecture comprises several
specify a transducer and a network environment to pressure and temperature sensors with safety valve
which it may connect. This model uses block and base controllers as base stations connected to wired intranets
classes offering patterns for one Physical Block, one or that dedicated clients can access effectively through
more Transducer Blocks, Function Blocks, and Internet. The web server supports each sensor group by
Network Blocks. Each block class may include specific an active web page with Java applets that, after
base classes from the model. The base classes include downloading, provide clients with transparent and
Parameters, Actions, Events, and Files, and provide efficient access to pressure and temperature
component classes. measurement services through controllers. Controllers

223

Authorized licensed use limited to: Satya Koneru. Downloaded on July 26,2010 at 08:47:00 UTC from IEEE Xplore. Restrictions apply.
provide clients not only with secure access to {IEEE 1451.1-6.1.1}
measurement services over systems of gas pipes, but var sever_operation_id: UInteger16;
var data:Float32;
also communicate to each other and cooperate so that i = 1;
the system can resolve safety and security-critical timeloop(interval_of_reading)
situations by shutting off some of the valves. {IEEE 1451.1-14.2.1}
Each wireless sensor group is supported by its Encode_inputsarguments(server_inputsarguments);
execute_mode = EM_RETURN_VALUE;
controller providing Internet-based clients with secure server_operation_id = READ_VALUE;
and efficient access to application-related services over {IEEE 1451.1-8.2.3.5 - Ethernet}
the associated part of gas pipes. In this case, clients MarshalArguments(server_operation_id,
communicate to controllers using a messaging protocol server_inputsarguments, request );
send(request, ServerDispatchAddress);
based on client-server and subscriber-publisher wait(response, port_timeout, success);
patterns employing 1451.1 Network Block functions. if success and execute_mode = EM_RETURN_VALUE
A typical configuration includes a set of sensors {IEEE 1451.1-8.2.3.5 - Ethernet}
generating pressure and temperature values for the then DemarshalArguments(response,
server_output_arguments);
related controller that computes profiles and checks Decode_outputsarguments(data, server_outputsarguments);
limits for users of those or derived values. When a else data = 0; fi;
limit is reached, the safety procedure closes valves in data_out[i] = data;
charge depending on safety service specifications. i = i + 1; when i > number_of_channels action exit;
endloop;
In the transducer’s 1451.1 object model, basic endprocess;
Network Block functions initialize and cover
communication between a client and the transducer. The full related behavioral specification was
The client-server communication style, which in this prototyped using the technique mentioned at the end of
application covers configurations of transducers, is subsection 2.1.
provided by two basic Network Block functions:
execute and perform. The standard defines a unique ID 3.4. CSL specifications
for every function and data item of each class. If the
client requests to call any of the functions on server The following example demonstrates the CSL
side, it uses command execute with the following specification of the NCAP Block class in frame of the
parameters: ID of requested function, enumerated class hierarchy of Block objects. The Block abstract
arguments, and requested variables. On server side, class provides the root for the class hierarchy of all
this request is decoded and used by the function Block objects. The BlockMajorState type is enumeration
perform. That function evaluates the requested function of possible block states. The state blUninitalize is
with the given arguments and, in addition, it returns the reserved for local activities related to creating that
resulting values to the client. Those data are delivered Block object and performing any related local
by requested variables in execute arguments. arrangements. The object in the state blInactive is able to
configure its network properties, initialize itself, and
3.3. ASL specifications diagnose and maintain the BlockMajorState. The working
state blActive is reached after all initialization and start-
The following example demonstrates the ASL up procedures and represents the state in which the
specification of a client accessing transducer through a object remains for the time of its normal activity.
network. In curly brackets, it includes references to
distinct sections of the IEEE 1451.1 standard. BlockMajorState :: {blActive, blInactive, blUninitialized}
IEEE1451Block :: [GetBlockMajorState : BlockMajorState,
process CLIENT(oc: data_out, request; ic: response): GoActive : IEEE1451Block, GoInactive : IEEE1451Block,
const number_of_channels = 10; Reset : IEEE1451Block, Initialize : IEEE1451Block,
const interval_of_reading = 100; Owns : IEEE1451Entity → bool] + IEEE1451Entity
const ServerDispatchAddress = NCAP;
const port_timeout = 200; A behavior of the object may implicitly change the
type buffer = array[1..number_of_channels] of Float32; state of this object usually in response to the
{IEEE 1451.1-6.1.1}
var data_out:buffer;
environment stimulus while a set of defined operations
var i: integer; can drive the object to change its state explicitly. The
var request, response: ArgumentArray; meanings of those operations are defined by sets of
{IEEE 1451.1-6.2.14} constraints. The behavior of the object influenced by
var server_inputsarguments: ArgumentArray;
var server_outputsarguments: ArgumentArray;
those operations is specified in form of
var success:boolean; IEEE1451BlockBehavior invariant.
var execute_mode: UInteger8;

224

Authorized licensed use limited to: Satya Koneru. Downloaded on July 26,2010 at 08:47:00 UTC from IEEE Xplore. Restrictions apply.
INV IEEE1451BlockBehavior(x : IEEE1451Block) ≡ [2] Wieringa, R., "A Survey of Structured and Object-
x.GetBlockMajorState ↔ blInactive Oriented Software Specification Methods and Techniques",
⊃ x.GoActive.GetBlockMajorState ↔ blActive ACM Computing Surveys, Vol.30, No.4, pp.459-527.
∧ x.GetBlockMajorState ↔ blActive
⊃ x.GoInactive.GetBlockMajorState ↔ blInactive [3] Melhart, B. and White, S., “Issues in Defining,
∧ x.Reset.GetBlockMajorState ↔ blUninitialized Analyzing, Refining, and Specifying System Dependability
∧ ¬x.GetBlockMajorState ↔ blActive Requirements”, Proceedings of the IEEE Conference and
⊃ x.Initialize.GetBlockMajorState ↔ blInactive
Workshop ECBS'2000, IEEE Computer Society Press,
Edinburgh, Scotland, 2000, pp.334 340.
The NCAP Block class provides resources and
operations within an NCAP process to support Block, [4] Holzmann, G.J., “The Model Checker Spin”, IEEE
Service, and Component management. Transactions on Software Engineering, Vol.23, No.5, 1997,
pp.279-295.
NCAPBlockState :: {nblInitialized, blUninitialized, nbErro}
IEEE14 51Block :: [GetNCAPBlockState : NCAPBlockState, [5] Owre, J.M., et al., “PVS: A Prototype Verification
RegisterObject : IEEE1451Block,
DeregisterObject: IEEE1451Block, System. Automated Deduction”, In: D. Kapur, Ed., Lecture
registers : IEEE1451Entity → bool] + IEEE1451Block Notes in Artificial Intelligence, Vol.607, Springer, New
York, USA, 1992, pp.748-752.
The state space derived from Block object is divided
[6] Kim, G., L. et al., “Uppaal in a Nutshell”, Int. Journal on
into more specialized substates that reflect purpose of
Software Tools for Technology Transfer, Vol.1, No.1-2,
NCAP Block objects. The state of object, which is 1997, pp.134-152.
stored in GetNCAPBlockState item, may obtain values of
NCAPBlockState type. [7] Sveda, M. and Vrba, R., "Executable Specifications for
Distributed Embedded Systems", IEEE Computer, Vol.34,
4. Conclusions No.1, 2001, pp.138-140.

This paper discusses executable specifications and [8] Sveda, M. and Vrba, R. and Ocenasek, P:, "Local Time
rapid prototyping for structured design, and structural Specifications of Networked Embedded Systems",
Proceedings of the International Conference on Systems
specifications for object-oriented design of embedded (ICONS 2006), IEEE Computer Society, Morne, MU, 2006,
system networks. Main attention focuses on behavioral pp.192-195.
specifications of reactive and real-time activities
utilizing either structured or object-oriented approach. [9] Rysavy, O. and Sveda, M., "A Minimal Formal Language
The paper presents ASL and CSL languages developed for Object-Oriented Specifications", Proceedings of the IEEE
for that purpose. The approach can eliminate not only TC-ECBS and IFIP WG10.1 Joint Workshop on Formal
behavioral faults but also security flaws caused by Specifications of Computer-Based Systems, University of
design errors, as they produce also behavioral defects. Stirling, UK, 2003, pp.35-40.

[10] Rysavy, O., Specifying and Reasoning in the Calculus of


5. Acknowledgement Objects, PhD Dissertation, Brno University of Technology,
Brno, Czech Republic, 2005.
The research has been supported by the Czech
Ministry of Education in the frame of Research
Intentions MSM 0021630528: Security-Oriented
Research in Information Technology and MSM
0021630503: MIKROSYN: New Trends in
Microelectronic Systems and Nanotechnologies; and
by the Grant Agency of the Czech Republic through
the grant GACR 102/08/1429: Safety and Security of
Networked Embedded System Applications.

6. References
[1] Lamport, L., Specifying Systems, Addison-Wesley,
Boston, USA, 2002.

225

Authorized licensed use limited to: Satya Koneru. Downloaded on July 26,2010 at 08:47:00 UTC from IEEE Xplore. Restrictions apply.

You might also like