Development of A Distributed Systems Simulator For Event Based Middle Ware
Development of A Distributed Systems Simulator For Event Based Middle Ware
SIMULATOR
A
Project Report
Submitted in Partial Fulfilment of The Degree
Bachelor of Technology
of
National Institute of Technology Calicut
By
Arun P Y2094
Jose Mathew Y2044
Rakesh S Y2048
Arun P Y2094
Jose Mathew Y2044
Rakesh S Y2048
In Partial Fulfilment of
Bachelor of Technology degree
_____________________________________________________________________
2
Acknowledgement
3
Table of Content
1 INTRODUCTION..................................................................................................6
1.1 Project Overview............................................................................................6
1.2 Motivation for Project ....................................................................................6
1.3 Project Objectives ..........................................................................................7
2 BACKGROUND....................................................................................................8
2.1 Background Research.....................................................................................8
2.2 Platform and Software Choice for the project................................................8
3 DSSIM PACKAGES..............................................................................................9
3.1 DSSIM Packages..........................................................................................11
3.1.1 The dssim package ...............................................................................11
3.1.2 The util package ...................................................................................11
4 DESIGN ...............................................................................................................12
4.1 Network Types .............................................................................................12
4.2 Overlay Network ..........................................................................................12
4.3 Failure and Recovery ...................................................................................12
5 IMPLEMENTATION ..........................................................................................13
5.1 DSSIM..........................................................................................................13
SimModel .............................................................................................................13
SimEvent ..............................................................................................................13
5.2 Link Types....................................................................................................14
5.3 Logical Network...........................................................................................15
5.4 Link Failure and Recovery...........................................................................16
6 Testing..................................................................................................................18
7 Future Work .........................................................................................................19
8 Conclusion............................................................................................................20
9 REFERENCES.....................................................................................................21
4
Abstract
5
1 INTRODUCTION
This Chapter outlines the aims of the project and motivation behind its
implementation.
6
1.3 Project Objectives
7
2 BACKGROUND
The background section of this project looks at areas considered during the
development phase of the simulator. This includes research conducted on Hermes a
research paper on event based middleware, and DSSIM a skeletal distributed system
simulator. This section will also consider tools and the programming language used
for implementation.
DSSIM was downloaded, installed and configured. Further studies on its inputs and
outputs were made as a case study. DSSIM is a highly scalable distributed system
simulator. It supports simulations with 105 physical nodes. DSSIM has moderate CPU
and memory requirements. The performance of routing algorithms and other
distributed algorithms, protocols etc. can be measured by DSSIM. DSSIM models
latency and hop count of routing messages in the physical network. DSSIM uses a
hierarchical two-level distance vector routing algorithm
DSSIM was implemented on Java. Since this project used DSSIM as a basis to add
new features, the language Java is used. Java provides an extensive API for graphical
development. This APIs were used for developing the visualisations of both logical
and physical topologies. Netbeans IDE, an integrated development environment for
Java is used for the implementation.
8
3 DSSIM PACKAGES
For easier evaluation of routing models and better feasibility, it was decided that the
routing models would be implemented on the distributed systems simulator DSSIM.
The distributed systems simulator DSSim is implemented in Java as a single-threaded
discrete event simulator. The primary design consideration for DSSIM was
scalability. Therefore, it supports simulations with 10 physical nodes while only
having moderate CPU and memory requirements. DSSIM models the latency and the
hop count of routing messages in the physical network, and it also maintains a
measure for bandwidth consumption. Note that congestion caused by bandwidth-
limited links is not modeled in DSSIM.
9
An overview of the internal architecture of DSSim is provided in Figure 3.1. The core
of DSSim is an event loop that takes simulation events from a time-ordered event
queue and executes them. A simulation event is, for example, the request of a logical
node to send a message, or the routing of a message by a physical node. Events are
added to the event queue by logical nodes through the EnvironmentIF interface.
This interface enables a logical node to interact with its environment and handle
messaging, monitoring, and time aspects during the simulation. The execution of
logical nodes is scheduled by the simulator, which calls a runNode method whenever
a particular node is supposed to run.
The functionality of the simulator can be extended with plug-ins that are inserted into
the event loop and can process simulation events. Currently there are four plug-ins
implemented in DSSim: a trace plug-in that records all simulation events in a file for
later replay, a statistics plug-in that gathers statistics during the simulation, and two
visualisation plug-ins. The visualisation plug-ins allow the display of a graphical
representation of the logical and physical network topologies and can visualise the
routing of messages and the internal state of logical nodes.
10
3.1 DSSIM Packages
The DSSIM package literally has the entire DSSIM contained in it. It contains sub-
packages that contain the code for the simulator, the codes for generating physical and
logical topologies, the code for generating a node, the codes for generating
visualisations etc. The sub packages in this package are:
1. The environment package: Provides all the interface classes which are
essential to implement an addressing scheme, a messaging scheme, a
simulation monitor, a clock etc.
2. The examples package: Has the source code giving examples as to how to
generate a running code for simulation purposes.
3. The node package: Has all the files necessary for making a node.
4. The simulator package : Is the package that 'contains' the simulator. This has
the necessary files for creating a simulator, handling simulation events in
message queues, sending messages from one node to the other simulation Eg a
real network etc, for creating a topology, for creating messaging and
monitoring interfaces, for selecting a routing model etc.
There is also a util package that provides some other utility classes which may be
used. Examples of some files are ByteArray.java, Debug.java, RingBuffer.java etc.
11
4 DESIGN
This chapter describes the design decisions made for achieving aims that were
specified in the introduction. This includes the new features added to DSSIM.
Initially DSSIM supported only one kind of network. All the links in the network
were taken as identical. Diversity of networks must be incorporated for a realistic
simulation. So three generic classes of networks namely fast, normal and reliable,
were introduced. Using this new feature the event brokers can communicate in a
diverse way. They could choose either a fast network for fastest delivery or reliable
for secure communication.
Nodes in the overlay network can be designed as a set of brokers having a one to one
correspondence with a selected set of physical nodes. . Nodes in the overlay can be
thought of as being connected by virtual or logical links, each of which corresponds to
a path, perhaps through many physical links, in the underlying network.
Failure is a very common thing in actual networks. In very large networks, failures
occur frequently. So failure simulation is an indispensable thing in realistic
simulation. So we need to simulate random failures of network links. Algorithms in
distributed systems should be able to cope with network failures. So simulation of
failures is very important.
The simulator should be able to dynamically recover from failures. Failure recovery
should be achieved by modification of the routing tables. Now the messages will be
routed according to the new routing tables.
12
5 IMPLEMENTATION
This section describes the development of the final project solution based upon the
decision in the Design chapter and ideas formed during this phase.
5.1 DSSIM
SimModel
SimModel defines the properties of the network to be simulated. It has got four main
attributes namely routing model, node mapping, node processing delay and router
processing delay. Routing model defines the strategy used for computing the routing
tables in the physical level. For example, All Shortest Path Routing Model. All
Shortest Path Routing Model will compute the shortest path between nodes.
Node Mapping contains information about all logical nodes in the network. It has a
mapping from logical nodes to their corresponding physical nodes. Node Processing
Delay is the time needed to process a message by the destination node. Router
Processing Delay is the time needed by an intermediate node to route the message to
its destination node.
SimEvent
Dssim
Topology
DSSIM provides some predefined topologies such as ring topology, transit stub
topology, random topology etc.
13
5.2 Link Types
Three new types of links were introduced into DSSIM, name Fast link, Normal Link
and Reliable Link. These three types of links differ in time delays, fast being the
fastest and reliable being the slowest. They also differ in their probability of failures,
reliable being the less probable and fast being most probable.
Three matrices were added for each type of links in the routing model to compute
individual routing tables. The matrices were delay matrix to represent the delay
between two nodes, nexthop matrix for finding the next hop in routing a message and
linkmatrix to specify the next link to follow in routing.
Routing strategy in case of multiple links is to follow the specified link to the
maximum. If a route cannot be found, then we will compromise with other link types
(most appropriate). For example, if we are finding a reliable route between two nodes,
we will follow reliable links to the maximum, and if it is not available we will
compromise with a normal link or in the worst case with a fast link.
The major additions and modifications are made in the following classes of the
DSSIM.
EN
14
5.3 Logical Network
Logical network consists of set logical nodes and set of logical links. Logical nodes
can be considered as a set of brokers having a one to one correspondence with a
selected set of physical nodes. Node Mapping maps the logical nodes to physical
nodes. Logical Links were added as connections between these logical nodes.
There exists three types of logical networks, as there are three types of physical links.
Thus there can be three logical links between same logical nodes.
Messages are sent between logical nodes. But routing is done in the physical level.
We introduced a new header field to specify the type of network through which it
should be routed. Logical Nodes can alter these headers according to the routing
strategy in the overlay level. On receiving a message in the physical node, it will route
the message according to the header in the message.
To compute the logical links, messages would be sent between logical nodes.
Consider a message M is send between logical nodes A and B.
If that message reaches a logical node, say C, before reaching any other logical node,
then
nextHop[A][B] = C
nextHop[A][C] = C
else if message M reaches B before reaching any other logical node, then
nextHop[A][B] = B
nextHop[B][A] = A
The major additions and modifications are made in the following classes of the
DSSIM.
15
5.4 Link Failure and Recovery
16
Fig 2 Physical Network after Link Failure
The major additions and modifications are made in the following classes of the
DSSIM.
17
6 Testing
The DSSIM package contains some standard test programs which can used for testing
the new simulator. The test programs are slightly modified to verify the working of
new features added. The following example algorithms are tested on the simulator.
TopologyDiscovery.java
This is a simple algorithm used to discover all logical nodes in the overlay network.
Fig 3 TopologyDiscoveryPhysicalVisualisationExample
RandomMessageSimulation.java
This is another algorithm which sends messages randomly between Logical nodes.
18
7 Future Work
The future work may include adding different types of nodes such as reliable node
and unreliable node. It may also include considerations of node processing delay
variations. Node Failures can also be included in the simulator with failure
frequencies different for different types of nodes.
Extending the network types to other topologies such as transit stub topology,
random topology. Extending support to different routing models as well.
19
8 Conclusion
The new simulator is found to be more realistic than the old one. Different test
programs verified the new features added. This simulator is a better platform for the
testing of new internet applications and protocols. Future work includes the usage of
this simulator for testing the new event based middleware developed.
20
9 REFERENCES
21
This document was created with Win2PDF available at http://www.daneprairie.com.
The unregistered version of Win2PDF is for evaluation or non-commercial use only.