Index: source/ariba/overlay/modules/chord/Chord.cpp
===================================================================
--- source/ariba/overlay/modules/chord/Chord.cpp	(revision 5736)
+++ source/ariba/overlay/modules/chord/Chord.cpp	(revision 5743)
@@ -57,5 +57,5 @@
 
 	// create routing table
-	this->table = new chord_routing_table(_nodeid, 2);
+	this->table = new chord_routing_table(_nodeid, 4);
 	orphan_removal_counter = 0;
 	discovery_count = 0;
@@ -71,7 +71,8 @@
 
 /// helper: sets up a link using the base overlay
-LinkID Chord::setup(const EndpointDescriptor& endp, const NodeID& node) {
+LinkID Chord::setup(const EndpointDescriptor& endp, const NodeID& node, const NodeID& remoteRelay ) {
 	logging_debug("Request to setup link to " << endp.toString() );
 
+	// check if we already have a connection
 	for (int i=0; i<table->size(); i++)
 		if ((*table)[i]->id == node && !((*table)[i]->info.isUnspecified()))
@@ -89,5 +90,5 @@
 
 	// establish link via base overlay
-	return baseoverlay.establishLink(endp, node, OverlayInterface::OVERLAY_SERVICE_ID);
+	return baseoverlay.establishLink(endp, node, OverlayInterface::OVERLAY_SERVICE_ID, remoteRelay );
 }
 
@@ -105,4 +106,5 @@
 	Discovery dmsg;
 	dmsg.setSourceEndpoint(&baseoverlay.getEndpointDescriptor());
+	dmsg.setSourceRelay(baseoverlay.getRelayNode(destination));
 	dmsg.setFollowType(Discovery::normal);
 	dmsg.setTTL((uint8_t) ttl);
@@ -120,4 +122,5 @@
 		Discovery dmsg;
 		dmsg.setSourceEndpoint(&baseoverlay.getEndpointDescriptor());
+		dmsg.setSourceRelay(baseoverlay.getRelayNode(nodeid));
 		dmsg.setFollowType(Discovery::successor);
 		dmsg.setTTL((uint8_t)3);
@@ -130,4 +133,5 @@
 		Discovery dmsg;
 		dmsg.setSourceEndpoint(&baseoverlay.getEndpointDescriptor());
+		dmsg.setSourceRelay(baseoverlay.getRelayNode(nodeid));
 		dmsg.setFollowType(Discovery::predecessor);
 		dmsg.setTTL((uint8_t)3);
@@ -332,5 +336,5 @@
 		// check if source node can be added to routing table and setup link
 		if (m->getSource() != nodeid && table->is_insertable(m->getSource()))
-			setup(*dmsg->getSourceEndpoint(), m->getSource() );
+			setup(*dmsg->getSourceEndpoint(), m->getSource(), dmsg->getSourceRelay() );
 
 		// delegate discovery message
Index: source/ariba/overlay/modules/chord/Chord.h
===================================================================
--- source/ariba/overlay/modules/chord/Chord.h	(revision 5736)
+++ source/ariba/overlay/modules/chord/Chord.h	(revision 5743)
@@ -81,5 +81,7 @@
 
 	// helper: sets up a link using the "base overlay"
-	LinkID setup( const EndpointDescriptor& endp, const NodeID& node = NodeID::UNSPECIFIED );
+	LinkID setup( const EndpointDescriptor& endp,
+		const NodeID& node = NodeID::UNSPECIFIED,
+		const NodeID& remoteRelay = NodeID::UNSPECIFIED );
 
 	// helper: sends a message using the "base overlay"
Index: source/ariba/overlay/modules/chord/messages/Discovery.h
===================================================================
--- source/ariba/overlay/modules/chord/messages/Discovery.h	(revision 5736)
+++ source/ariba/overlay/modules/chord/messages/Discovery.h	(revision 5743)
@@ -70,4 +70,5 @@
 		this->follow_type = msg.follow_type;
 		this->ttl = msg.ttl;
+		this->source_relay = msg.source_relay;
 		this->source_endpoint = msg.source_endpoint;
 	}
@@ -99,8 +100,16 @@
 	}
 
+	inline void setSourceRelay( const NodeID& relay ) {
+		source_relay = relay;
+	}
+
+	inline const NodeID& getSourceRelay() const {
+		return source_relay;
+	}
 private:
 	uint8_t follow_type;
 	uint8_t ttl;
 	EndpointDescriptor source_endpoint;
+	NodeID source_relay;
 };
 
@@ -112,5 +121,5 @@
 
 	// serialize end-point
-	X && source_endpoint;
+	X && source_relay && source_endpoint;
 } sznEnd();
 
