To check the situation I use kind of clean install: no shared files, no downloads, no servers, just a nodes.dat from eMule's version 0.50a installation files.
I did such tests shortly after the release of 0.50a, then a few months later. It worked, KAD was connecting.
But not today.
The verbose log shows:
18.01.2013 12:13:07: Loaded Bootstrap nodes.dat, selected 50 out of 1200 valid contacts
Later:
18.01.2013 12:14:58: Trying to Bootstrap Kad from 59.54.220.*, Distance: 0A88DF7869490EEBBD713449339CFCA2, Version: 7, 0 Contacts left 18.01.2013 12:15:02: No valid client for requesting external port available
Stopping KAD at this point overwrites nodes.dat and leaves in it 0 contacts; all other 1150 contacts are lost.
Copying again the same nodes.dat does not help because exactly the same IPs would be tried, even in the same order.
Luckily, RoutingZone.cpp contains sufficiently clear comments: bootstrapping code selects the first 50 closest nodes, the rest is dropped.
I decided that this could be fixed by selecting all available nodes, sorted by the distance. That would use all possible contacts while avoiding overload for certain IPs the same way as it was designed.
It was enough to comment out just 5 lines (with //--- sequence) in RoutingZone.cpp, starting at line 318
//--- if (CKademlia::s_liBootstapList.GetCount() < 50 || CKademlia::s_liBootstapList.GetTail()->GetDistance() > uDistance){ // look were to put this contact into the proper position bool bInserted = false; CContact* pContact = new CContact(uID, uIP, uUDPPort, uTCPPort, uMe, uContactVersion, 0, false); for (POSITION pos = CKademlia::s_liBootstapList.GetHeadPosition(); pos != NULL; CKademlia::s_liBootstapList.GetNext(pos)){ if (CKademlia::s_liBootstapList.GetAt(pos)->GetDistance() > uDistance){ CKademlia::s_liBootstapList.InsertBefore(pos, pContact); bInserted = true; break; } } if (!bInserted){ //--- ASSERT( CKademlia::s_liBootstapList.GetCount() < 50 ); CKademlia::s_liBootstapList.AddTail(pContact); } //--- else if (CKademlia::s_liBootstapList.GetCount() > 50) //--- delete CKademlia::s_liBootstapList.RemoveTail(); //--- }
Started compiled eMule again with the same nodes.dat. I had to wait, but finally, after about 13 minutes and 372 attempts:
18.01.2013 14:04:50: Trying to Bootstrap Kad from 125.110.65.*, Distance: 008A1C684F92BC7B83916203969A3E2C, Version: 4, 1199 Contacts left . . . 18.01.2013 14:17:15: Trying to Bootstrap Kad from 88.161.93.*, Distance: 411F02B75688B4AB4FA235450E8EAB92, Version: 8, 838 Contacts left 18.01.2013 14:17:15: Starting NODEFWCHECKUDP Kad Search 18.01.2013 14:17:15: Inc Kad2 Bootstrap Packet from 88.161.93.*
Which means, there are very few active contacts in the old file: 1200/372=3.2
Guess the chances for connection with only 50 contacts selected now.
What should be changed in my opinion:
1. If there are no big changes in code, there could be minor fixes and updated third party libraries. I do not see why devs could not compile versions 0.50b, c, d etc. and refresh nodes.dat too. And server.met.
2. There is no clear indication of the bootstrapping progress (except verbose log), so most users do not know when to keep waiting, and when it's time to try something else.
This post has been edited by fox88: 19 January 2013 - 02:58 PM