Você está na página 1de 25

SIMULATION BASICS

FOR FORMAL MODEL


SPECIFICATION
PREPARED BY
SIDDHARTH BHORE(06)
VIKAS SHARMA (49)

What is Distributed system?

A set of nodes connected by a network ,


which appears to its users as single
coherent system.

A distributed system is single consolidated


system consisting of multiple high
performance computers connected by high
speed communication links.

The communication between computers is


established through message passing.

A Distributed System Example

Different nodes connected to a distributed system at the centre backed by


serveral other distributed systems.

Message communication techniques


in a distributed system
In a Distributed system messages are transferred either as
point-to-point or Multicast or Broadcast to all nodes.

The two basic method for communication are as follows.


Message-passing approach
Shared memory approach

Message Passing
Message passing approach

In a message passing system, multiple processes communicate by


exchanging messages through a communication link.

Shared Memory
Shared memory approach

Processes communicate via shared memory in a shared memory


system

Shared memory systems vs Message passing


systems

Shared memory systems are more expensive and


are assembled with custom built components.

Message passing systems are more prevalent as


they are considered from easily available
components.

Message transferring techniques

The messages are transferred either as

1.

Point

to Point

2.

Multicast

3.

Broadcast

to all nodes.

Message transferring techniques

Point-to-point

Unicast

Broadcast

WHAT IS SIMULATION ?

Computer simulation is the discipline of designing a model of


an actual or theoretical physical system, executing the
model on a digital computer, and analyzing the execution
output.

The act of simulating something first requires that a model


be developed; this model represents the key characteristics
or behaviors/functions of the selected physical or abstract
system or process.

What are Formal Methods


(here)?

Formal methodsare mathematical approaches


to software and system development which
support the rigorous specification, design and
verification of computer systems.

Mathematical techniques for developing


computer-based systems :

Programs

Languages

Systems

Model

What is Model ?

Abstraction of relevant system properties.

(the quality of dealing with ideas rather than events)

Models may be mathematical, physical, or


logical representations of a system, entity,
phenomenon, or process.

Why construct or learn model ?

Real world is complex , model simplifies the complexity.

Modeling Benefits

What can modeling do for us ?

help solving problems

Making algorithms

Simulate part failure and identify the loading


conditions that cause them

Validate the likely safety and survival of a physical


prototype before

Select materials that meet weight, strength, and


budget requirements

What are different types of


models ?

Discrete event models :


Often described by state transition systems evolves ,
moving from one step to another at discrete time steps.

Continuous models :

Often described by differential equations involving


variables which can take real continues values

Basic Model of message


passing systems
In message passing systems, the processors transfer information
between them using messages sent explicitly on bidirectional
channels.
The information path between them can be defined by a
unidirectional graph where nodes represent processors and edges
represent communication channels between the nodes.
1

P0

P
2

2
2

P4

1
3

P3

P2

Contd..

The above diagram describes a simple network of 5 processors.


Processors P0 to P3 are connected in a loop and this is shown by edges
between them.
P4 is connected to only P3
There is no edge between P4 to P0.
The edges are outlets and they are numbered from 1 to 3.
P3 has 3 edges, P0 and P2 have two edges each, and P4 has only one edge.

Types of Message Passing


System

Asynchronous systems

In asynchronous system, operations (instructions,calculations,logic, etc.) are


coordinated by one, or more, centralizedclock signals. An asynchronous digital
system, in contrast, has no global clock.

Asynchronous systems do not depend on strict arrival times of signals or messages for
reliable operation.

e.g. : SMS sent on a mobile.

Synchronous systems

Synchronous systems have a definite upper bound on the delivery time.

The sender keeps waiting till the message is delivered to the receiver.

The sender and the receiver are both locked till the event is completed
unlike receiving an SMS which can be read at leisure.

Communication Systems

The communication subsystem forms an interface between the


processors through which two processors communicate with each other.

Communication system will differ for different systems.

This system varies in different situations which are as follows:

Interface for message passing (send and receive)

Interface for shared memory (invocation and response on shared


objects)

Generic model for two types of


message passing system

The two types of generic message-passing systems are:

Asynchronous point-to-point message passing system.

Asynchronous broadcast messaging

Contd..

Asynchronous point-to-point message passing


system work with two commands

send i (X) and

receive i(x) where X is the set of messages.

Node 1

Send i

Message
Passing
Interface

Receive l

Node 2

Message passing interface between two node

i) Sendi(X): I/p event of message-passing system from node i. It sends (X) of


messages. Sendi contains addresses of sender and receiver. There is atleast
one message for each receiver. Sender receiver follows the interconnection
topology.

ii)Receive(X): An o/p event of the message-passing system. X may be a set


of empty message or contain valid information. Every message in the
receive has to have a corresponding Send(i) with the same content.

iii)If every sequence in the set of messages in all receive(i) events has a
mapping M to a set message in Send(i), for all i, then the sequence is
allowable.

Additionally it has the following properties.

a) integrity: M is well defined. It means that all messages sent were received
at destination.

B)No Duplicate: M is one to one. There are no duplicates.

C)Liveness :Every message which is sent is received.

Asynchronous Broadcast

When the same message is sent across all the nodes in the network it becomes
broadcast event. The broadcast event can be explained by the diagram described
earlier.

i) b-sendi(x)

Node 1

and

Sendi

ii)b-receivei(x,j)

Message
Passing
Interface

Receive i

Node 2

Asynchronous Broadcast (cont..)

i)b-sendi(x): An input event of the broadcast service for node i. It sends a


message x to all nodes.

B-receivei (x,j) : An output event of the broadcast service for node I receiving
message x sent by node j.

iii) If each b-recvi(x,j) is linked to the previous b-sendi(x) with a mapping M and
the message contains the same contents then it is called an allowable sequence.
It has the following properties.

a)Intergrity : M is well defined. Every received message was sent earlier by some
other node. No message was spurious.

b)No duplicates: For each node I, no message is received more than once.

c)Liveness : For each node I, the restriction of M is such that every broadcast
message is received once.

*All the above properties get modified if you consider failure of message!

Você também pode gostar