1 / 46

Introduction to SDL

Introduction to SDL.

alagan
Download Presentation

Introduction to SDL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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.

  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)

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

  4. Structure: Basic components • Three basic components in SDL • System • Block • Process

  5. System: Highest level

  6. Block: middle level(s)

  7. Process: lowest level

  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

  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)

  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

  11. SDL Channels • Signal channel, between blocks • communication delays are uncertain • Signal route, in the same block (computer), between processes • Almost instantaneous

  12. SDL Channels (2) • A signal can travel across several channels on its way from the source to destination

  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

  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)

  15. Finite State Machines • A finite state machine has: • States • Inputs (events) • Transition function • Outputs (events) • Examples…

  16. FSM: Example

  17. (Some) properties of FSM • Deterministic • Non-deterministic • Complete • Partial • Connected • …

  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…

  19. Example of EFSM

  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

  21. 1 1 +B -A +A -C -B 2 2 M2 ECFSM: Example - Means a message is sent + means a message is received M1

  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

  23. Money Cancel SDL Process (2) • Text and graphic forms state Wait; input Money(a); task x := a; nextstate Pay; input Cancel; nextstate Wait; endstate; Wait x := a Wait Pay

  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

  25. State symbol • Indicates either the current state or the next state, depending on its use inactive ready

  26. Start State • Indicates the start of a process • Nameless ... ready

  27. Coin Choice Clear Receive symbol • Follows a State symbol • Indicates the Signal activating a transition [Edwards2001] Idle ... ... ...

  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

  29. Coin Clear 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] A “Choice” signal that arrives in this state will be deferred to the next Idle Choice

  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)

  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

  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

  33. Important! There are no global variables in SDL!!!

  34. Variable types • integer, Boolean, real, character, string • Operators +, -, *, etc. • Arrays, enumerations et sets

  35. Task symbol • Assignment statements, expressions • Informal text • Incomplete specification, to be detailed later • Useful during simulation

  36. Decision symbol • Branch according to a condition • Expression form a=e • Informal ‘message’

  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]

  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

  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)

  40. Terminating a process • Only a process can terminate ‘last task’

  41. T B(r) Timers A(s) Timer T; set (now+10, T) Duration of timer is specified here A timer is declare like a variable att_ack Once a timer has expired, the process receives a message. A(s) reset(T) ... Timer is deactivated ...

  42. SDL: Inside information… • SDL has two “close cousins” • ASN.1 • MSC • They are always together on projects that are serious.

  43. Examples

  44. Examples

  45. Example: (MSC)

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

More Related