Index: /source/ariba/Makefile.am
===================================================================
--- /source/ariba/Makefile.am	(revision 6797)
+++ /source/ariba/Makefile.am	(revision 6822)
@@ -436,7 +436,10 @@
 
 libariba_la_SOURCES += \
-  utility/visual/OvlVis.cpp
-
-nobase_libariba_la_HEADERS += \
-  utility/visual/OvlVis.h
-  
+  utility/visual/OvlVis.cpp \
+  utility/visual/ServerVis.cpp \
+  utility/visual/DddVis.cpp
+
+nobase_libariba_la_HEADERS += \
+  utility/visual/OvlVis.h \
+  utility/visual/ServerVis.h \
+  utility/visual/DddVis.h
Index: /source/ariba/Node.cpp
===================================================================
--- /source/ariba/Node.cpp	(revision 6797)
+++ /source/ariba/Node.cpp	(revision 6822)
@@ -120,5 +120,5 @@
 
 NodeID Node::generateNodeId(const Name& name) const {
-	if (name == Name::UNSPECIFIED) return Name::random().toNodeId();
+	if (name == Name::UNSPECIFIED) return NodeID(Identifier::random());
 	else return name.toNodeId();
 }
Index: /source/ariba/overlay/BaseOverlay.cpp
===================================================================
--- /source/ariba/overlay/BaseOverlay.cpp	(revision 6797)
+++ /source/ariba/overlay/BaseOverlay.cpp	(revision 6822)
@@ -56,12 +56,18 @@
 
 #include "ariba/utility/visual/OvlVis.h"
+#include "ariba/utility/visual/DddVis.h"
+#include "ariba/utility/visual/ServerVis.h"
 
 namespace ariba {
 namespace overlay {
+
+#define visual 				ariba::utility::DddVis::instance()
+#define visualIdOverlay 	ariba::utility::ServerVis::NETWORK_ID_BASE_OVERLAY
+#define visualIdBase		ariba::utility::ServerVis::NETWORK_ID_BASE_COMMUNICATION
 
 class ValueEntry {
 public:
 	ValueEntry( const Data& value ) : ttl(0), last_update(time(NULL)),
-		last_change(time(NULL)), value(value.clone()) {
+	last_change(time(NULL)), value(value.clone()) {
 	}
 
@@ -122,5 +128,5 @@
 		vector<Data> vect;
 		BOOST_FOREACH( ValueEntry& e, values )
-			vect.push_back( e.get_value() );
+		vect.push_back( e.get_value() );
 		return vect;
 	}
@@ -163,5 +169,5 @@
 						if (verbose)
 							std::cout << "DHT: Republished value. Refreshing value timestamp."
-							<< std::endl;
+								<< std::endl;
 						return;
 					}
@@ -171,5 +177,5 @@
 				if (verbose)
 					std::cout << "DHT: Added value to "
-					<< " key=" << key << " with value=" << value << std::endl;
+						<< " key=" << key << " with value=" << value << std::endl;
 				entry.values.push_back( ValueEntry( value ) );
 				entry.values.back().set_ttl(ttl);
@@ -181,5 +187,5 @@
 		if (verbose)
 			std::cout << "DHT: New key value pair "
-			<< " key=" << key << " with value=" << value << std::endl;
+				<< " key=" << key << " with value=" << value << std::endl;
 
 		// add new entry
@@ -274,6 +280,6 @@
 LinkDescriptor* BaseOverlay::getDescriptor( const LinkID& link, bool communication ) {
 	BOOST_FOREACH( LinkDescriptor* lp, links )
-		if ((communication ? lp->communicationId : lp->overlayId) == link)
-			return lp;
+				if ((communication ? lp->communicationId : lp->overlayId) == link)
+					return lp;
 	return NULL;
 }
@@ -281,6 +287,6 @@
 const LinkDescriptor* BaseOverlay::getDescriptor( const LinkID& link, bool communication ) const {
 	BOOST_FOREACH( const LinkDescriptor* lp, links )
-		if ((communication ? lp->communicationId : lp->overlayId) == link)
-			return lp;
+				if ((communication ? lp->communicationId : lp->overlayId) == link)
+					return lp;
 	return NULL;
 }
@@ -313,10 +319,10 @@
 	// search for a descriptor that is already up
 	BOOST_FOREACH( LinkDescriptor* lp, links )
-		if (lp->autolink && lp->remoteNode == node && lp->service == service && lp->up && lp->keepAliveMissed == 0)
-			return lp;
+				if (lp->autolink && lp->remoteNode == node && lp->service == service && lp->up && lp->keepAliveMissed == 0)
+					return lp;
 	// if not found, search for one that is about to come up...
 	BOOST_FOREACH( LinkDescriptor* lp, links )
-		if (lp->autolink && lp->remoteNode == node && lp->service == service && lp->keepAliveMissed == 0 )
-			return lp;
+	if (lp->autolink && lp->remoteNode == node && lp->service == service && lp->keepAliveMissed == 0 )
+		return lp;
 	return NULL;
 }
@@ -328,5 +334,5 @@
 		if (!ld->up) continue;
 		OverlayMsg msg( OverlayMsg::typeLinkAlive,
-			OverlayInterface::OVERLAY_SERVICE_ID, nodeId, ld->remoteNode );
+				OverlayInterface::OVERLAY_SERVICE_ID, nodeId, ld->remoteNode );
 		if (ld->relayed) msg.setRouteRecord(true);
 		send_link( &msg, ld->overlayId );
@@ -416,10 +422,10 @@
 			bool found = false;
 			BOOST_FOREACH(NodeID& id, nodes)
-				if (id  == ld->remoteNode) found = true;
+			if (id  == ld->remoteNode) found = true;
 			if (found) continue;
 			i++;
 			nodes.push_back(ld->remoteNode);
 			if ((i%1) == 1) s << "<tr style=\"background-color=#f0f0f0;\">";
-				else s << "<tr>";
+			else s << "<tr>";
 			s << "<td>" << ld->overlayId.toString().substr(0,4) << "..</td>";
 			s << "<td>" << ld->remoteNode.toString().substr(0,4) << "..</td>";
@@ -455,6 +461,6 @@
 	LinkDescriptor* rhsld = getDescriptor(rhs);
 	if (lhsld==NULL || rhsld==NULL
-		|| !lhsld->up || !rhsld->up
-		|| lhsld->remoteNode != rhsld->remoteNode) return -1;
+			|| !lhsld->up || !rhsld->up
+			|| lhsld->remoteNode != rhsld->remoteNode) return -1;
 
 	if ((lhsld->remoteLink^lhsld->overlayId)<(rhsld->remoteLink^lhsld->overlayId)  )
@@ -503,5 +509,5 @@
 	if (destination == nodeId) {
 		logging_warn("Sent message to myself. Handling message.")
-		Message msg;
+				Message msg;
 		msg.encapsulate(message);
 		handleMessage( &msg, NULL );
@@ -518,5 +524,5 @@
 			logging_warn("Could not send message. No relay hop found to "
 					<< destination)
-			return -1;
+					return -1;
 		}
 	}
@@ -528,5 +534,5 @@
 		if (next_id.isUnspecified()) {
 			logging_warn("Could not send message. No next hop found to " <<
-				destination );
+					destination );
 			return -1;
 		}
@@ -568,5 +574,5 @@
 	if (ldr->relayed) {
 		logging_debug("Resolving direct link for relayed link to "
-			<< ldr->remoteNode);
+				<< ldr->remoteNode);
 		ld = getRelayLinkTo( ldr->remoteNode );
 		if (ld==NULL) {
@@ -592,5 +598,5 @@
 
 seqnum_t BaseOverlay::send_node( OverlayMsg* message, const NodeID& remote,
-	const ServiceID& service) {
+		const ServiceID& service) {
 	message->setSourceNode(nodeId);
 	message->setDestinationNode(remote);
@@ -627,6 +633,6 @@
 		// relay link still used and alive?
 		if (ld==NULL
-			|| !ld->isDirectVital()
-			|| difftime(route.used, time(NULL)) > 8) {
+				|| !ld->isDirectVital()
+				|| difftime(route.used, time(NULL)) > 8) {
 			logging_info("Forgetting relay information to node "
 					<< route.node.toString() );
@@ -658,6 +664,6 @@
 	// handle relayed messages from real links only
 	if (ld == NULL
-		|| ld->relayed
-		|| message->getSourceNode()==nodeId ) return;
+			|| ld->relayed
+			|| message->getSourceNode()==nodeId ) return;
 
 	// update usage information
@@ -691,9 +697,9 @@
 				// route has a shorter hop count or old link is dead? yes-> replace
 				if (route.hops > message->getNumHops()
-					|| rld == NULL
-					|| !rld->isDirectVital()) {
+						|| rld == NULL
+						|| !rld->isDirectVital()) {
 					logging_info("Updating relay information to node "
-						<< route.node.toString()
-						<< " reducing to " << message->getNumHops() << " hops.");
+							<< route.node.toString()
+							<< " reducing to " << message->getNumHops() << " hops.");
 					route.hops = message->getNumHops();
 					route.link = ld->overlayId;
@@ -710,5 +716,5 @@
 		route.used = time(NULL);
 		logging_info("Remembering relay information to node "
-			<< route.node.toString());
+				<< route.node.toString());
 		relay_routes.push_back(route);
 	}
@@ -739,7 +745,7 @@
 
 BaseOverlay::BaseOverlay() :
-	bc(NULL), overlayInterface(NULL), nodeId(NodeID::UNSPECIFIED),
-	spovnetId(SpoVNetID::UNSPECIFIED), state(BaseOverlayStateInvalid),
-	sideport(&SideportListener::DEFAULT), started(false), counter(0) {
+			bc(NULL), overlayInterface(NULL), nodeId(NodeID::UNSPECIFIED),
+			spovnetId(SpoVNetID::UNSPECIFIED), state(BaseOverlayStateInvalid),
+			sideport(&SideportListener::DEFAULT), started(false), counter(0) {
 	dht = new DHT();
 	localDHT = new DHT();
@@ -818,5 +824,5 @@
 		state = BaseOverlayStateCompleted;
 		BOOST_FOREACH( NodeListener* i, nodeListeners )
-			i->onJoinCompleted( spovnetId );
+		i->onJoinCompleted( spovnetId );
 
 		//ovl.visChangeNodeIcon ( ovlId, nodeId, OvlVis::ICON_ID_CAMERA );
@@ -853,10 +859,10 @@
 	BOOST_FOREACH( LinkDescriptor* ld, links ) {
 		if( ld->service != OverlayInterface::OVERLAY_SERVICE_ID )
-		servicelinks.push_back( ld->overlayId );
+			servicelinks.push_back( ld->overlayId );
 	}
 
 	// drop all service links
 	BOOST_FOREACH( LinkID lnk, servicelinks )
-		dropLink( lnk );
+	dropLink( lnk );
 
 	// let the node leave the spovnet overlay interface
@@ -867,9 +873,12 @@
 	// drop still open bootstrap links
 	BOOST_FOREACH( LinkID lnk, bootstrapLinks )
-		bc->dropLink( lnk );
+	bc->dropLink( lnk );
 
 	// change to inalid state
 	state = BaseOverlayStateInvalid;
 	//ovl.visShutdown( ovlId, nodeId, string("") );
+
+	visual.visShutdown(visualIdOverlay, nodeId, "");
+	visual.visShutdown(visualIdBase, nodeId, "");
 
 	// inform all registered services of the event
@@ -898,8 +907,13 @@
 
 		BOOST_FOREACH( NodeListener* i, nodeListeners )
-			i->onJoinFailed( spovnetId );
+		i->onJoinFailed( spovnetId );
 
 		return;
 	}
+
+	visual.configure("127.0.0.1", 50005);
+	//visual.configure("141.3.161.8", 50005);
+	visual.visCreate(visualIdBase, nodeId, "", "");
+	visual.visCreate(visualIdOverlay, nodeId, "", "");
 }
 
@@ -907,5 +921,5 @@
 
 const LinkID BaseOverlay::establishLink( const EndpointDescriptor& remoteEp,
-	const NodeID& remoteId, const ServiceID& service ) {
+		const NodeID& remoteId, const ServiceID& service ) {
 
 	// establish link via overlay
@@ -914,7 +928,7 @@
 	else
 
-	// establish link directly if only ep is known
-	if (remoteId.isUnspecified())
-		return establishDirectLink(remoteEp, service );
+		// establish link directly if only ep is known
+		if (remoteId.isUnspecified())
+			return establishDirectLink(remoteEp, service );
 
 }
@@ -922,5 +936,5 @@
 /// call base communication's establish link and add link mapping
 const LinkID BaseOverlay::establishDirectLink( const EndpointDescriptor& ep,
-	const ServiceID& service ) {
+		const ServiceID& service ) {
 
 	/// find a service listener
@@ -941,5 +955,5 @@
 	/// establish link and add mapping
 	logging_info("Establishing direct link " << ld->communicationId.toString()
-		<< " using " << ep.toString());
+			<< " using " << ep.toString());
 
 	return ld->communicationId;
@@ -948,5 +962,5 @@
 /// establishes a link between two arbitrary nodes
 const LinkID BaseOverlay::establishLink( const NodeID& remote,
-	const ServiceID& service ) {
+		const ServiceID& service ) {
 
 	// do not establish a link to myself!
@@ -967,8 +981,8 @@
 	// debug message
 	logging_info(
-		"Sending link request with"
-		<< " link=" << ld->overlayId.toString()
-		<< " node=" << ld->remoteNode.toString()
-		<< " serv=" << ld->service.toString()
+			"Sending link request with"
+			<< " link=" << ld->overlayId.toString()
+			<< " node=" << ld->remoteNode.toString()
+			<< " serv=" << ld->service.toString()
 	);
 
@@ -1023,5 +1037,5 @@
 	if( ld == NULL ) {
 		logging_error("Could not send message. "
-			<< "Link not found id=" << link.toString());
+				<< "Link not found id=" << link.toString());
 		return -1;
 	}
@@ -1050,5 +1064,5 @@
 
 seqnum_t BaseOverlay::sendMessage(const Message* message,
-	const NodeID& node, const ServiceID& service) {
+		const NodeID& node, const ServiceID& service) {
 
 	// find link for node and service
@@ -1060,6 +1074,6 @@
 		// debug output
 		logging_info( "No link to send message to node "
-			<< node.toString() << " found for service "
-			<< service.toString() << ". Creating auto link ..."
+				<< node.toString() << " found for service "
+				<< service.toString() << ". Creating auto link ..."
 		);
 
@@ -1183,5 +1197,5 @@
 	// already bound? yes-> warning
 	NodeListenerVector::iterator i =
-		find( nodeListeners.begin(), nodeListeners.end(), listener );
+			find( nodeListeners.begin(), nodeListeners.end(), listener );
 	if( i != nodeListeners.end() ) {
 		logging_warn("Node listener " << listener << " is already bound!" );
@@ -1212,5 +1226,5 @@
 
 void BaseOverlay::onLinkUp(const LinkID& id,
-	const address_v* local, const address_v* remote) {
+		const address_v* local, const address_v* remote) {
 	logging_debug( "Link up with base communication link id=" << id );
 
@@ -1221,11 +1235,11 @@
 	if( std::find(bootstrapLinks.begin(), bootstrapLinks.end(), id) != bootstrapLinks.end() ){
 		logging_info(
-			"Join has been initiated by me and the link is now up. " <<
-			"Sending out join request for SpoVNet " << spovnetId.toString()
+				"Join has been initiated by me and the link is now up. " <<
+				"Sending out join request for SpoVNet " << spovnetId.toString()
 		);
 
 		// send join request message
 		OverlayMsg overlayMsg( OverlayMsg::typeJoinRequest,
-			OverlayInterface::OVERLAY_SERVICE_ID, nodeId );
+				OverlayInterface::OVERLAY_SERVICE_ID, nodeId );
 		JoinRequest joinRequest( spovnetId, nodeId );
 		overlayMsg.encapsulate( &joinRequest );
@@ -1249,5 +1263,5 @@
 		// -> wait for update message!
 
-	// link mapping found? -> send update message with node-id and service id
+		// link mapping found? -> send update message with node-id and service id
 	} else {
 		logging_info( "onLinkUp descriptor (initiated locally):" << ld );
@@ -1271,7 +1285,7 @@
 			// note: necessary to validate the link on the remote side!
 			logging_info( "Sending out update" <<
-				" for service " << ld->service.toString() <<
-				" with local node id " << nodeId.toString() <<
-				" on link " << ld->overlayId.toString() );
+					" for service " << ld->service.toString() <<
+					" with local node id " << nodeId.toString() <<
+					" on link " << ld->overlayId.toString() );
 
 			// compile and send update message
@@ -1285,5 +1299,5 @@
 
 void BaseOverlay::onLinkDown(const LinkID& id,
-	const address_v* local, const address_v* remote) {
+		const address_v* local, const address_v* remote) {
 
 	// erase bootstrap links
@@ -1318,6 +1332,6 @@
 
 void BaseOverlay::onLinkChanged(const LinkID& id,
-	const address_v* oldlocal, const address_v* newlocal,
-	const address_v* oldremote, const address_v* newremote) {
+		const address_v* oldlocal, const address_v* newlocal,
+		const address_v* oldremote, const address_v* newremote) {
 
 	// get descriptor for link
@@ -1335,5 +1349,5 @@
 
 void BaseOverlay::onLinkFail(const LinkID& id,
-	const address_v* local, const address_v* remote) {
+		const address_v* local, const address_v* remote) {
 	logging_debug( "Link fail with base communication link id=" << id );
 
@@ -1353,5 +1367,5 @@
 
 void BaseOverlay::onLinkQoSChanged(const LinkID& id, const address_v* local,
-	const address_v* remote, const QoSParameterSet& qos) {
+		const address_v* remote, const QoSParameterSet& qos) {
 	logging_debug( "Link quality changed with base communication link id=" << id );
 
@@ -1363,5 +1377,5 @@
 
 bool BaseOverlay::onLinkRequest( const LinkID& id, const address_v* local,
-	const address_v* remote ) {
+		const address_v* remote ) {
 	logging_debug("Accepting link request from " << remote->to_string() );
 	return true;
@@ -1389,6 +1403,6 @@
 	if( joinReq->getSpoVNetID() != spovnetId ) {
 		logging_error(
-			"Received join request for spovnet we don't handle " <<
-			joinReq->getSpoVNetID().toString() );
+				"Received join request for spovnet we don't handle " <<
+				joinReq->getSpoVNetID().toString() );
 		return false;
 	}
@@ -1405,8 +1419,8 @@
 	assert( overlayInterface != NULL );
 	logging_debug( "Using bootstrap end-point "
-		<< getEndpointDescriptor().toString() )
+			<< getEndpointDescriptor().toString() )
 	OverlayParameterSet parameters = overlayInterface->getParameters();
 	OverlayMsg retmsg( OverlayMsg::typeJoinReply,
-		OverlayInterface::OVERLAY_SERVICE_ID, nodeId );
+			OverlayInterface::OVERLAY_SERVICE_ID, nodeId );
 	JoinReply replyMsg( spovnetId, parameters,
 			allow, getEndpointDescriptor() );
@@ -1448,5 +1462,5 @@
 		// inform all registered services of the event
 		BOOST_FOREACH( NodeListener* i, nodeListeners )
-			i->onJoinFailed( spovnetId );
+		i->onJoinFailed( spovnetId );
 
 		delete replyMsg;
@@ -1459,5 +1473,5 @@
 
 	logging_debug( "Using bootstrap end-point "
-		<< replyMsg->getBootstrapEndpoint().toString() );
+			<< replyMsg->getBootstrapEndpoint().toString() );
 
 	// create overlay structure from spovnet parameter set
@@ -1468,5 +1482,5 @@
 
 		overlayInterface = OverlayFactory::create(
-			*this, replyMsg->getParam(), nodeId, this );
+				*this, replyMsg->getParam(), nodeId, this );
 
 		// overlay structure supported? no-> fail!
@@ -1503,5 +1517,5 @@
 		// inform all registered services of the event
 		BOOST_FOREACH( NodeListener* i, nodeListeners )
-			i->onJoinCompleted( spovnetId );
+		i->onJoinCompleted( spovnetId );
 
 		delete replyMsg;
@@ -1526,11 +1540,11 @@
 	const ServiceID& service = overlayMsg->getService();
 	logging_debug( "Received data for service " << service.toString()
-		<< " on link " << overlayMsg->getDestinationLink().toString() );
+			<< " on link " << overlayMsg->getDestinationLink().toString() );
 
 	// delegate data message
 	getListener(service)->onMessage(
-		overlayMsg,
-		overlayMsg->getSourceNode(),
-		overlayMsg->getDestinationLink()
+			overlayMsg,
+			overlayMsg->getSourceNode(),
+			overlayMsg->getDestinationLink()
 	);
 
@@ -1550,6 +1564,6 @@
 	// update our link mapping information for this link
 	bool changed =
-		( ld->remoteNode != overlayMsg->getSourceNode() )
-		|| ( ld->service != overlayMsg->getService() );
+			( ld->remoteNode != overlayMsg->getSourceNode() )
+			|| ( ld->service != overlayMsg->getService() );
 
 	// set parameters
@@ -1591,5 +1605,5 @@
 
 		logging_debug("Link id=" << ld->overlayId.toString() <<
-			" has been denied by service " << ld->service.toString() << ", dropping link");
+				" has been denied by service " << ld->service.toString() << ", dropping link");
 
 		// prevent onLinkDown calls to the service
@@ -1668,5 +1682,5 @@
 	if (ldn == NULL) {
 		logging_error( "No link request pending for "
-			<< overlayMsg->getDestinationLink().toString() );
+				<< overlayMsg->getDestinationLink().toString() );
 		return false;
 	}
@@ -1681,8 +1695,8 @@
 	// debug message
 	logging_debug( "Link request reply received. Establishing link"
-		<< " for service " << overlayMsg->getService().toString()
-		<< " with local id=" << overlayMsg->getDestinationLink()
-		<< " and remote link id=" << overlayMsg->getSourceLink()
-		<< " to " << overlayMsg->getSourceEndpoint().toString()
+			<< " for service " << overlayMsg->getService().toString()
+			<< " with local id=" << overlayMsg->getDestinationLink()
+			<< " and remote link id=" << overlayMsg->getSourceLink()
+			<< " to " << overlayMsg->getSourceEndpoint().toString()
 	);
 
@@ -1702,5 +1716,5 @@
 	if( ldn->messageQueue.size() > 0 ) {
 		logging_info( "Sending out queued messages on link " <<
-			ldn->overlayId.toString() );
+				ldn->overlayId.toString() );
 		BOOST_FOREACH( Message* msg, ldn->messageQueue ) {
 			sendMessage( msg, ldn->overlayId );
@@ -1715,5 +1729,5 @@
 	// try to replace relay link with direct link
 	ldn->communicationId =
-		bc->establishLink( overlayMsg->getSourceEndpoint() );
+			bc->establishLink( overlayMsg->getSourceEndpoint() );
 
 	return true;
@@ -1725,5 +1739,5 @@
 	if ( rld != NULL ) {
 		logging_debug("Keep-Alive for " <<
-			overlayMsg->getDestinationLink() );
+				overlayMsg->getDestinationLink() );
 		if (overlayMsg->isRouteRecord())
 			rld->routeRecord = overlayMsg->getRouteRecord();
@@ -1765,10 +1779,10 @@
 /// handles an incoming message
 bool BaseOverlay::handleMessage( const Message* message, LinkDescriptor* ld,
-	const LinkID bcLink ) {
+		const LinkID bcLink ) {
 	logging_debug( "Handling message: " << message->toString());
 
 	// decapsulate overlay message
 	OverlayMsg* overlayMsg =
-		const_cast<Message*>(message)->decapsulate<OverlayMsg>();
+			const_cast<Message*>(message)->decapsulate<OverlayMsg>();
 	if( overlayMsg == NULL ) return false;
 
@@ -1788,5 +1802,5 @@
 	// handle signaling messages (do not route!)
 	if (overlayMsg->getType()>=OverlayMsg::typeSignalingStart &&
-		overlayMsg->getType()<=OverlayMsg::typeSignalingEnd ) {
+			overlayMsg->getType()<=OverlayMsg::typeSignalingEnd ) {
 		overlayInterface->onMessage(overlayMsg, NodeID::UNSPECIFIED, LinkID::UNSPECIFIED);
 		delete overlayMsg;
@@ -1796,8 +1810,8 @@
 	// message for reached destination? no-> route message
 	if (!overlayMsg->getDestinationNode().isUnspecified() &&
- 		 overlayMsg->getDestinationNode() != nodeId ) {
+			overlayMsg->getDestinationNode() != nodeId ) {
 		logging_debug("Routing message "
-			<< " from " << overlayMsg->getSourceNode()
-			<< " to " << overlayMsg->getDestinationNode()
+				<< " from " << overlayMsg->getSourceNode()
+				<< " to " << overlayMsg->getDestinationNode()
 		);
 		route( overlayMsg );
@@ -1818,33 +1832,33 @@
 	switch ( overlayMsg->getType() ) {
 
-		// data transport messages
-		case OverlayMsg::typeData:
-			ret = handleData(overlayMsg, ld); 			break;
+	// data transport messages
+	case OverlayMsg::typeData:
+		ret = handleData(overlayMsg, ld); 			break;
 
 		// overlay setup messages
-		case OverlayMsg::typeJoinRequest:
-			ret = handleJoinRequest(overlayMsg, bcLink ); 	break;
-		case OverlayMsg::typeJoinReply:
-			ret = handleJoinReply(overlayMsg, bcLink ); 	break;
+	case OverlayMsg::typeJoinRequest:
+		ret = handleJoinRequest(overlayMsg, bcLink ); 	break;
+	case OverlayMsg::typeJoinReply:
+		ret = handleJoinReply(overlayMsg, bcLink ); 	break;
 
 		// link specific messages
-		case OverlayMsg::typeLinkRequest:
-			ret = handleLinkRequest(overlayMsg, ld ); 	break;
-		case OverlayMsg::typeLinkReply:
-			ret = handleLinkReply(overlayMsg, ld ); 	break;
-		case OverlayMsg::typeLinkUpdate:
-			ret = handleLinkUpdate(overlayMsg, ld );  	break;
-		case OverlayMsg::typeLinkAlive:
-			ret = handleLinkAlive(overlayMsg, ld );   	break;
-		case OverlayMsg::typeLinkDirect:
-			ret = handleLinkDirect(overlayMsg, ld );  	break;
+	case OverlayMsg::typeLinkRequest:
+		ret = handleLinkRequest(overlayMsg, ld ); 	break;
+	case OverlayMsg::typeLinkReply:
+		ret = handleLinkReply(overlayMsg, ld ); 	break;
+	case OverlayMsg::typeLinkUpdate:
+		ret = handleLinkUpdate(overlayMsg, ld );  	break;
+	case OverlayMsg::typeLinkAlive:
+		ret = handleLinkAlive(overlayMsg, ld );   	break;
+	case OverlayMsg::typeLinkDirect:
+		ret = handleLinkDirect(overlayMsg, ld );  	break;
 
 		// handle unknown message type
-		default: {
-			logging_error( "received message in invalid state! don't know " <<
+	default: {
+		logging_error( "received message in invalid state! don't know " <<
 				"what to do with this message of type " << overlayMsg->getType() );
-			ret = false;
-			break;
-		}
+		ret = false;
+		break;
+	}
 	}
 
@@ -1910,6 +1924,134 @@
 	stabilizeLinks();
 	stabilizeDHT();
-}
-
+	updateVisual();
+}
+
+void BaseOverlay::updateVisual(){
+
+	//
+	// update base overlay structure
+	//
+
+	static NodeID pre = NodeID::UNSPECIFIED;
+	static NodeID suc = NodeID::UNSPECIFIED;
+
+	vector<NodeID> nodes = this->getOverlayNeighbors(false);
+
+	if(nodes.size() == 0){
+
+		if(pre != NodeID::UNSPECIFIED){
+			visual.visDisconnect(visualIdOverlay, this->nodeId, pre, "");
+			pre = NodeID::UNSPECIFIED;
+		}
+		if(suc != NodeID::UNSPECIFIED){
+			visual.visDisconnect(visualIdOverlay, this->nodeId, suc, "");
+			suc = NodeID::UNSPECIFIED;
+		}
+
+	} // if(nodes.size() == 0)
+
+	if(nodes.size() == 1){
+		// only one node, make this pre and succ
+		// and then go into the node.size()==2 case
+		//nodes.push_back(nodes.at(0));
+
+		if(pre != nodes.at(0)){
+			pre = nodes.at(0);
+			if(pre != NodeID::UNSPECIFIED)
+				visual.visConnect(visualIdOverlay, this->nodeId, pre, "");
+		}
+	}
+
+	if(nodes.size() == 2){
+
+		// old finger
+		if(nodes.at(0) != pre){
+			if(pre != NodeID::UNSPECIFIED)
+				visual.visDisconnect(visualIdOverlay, this->nodeId, pre, "");
+			pre = NodeID::UNSPECIFIED;
+		}
+		if(nodes.at(1) != suc){
+			if(suc != NodeID::UNSPECIFIED)
+				visual.visDisconnect(visualIdOverlay, this->nodeId, suc, "");
+			suc = NodeID::UNSPECIFIED;
+		}
+
+		// connect with fingers
+		if(pre == NodeID::UNSPECIFIED){
+			pre = nodes.at(0);
+			if(pre != NodeID::UNSPECIFIED)
+				visual.visConnect(visualIdOverlay, this->nodeId, pre, "");
+		}
+		if(suc == NodeID::UNSPECIFIED){
+			suc = nodes.at(1);
+			if(suc != NodeID::UNSPECIFIED)
+				visual.visConnect(visualIdOverlay, this->nodeId, suc, "");
+		}
+
+	} //if(nodes.size() == 2)
+
+//	{
+//		logging_error("================================");
+//		logging_error("my nodeid " << nodeId.get(MAX_KEYLENGTH-16, 16));
+//		logging_error("================================");
+//		if(nodes.size()>= 1){
+//			logging_error("real pre " << nodes.at(0).toString());
+//			logging_error("real pre " << nodes.at(0).get(MAX_KEYLENGTH-16, 16));
+//		}
+//		if(nodes.size()>= 2){
+//			logging_error("real suc " << nodes.at(1).toString());
+//			logging_error("real suc " << nodes.at(1).get(MAX_KEYLENGTH-16, 16));
+//		}
+//		logging_error("================================");
+//		if(pre == NodeID::UNSPECIFIED){
+//			logging_error("pre: unspecified");
+//		}else{
+//			unsigned int prei = pre.get(MAX_KEYLENGTH-16, 16);
+//			logging_error("pre: " << prei);
+//		}
+//		if(suc == NodeID::UNSPECIFIED){
+//			logging_error("suc: unspecified");
+//		}else{
+//			unsigned int suci = suc.get(MAX_KEYLENGTH-16, 16);
+//			logging_error("suc: " << suci);
+//		}
+//		logging_error("================================");
+//	}
+
+	//
+	// update base communication links
+	//
+
+	static set<NodeID> linkset;
+	set<NodeID> remotenodes;
+	BOOST_FOREACH( LinkDescriptor* ld, links ) {
+		if (!ld->isVital() || ld->service != OverlayInterface::OVERLAY_SERVICE_ID)
+			continue;
+
+		if (ld->routeRecord.size()>1 && ld->relayed) {
+			for (size_t i=1; i<ld->routeRecord.size(); i++)
+				remotenodes.insert( ld->routeRecord[ld->routeRecord.size()-i-1] );
+		} else {
+			remotenodes.insert(ld->remoteNode);
+		}
+	}
+
+	// which links are old and need deletion?
+	BOOST_FOREACH(NodeID n, linkset){
+		if(remotenodes.find(n) == remotenodes.end()){
+			visual.visDisconnect(visualIdBase, this->nodeId, n, "");
+			linkset.erase(n);
+		}
+	}
+
+	// which links are new and need creation?
+	BOOST_FOREACH(NodeID n, remotenodes){
+		if(linkset.find(n) == linkset.end()){
+			visual.visConnect(visualIdBase, this->nodeId, n, "");
+			linkset.insert(n);
+		}
+	}
+
+}
 
 // ----------------------------------------------------------------------------
@@ -1954,6 +2096,6 @@
 	if (!overlayInterface->isClosestNodeTo(msg->getDestinationNode())) {
 		logging_debug("Routing DHT message to closest node "
-			<< " from " << msg->getSourceNode()
-			<< " to " << msg->getDestinationNode()
+				<< " from " << msg->getSourceNode()
+				<< " to " << msg->getDestinationNode()
 		);
 		route( msg );
@@ -1966,5 +2108,5 @@
 	case OverlayMsg::typeDHTPut: {
 		BOOST_FOREACH( Data value, dhtMsg->getValues() )
-			dht->put(dhtMsg->getKey(), value, dhtMsg->getTTL() );
+					dht->put(dhtMsg->getKey(), value, dhtMsg->getTTL() );
 		break;
 	}
@@ -1987,5 +2129,5 @@
 		if (dhtMsg->hasValues()) {
 			BOOST_FOREACH( Data value, dhtMsg->getValues() )
-					dht->remove(dhtMsg->getKey(), value );
+							dht->remove(dhtMsg->getKey(), value );
 		} else
 			dht->remove( dhtMsg->getKey() );
Index: /source/ariba/overlay/BaseOverlay.h
===================================================================
--- /source/ariba/overlay/BaseOverlay.h	(revision 6797)
+++ /source/ariba/overlay/BaseOverlay.h	(revision 6822)
@@ -70,7 +70,4 @@
   class CommunicationListener;
   class SideportListener;
-  namespace utility {
-    class OvlVis;
-  }
 }
 
@@ -110,8 +107,4 @@
 using ariba::utility::seqnum_t;
 using ariba::utility::Timer;
-using ariba::utility::OvlVis;
-
-//#define ovl OvlVis::instance()
-//#define ovlId OvlVis::NETWORK_ID_BASE_OVERLAY
 
 namespace ariba {
@@ -519,4 +512,6 @@
 	typedef vector<NodeID> JoiningNodes;
 	JoiningNodes joiningNodes;
+
+	void updateVisual();
 };
 
Index: /source/ariba/utility/visual/DddVis.cpp
===================================================================
--- /source/ariba/utility/visual/DddVis.cpp	(revision 6822)
+++ /source/ariba/utility/visual/DddVis.cpp	(revision 6822)
@@ -0,0 +1,306 @@
+// [License]
+// The Ariba-Underlay Copyright
+//
+// Copyright (c) 2008-2009, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
+//
+// Institute of Telematics
+// UniversitÃ€t Karlsruhe (TH)
+// Zirkel 2, 76128 Karlsruhe
+// Germany
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARIBA PROJECT OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// The views and conclusions contained in the software and documentation
+// are those of the authors and should not be interpreted as representing
+// official policies, either expressed or implied, of the Institute of
+// Telematics.
+// [License]
+
+#include "DddVis.h"
+
+namespace ariba {
+namespace utility {
+
+const string DddVis::del = ":";
+use_logging_cpp(DddVis);
+
+DddVis::DddVis() : commandid(0) {
+	srand(time(NULL));
+}
+
+DddVis::~DddVis(){
+}
+
+void DddVis::sendMessage( const string msg, NETWORK_ID nid ) {
+	sendSocket( msg + "\n" );
+}
+
+long DddVis::getCommandID() {
+	return ++commandid;
+}
+
+long DddVis::getTimestamp() {
+	return 0; //time(NULL);
+}
+
+unsigned int DddVis::getNodeNumber(const NodeID& node){
+	NodeSet::iterator i = nodeSet.find(node);
+
+	if(i == nodeSet.end()){
+		unsigned int number = node.get(MAX_KEYLENGTH-16, 16);
+		nodeSet.insert(make_pair(node, number));
+		return number;
+	} else {
+		return i->second;
+	}
+}
+
+void DddVis::visCreate(
+		NETWORK_ID network,
+		NodeID& node,
+		string nodename,
+		string info
+){
+	//
+	// create layer first if not already done
+	//
+
+	if(layerSet.find(network) == layerSet.end()){
+
+		//
+		// create layer
+		//
+
+		{
+			ostringstream out;
+			out		<< CREATE_LAYER_TYPE		<< del
+					<< getCommandID()			<< del
+					<< getTimestamp()			<< del
+					<< getNetworkName(network)	<< del
+					<< 0						<< del;
+
+			sendMessage( out.str(), network );
+			layerSet.insert(network);
+		}
+
+		//
+		// set layer layout
+		//
+
+		{
+			LayoutType layout = FORCE_LAYOUT;
+			LayoutOrderStrategie order = ORDER_RANDOMLY;
+
+			switch(network){
+			case NETWORK_ID_BASE_COMMUNICATION:
+				layout = FORCE_LAYOUT;
+				order = ORDER_RANDOMLY;
+				break;
+			case NETWORK_ID_BASE_OVERLAY:
+				layout = CIRCULAR_LAYOUT;
+				order = ORDER_BY_ID;
+				break;
+			case NETWORK_ID_MCPO:
+				layout = FORCE_LAYOUT;
+				order = ORDER_RANDOMLY;
+				break;
+			}
+
+			ostringstream out;
+			out		<< SET_CLUSTER_LAYOUT_TYPE	<< del
+					<< getCommandID()			<< del
+					<< getTimestamp()			<< del
+					<< getNetworkName(network)	<< del
+					<< 0						<< del
+					<< layout					<< del
+					<< order					<< del;
+
+			sendMessage( out.str(), network );
+		}
+
+	} // if(layerSet.find(network) == layerSet.end())
+
+	//
+	// create node
+	//
+
+	ostringstream out;
+	out 	<< CREATE_NODE_TYPE 		<< del
+			<< getCommandID() 			<< del
+			<< getTimestamp() 			<< del
+			<< getNetworkName(network) 	<< del
+			<< 0						<< del
+			<< getNodeNumber(node) 		<< del
+			<< 0x00000000				<< del
+			<< "null" 					<< del;
+
+	sendMessage( out.str(), network );
+}
+
+void DddVis::visConnect(
+		NETWORK_ID network,
+		NodeID& srcnode,
+		NodeID& destnode,
+		string info
+){
+	// if we already have a link between the two nodes
+	// we just ignore the call and leave the old link
+
+	if( networkLinks.exists( network, NodePair(srcnode,destnode) )) return;
+
+	ostringstream out;
+	unsigned long edgekey = networkLinks.insert( network, NodePair(srcnode,destnode) );
+
+	out	<< CREATE_EDGE_TYPE 			<< del
+			<< getCommandID() 			<< del
+			<< getTimestamp() 			<< del
+			<< getNetworkName(network) 	<< del
+			<< 0						<< del
+			<< getNodeNumber(srcnode) 	<< del
+			<< getNodeNumber(destnode) 	<< del
+			<< edgekey 					<< del
+			<< 0x00000000 				<< del
+			<< "null" 					<< del;
+
+	sendMessage( out.str(), network );
+}
+
+void DddVis::visDisconnect(
+		NETWORK_ID network,
+		NodeID& srcnode,
+		NodeID& destnode,
+		string info
+){
+	if( !networkLinks.exists(network, NodePair(srcnode, destnode)) ) return;
+
+	unsigned long edgekey = networkLinks.get( network, NodePair(srcnode, destnode) );
+	networkLinks.remove( network, NodePair(srcnode, destnode) );
+
+	ostringstream out;
+	out	<< REMOVE_EDGE_TYPE 		<< del
+		<< getCommandID() 			<< del
+		<< getTimestamp() 			<< del
+		<< getNetworkName(network)	<< del
+		<< edgekey 					<< del;
+
+	sendMessage( out.str(), network );
+}
+
+void DddVis::visShutdown(
+		NETWORK_ID network,
+		NodeID& node,
+		string info
+){
+	ostringstream out;
+
+	out	<< REMOVE_NODE_TYPE 		<< del
+		<< getCommandID() 			<< del
+		<< getTimestamp() 			<< del
+		<< getNetworkName(network) 	<< del
+		<< getNodeNumber(node) 		<< del;
+
+	sendMessage( out.str(), network );
+}
+
+void DddVis::visChangeNodeColor (
+		NETWORK_ID network,
+		NodeID& node,
+		unsigned char r,
+		unsigned char g,
+		unsigned char b
+){
+	ostringstream out;
+
+	out	<< SET_NODE_COLOR_TYPE 		<< del
+			<< getCommandID() 			<< del
+			<< getTimestamp() 			<< del
+			<< getNetworkName(network) 	<< del
+			<< getNodeNumber(node) 		<< del
+			<< makeColor(r, g, b) 		<< del;
+
+	sendMessage( out.str(), network );
+}
+
+int DddVis::makeColor(unsigned char r, unsigned char g, unsigned char b){
+	return ((r<<16)+(g<<8)+b);
+}
+
+void DddVis::visChangeNodeColor (
+		NETWORK_ID network,
+		NodeID& node,
+		NODE_COLORS color
+){
+	unsigned char r = 0;
+	unsigned char g = 0;
+	unsigned char b = 0;
+
+	switch( color ) {
+	case NODE_COLORS_GREY: 	r = 128; g = 128; b = 128; break;
+	case NODE_COLORS_GREEN:	r = 0;   g = 200; b = 0;   break;
+	case NODE_COLORS_RED:	r = 255; g = 0;   b = 0;   break;
+	}
+
+	visChangeNodeColor( network, node, r, g, b );
+}
+
+void DddVis::visChangeLinkColor (
+		NETWORK_ID network,
+		NodeID& srcnode,
+		NodeID& destnode,
+		unsigned char r,
+		unsigned char g,
+		unsigned char b
+){
+	ostringstream out;
+	unsigned long edgekey = networkLinks.get( network, NodePair(srcnode, destnode) );
+
+	out	<< SET_EDGE_COLOR_TYPE 		<< del
+			<< getCommandID() 			<< del
+			<< getTimestamp() 			<< del
+			<< getNetworkName(network) 	<< del
+			<< edgekey 					<< del
+			<< makeColor(r, g, b) 		<< del;
+
+	sendMessage( out.str(), network );
+}
+
+void DddVis::visChangeLinkColor (
+		NETWORK_ID network,
+		NodeID& srcnode,
+		NodeID& destnode,
+		NODE_COLORS color
+){
+	unsigned char r = 0;
+	unsigned char g = 0;
+	unsigned char b = 0;
+
+	switch( color ) {
+	case NODE_COLORS_GREY: 	r = 128; g = 128; b = 128; break;
+	case NODE_COLORS_GREEN:	r = 0;   g = 200; b = 0;   break;
+	case NODE_COLORS_RED:	r = 255; g = 0;   b = 0;   break;
+	}
+
+	visChangeLinkColor( network, srcnode, destnode, r, g, b );
+}
+
+}} // namespace ariba, common
Index: /source/ariba/utility/visual/DddVis.h
===================================================================
--- /source/ariba/utility/visual/DddVis.h	(revision 6822)
+++ /source/ariba/utility/visual/DddVis.h	(revision 6822)
@@ -0,0 +1,224 @@
+// [License]
+// The Ariba-Underlay Copyright
+//
+// Copyright (c) 2008-2009, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
+//
+// Institute of Telematics
+// UniversitÃ€t Karlsruhe (TH)
+// Zirkel 2, 76128 Karlsruhe
+// Germany
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARIBA PROJECT OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// The views and conclusions contained in the software and documentation
+// are those of the authors and should not be interpreted as representing
+// official policies, either expressed or implied, of the Institute of
+// Telematics.
+// [License]
+
+#ifndef DDDVIS_H__
+#define DDDVIS_H__
+
+#include <sstream>
+#include <iostream>
+#include <string>
+#include <map>
+#include <set>
+#include <boost/utility.hpp>
+#include "ariba/utility/types/NodeID.h"
+#include "ariba/utility/logging/Logging.h"
+#include "ariba/utility/system/Timer.h"
+#include "ariba/utility/misc/Helper.h"
+#include "ariba/utility/misc/KeyMapping.hpp"
+#include "ariba/utility/configuration/Configuration.h"
+#include "ariba/utility/visual/ServerVis.h"
+
+using std::set;
+using std::string;
+using std::map;
+using std::pair;
+using std::make_pair;
+using std::cout;
+using std::ostringstream;
+using ariba::utility::NodeID;
+using ariba::utility::Configuration;
+using ariba::utility::KeyMapping;
+using ariba::utility::Timer;
+
+namespace ariba {
+namespace utility {
+
+class DddVis : public ServerVis, private boost::noncopyable {
+	use_logging_h(DddVis);
+public:
+	static DddVis& instance() { static DddVis the_inst; return the_inst; }
+
+	//****************************************************************
+	// Node creation, node connections, status, node deletion, ...
+	//****************************************************************
+
+	/**
+	 * Create a node in the network that is initially unconnected.
+	 */
+	void visCreate (
+			NETWORK_ID network,
+			NodeID& node,
+			string nodename,
+			string info
+	);
+
+	/**
+	 * Connect two nodes using a link.
+	 */
+	void visConnect (
+			NETWORK_ID network,
+			NodeID& srcnode,
+			NodeID& destnode,
+			string info
+	);
+
+	/**
+	 * Disconnect the link between two nodes.
+	 */
+	void visDisconnect (
+			NETWORK_ID network,
+			NodeID& srcnode,
+			NodeID& destnode,
+			string info
+	);
+
+	/**
+	 * Delete a node from the network.
+	 */
+	void visShutdown (
+			NETWORK_ID network,
+			NodeID& node,
+			string info
+	);
+
+	//****************************************************************
+	// Node manipulation: change color, change icon
+	//****************************************************************
+
+	/**
+	 * Change the color of the node.
+	 */
+	void visChangeNodeColor (
+			NETWORK_ID network,
+			NodeID& node,
+			unsigned char r,
+			unsigned char g,
+			unsigned char b
+	);
+
+	/**
+	 * Change the color of the node.
+	 */
+	void visChangeNodeColor (
+			NETWORK_ID network,
+			NodeID& node,
+			NODE_COLORS color
+	);
+
+	/**
+	 * Change the link color
+	 */
+	void visChangeLinkColor (
+			NETWORK_ID network,
+			NodeID& srcnode,
+			NodeID& destnode,
+			unsigned char r,
+			unsigned char g,
+			unsigned char b
+	);
+
+	/**
+	 * Change the link color
+	 */
+	void visChangeLinkColor (
+			NETWORK_ID network,
+			NodeID& srcnode,
+			NodeID& destnode,
+			NODE_COLORS color
+	);
+
+protected:
+	DddVis();
+	virtual ~DddVis();
+
+private:
+
+	typedef enum _CommandType {
+		CREATE_LAYER_TYPE 			= 0,
+		CREATE_CLUSTER_TYPE 		= 1,
+		CREATE_NODE_TYPE 			= 2,
+		CREATE_EDGE_TYPE 			= 3,
+		REMOVE_LAYER_TYPE 			= 4,
+		REMOVE_CLUSTER_TYPE 		= 5,
+		REMOVE_NODE_TYPE 			= 6,
+		REMOVE_EDGE_TYPE 			= 7,
+		SET_CLUSTER_LAYOUT_TYPE 	= 8,
+		SET_NODE_COLOR_TYPE 		= 9,
+		SET_EDGE_COLOR_TYPE 		= 10,
+		SET_NODE_INFO_TYPE 			= 11,
+		SET_EDGE_INFO_TYPE 			= 12,
+		SET_LAYOUT_LEADER_TYPE 		= 13,
+	} CommandType;
+
+	typedef enum _LayoutType {
+		CIRCULAR_LAYOUT				= 0,
+		FORCE_LAYOUT				= 1,
+		LEADER_LAYOUT				= 2,
+		RANDOM_LAYOUT				= 3,
+	} LayoutType;
+
+	typedef enum _LayoutOrderStrategie {
+		ORDER_BY_ID					= 0,
+		ORDER_RANDOMLY				= 1,
+	} LayoutOrderStrategie;
+
+	long getCommandID();
+	long getTimestamp();
+	int makeColor(unsigned char r, unsigned char g, unsigned char b);
+	void sendMessage( const string msg, NETWORK_ID nid );
+	unsigned int getNodeNumber(const NodeID& node);
+
+	unsigned long commandid;
+	static const string del;
+
+	typedef set<ServerVis::NETWORK_ID> LayerSet;
+	LayerSet layerSet;
+
+	typedef map<NodeID,unsigned int> NodeSet;
+	NodeSet nodeSet;
+
+	typedef pair<NodeID, NodeID> NodePair;
+	typedef KeyMapping<NodePair> NetworkLinks;
+	NetworkLinks networkLinks;
+
+
+};
+
+}} // namespace ariba, common
+
+#endif // DDDVIS_H__
Index: /source/ariba/utility/visual/OvlVis.cpp
===================================================================
--- /source/ariba/utility/visual/OvlVis.cpp	(revision 6797)
+++ /source/ariba/utility/visual/OvlVis.cpp	(revision 6822)
@@ -42,50 +42,10 @@
 namespace utility {
 
-//*****************************************************
-//*****************************************************
-//*****************************************************
-
 use_logging_cpp(OvlVis);
 
-OvlVis::OvlVis() : socket(io_service), socketOpened(false) {
-
-	if( ! Configuration::haveConfig() ) return;
-	if( ! Configuration::instance().exists("DEMO_OvlVisIP") )   return;
-	if( ! Configuration::instance().exists("DEMO_OvlVisPort") ) return;
-
-	string serverIP = Configuration::instance().read<string>("DEMO_OvlVisIP");
-	string serverPort = Configuration::instance().read<string>("DEMO_OvlVisPort");
-	if( serverIP.length() == 0 || serverPort.length() == 0) return;
-
-	logging_debug( "connecting to ovlvis " + serverIP + " on " + serverPort );
-
-	tcp::resolver resolver(io_service);
-	tcp::resolver::query query(
-		serverIP,
-		serverPort,
-		tcp::resolver::query::passive |
-		tcp::resolver::query::address_configured |
-		tcp::resolver::query::numeric_service);
-
-	tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);
-	tcp::resolver::iterator end;
-
-	boost::system::error_code error = boost::asio::error::host_not_found;
-	while (error && endpoint_iterator != end){
-		socket.close();
-		socket.connect(*endpoint_iterator++, error);
-	}
-
-	if (error){
-		logging_warn( "OvlVis could not connect to GUI" );
-	} else {
-		socketOpened = true;
-	}
+OvlVis::OvlVis() {
 }
 
 OvlVis::~OvlVis(){
-
-	socket.close();
-
 }
 
@@ -115,9 +75,4 @@
 // 	}
 
-}
-
-void OvlVis::sendSocket(const string msg){
-	if( socket.is_open() && socketOpened )
-		socket.send( boost::asio::buffer(msg) );
 }
 
@@ -665,7 +620,3 @@
 }
 
-//*****************************************************
-//*****************************************************
-//*****************************************************
-
 }} // namespace ariba, common
Index: /source/ariba/utility/visual/OvlVis.h
===================================================================
--- /source/ariba/utility/visual/OvlVis.h	(revision 6797)
+++ /source/ariba/utility/visual/OvlVis.h	(revision 6822)
@@ -45,11 +45,8 @@
 #include <map>
 #include <boost/utility.hpp>
-#include <boost/asio.hpp>
-#include "ariba/utility/types/NodeID.h"
-#include "ariba/utility/logging/Logging.h"
 #include "ariba/utility/system/Timer.h"
 #include "ariba/utility/misc/Helper.h"
 #include "ariba/utility/misc/KeyMapping.hpp"
-#include "ariba/utility/configuration/Configuration.h"
+#include "ariba/utility/visual/ServerVis.h"
 
 using std::string;
@@ -59,7 +56,4 @@
 using std::cout;
 using std::ostringstream;
-using boost::asio::ip::tcp;
-using ariba::utility::NodeID;
-using ariba::utility::Configuration;
 using ariba::utility::KeyMapping;
 using ariba::utility::Timer;
@@ -68,20 +62,9 @@
 namespace utility {
 
-class OvlVis : private boost::noncopyable {
+class OvlVis : public ServerVis, private boost::noncopyable {
 	use_logging_h(OvlVis);
 public:
 	static OvlVis& instance() { static OvlVis the_inst; return the_inst; }
 
-	typedef enum _NETWORK_ID {
-		NETWORK_ID_BASE_COMMUNICATION 	= 1,
-				NETWORK_ID_BASE_OVERLAY = 2,
-				NETWORK_ID_EONSON 		= 3,
-				NETWORK_ID_MCPO 		= 4,
-				NETWORK_ID_CLIO 		= 5,
-				NETWORK_ID_VIDEOSTREAM 	= 6,
-				NETWORK_ID_GAME 		= 7,
-				NETWORK_ID_SECURITY 	= 8,
-	} NETWORK_ID;
-
 	//****************************************************************
 	// Node creation, node connections, status, node deletion, ...
@@ -162,10 +145,4 @@
 			unsigned char b
 	);
-
-	typedef enum _NODE_COLORS {
-		NODE_COLORS_GREY,
-		NODE_COLORS_GREEN,
-		NODE_COLORS_RED,
-	} NODE_COLORS;
 
 	/**
@@ -385,16 +362,8 @@
 protected:
 	OvlVis();
-	~OvlVis();
+	virtual ~OvlVis();
 
 private:
 	void sendMessage( const string msg, NETWORK_ID nid );
-	void sendSocket( const string msg );
-
-	/**
-	 * boost asio stuff for connecting to ovlvis
-	 */
-	boost::asio::io_service io_service;
-	tcp::socket socket;
-	volatile bool socketOpened;
 
 	typedef pair<NodeID, NodeID> NodePair;
Index: /source/ariba/utility/visual/ServerVis.cpp
===================================================================
--- /source/ariba/utility/visual/ServerVis.cpp	(revision 6822)
+++ /source/ariba/utility/visual/ServerVis.cpp	(revision 6822)
@@ -0,0 +1,117 @@
+// [License]
+// The Ariba-Underlay Copyright
+//
+// Copyright (c) 2008-2009, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
+//
+// Institute of Telematics
+// UniversitÃ€t Karlsruhe (TH)
+// Zirkel 2, 76128 Karlsruhe
+// Germany
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARIBA PROJECT OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// The views and conclusions contained in the software and documentation
+// are those of the authors and should not be interpreted as representing
+// official policies, either expressed or implied, of the Institute of
+// Telematics.
+// [License]
+
+#include "ServerVis.h"
+
+namespace ariba {
+namespace utility {
+
+use_logging_cpp(ServerVis);
+
+
+typedef enum _NETWORK_ID {
+	NETWORK_ID_BASE_COMMUNICATION 	= 1,
+			NETWORK_ID_BASE_OVERLAY 		= 2,
+			NETWORK_ID_EONSON 				= 3,
+			NETWORK_ID_MCPO 				= 4,
+			NETWORK_ID_CLIO 				= 5,
+			NETWORK_ID_VIDEOSTREAM 			= 6,
+			NETWORK_ID_GAME 				= 7,
+			NETWORK_ID_SECURITY 			= 8,
+} NETWORK_ID;
+
+string ServerVis::getNetworkName(NETWORK_ID network) const {
+	switch(network){
+		case NETWORK_ID_BASE_COMMUNICATION	: return "BaseCommunication";
+		case NETWORK_ID_BASE_OVERLAY 		: return "BaseOverlay";
+		case NETWORK_ID_EONSON 				: return "Eonson";
+		case NETWORK_ID_MCPO 				: return "Multicast/Multipeer Overlay";
+		case NETWORK_ID_CLIO 				: return "CLIO";
+		case NETWORK_ID_VIDEOSTREAM 		: return "Video";
+		case NETWORK_ID_GAME 				: return "Game";
+		case NETWORK_ID_SECURITY 			: return "Security";
+		default								: return "<undefined>";
+	}
+}
+
+void ServerVis::configure(string ip, unsigned int port){
+	if( ip.length() == 0 ) return;
+
+	ostringstream sport;
+	sport << port;
+	logging_debug( "connecting to visualization server " << ip << " on " << sport.str());
+
+	tcp::resolver resolver(io_service);
+	tcp::resolver::query query(
+			ip, sport.str(),
+			tcp::resolver::query::passive |
+			tcp::resolver::query::address_configured |
+			tcp::resolver::query::numeric_service);
+
+	tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);
+	tcp::resolver::iterator end;
+
+	boost::system::error_code error = boost::asio::error::host_not_found;
+	while (error && endpoint_iterator != end){
+		socket.close();
+		socket.connect(*endpoint_iterator++, error);
+	}
+
+	if (error){
+		logging_warn( "visualization could not connect to visualization server" );
+	} else {
+		logging_info( "connected to visualization server on " << ip << ":" << port );
+		socketOpened = true;
+	}
+}
+
+ServerVis::ServerVis() : socket(io_service), socketOpened(false) {
+}
+
+ServerVis::~ServerVis(){
+	socket.close();
+}
+
+void ServerVis::sendSocket(const string& msg){
+	if( socket.is_open() && socketOpened ){
+		logging_error("SENDING VISUAL COMMAND: " << msg);
+		socket.send( boost::asio::buffer(msg) );
+	}
+}
+
+}} // namespace ariba, common
Index: /source/ariba/utility/visual/ServerVis.h
===================================================================
--- /source/ariba/utility/visual/ServerVis.h	(revision 6822)
+++ /source/ariba/utility/visual/ServerVis.h	(revision 6822)
@@ -0,0 +1,120 @@
+// [License]
+// The Ariba-Underlay Copyright
+//
+// Copyright (c) 2008-2009, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
+//
+// Institute of Telematics
+// UniversitÃ€t Karlsruhe (TH)
+// Zirkel 2, 76128 Karlsruhe
+// Germany
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARIBA PROJECT OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// The views and conclusions contained in the software and documentation
+// are those of the authors and should not be interpreted as representing
+// official policies, either expressed or implied, of the Institute of
+// Telematics.
+// [License]
+
+#ifndef SERVERVIS_H__
+#define SERVERVIS_H__
+
+#include <string>
+#include <sstream>
+#include <boost/utility.hpp>
+#include <boost/asio.hpp>
+#include "ariba/utility/logging/Logging.h"
+#include "ariba/utility/types/NodeID.h"
+
+using ariba::utility::NodeID;
+using std::ostringstream;
+using std::string;
+using boost::asio::ip::tcp;
+
+namespace ariba {
+namespace utility {
+
+class ServerVis {
+	use_logging_h(ServerVis);
+public:
+	void configure(string ip, unsigned int port);
+
+	typedef enum _NETWORK_ID {
+		NETWORK_ID_BASE_COMMUNICATION 	= 1,
+		NETWORK_ID_BASE_OVERLAY 		= 2,
+		NETWORK_ID_EONSON 				= 3,
+		NETWORK_ID_MCPO 				= 4,
+		NETWORK_ID_CLIO 				= 5,
+		NETWORK_ID_VIDEOSTREAM 			= 6,
+		NETWORK_ID_GAME 				= 7,
+		NETWORK_ID_SECURITY 			= 8,
+	} NETWORK_ID;
+
+	// get the name of the network
+	string getNetworkName(NETWORK_ID network) const;
+
+	/// Create a node
+	virtual void visCreate (NETWORK_ID network, NodeID& node, string nodename, string info) = 0;
+
+	/// Delete a node
+	virtual void visShutdown (NETWORK_ID network, NodeID& node, string info) = 0;
+
+	/// Connect two nodes
+	virtual void visConnect (NETWORK_ID network, NodeID& srcnode, NodeID& destnode, string info) = 0;
+
+	/// Disconnect two nodes
+	virtual void visDisconnect (NETWORK_ID network, NodeID& srcnode, NodeID& destnode, string info) = 0;
+
+	/// Node colors
+	typedef enum _NODE_COLORS {
+		NODE_COLORS_GREY,
+		NODE_COLORS_GREEN,
+		NODE_COLORS_RED,
+	} NODE_COLORS;
+
+	/// Change the node color
+	virtual void visChangeNodeColor (NETWORK_ID network, NodeID& node, unsigned char r, unsigned char g, unsigned char b) = 0;
+
+	/// Change the node color
+	virtual void visChangeNodeColor (NETWORK_ID network, NodeID& node, NODE_COLORS color) = 0;
+
+	/// Change the link color
+	virtual void visChangeLinkColor (NETWORK_ID network, NodeID& srcnode, NodeID& destnode, unsigned char r, unsigned char g, unsigned char b) = 0;
+
+	/// Change the link color
+	virtual void visChangeLinkColor (NETWORK_ID network, NodeID& srcnode, NodeID& destnode, NODE_COLORS color) = 0;
+
+protected:
+	ServerVis();
+	virtual ~ServerVis();
+	void sendSocket( const string& msg );
+
+private:
+	boost::asio::io_service io_service;
+	tcp::socket socket;
+	volatile bool socketOpened;
+};
+
+}} // namespace ariba, common
+
+#endif // SERVERVIS_H__
