Index: source/ariba/overlay/modules/chord/detail/chord_routing_table.hpp
===================================================================
--- source/ariba/overlay/modules/chord/detail/chord_routing_table.hpp	(revision 10700)
+++ source/ariba/overlay/modules/chord/detail/chord_routing_table.hpp	(revision 12060)
@@ -96,4 +96,7 @@
 	// the own node id
 	nodeid_t id;
+    
+    // the own node id as routing item
+    item own_id_item;
 
 	// successor and predecessor tables
@@ -168,6 +171,11 @@
 	/// constructs the reactive chord routing table
 	explicit chord_routing_table( const nodeid_t& id, int redundancy = 4 ) :
-		id(id),	succ( redundancy, succ_compare_type(this->id), *this ),
-		pred( redundancy, pred_compare_type(this->id), *this ) {
+		id(id),
+		succ( redundancy, succ_compare_type(this->id), *this ),
+		pred( redundancy, pred_compare_type(this->id), *this )
+    {
+        // init reflexive item
+        own_id_item.id = id;
+        own_id_item.ref_count = 1;
 
 		// create finger tables
@@ -273,16 +281,68 @@
 			}
 		}
+
 		if (best_item != NULL && distance(value, id)<distance(value, best_item->id))
 			return NULL;
 		return best_item;
 	}
+	
+	std::vector<const item*> get_next_2_hops( const nodeid_t& value)
+    {
+        ring_distance distance;
+        item* best_item = &own_id_item;
+        item* second_best_item = NULL;
+        
+        // find best and second best item
+        for (size_t i=0; i<table.size(); i++)
+        {
+            item* curr = &table[i];
+
+            // not not include orphans into routing!
+            if (curr->ref_count==0) continue;
+
+            // check if we found a better item
+            // is best item
+            if ( distance(value, curr->id) < distance(value, best_item->id) )
+            {
+                second_best_item = best_item;
+                best_item = curr;
+            }
+            // is second best item
+            else
+            {
+                if ( second_best_item == NULL )
+                {
+                    second_best_item = curr;
+                    continue;
+                }
+                
+                if ( distance(value, curr->id) < distance(value, second_best_item->id) )
+                {
+                    second_best_item = curr;
+                }
+            }
+        }
+
+        // prepare return vector
+        std::vector<const item*> ret;
+        if ( best_item != NULL )
+        {
+            ret.push_back(best_item);
+        }
+        if ( second_best_item != NULL )
+        {
+            ret.push_back(second_best_item);
+        }
+        
+        return ret;
+    }
 
 	const nodeid_t* get_successor() {
-		if (succ.size()==NULL) return NULL;
+		if (succ.size()==0) return NULL;
 		return &succ.front();
 	}
 
 	const nodeid_t* get_predesessor() {
-		if (pred.size()==NULL) return NULL;
+		if (pred.size()==0) return NULL;
 		return &pred.front();
 	}
