View page as slide show

Communications Software and architecture

Behaviour modelling

Behaviour modelling

  • In communication software the software entities will get signals from other entities
    • The entities have to react to these signals based on the defined protocol.
  • Behaviour model describes the reactions and results for incoming input to the entity
    • Local input e.g. timer
    • external input e.g. PDU or primitive
  • The behaviour is modeled by using finite state machine

Finite state machine (FSM)

  • aka. Finite state automaton
  • Consists of:
    • Finite amount of states in which the entity can be
    • input events (signals, messages…)
    • Transition funtions
      • The conditions on which the state is changed.
    • Output events

Types of FSMs

  • Deterministic FSM
    • All the possible inputs are taken into account in all states
    • For each state, there is one and only one transition to next state for each possible input.
  • Moore FSM
    • Output function is determined by the current state. → output is attached to the state
  • Mealy FSM
    • Output function is determined by state and the input. → output is attached to the links between states

FSM Transition

  • Transition from one state to another is defined by transition function.
    • transition is triggered by input event.
  • Transition function produces the output and next state
    • Result depends on current state and input event
  • FSM is inactive, when it is in state
    • Waits for an input to perform next activity
  • Some events may cause the state to remain same → transition to itself

Modeling FSM

  • Table based modeling
    • input events on rows
    • states on columns
    • crossing of input event and state describes the transition function
  • Graphical model
    • State transition diagrams
    • State chart (in UML)

FSM as Table

  • all states and inputs must exist
  • Intersection contains first the optional event and then the transition
  • Example: Parity bit counter
    • starts at idle
input\state idle s_odd s_even
Message 0 s_even s_odd s_even
Message 1 s_odd s_even s_odd
Finished print error
print odd
print even

FSM as Graph

  • States are described as circles
    • name of state is inside circle
  • State transition is described with arrow
    • Input causing the transition is written by the transition arrow.
  • output is written separated by a line
    • in Moore machine under the state name
    • in mealy machine under the input


  • Communication protocols usually rely on timers
    • surviving error condition.
  • Timers are started usually after transition
    • Last for specified time
  • Timer expiration is handled as an input
  • All the timers

Extended FSM

State chart

  • UML
  • Describes the behaviour of object
Last modified: 2013/07/01 14:42