Introduction to SDL - National Chiao Tung...

32
1 Network E xperiment Introduction to SDL S DL : 2 Network E xperiment Statistics from 9 federal S/W projects

Transcript of Introduction to SDL - National Chiao Tung...

Page 1: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

1

Network Experiment

Introduction to SDL

S DL : 2

Network Experiment

Statistics from 9 federal S/W projects

¶±¦

³¶¦

²º¦

µ¦ ³¦Ô°Ø Åæíê÷æóæå­ ïæ÷æó öôæå

ÿ ¶±¦

Ô°Ø Ñâêå çðó­ ïðõ åæíê÷æóå

ÿ ³¶¦

Ô°Ø Öôæå íâõæó ðó

óæøðóìæå ÿ ²º¦

Ô°Ø Öôæå âçõæó äéâïèæô ÿ

µ¦

Ô°Ø Öôæå âô åæíê÷æóæå ÿ

³¦

Page 2: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

2

S DL : 3

Network Experiment

S/W Costs

±¦

²±¦

³±¦

´±¦

µ±¦

¶±¦

·±¦

¸±¦

¹±¦

º±¦

²±±¦

²º¶¶ ²º·³ ²º¸± ²º¸¸ ²º¹¶

HardwareSoftware

Maintenance

S DL : 4

Network Experiment

Error Correction

Relative Cost

1

2

10

20

100

200

1000

Requirement Specification Design Implementation Test/Operation

Page 3: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

3

S DL : 5

Network Experiment

S/W Project Related Knowledge

DomainKnowledge

Development ProcessTechnique

Project Management &Configuration Management

S DL : 6

Network Experiment

A Formal Protocol Development Process

Tpguxbsf

Sfrvjsfnfou

Tqfdjgjdbujpo

)TEM- NTD- BTO/2*

Iptu Uftu Tvjuf

)UUDO- BTO/2*

JVU

)D*

Ubshfu Uftu Tvjuf

)D*

Tpguxbsf

Qspevdu

Tjnvmbujpo

Uftu

Dbtf

Hfofsbujpo

Iptu

Dpogpsnbodf

Uftujoh

Ubshfu

Dpogpsnbodf

Uftujoh

Dpef

Hfofsbujpo

Dpef

Hfofsbujpo

Page 4: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

4

S DL : 7

Network Experiment

Procedure for Building an SDL System

SDL Specification(GR)

SDL Specification(PR)

Generated C CodeRT KernelTemplate

RT Kernel

Executable Program

ROM(Target)

Converting

C Code Generating

Binding/Compiling/Linking

Porting

S DL : 8

Network Experiment

Why SDL

• Graphic Representation• Hierarchical Representation• Simulation/Validation Capability• Other reasons:

– International Standard(ITU-T, Z.100).– Formal description.– Easy to understand even for non con-

structors (graphical representation).– Object Oriented language (supports object

oriented thinking and reuse of specifications).

Page 5: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

5

S DL : 9

Network Experiment

Good Specification

• Enables an easier communication between customer and producer.• Makes it easier to discover errors in an earlier stage of the life cycle.• Reduces maintenances costs.

S DL : 10

Network Experiment

Why formal?

The representation technique is formal if the interpreta-tion model is formally defined and guarantee that noambiguities can occuri.e.an ambiguity based on the interpretation is an errorand can automatically be detected.

Page 6: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

6

1999/9/11 Chiung S. Wu S DL : 11

Network Experiment

What is SDL ?

• SDL (Specification and Description Language) isa standard language for the specification anddescription of systems. It has been developedand standardized by ITU (InternationalTelecommunication Union, formerly CCITT).

• The development of SDL started in 1972 after aperiod of investigations. The first version of thelanguage was issued 1976, followed by newversions 1980, 19N and 1988.

• SDL88, was approved 1987.• SDL92, was defined by Z.100.• Future goal: SDL 2000.

1999/9/11 Chiung S. Wu S DL : 12

Network Experiment

Application of SDL

• type of system:– real time, interactive, distributed,

• type of information:– behavior and structure,

• level of abstraction:– overview to details.

• SDL is widely used intelecommunication field, however, it hasbroader application area.

Page 7: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

7

1999/9/11 Chiung S. Wu S DL : 13

Network Experiment

Overview of SDL

• Multi-level description, combined with finitestate machine.

dcl Count := 0 ;

S 1

A

B

Coun t :=C o u n t + 1

S 2

1999/9/11 Chiung S. Wu S DL : 14

Network Experiment

SDL System

• The system description constitutes the top levelof detail.

• The system is what the SDL descriptionspecifies: an abstract machine communicatingwith its environment.

Page 8: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

8

1999/9/11 Chiung S. Wu S DL : 15

Network Experiment

SDL System

• The system contains everything to be specified,but nothing not to be specified It communicateswith its environment via channels.

• The communication mechanisms used betweenthe system and the environment are the sameas those used inside the system.

1999/9/11 Chiung S. Wu S DL : 16

Network Experiment

A Typical System Contains ...

• system name (Daemongame);• signal descriptions (for the types of signals interchanged

between the blocks of the system or between the blocksand the environment; Newgame, Probe, etc);

• channel descriptions (for the channels connecting theblocks of the system to one another and to theenvironment of the system; Daemonserver, etc.);

• data type descriptions (for the user defined data types,visible in the whole system and its environment; there areno user defined data types);

• block descriptions (for the blocks into which the system ispartitioned; the system contains only one block:Blockgame).

Page 9: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

9

1999/9/11 Chiung S. Wu S DL : 17

Network Experiment

System Deamongame

1999/9/11 Chiung S. Wu S DL : 18

Network Experiment

Block

• A block is a part of the system- that can be treated invarious respects (development, description,understanding etc.) as a self-contained object.

• A block diagram usually contains the following elements:– block name (in Blockgame);

– signal descriptions (for the signals local to the block, i.e.not visible outside the block; Gameover, Gameoverack);

– signal route descriptions (for the signal routes connectingthe processes of the block to one another and to theenvironment of the block; R1, R2, etc.);

– channel-to-route connections (the specification of theconnections between the channels external to the block andthe signal routes internal to the block; l Daemonserver to R4,etc.):

– process descriptions (for the process types that describethe behaviour of the block; Monitor, Game).

Page 10: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

10

1999/9/11 Chiung S. Wu S DL : 19

Network Experiment

Blockgame

1999/9/11 Chiung S. Wu S DL : 20

Network Experiment

Process

• A process in SDL is an extended finite state machine, i.e. afinite state machine that can use manipulate data storedin variables local to the machine.

• The behavior of a finite state machine is described bystates and transitions.

• The behavior of a finite state machine may also be definedby a directed graph.

This is not SDL !!!

Page 11: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

11

1999/9/11 Chiung S. Wu S DL : 21

Network Experiment

Elements of a Process

• A process diagram usually contains thefollowing elements:– Process name,– formal parameters,– variables descriptions,– timer descriptions,– procedure description, and– process graph (for the description of the finite

state machine of the process).

1999/9/11 Chiung S. Wu S DL : 22

Network Experiment

Basic constructs for the description of a process

Page 12: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

12

1999/9/11 Chiung S. Wu S DL : 23

Network Experiment

A Process Example

1999/9/11 Chiung S. Wu S DL : 24

Network Experiment

Timer

• The timer is an object, owned by aprocess, that is able to generate atimer signal and put this signal intothe input queue of the process.

• During a transition a timer can beactivated with the set construct. Theset construct has two arguments.First one is the absolute time for theexpiration of the timer, and the otherone is the name of the timer.

• For the specification of the expirationtime, the expression NOW (of thepredefined type Time, which issimilar to Real) can be used. NOWalways gives the current time duringthe interpretation of the systemdescription.

Page 13: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

13

1999/9/11 Chiung S. Wu S DL : 25

Network Experiment

Data

• The description of a variable is following the keyword DCL.• During a transition the process can use and manipulate

its own local variables, using the task construct. A taskconstruct is always an assignment. In SDL/GR the taskconstruct is represented by a task symbol, which is arectangle.

1999/9/11 Chiung S. Wu S DL : 26

Network Experiment

Decision

Page 14: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

14

1999/9/11 Chiung S. Wu S DL : 27

Network Experiment

Single I/O

• With the signal A, the values 5 and true are sent fromprocess P1 to process P2. The process P2 owns variablesv1 and v2 of type Integer and Boolean, respectively. Whensignal A is consumed by process P2, the value 5 isassigned to v1 and true is assigned to v2.

1999/9/11 Chiung S. Wu S DL : 28

Network Experiment

Legal I/O

• One or more variables may beomitted in the input constructThe corresponding receivedvalues are lost in this case.

• Similarly, one or more valuesmay be omitted in an outputconstruct

• But still the order of theremaining values and variablesis important.

Page 15: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

15

1999/9/11 Chiung S. Wu S DL : 29

Network Experiment

Dynamic Process Creation

• processes can be created by otherprocesses dynamically atinterpretation time. This isindicated in a block diagram by adashed line from the creatingprocess to the created process.

1999/9/11 Chiung S. Wu S DL : 30

Network Experiment

Process Termination

• A process can only be terminated by itself, byusing the stop construct.

• Afterwards, all the data values and the contentsof the input queue are discarded

Page 16: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

16

S DL : 31

Network Experiment

ProcedureSDL/System Behaviors

a1

a2

I ) a := 5

a1(a)

a2(a)

b := a+5

a := 5

a2(a)

a1(a)

b := a+5

II )procedure a1fpar in x Integer

x := x*x

O(x)

procedure a2fpar in /out x Integer

x := x*x

O(x)

S DL : 32

Network Experiment

Process Communication

Page 17: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

17

1999/9/11 Chiung S. Wu S DL : 33

Network Experiment

Process Communication Example

S DL : 34

Network Experiment

Explicit Addressing

Ato sender

Ato self

Ato Dest

Ato of fspr ing Dest is of

PId type

• four predefined expressions of type PId, i.e. self, sender, offspring and parent

Page 18: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

18

S DL : 35

Network Experiment

Implicit Addressing

Av ia Sr1

P1(1 ,1 ) P2 (1 ,1 )

block Examp le

signalA, B, C, D

S r 1

[A,B,C, ]

S r 2[A ,D]

B

process P1

• a unique destination process may be specified by -system structure -naming a signal route or channel

S DL : 36

Network Experiment

Uef

Ujnfs U

bu

ujnf y

Qspdftt

Timer Signal

• with set(x,T), the timer signal T will be put into the input port of its process at time x• timer signal might be removed from the input queue by using reset construct, e.g. reset(T)

b

a

d

Page 19: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

19

1999/9/11 Chiung S. Wu S DL : 37

Network Experiment

Process Monitor

1999/9/11 Chiung S. Wu S DL : 38

Network Experiment

Process Game

Page 20: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

20

S DL : 39

Network Experiment

SDL Predefined Data Sorts

• Integer• Natural• Real• Boolean• Character

• Charstring• Pid• Duration• Time

S DL : 40

Network Experiment

Synonym

With Synonym, constants are declared in SDL.

If a constant is declared as EXTERNAL it means thatthe constant will be assigned first at system start-uptime (i.e. it can be assigned different values each time.)

SYNONYM ZERO INTEGER = 0;SYNONYM ONE INTEGER = 1;SYNONYM NrOfDoors INTEGER = EXTERNAL;

Page 21: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

21

S DL : 41

Network Experiment

Newtype

newtype literals ; operators

axioms

endnewtype;

booltrue false,

not bool bool: ;→

not true false( ) ;==not false true( ) ;==

• Newtype creates a new data type.

S DL : 42

Network Experiment

Syntype

With Syntype you can restrict the set of values of a ground type.NOTE! The syntype will not be a new type but a subtype, and can thus be assigned values of the ground type.

SYNTYPE Age = Natural CONSTANTS 0:150ENDSYNTYPE Age; Example:

DCL MyAge, YourAge;

TASKMyAge := 1,YourAge := 100

Page 22: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

22

S DL : 43

Network Experiment

Struct

NEWTYPE Person STRUCT theName Charstring; theAge Age; theSex SexType;ENDNEWTYPE Person;

Example:

DCL SomePerson Person; PersonAge Natural;

TASKSomePerson := (. ‘John’, 26, Male .),PersonAge := SomePerson!theAge

Struct in SDL is similar to struct in C and Record in Pascal.

S DL : 44

Network Experiment

Generators in SDL

A generator is a parameterized data type template.

The generator defines the operators that should be available forall data types generated by the generator.

The instantiation of a generator is expanded before semanticanalysis.

Predefined SDL generators:• Array• String• Powerset

Page 23: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

23

S DL : 45

Network Experiment

Generators in SDL

In SDL the following is predefined:GENERATOR Array(TYPE Index, TYPE Itemsort);

The data type must be instantiated with an index type and anelement type. The index type is often a syntype with a closed range.SYNTYPE IndexType = Natural CONSTANTS 1:100ENDSYNTYPE;

NEWTYPE PArrayType Array(IndexType, Person)ENDNEWTYPE PArrayType;

Example:

DCL PersonArray ParrayType, I IndexType := 1;

TASKPersonArray(i) := (. ‘John’, 26, Male .)

S DL : 46

Network Experiment

Unified Modeling Language

• Convergence of Booch, OMT, Objectory• Standardize the artifacts of development• UML is nonproprietary and open to all

Page 24: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

24

S DL : 47

Network Experiment

UML Modeling Concepts

• Classes and relationships• Grouping constructs• Interaction mechanisms• Behavior entities• Extension mechanisms

Network Experiment

Introduction to MSC

Page 25: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

25

1999/9/11 Chiung S. Wu S DL : 49

Network Experiment

What is MSC ?

• A Message Sequence Chart is not adescription of the complete behavior of asystem, it merely expresses oneexecution trace.

• A collection of Message Sequence Chartsmay be used to give a more detailedspecification of a system.

1999/9/11 Chiung S. Wu S DL : 50

Network Experiment

MSC Features

• A Message Sequence Chart contains thedescription of the asynchronouscommunication between instances.

• The complete Message Sequence Chartlanguage, in addition, has primitives forlocal actions, timers (set, reset and time-out), process creation, process stop andcoregions.

• Furthermore sub Message SequenceCharts and conditions can be used toconstruct modular specifications.

Page 26: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

26

1999/9/11 Chiung S. Wu S DL : 51

Network Experiment

MSC Instances

• A Basic Message Sequence Chart contains a (partial)description of the communication behavior of a number ofinstances. An instance is an abstract entity of which onecan observe (part of) the interaction with other instancesor with the environment.

1999/9/11 Chiung S. Wu S DL : 52

Network Experiment

MSC Messages

• A communication between two instances isrepresented by an arrow which starts at thesending instance and ends at the receivinginstance.

• In the previous figure we consider the messagesm1, m2, m3 and m4. Message m0 is sent to theenvironment. The behavior of the environmentis not specified.

• For instance i2 we also define a local action a.

Page 27: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

27

1999/9/11 Chiung S. Wu S DL : 53

Network Experiment

Timing of MSC

• Although the activities along one single instance axis arecompletely ordered, we will not assume a notion of globaltime. The only dependencies between the timing of theinstances come from the restriction that a message musthave been sent before it is received.

• In the figure this implies for example that message m3 isreceived by i4 only after it has been sent by i3, and,consequently, after the reception of m2 by i3. Thus m1and m3 are ordered in time, while for m4 and m3 noorder is specified. The execution of a local action is onlyrestricted by the ordering of events on its own instance.

• The second Basic Message Sequence Chart in the figuredefines the same Basic Message Sequence Chart, but inan alternative drawing.

1999/9/11 Chiung S. Wu S DL : 54

Network Experiment

Overtaking of Messages

• It would even be possible to first send m3,then send and receive m4, and finallyreceive m3.

Page 28: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

28

1999/9/11 Chiung S. Wu S DL : 55

Network Experiment

Textual notation

msc example1; instance i1; out m0 to env; out m1 to i2; in m4 from i2; endinstance; instance i2; in m1 from i1; out m2 to i3; action a; out m4 to i1; endinstance; instance i3; in m2 from i2; out m3 to i4; endinstance; instance i4; in m3 from i3; endinstance;endmsc;

S DL : 56

Network Experiment

Instance, Message, Environment, Condition

msc connect ioncalling party

process digitecalled partyprocess digite

Id le

o f f hook

d ia l t one on

digit

dial tone off

digit

se i zu re i n t

a c kr i n g b a c k t o n e o n in te rna l r i ng i ng on

o f f hook

answer

c o n n e c t

Seizure

Talking

Page 29: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

29

S DL : 57

Network Experiment

Action, Time Expiration

disconnected

Disconnected

wait

wait

ICONreq

ProcessISAP_Manager_Ini

IDISind

setting counter

ICON ICONind

ResponderInitiator

T(5)

msc basic concepts

S DL : 58

Network Experiment

Time Supervision

Disconnected

Connected

ICONreq

ICONconf

ICON

T

ICONresp

ICONind

ICONF

Initiator Responder

msc connection setup

Page 30: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

30

S DL : 59

Network Experiment

Instance Creation, Instance Stop

msc p rocess_creat ion

manager

I C O N r e q

IDIS ind

data

terminate

subscr iber

S DL : 60

Network Experiment

Coregion

msc coregion

inst 1:

b lock d ig i te

inst 2:

b lock d ig i te

b lock data1

b lock data2

start

Page 31: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

31

S DL : 61

Network Experiment

Sub Message Sequence Chart

submsc Sys

In i t ia tor R e s p o n d e r

D i s c o n n e c t e d

I C O N r e q

set t ing T

I C O N I C O N i n d

Wa i t Fo r Resp

Sys

I C O N r e q

I C O N i n d

msc w i t h _ s u b m s c

decomposed

S DL : 62

Network Experiment

Composition and Decomposition Rules

Disconnected

ICONreq ICONind

Initiator Responder

msc connection request

Wait For Resp

ICON

Page 32: Introduction to SDL - National Chiao Tung Universityshannon.cm.nctu.edu.tw/netexp/sdl.pdfIntroduction to SDL SDL : 2 Network Experiment ... • SDL (Specification and Description Language)

32

S DL : 63

Network Experiment

Composition and Decomposition Rules

Connected

ICONconf ICONrespICONF

Initiator Responder

msc connection confirm

Wait For Resp

S DL : 64

Network Experiment

Composition and Decomposition Rules

Disconnected

Connected

ICONreq

ICONconf ICONresp

ICONind

ICONF

Initiator Responder

msc composed

Wait For Resp

ICON