Index: sample/pingpong/PingPong.cpp
===================================================================
--- sample/pingpong/PingPong.cpp	(revision 2432)
+++ sample/pingpong/PingPong.cpp	(revision 2473)
@@ -1,3 +1,2 @@
-
 #include "PingPong.h"
 #include "ariba/utility/configuration/Configuration.h"
@@ -11,8 +10,8 @@
 
 // logging
-use_logging_cpp( PingPong);
+use_logging_cpp( PingPong );
 
 // the service id of the ping pong service
-ServiceID PingPong::PINGPONG_ID = ServiceID(111);
+ServiceID PingPong::PINGPONG_ID = ServiceID( 111 );
 
 // construction
@@ -27,11 +26,11 @@
 void PingPong::startup() {
 
+	logging_info( "starting up PingPong service ... " );
+
 	// create ariba module
-	logging_info("Creating ariba underlay module ... ");
+	logging_debug( "creating ariba underlay module ... " );
 	ariba = new AribaModule();
 
-	logging_info("Starting up PingPong service ... ");
-
-	// --- get config ---
+	// get the configuration object
 	Configuration& config = Configuration::instance();
 
@@ -66,27 +65,23 @@
 	node->start();
 
-	if (!isInitiator) {
-		node->join(spovnetName);
-	} else {
-		node->initiate(spovnetName);
-	}
+	// initiate or join the spovnet
+	if (!isInitiator) node->join(spovnetName);
+	else node->initiate(spovnetName);
 
 	// bind communication and node listener
 	node->bind(this);
 	node->bind(this, PingPong::PINGPONG_ID);
-
+	
 	// ping pong started up...
-	logging_info("PingPong started up");
+	logging_info( "pingpong started up ");
 }
 
 // implementation of the startup interface
 void PingPong::shutdown() {
-	logging_info("PingPong service starting shutdown sequence ...");
+
+	logging_info( "pingpong service starting shutdown sequence ..." );
 
 	// stop timer
 	Timer::stop();
-
-	// leave spovnet
-	node->leave();
 
 	// unbind listeners
@@ -94,18 +89,29 @@
 	node->unbind( this, PingPong::PINGPONG_ID );
 
+	// leave spovnet
+	node->leave();
+
+	// stop the ariba module
 	ariba->stop();
+
+	// delete node and ariba module
 	delete node;
 	delete ariba;
 
-	logging_info("PingPong service shut down!");
+	// now we are completely shut down
+	logging_info( "pingpong service shut down" );
 }
 
 // node listener interface
 void PingPong::onJoinCompleted( const SpoVNetID& vid ) {
-	logging_info("PingPong node join completed, spovnetid=" << vid.toString() );
+	logging_info( "pingpong node join completed, spovnetid=" << vid.toString() );
+
+	// start the timer to ping every second
+	Timer::setInterval( 1000 );
+	Timer::start();
 }
 
 void PingPong::onJoinFailed( const SpoVNetID& vid ) {
-	logging_info("PingPong node join failed, spovnetid=" << vid.toString() );
+	logging_error(" pingpong node join failed, spovnetid=" << vid.toString() );
 }
 
@@ -115,14 +121,26 @@
 }
 
-void PingPong::onMessage(Message* msg, const NodeID& remote, const LinkID& lnk =
-		LinkID::UNSPECIFIED) {
-	PingPongMessage* incoming = msg->decapsulate<PingPongMessage> ();
+void PingPong::onMessage(Message* msg, const NodeID& remote, 
+		const LinkID& lnk = LinkID::UNSPECIFIED) {
 
-	logging_info("received ping message on link " << lnk.toString()
-			<< " from node with id " << (int) incoming->getid());
+	PingPongMessage* pingmsg = msg->decapsulate<PingPongMessage> ();
+
+	logging_info( "received ping message on link " << lnk.toString()
+			<< " from node " << remote.toString()
+			<< ": " << pingmsg->toString() );
 }
 
 // timer event
 void PingPong::eventFunction() {
+	
+	// we ping all nodes that are known in the overlay structure
+	// this can be all nodes (OneHop) overlay or just some neighbors
+	// in case of a Chord or Kademlia structure
+	
+	logging_info( "pinging overlay neighbors with ping id " << ++pingId );
+
+	PingPongMessage pingmsg( pingId );
+	node->sendBroadcastMessage( pingmsg, PingPong::PINGPONG_ID );
+
 }
 
Index: sample/pingpong/PingPong.h
===================================================================
--- sample/pingpong/PingPong.h	(revision 2432)
+++ sample/pingpong/PingPong.h	(revision 2473)
@@ -4,9 +4,8 @@
 #include "ariba/ariba.h"
 #include "PingPongMessage.h"
+#include "ariba/utility/system/StartupInterface.h"
+#include "ariba/utility/system/Timer.h"
 
 using namespace ariba;
-
-#include "ariba/utility/system/StartupInterface.h"
-#include "ariba/utility/system/Timer.h"
 using ariba::utility::StartupInterface;
 using ariba::utility::Timer;
@@ -55,5 +54,5 @@
 	Node* node;
 
-	// flag, wheter this node is the initiator of this spovnet
+	// flag, wheter this node initiates or just joins the spovnet
 	bool isInitiator;
 
@@ -65,5 +64,6 @@
 };
 
-//ARIBA_SIMULATION_SERVICE(PingPong);
+// needed for simulation support
+ARIBA_SIMULATION_SERVICE(PingPong);
 
 }}} // namespace ariba, application, pingpong
