


Next:Protocol
modelUp:LYDIAN
modelPrevious:LYDIAN
modelContents
Simulator model
The distributed systems simulator of Lydian is based on the simulator of
the DSS tool [3].
The basic choice made for this simulation model is that the input data,
e.g the ordering of events of the simulated system is probabilistic (found
in bibliography as Monte-Carlo simulation ). For every node and for every
link of the distributed system the simulator needs some parameters about
the step and communication delays depending on the desired time distribution.
Along with this, the simulation is event driven, i.e. the simulator
schedules the events of the future in time ordering and when the next event
causes a simulator call to the protocol, the time of the simulation model
advances by a variable amount.
To implement this concept, the simulator actually proceeds by keeping
track of the event list. This list has all the kinds of events, and has
the structure of a heap which means that every new event that is created
during the execution of an action of the protocol is inserted in this list
at the proper place to keep the time ordering of events.
In order to make a more realistic handling of the time that it takes
each node to execute an action of the protocol, the notion of idle time
is introduced. This means that after the execution of an action the corresponding
node will remain idle, i.e. unable to execute a next event, for an amount
of time equal to the currently chosen step, even though such an event could
be scheduled for an earlier time.
Of course, the above notion is used only when asynchronous or Archimedean
systems (Section 4.3.1)
are simulated. In the case of synchronous systems or when a synchronizer
is used, the handling of the timing is determined by the notion of cycles.
When an event occurs and the simulator calls the protocol the global
variable CUREVENT contains this event and global variable me
contains the number of the node for which the event occurs. For more information
about system variables, refer to Section 5.2.
The kinds of events that are supported by this simulator are:
-
INITPROTOCOL
-
It is the initial event that corresponds to the spontaneous awakening of
a node. At the begining of the simulation an INITPROTOCOL event is automatically
scheduled for every node of the distributed system. The times for these
events are chosen with uniform distribution between initial time limits
taken from input file. The above are valid, if the user has selected spontaneous
initialization for all nodes. In case, the user selects spontaneous initialization
for some nodes, then at the beginning of the simulation, an INITPROTOCOL
event is scheduled for each of the selected nodes. Information about the
time on which these events are bound to happen is taken from the network
description file (Section 6).
-
RECMES
-
This event corresponds to the receipt of a message from a neighbour. When
this event occurs the global variable CURMESS contains the currently
received message and information about it is contained in its structure.
-
TIMEOUTS
-
Theses events correspond to the timeout of some local timers contained
in every node and can be used by some special protocols such as Archimedean
protocols. A timer can be started in an action and made to cause a timeout
after a number of steps (local steps), and can be stopped (canceled) as
well. These timeouts have predefined names TIMEOUT_1, TIMEOUT_2, ..., TIMEOUT_5
in analogy with the 5 timers that are supported for each node. The timers
can be handled with their predefined names TIMER1, TIMER2 , ... , TIMER5.
For more information about using timer, refer to Section 7.2.3.
During the simulation if a node decides to fall asleep and restart the
protocol it can change its state to SLEEPING and issue the system
call init_event.
At last, the simulation ends when a node while executing an action,
decides to stop the simulation of the protocol and issues the system call
simul_end.



Next:Protocol
modelUp:LYDIAN
modelPrevious:LYDIAN
modelContents
Ha Hoai Phuong
2002-11-11