View
212
Download
0
Embed Size (px)
Citation preview
Distributed Algorithms Simulator
By Har-Tal Oded
Supervised by Dr Shlomi Dolev
Project’s goal:
Designing and implementing a simulator for Designing and implementing a simulator for distributed algorithms, which will help to distributed algorithms, which will help to
understand the behavior of distributed systems, understand the behavior of distributed systems, and exploring the area of self-stabilizing and exploring the area of self-stabilizing
distributed algorithmsdistributed algorithms..
B.Sc Final Project
C on cep tsIm p lem en ta tion
Distributed Algorithm s
Research
C on cep ts
D is trib u ted B F SD is trib u ted Token R in gD is trib u ted L ead er E lc tion
Im p lem en ta tion
Self Stabilizing Distributed Algorithm s
E ven t D riven P rog ram m in gG rap h ic U ser In te rfaceTh read M an eg m en t
D yn am ica lly load o f java c lasses
Java V irtu a l M ach in e
Java Program m ing
Research
Development
Im p lem en ta tion o f an ab s trac t c lass P rocessor
Im p lem en ta tion o f a C om m u n ica tion g rap h
Im p lem en ta tion o f G rap h ic In te rface c lasses
Im p lem en ta tion o f p red e fin ed A lg orith m s c lasses
D em on s tra tin g an d tes tin g
D es ig n in g a G rap h ic U ser In te rface
D es ig n in g C om m u n ica tion con cep ts
D es ig n in g A b s trac tion m od e l o f D is trib u ted A log orith m
Simulator’s Structure
Sim ulatorG UIM ain w in d ow ,m en u s an d
even t h an d lin g
G UI dialogsin te rface fo r u se rs com m an d s
Propertyin te rface fo r view in g
variab les
User-Defined Algorithm
ProcessorR u n n in g a D is trib u ted a lg o rith m
ControllerC on tro lin g b eh avio ro f each p rocessor
Com m unicationG raphh o ld s sys tem 's top o log y
Sim ulator en g in e o f p rog ram
Using The Simulator
Running simulation
Designing a distributed algorithm
Allocating processorswhile dynamically loading
their algorithms
Implementing algorithm in Java,extending class processor
and using processor API
Defining system topology
Implementing a Distributed Algorithm
Processor inspector
Communication Graph
log
Users menu
Processor
A Simulation View
Controlling a Simulation
Enabling processor
Watch value
Watch name
Processor ID
Algorithm name
Running processor a single step
Design Time Features
• Implementing algorithms in Java , using JDK. User can write any kind of desired algorithm.
• Extended yet flexible API provided. Easy methods were implemented for user convenience.
• Sending and receiving any kind of Java Objects by reference .
User can design any kind of communication object.
• Self design of processor properties User can decide what properties to inspect , and how
should they be inspected.
Run Time Features• Loading Algorithms in run time.
User can load any processor in system with any desired algorithm .
• Changing internal values of processorsUser can change any of the visible properties of each processor ,
during each stage of the running simulation. • Changing distributed system topology
User can add and remove processors , connect and disconnect them ,and watch the consequences on the system.
• Defining simulation’s flow of control User can choose to run a single processor alone , disable some processors, run all processors one or many rounds.
• Viewing debugging informationUser can insert his code with debug messages and display them on simulator
log window.
Example : Implementing Distributed BFS
Sending and receiving data
Performing algorithm
Overriding method’s initialize and singleStep
Extending Class Processor
Example : Running Distributed BFS
Graph leader
number in processor view = distance from leader
Distance from leader