Menu

#4 Lookup incorrect when contact in initial lookup contacts

open
nobody
JKad (1)
5
2010-06-18
2010-06-18
Steve J
No

I used Jmule on 120 nodes over the planet-lab network, and I got a hard time to succeed publishing or searching. the issue I derived was on the lookup implementation, which from what I saw is an iterative lookup:
The 50 first nodes which are being used for the "possibleContact" list will not be tested for closure with the "targetID":

LookupTask.startLookup
106 public void startLookup() {
107 lookupStarted = true;
108 responseTime = System.currentTimeMillis();
109 possibleContacts.addAll(routingTable.getNearestContacts(targetID, initialLookupContacts)); /* these contacts will be rejected at line 157 */
110
111
112 int count = ALPHA;
113 if (count > possibleContacts.size()) count = possibleContacts.size();
114 for (int i = 0; i < count; i++) {
115 KadContact contact = getNearestContact(Utils.XOR(targetID,_jkad_manager.getClientID()), possibleContacts,usedContacts);
116
117 lookupContact(contact);
118 }

LookupTask.processResults
155 for(KadContact contact : results) {
156 if (usedContacts.contains(contact)) continue;
157 if (possibleContacts.contains(contact)) continue; /*here*/
158 if (inToleranceZone(Utils.XOR(contact.getContactID(), _jkad_manager.getClientID()), Utils.XOR(targetID, _jkad_manager.getClientID()), toleranceZone)) {
159
160 alpha.add(contact);
161 }
162 else
163 possibleContacts.add(contact);

I solved it by always looking for the tolerance zone, but as it may add performance issues another method may be to pre-check in the start lookup method.
hope it helps,
aureshy

Discussion

  • Binary

    Binary - 2010-06-18

    what do you mean in "I got a hard time to succeed publishing or searching" ?

    line 109 - obtain nearest contacts to targetID from routin gtable
    line 157 - drop contacts already added in possibleContacts to avoid recursion in lookup

     
  • Steve J

    Steve J - 2010-06-19

    Assume an extreme case, where there are less than 50 contacts in the network at the beginning of the lookup, and that all of them are known by the initiator. the line 157 will drop all of them whether or not they are in the tolerance zone. That's my point.
    It was not "visible" when I was using the nodes.dat which is given, because in the "real" network there are more than 50 nodes. But I had only 120 nodes, and with a high probability a tolerant node will be in the 50 initial contacts.

     
  • Steve J

    Steve J - 2010-06-19

    My suggestion is an initial check of tolerance at the line 110, for the initials contact. I don't know, something like:

    List<KadContact> closetsknown = new Arryalist<KadContact>(routingTable.getNe....
    processResults(closestknown),

    will be fine, and everything else goes the same way as before.

     
  • Steve J

    Steve J - 2010-06-19

    My suggestion is an initial check of tolerance at the line 110, for the initials contact. I don't know, something like:

    List<KadContact> closetsknown = new Arryalist<KadContact>(routingTable.getNe....
    processResults(closestknown),

    will be fine, and everything else goes the same way as before.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.