Index: source/ariba/DataMessage.h
===================================================================
--- source/ariba/DataMessage.h	(revision 2467)
+++ source/ariba/DataMessage.h	(revision 2473)
@@ -54,4 +54,9 @@
 	}
 
+	inline DataMessage( const Message& message ) {
+		this->data = (void*)const_cast<Message*>(&message);
+		this->size = ~0;
+	}
+
 	inline Message* getMessage() const {
 		return (Message*)data;
Index: source/ariba/Node.cpp
===================================================================
--- source/ariba/Node.cpp	(revision 2467)
+++ source/ariba/Node.cpp	(revision 2473)
@@ -37,5 +37,4 @@
 // [License]
 
-
 #include "Node.h"
 
@@ -61,7 +60,11 @@
 
 	}
+
 	ServiceInterfaceWrapper(CommunicationListener* listener) :
 		nodeListener(NULL), commListener(listener) {
 	}
+	
+	~ServiceInterfaceWrapper() {
+	}
 
 protected:
@@ -69,4 +72,5 @@
 
 	}
+
 	void onOverlayDestroy(const SpoVNetID& id) {
 
@@ -120,9 +124,9 @@
 			const NodeID& node) {
 		if (commListener != NULL) commListener->onMessage(
-				const_cast<Message*> (message), node, link);
+				const_cast<Message*>(message), node, link);
 	}
 };
 
-const ServiceID Node::anonymousService = 0xFF00;
+ServiceID Node::anonymousService = ServiceID(0xFF00);
 
 Node::Node(AribaModule& ariba_mod, const Name& node_name) :
@@ -142,26 +146,19 @@
 //TODO: Implement error handling: no bootstrap node available
 void Node::initiate(const Name& vnetname, const SpoVNetProperties& parm) {
-	utility::OverlayParameterSet
-			ovrpset =
-					(utility::OverlayParameterSet::_OverlayStructure) parm.getBaseOverlayType();
+	utility::OverlayParameterSet ovrpset =
+			(utility::OverlayParameterSet::_OverlayStructure) parm.getBaseOverlayType();
+
 	spovnetId = vnetname.toSpoVNetId();
 	nodeId = generateNodeId(name);
+
 	this->context = ariba_mod.underlay_abs->createSpoVNet(spovnetId, nodeId,
-			ariba_mod.ip_addr, ariba_mod.tcp_port);
+							ariba_mod.ip_addr, ariba_mod.tcp_port);
 	ariba_mod.addBootstrapNode(vnetname,
-			new EndpointDescriptor(this->context->getBaseCommunication().getEndpointDescriptor()));
+		new EndpointDescriptor(this->context->getBaseCommunication().getEndpointDescriptor()));
 }
 
 void Node::leave() {
-	// not implemeted yet.
-}
-
-void Node::bind(NodeListener* listener) {
-	this->context->getOverlay().bind(new ServiceInterfaceWrapper(listener),
-			Node::anonymousService);
-}
-
-void Node::unbind(NodeListener* listener) {
-	// TODO: allow unbinding
+	ariba_mod.underlay_abs->leaveSpoVNet( context );
+	context = NULL;
 }
 
@@ -171,9 +168,9 @@
 
 const SpoVNetID& Node::getSpoVNetId() const {
-	return SpoVNetID::UNSPECIFIED;
+	return spovnetId;
 }
 
 const NodeID& Node::getNodeId(const LinkID& lid) const {
-	return NodeID::UNSPECIFIED;
+	return nodeId;
 }
 
@@ -201,10 +198,23 @@
 }
 
+void Node::sendBroadcastMessage(const DataMessage& msg, const ServiceID& sid) {
+	return context->getOverlay().broadcastMessage((Message*)msg, sid);
+}
+
+void Node::bind(NodeListener* listener) {
+	context->getOverlay().bind(new ServiceInterfaceWrapper(listener),
+			Node::anonymousService);
+}
+
+void Node::unbind(NodeListener* listener) {
+	delete context->getOverlay().unbind(Node::anonymousService);
+}
+
 void Node::bind(CommunicationListener* listener, const ServiceID& sid) {
-	this->context->getOverlay().bind(new ServiceInterfaceWrapper(listener), sid);
+	context->getOverlay().bind(new ServiceInterfaceWrapper(listener), sid);
 }
 
 void Node::unbind(CommunicationListener* listener, const ServiceID& sid) {
-	// TODO
+	delete context->getOverlay().unbind(sid);
 }
 
Index: source/ariba/Node.h
===================================================================
--- source/ariba/Node.h	(revision 2467)
+++ source/ariba/Node.h	(revision 2473)
@@ -37,5 +37,4 @@
 // [License]
 
-
 #ifndef NODE_H_
 #define NODE_H_
@@ -236,4 +235,13 @@
 	seqnum_t sendMessage(const DataMessage& msg, const LinkID& lnk);
 
+	/**
+	 * Sends a message to all known hosts in the overlay structure
+	 * the nodes that are reached here depend on the overlay structure.
+	 *
+	 * @param msg The message to be send
+	 * @param sid The id of the service that should receive the message
+	 */
+	void sendBroadcastMessage(const DataMessage& msg, const ServiceID& sid);
+
 	// --- communication listeners ---
 
@@ -316,5 +324,5 @@
 	// delegates
 	interface::AribaContext* context;
-	static const ServiceID anonymousService;
+	static ServiceID anonymousService;
 };
 
Index: source/ariba/interface/ServiceInterface.cpp
===================================================================
--- source/ariba/interface/ServiceInterface.cpp	(revision 2467)
+++ source/ariba/interface/ServiceInterface.cpp	(revision 2473)
@@ -38,28 +38,12 @@
 
 #include "ServiceInterface.h"
-#include "ariba/interface/AribaContext.h"
 
 namespace ariba {
 namespace interface {
 
-ServiceInterface::ServiceInterface() : overlay( NULL ){
+ServiceInterface::ServiceInterface() {
 }
 
 ServiceInterface::~ServiceInterface(){
-	if( overlay != NULL )
-		overlay->unbind( this, serviceid );
-}
-
-bool ServiceInterface::initialize( AribaContext* _ctx, const ServiceID& _serviceid ){
-	return initialize( &_ctx->getOverlay(), _serviceid );
-}
-
-bool ServiceInterface::initialize( BaseOverlay* _overlay, const ServiceID& _serviceid ){
-	if( _overlay == NULL ) return false;
-
-	overlay = _overlay;
-	serviceid = _serviceid;
-
-	return overlay->bind( this, serviceid);
 }
 
Index: source/ariba/interface/ServiceInterface.h
===================================================================
--- source/ariba/interface/ServiceInterface.h	(revision 2467)
+++ source/ariba/interface/ServiceInterface.h	(revision 2473)
@@ -67,6 +67,4 @@
 namespace interface {
 
-class AribaContext;
-
 class ServiceInterface : public OverlayEvents, MessageReceiver {
 	friend class ariba::overlay::BaseOverlay;
@@ -74,7 +72,4 @@
 	ServiceInterface();
 	virtual ~ServiceInterface();
-
-	bool initialize( AribaContext* _ctx, const ServiceID& _serviceid );
-	bool initialize( BaseOverlay* _overlay, const ServiceID& _serviceid );
 
 protected:
@@ -96,8 +91,4 @@
 
 	virtual bool receiveMessage( const Message* message, const LinkID& link, const NodeID& node );
-
-private:
-	BaseOverlay* overlay;
-	ServiceID serviceid;
 };
 
Index: source/ariba/interface/UnderlayAbstraction.cpp
===================================================================
--- source/ariba/interface/UnderlayAbstraction.cpp	(revision 2467)
+++ source/ariba/interface/UnderlayAbstraction.cpp	(revision 2473)
@@ -86,11 +86,4 @@
 }
 
-void UnderlayAbstraction::destroySpoVNet(AribaContext* ctx) {
-	ctx->getOverlay().leaveSpoVNet();
-	delete &ctx->getOverlay();
-	delete &ctx->getBaseCommunication();
-	delete ctx;
-}
-
 AribaContext* UnderlayAbstraction::joinSpoVNet(const SpoVNetID& spovnetid, const EndpointDescriptor& bootstrapnode, const NodeID& nodeid, const NetworkLocator* locallocator, const uint16_t localport) {
 
@@ -107,5 +100,8 @@
 
 void UnderlayAbstraction::leaveSpoVNet(AribaContext* ctx) {
-	destroySpoVNet( ctx );
+	ctx->getOverlay().leaveSpoVNet();
+	delete &ctx->getOverlay();
+	delete &ctx->getBaseCommunication();
+	delete ctx;
 }
 
Index: source/ariba/interface/UnderlayAbstraction.h
===================================================================
--- source/ariba/interface/UnderlayAbstraction.h	(revision 2467)
+++ source/ariba/interface/UnderlayAbstraction.h	(revision 2473)
@@ -79,6 +79,4 @@
 	);
 
-	void destroySpoVNet( AribaContext* ctx );
-
 	AribaContext* joinSpoVNet(
 		const SpoVNetID& spovnetid,
Index: source/ariba/overlay/BaseOverlay.cpp
===================================================================
--- source/ariba/overlay/BaseOverlay.cpp	(revision 2467)
+++ source/ariba/overlay/BaseOverlay.cpp	(revision 2473)
@@ -273,5 +273,5 @@
 bool BaseOverlay::bind(ServiceInterface* service, const ServiceID& sid) {
 
-	logging_debug( "binding service on serviceid " << sid.toString() );
+	logging_debug( "binding service " << service << " on serviceid " << sid.toString() );
 
 	if( listenerMux.contains( sid ) ){
@@ -284,15 +284,17 @@
 }
 
-bool BaseOverlay::unbind(ServiceInterface* service, const ServiceID& sid){
-
-	logging_debug( "unbinding service on serviceid " << sid.toString() );
+ServiceInterface* BaseOverlay::unbind(const ServiceID& sid){
+
+	logging_debug( "unbinding service from serviceid " << sid.toString() );
 
 	if( !listenerMux.contains( sid ) ){
 		logging_warn( "cannot unbind service. no service registered on service id " << sid.toString() );
-		return false;
-	}
-
-	listenerMux.unregisterItem( service );
-	return true;
+		return NULL;
+	}
+
+	ServiceInterface* iface = listenerMux.get( sid );
+	listenerMux.unregisterItem( sid );
+	
+	return NULL; //iface;
 }
 
Index: source/ariba/overlay/BaseOverlay.h
===================================================================
--- source/ariba/overlay/BaseOverlay.h	(revision 2467)
+++ source/ariba/overlay/BaseOverlay.h	(revision 2473)
@@ -185,7 +185,7 @@
 	 * Unregister a receiver.
 	 *
-	 * @param receiver An implementation of the receiver interface
-	 */
-	bool unbind( ServiceInterface* service, const ServiceID& sid );
+	 * @param sid The service id to unregister
+	 */
+	ServiceInterface* unbind( const ServiceID& sid );
 
 	/**
@@ -271,5 +271,5 @@
 	 * to deliver upcoming messages to the correct service.
 	 */
-	Demultiplexer<ServiceInterface*, const ServiceID> listenerMux;
+	Demultiplexer<ServiceInterface*, ServiceID> listenerMux;
 
 	/**
Index: source/ariba/overlay/modules/OverlayInterface.cpp
===================================================================
--- source/ariba/overlay/modules/OverlayInterface.cpp	(revision 2467)
+++ source/ariba/overlay/modules/OverlayInterface.cpp	(revision 2473)
@@ -53,8 +53,9 @@
 		eventsReceiver( _eventsReceiver ) {
 
-	ServiceInterface::initialize( &_baseoverlay, OVERLAY_SERVICE_ID );
+	_baseoverlay.bind( this, OVERLAY_SERVICE_ID );
 }
 
 OverlayInterface::~OverlayInterface(){
+	baseoverlay.unbind( OVERLAY_SERVICE_ID );
 }
 
Index: source/ariba/utility/misc/Demultiplexer.hpp
===================================================================
--- source/ariba/utility/misc/Demultiplexer.hpp	(revision 2467)
+++ source/ariba/utility/misc/Demultiplexer.hpp	(revision 2473)
@@ -41,4 +41,5 @@
 
 #include <list>
+#include <iostream>
 #include <map>
 #include <boost/thread/mutex.hpp>
@@ -46,4 +47,5 @@
 #include "ariba/utility/messages/Message.h"
 
+using std::cout;
 using std::list;
 using std::map;
@@ -73,4 +75,24 @@
 	boost::mutex						mapMutex;
 
+	void debugprint() {
+		cout << "-------------start--------" << std::endl;
+		{
+			LISTENER_SERVICE_MAP_CITERATOR i = mapListenerService.begin();
+			LISTENER_SERVICE_MAP_CITERATOR iend = mapListenerService.end();
+			
+			for( ; i != iend; i++ )
+				cout << "xxx" << i->first.toString() << " -> " << i->second << std::endl;
+		}
+		cout << "-----------------------" << std::endl;
+		{
+			SERVICE_LISTENER_MAP_CITERATOR i = mapServiceListener.begin();
+			SERVICE_LISTENER_MAP_CITERATOR iend = mapServiceListener.end();
+			
+			for( ; i != iend; i++ )
+				cout << "xxx" << i->first << " -> " << i->second.toString() << std::endl;
+		}
+		cout << "-------------end---------" << std::endl;
+	}
+
 public:
 
@@ -83,15 +105,14 @@
 	void registerItem( S id, T listener ) {
 		boost::mutex::scoped_lock lock( mapMutex );
-		{
-			mapServiceListener.insert( SERVICE_LISTENER_PAIR( id, listener ) );
-			mapListenerService.insert( LISTENER_SERVICE_PAIR( listener, id ) );
-		}
+
+		mapServiceListener.insert( SERVICE_LISTENER_PAIR( id, listener ) );
+		mapListenerService.insert( LISTENER_SERVICE_PAIR( listener, id ) );
 	}
 
-	void unregisterItem( S id) {
+	void unregisterItem( S id ) {
 		T listener = get( id );
-
-		boost::mutex::scoped_lock lock( mapMutex );
+		
 		{
+			boost::mutex::scoped_lock lock( mapMutex );
 			mapServiceListener.erase( id );
 			mapListenerService.erase( listener );
@@ -100,5 +121,5 @@
 
 	void unregisterItem( T listener ) {
-		S id = get (listener);
+		S id = get( listener );
 		unregisterItem( id );
 	}
@@ -106,34 +127,29 @@
 	S get( T listener ) {
 		boost::mutex::scoped_lock lock( mapMutex );
-		{
-			LISTENER_SERVICE_MAP_CITERATOR it = mapListenerService.find( listener );
-			return it->second;
-		}
+
+		LISTENER_SERVICE_MAP_CITERATOR it = mapListenerService.find( listener );
+		return it->second;
 	}
 
 	T get( S id ) {
 		boost::mutex::scoped_lock lock( mapMutex );
-		{
-			SERVICE_LISTENER_MAP_CITERATOR it = mapServiceListener.find( id );
 
-			if( it == mapServiceListener.end() ) 	return NULL;
-			else					return it->second;
-		}
+		SERVICE_LISTENER_MAP_CITERATOR it = mapServiceListener.find( id );
+		if( it == mapServiceListener.end() ) 	return NULL;
+		else					return it->second;
 	}
 
 	bool contains( T listener ) {
 		boost::mutex::scoped_lock lock( mapMutex );
-		{
-			LISTENER_SERVICE_MAP_CITERATOR it = mapListenerService.find( listener );
-			return ( it != mapListenerService.end() );
-		}
+
+		LISTENER_SERVICE_MAP_CITERATOR it = mapListenerService.find( listener );
+		return ( it != mapListenerService.end() );
 	}
 
 	bool contains( S id ) {
 		boost::mutex::scoped_lock lock( mapMutex );
-		{
-			SERVICE_LISTENER_MAP_CITERATOR it = mapServiceListener.find( id );
-			return ( it != mapServiceListener.end() );
-		}
+
+		SERVICE_LISTENER_MAP_CITERATOR it = mapServiceListener.find( id );
+		return ( it != mapServiceListener.end() );
 	}
 
@@ -141,5 +157,6 @@
 	typedef list<T> TwoList;
 
-	OneList getOneList() const {
+	OneList getOneList() {
+		boost::mutex::scoped_lock lock( mapMutex );
 		OneList ret;
 
@@ -151,5 +168,6 @@
 	}
 
-	TwoList getTwoList() const {
+	TwoList getTwoList() {
+		boost::mutex::scoped_lock lock( mapMutex );
 		TwoList ret;
 
Index: source/ariba/utility/types/ServiceID.cpp
===================================================================
--- source/ariba/utility/types/ServiceID.cpp	(revision 2467)
+++ source/ariba/utility/types/ServiceID.cpp	(revision 2473)
@@ -24,5 +24,5 @@
 // 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,
+// 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
@@ -50,5 +50,5 @@
 }
 
-ServiceID::ServiceID(unsigned int _id) : id( _id ){
+ServiceID::ServiceID(uint32_t _id) : id( _id ){
 }
 
@@ -57,4 +57,9 @@
 
 ServiceID::~ServiceID() {
+}
+
+ServiceID& ServiceID::operator=(const ServiceID &rh) {
+	id = rh.id;
+	return *this;
 }
 
Index: source/ariba/utility/types/ServiceID.h
===================================================================
--- source/ariba/utility/types/ServiceID.h	(revision 2467)
+++ source/ariba/utility/types/ServiceID.h	(revision 2473)
@@ -72,4 +72,5 @@
 	bool operator<(const ServiceID& rh) const;
 	bool operator!=(const ServiceID& rh) const;
+	ServiceID& operator=(const ServiceID &rh);
 
 	inline bool isUnspecified() const {
