PlanetSim Release 3.0 Candidate in depth Jordi Pujol Ahulló Universitat Rovira i Virgili [email protected]
Jan 16, 2016
PlanetSim Release 3.0 Candidatein depth
Jordi Pujol Ahulló
Universitat Rovira i Virgili
Copyright
• © University Rovira i Virgili
• Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; provided its original author is mentioned and the link to http://libre.act-europe.fr/ is kept at the bottom of every non-title slide. A copy of the license is available at:
• http://www.fsf.org/licenses/fdl.html
Index
• Introduction: Use cases
• Architecture: Simulator, Node, RouteMessage structure, Factories, RouteMessagePool
• Configuration: tuning
• Life cycle: Simulation, Applications, Application level messages
Introduction
• Open code project• Framework for overlay network
simulation• Implemented in Java• Layered architecture (decouple p2p
protocols from applications)• Advanced visualization output
(Pajek, GML)
Use Cases: Researcher
2. Build network with nodes
6. Stabilize
3. Build network by events
<extends>
Researcher
4. Serialize network
5. Deserialize network
7. Run applications over
the network
<extends>
<includes>
1. Simulate time-steps
<includes>
Use cases: Researcher (II)
1. Simulate time-steps:Run specified number of time-steps within current network. The simulator processes all nodes this number of time-steps and delivers generated messages at each time-step to the target nodes.
2. Build network with nodes:Build network with the specified number of nodes. Can be built a zero-sized network. A cofigured number of time-steps is run between each node join.
Use cases: Researcher (III)
3. Build network by events1. A zero-sized network has to be built. 2. All events in specified file will be loaded.3. Only node events: { JOIN | LEAVE | FAIL }
4. Serialize networkSave on disk the current network. Waste time only once: reuse simulated networks different times.
5. Deserialize networkLoad from disk a serialized network. It will be presented as before being serialized. Continue your research at this point.
Use cases: Researcher (IV)
6. StabilizePost-conditions:
- Overlay network stabilized - Only overlay maintenance messages- No application level messages remain to deliver
7. Run application over the networkAdd/Register the applications to the nodes, focus of your research, and evaluate its operation.
Use cases: Developer
2. Implement applications
Developer
1. Implement KBR
Use cases: Developer (II)
1. Implement KBR• Implement new KBR overlay networks, like
Pastry or Chord.• Mainly, it requires the related node
implementation, following the new overlay protocol.
2. Implement applicationsDevelop new compatible applications for these KBR overlay networks, not focused on any specific KBR.
PlanetSim Architecture
PlanetSim Architecture cont’dNetwork layer Node layer Application layer
Node Architecture
• Layered definition
Message
RouteMessage
Node N Node M
NodeHandle
Node
EndPoint
EndPoint
…
Application
Application
…
NodeHandle
Node
EndPoint
EndPoint
…
Application
Application
…
RouteMessage
RouteMessage Structure
• Extensible• Invariants:
– Source: 48– Destination: 4– Key: 8123– AppId: “”– Message: “Put
sth”
• Variants:– NextHop: 56
Source Destination NextHop Key AppId Message
K54
2m-1 0N1
N48
N51
N56
K4
NextHop
Destination
Factories
• Interfaces that follow the Factory Method design pattern– Goal: Build elemental instances, without mean
real implementations– {Application|EndPoint|Node|NodeHandle|
Id}Factory
• GenericFactory:– A “super-factory”, that uses specified factories
implementations within simulation
RouteMessagePool
• Time and resources eficiency is required• Java Garbage Collector is our “enemy”. No
“new XYZ(…);” in your code!!• A lot of RouteMessages are used within a
simulation• RouteMessages have a very short life time• A Pool of RouteMessages is the most
suitable design: getRouteMessage( ) & freeRouteMessage( )
• Note: The RouteMessage’s life cycle is handled by the programmer
Configuration: Tuning
• Example: Running a test called “SIMNETTEST”
Simulator master.properties
chord.properties
symphony.properties
trivial.properties
. . .
GenericApp.start("../conf/master.properties", TestNames.SIMNETTEST,false,false,false,false);
//TestNames.SIMNETTEST = “SIMNETTEST”
SIMNETTEST = ../conf/chord.properties#SIMNETTEST = ../conf/symphony.properties#SIMNETTEST = ../conf/chord.propertiesSIMNETTEST = ../conf/symphony.properties
Without recompilin
g!
Configuration: Tuning cont’d
• Steps for adding a new test (recommended):– Select a non repeated name for the test and
put it in planet.test.TestNames– Put this name into the conf/master.properties
and associate the final(s) configuration filesFACTORY_TESTAPPFACTORY = ../conf/chord.properties#FACTORY_TESTAPPFACTORY = ../conf/symphony.properties#FACTORY_TESTAPPFACTORY = ../conf/trivial.properties
– Create your own configuration files (if necessary), based on {chord|symphony}.properties
– Build the test itself under planet.test hierarchy
Simulation’s life cycle
Simulation’s life cycle cont’d
Applications management
Applications management cont’d
Application level messages life cycle
Application level messages life cycle