Introduction to SDL

46
Introduction to SDL Bibliography: [Doldi2001] L. Doldi, (2001), SDL Illustrated. [Edwards2001] S. Edwards, (2001), SDL, http://www.cs.columbia.edu/~sedwards/classes/2001/w499 5-02/presentations/sdl.ppt . [ABS2002] A. Alkhodre, J.-P. Babau, and J.-J. Schwarz, "Modelling of real-time constraints using SDL for embedded systems design," Computing & Control Engineering

description

Introduction to SDL. - PowerPoint PPT Presentation

Transcript of Introduction to SDL

Page 1: Introduction to SDL

Introduction to SDL

Bibliography:

[Doldi2001] L. Doldi, (2001), SDL Illustrated.[Edwards2001] S. Edwards, (2001), SDL, http://www.cs.columbia.edu/~sedwards/classes/2001/w4995-02/presentations/sdl.ppt.[ABS2002] A. Alkhodre, J.-P. Babau, and J.-J. Schwarz, "Modelling of real-time constraints using SDL for embedded systems design," Computing & Control Engineering Journal, vol. 13, pp. 189-196, 2002.

Page 2: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 2

SDL: Specification and Description Language

• ITU-T (International Telecommunication Union) Recommendation Z.100

• Created for the specification of communication protocols

• Two forms: Textual (SDL/PR) et Graphic (SDL/GR)

Page 3: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 3

SDL

• Two aspects:1. Structure of a specification in SDL2. Behavior of a specification in SDL

Page 4: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 4

Structure: Basic components

• Three basic components in SDL System Block Process

Page 5: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 5

System: Highest level

Page 6: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 6

Block: middle level(s)

Page 7: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 7

Process: lowest level

Page 8: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 8

Communication in SDL

• Signal Models an event that

is communicated between processes, blocks, or systems

• Channel Models the means of

transferring a signal between two blocks, or a block and the external environment

• Signal route Models the means of

transferring a signal between two processes

Page 9: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 9

SDL Signals

• General format: Signal_name(parameters)

• Simplest format start

• Format with values A(true) (message with a Boolean argument) dial(number) get_request(file, username)

• Parameters in SDL can be rather complex if necessary (supports ASN.1)

Page 10: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 10

Signal address

• Source address (process that sent it) Useful when there are more than one

instance of the same process• e.g., in the case of a server that handles

many requests from different clients, each request can be run in a separate concurrent process, which are different instances of the same process

Page 11: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 11

SDL Channels

• Signal channel, between blocks communication delays are uncertain

• Signal route, in the same block (computer), between processes Almost instantaneous

Page 12: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 12

SDL Channels (2)

• A signal can travel across several channels on its way from the source to destination

Page 13: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 13

SDL: Behavior

• A process in SDL is modeled as a finite-state machine (actually extended, communicating FSM). System behavior

• A process can be created or terminated dynamcially

Page 14: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 14

Specification in SDL

• An SDL specification is a group of communicating modules

• An SDL specification is a group of ECFSM (extended communication finite-state machines)

Page 15: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 15

Finite State Machines

• A finite state machine has: States Inputs (events) Transition function Outputs (events)

• Examples…

Page 16: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 16

FSM: Example

Page 17: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 17

(Some) properties of FSM

• Deterministic• Non-deterministic• Complete• Partial• Connected• …

Page 18: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 18

Extended Finite State Machine

• It’s an FSM that has state variables• For complex problems, the state-space

can explode Can be reduced by using state variables

• 3 additional features Input/Output events can have parameters Use of predicates for firing transitions Variables can be modified during a

transition

• Examples…

Page 19: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 19

Example of EFSM

Page 20: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 20

Extended Communicating Finite State Machine

(ECFSM)• It’s an EFSM that can communicate

with other EFSM• Each EFSM has it’s own (input)

queue• If M1 sends a message to M2, the

message is put in M2’s queue

Page 21: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 21

ECFSM: Example- Means a message is sent

+ means a message is received

1

2

-B+A-C

1

2

+B -A

M2M1

Page 22: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 22

SDL Process

• A process in SDL is an ECFSM• Execution rule: take the next signal

(message) from the queue and... Update variables Process branch decisions Send a new signal … Determine the next state End

Page 23: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 23

SDL Process (2)

• Text and graphic forms

state Wait; input Money(a); task x := a; nextstate Pay; input Cancel; nextstate Wait;endstate;

Wait

Money

Pay

Cancel

Waitx := a

Page 24: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 24

SDL Process (3)

• Transition rules At any given state, remove a signal from the

input queue If a transition is defined for this signal, then

• Fire the transition Output signal(s) Modify internal variables, etc.

Else (no transition defined for this signal)• Ignore the signal and stay in the same state

Page 25: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 25

State symbol

• Indicates either the current state or the next state, depending on its use

inactive

ready

Page 26: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 26

Start State

• Indicates the start of a process• Nameless

ready

...

Page 27: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 27

Receive symbol

• Follows a State symbol• Indicates the Signal activating a

transition [Edwards2001]

Idle

Coin Choice Clear

... ... ...

Page 28: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 28

Receiving a signal

• Set of valid signals Contains all signals a process can receive Any signal not in this set will produce an

error

• At a given state, only certain signals can activate a transition If a (valid) signal is received but it has no

defined transition, the signal is destroyed without causing a transition

This is called an implicit transition

Page 29: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 29

Save symbol

• Allows a signal to be accepted and stored again into the input queue (without losing it) Useful when signals can get re-ordered

[Edwards2001]Idle

Coin Clear Choice

A “Choice” signal that arrives in this state will be deferred to the next

Page 30: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 30

Output symbol

• Sends a signal to another process Explicit forms « VIA channel » et

« TO process »

• The channel by which the signal is sent is determined by the signal’s type

A(s)

Page 31: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 31

Explicit output

• VIA channel or TO process e.g., a process that

needs to resend the same signal it has received

To avoid receiving again the same signal, a channel can be specified

There are other cases…

“VIA” the channel named MB

Page 32: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 32

Local variables

• A process has local variables

• Shared variables Modified only by the

process itself Read by other

processes (in certain cases)

• Declared textually

Page 33: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 33

Important!

There are no global variables

in SDL!!!

Page 34: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 34

Variable types

• integer, Boolean, real, character, string Operators +, -, *, etc.

• Arrays, enumerations et sets

Page 35: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 35

Task symbol

• Assignment statements, expressions

• Informal text Incomplete

specification, to be detailed later

Useful during simulation

Page 36: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 36

Decision symbol

• Branch according to a condition Expression form

a=e

Informal‘message’

Page 37: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 37

Process Creation symbol

• Creates (instantiates) a new process after a transition Channels aren’t

duplicated Make sure that a

message is sent to the right instance

• Specification of the number of instances

CallHandler

CallHandler(0,63)

[Edwards2001]

Page 38: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 38

Process creation

• Convention: independent handling of a request Like a daemon in Unix (lpd, httpd, etc.) e.g., create a new server process to

handle a file-transfer request• The process “dies” when the file has been sent

• Set the maximum number of process instances because resources are limited

Page 39: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 39

Process creation

• Process is running at all times (one and only one instance)

• Process starts out as inactive. No more than one instance.

• No processes running at first, but up to 64 instances.

CallHandler(1,1)

CallHandler(0,1)

CallHandler(0,64)

Page 40: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 40

Terminating a process

• Only a process can terminate

‘last task’

Page 41: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 41

Timers

att_ack

TB(r)

reset(T)

Timer T;

A(s)

... ...

set (now+10, T)

A(s)

Once a timer has expired, the process receives a message.

A timer is declare like a variable

Duration of timer is specified here

Timer is deactivated

Page 42: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL 42

SDL: Inside information…

• SDL has two “close cousins” ASN.1 MSC

• They are always together on projects that are serious.

Page 43: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL

Examples

43

Documenting Software Architectures: Views and Beyond

by Paul Clements; Felix Bachmann; Len Bass; David Garlan; James Ivers; Reed Little; Robert Nord; Judith StaffordPublisher: Addison-Wesley Professional

Pub Date: September 26, 2002

Page 44: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL

Examples

44

Documenting Software Architectures: Views and Beyond

by Paul Clements; Felix Bachmann; Len Bass; David Garlan; James Ivers; Reed Little; Robert Nord; Judith StaffordPublisher: Addison-Wesley Professional

Pub Date: September 26, 2002

Page 45: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL

Example: (MSC)

45

Documenting Software Architectures: Views and Beyond

by Paul Clements; Felix Bachmann; Len Bass; David Garlan; James Ivers; Reed Little; Robert Nord; Judith StaffordPublisher: Addison-Wesley Professional

Pub Date: September 26, 2002

Page 46: Introduction to SDL

Dept. of Software and IT Engineering

Introduction to SDL

Exercise

• http://www.comnets.uni-bremen.de/typo3site/uploads/media/Exercise6.pdf

46