aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Finding sources with Kad  (Read 6987 times)

ZioNemo

  • Approved Newbie
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 18
Finding sources with Kad
« on: June 10, 2009, 12:44:04 PM »

Hi,
I have aMule 2.2.2 running on Ubuntu Jaunty; installed from the normal apt-get sources.

It works and it works relatively well.
I am using KAD *only* (no servers).
I am usually searching for rare files (sources << 10)

I have two questions about sources:
Why I often see less sources in download than I see in the search (done using KAD, of course)?
Often I see my sources dropping to zero and remain there, but, if I "stop" the file and then "continue" it, the sources reappear (after a short while).

What's going on?
Can someone enlighten me?

TiA
ZioNemo
Logged

Festor

  • Hero Member
  • *****
  • Karma: 79
  • Offline Offline
  • Posts: 935
  • Offline -> Studying...
Re: Finding sources with Kad
« Reply #1 on: June 10, 2009, 06:53:52 PM »

I have aMule 2.2.2 running on Ubuntu Jaunty; installed from the normal apt-get sources.

Please, update to 2.2.5. This version fixes some serious bugs of the previous release. You're strongly encouraged to upgrade.

Ubuntu packages: http://www.amule.org/amule/index.php?topic=16647.0

ZioNemo

  • Approved Newbie
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 18
Re: Finding sources with Kad
« Reply #2 on: June 11, 2009, 10:55:57 AM »

Please, update to 2.2.5. This version fixes some serious bugs of the previous release. You're strongly encouraged to upgrade.

Thanks

ZioNemo
Logged

ZioNemo

  • Approved Newbie
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 18
Re: Finding sources with Kad
« Reply #3 on: June 14, 2009, 05:41:08 PM »

Hi again,
I upgraded to latest as suggested, but the effect is still here.
I was out-of-town for two days and I just came back.
All my downloads are with 0 (zero) sources.
I stopped all downloads and restarted just one.
It has a few (4) sources now.
Right now I restarted all others and they are already finding sources.
All downloads I usually do are fairly rare (sources << 10), but, definitely, *there are* sources.
Problem is aMule seems to lose them over the time (communication errors?), but seems unable to recover them without human intervention.
Is there anything I could do?

TiA
ZioNemo
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Finding sources with Kad
« Reply #4 on: June 14, 2009, 05:52:38 PM »

Why I often see less sources in download than I see in the search (done using KAD, of course)?
The number of sources in the search is not really reliable. You can get more sources than search shows as well.

Problem is aMule seems to lose them over the time (communication errors?), but seems unable to recover them without human intervention.
I'd guess they change their IP address (DSL reconnect) and vanish from your sight.

Anybody knows how often the Kad search for sources is repeated? Maybe it should be retriggered if sources drop to zero?
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

ZioNemo

  • Approved Newbie
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 18
Re: Finding sources with Kad
« Reply #5 on: June 14, 2009, 08:21:01 PM »

Why I often see less sources in download than I see in the search (done using KAD, of course)?
The number of sources in the search is not really reliable. You can get more sources than search shows as well.
I know, but it is rather strange that, when there are very few sources and I decide to start a download all those sources are not passed to the download in order to initialize it. A new sources search is started instead. This seems a bit wasteful to me. But, again, I do not really know the details of the protocol, so I could be *very* wrong.
Quote
Problem is aMule seems to lose them over the time (communication errors?), but seems unable to recover them without human intervention.
I'd guess they change their IP address (DSL reconnect) and vanish from your sight.

Anybody knows how often the Kad search for sources is repeated? Maybe it should be retriggered if sources drop to zero?
I have a fixed address, so it will always be the same.
Problem, anyways, doesn't belong to the "losing sources" half; I believe that can happen for a lot of reasons, including packet drop for temporary net congestion or DSL reconnect in the source itself (as You suggest).
Problem is it seems aMule will not automatically trigger a periodic source search (eMule doesn't seem to suffer this!).
I understood aMule should periodically try to find new sources, but this doesn't seem to happen in my installation.
What can/should I check?

TiA
ZioNemo
Logged

^marcell^

  • Developer
  • Hero Member
  • *****
  • Karma: 28
  • Offline Offline
  • Posts: 524
Re: Finding sources with Kad
« Reply #6 on: June 14, 2009, 09:35:56 PM »

If I leave my PC turned off for several days and reconnect to the KAD network some time later, it takes more time to find sources and even for others to find me (filling my upload queue). I have experienced this for eMule in the past too. So I think it's not something related to aMule, but instead to some network caused issue. But since I am not very familiar with KAD, I can't give you any concrete idea, what the reason could be.
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Finding sources with Kad
« Reply #7 on: June 14, 2009, 09:59:40 PM »

so I could be *very* wrong.
You are.  ;) The search function delivers only filenames and hashes, no sources.

Quote
I have a fixed address, so it will always be the same.
Your sources maybe don't however.

Quote
I understood aMule should periodically try to find new sources, but this doesn't seem to happen in my installation.
Well, it does, but slowly...
Code: [Select]
if(m_TotalSearchesKad < 7) {
m_TotalSearchesKad++;
}
m_LastSearchTimeKad = dwCurTick + (KADEMLIAREASKTIME*m_TotalSearchesKad);
SetKadFileSearchID(pSearch->GetSearchID());
This means first search is after 1h, second after 2h, ... until the time reaches 7h where it stops getting longer.
The idea is of course to keep load off the network. Mind, if your sources are downloading too you also benefit from source exchange. But you don't if they are just sharing a completed file.

So - does it get back its sources after several hours?
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

ZioNemo

  • Approved Newbie
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 18
Re: Finding sources with Kad
« Reply #8 on: June 14, 2009, 11:10:00 PM »

This means first search is after 1h, second after 2h, ... until the time reaches 7h where it stops getting longer.
...
So - does it get back its sources after several hours?
I cannot be sure, since 7h is a VeryLongTimeIndeed (TM)  ;)
But:
A few times I left aMule working when I'm out-of-town for work (or vacation).
Last time has been this weekend (I left aMule working ok Friday ~5 PM and came back shortly before sending prev message i.e.: Sunday ~7PM)).
Almost  each time I found all my sources at 0.
I obviously cannot know exactly when they went low, so I cannot know if it is >7h, but they looked pretty stable.
If I'm in front of the PC I usually do not wait 7h before acting :)

The 7h timeout is per-file?
In that case I could let one of the files alone (when I see sources going to 0) for >7h and see what happens.
... or should I leave the whole bunch of downloads alone for a whole day?

In any case I would suggest to restore the timeout to 1h (or even less) if the sources count drop to 0.
Rationale behind that is that for rare files, possibly with feeds not always online, the net overhead is more than balanced with the chance to find another possible source before it goes offline again.

Thanks for the insight.
Mauro
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Finding sources with Kad
« Reply #9 on: June 14, 2009, 11:35:35 PM »

The 7h timeout is per-file?
Yes.

In any case I would suggest to restore the timeout to 1h (or even less) if the sources count drop to 0.
That's ticklish. Many people might have many files without sources lying around, so this would definitely increase load on KAD.
What the net could probably live with is restore timeout if the source count drops to zero (not if it is zero).

If you just a few stable looking sources for one file you could write down their hashes/IPs and then check after stop/resume if the IPs have changed to see if my idea is right. The interesting question is why they are dropped at all.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

ZioNemo

  • Approved Newbie
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 18
Re: Finding sources with Kad
« Reply #10 on: June 15, 2009, 09:46:42 AM »

In any case I would suggest to restore the timeout to 1h (or even less) if the sources count drop to 0.
That's ticklish. Many people might have many files without sources lying around, so this would definitely increase load on KAD.
What the net could probably live with is restore timeout if the source count drops to zero (not if it is zero).
Agreed.
I understand that having the possibility to better the search-for-sources is likely to lead to abuses. :(
Quote
If you just a few stable looking sources for one file you could write down their hashes/IPs and then check after stop/resume if the IPs have changed to see if my idea is right. The interesting question is why they are dropped at all.
I have now the following situation:

  • I suffered a disconnection from my ISP during the night.
  • This morning I found the system asking for reconnection (it will NOT happen automatically; I have to manually input a password).
  • aMule was obviously very idle and without sources.
  • I reconnected the Internet.
  • aMule remained with very few KAD known nodes (<<100) and reported "firewalled".
  • After a while (~1hour) I just disconnected and, after a few seconds, reconnected the KAD network.
  • In a few minutes the number of active nodes climbed to 1k.
  • The number of sources for my downloads is still (after ~30 min.) all zero.
  • Please note: I do not have a server connection; I use KAD only. Could it be relevant?
  • I did not try to force a source search because I wanted Your input.

I am willing to help debugging this, if You are interested.
I am a fairly seasoned programmer, but I resisted, up to now, the temptation to mess with the code.

It seems a bit strange to me a search is not started after a net disconnect/connect.

... still no sources...

Thanks for Your time
ZioNemo
Logged

myth

  • Global Moderator
  • Hero Member
  • *****
  • Karma: 38
  • Offline Offline
  • Posts: 570
Re: Finding sources with Kad
« Reply #11 on: June 15, 2009, 10:52:10 AM »

Why must you input a password?

Here when i get a disconnect from ISP my router re-connects immediatly and aMule continues working ;)
Logged

ZioNemo

  • Approved Newbie
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 18
Re: Finding sources with Kad
« Reply #12 on: June 15, 2009, 03:22:12 PM »

Why must you input a password?

Here when i get a disconnect from ISP my router re-connects immediatly and aMule continues working ;)
Because I'm connected via a wireless net, so whenever I logout (either voluntarily or otherwise) ANY net access will redirect me to a *web* page asking for username/password.
I have (any suggestion welcome!!!!!!) to fire up a browser (e.g.: Firefox) and manually login.
After that I can use the Internet transparently for anything.
Fortunately disconnections are quite rare (<1/week).

This, obviously has nothing to do with the problem at hand.

UPDATE!!
After a few hours (~6) the sources have been detected again, so I guess this is consistent with the 7h timeout.

This means I should find a way to shorten this timeout somehow, since with my normal download style (rare files, often seeded by non-permanently-connected nodes) the current default does not seem to work very well. Will enabling also the e2k  network (server) help?

Regards
ZioNemo
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Finding sources with Kad
« Reply #13 on: June 16, 2009, 10:06:08 PM »

Sorry to say it, but after a long time disconnect the best idea is always to restart the client.

What's happening is probably that aMule periodically connects to the sources, finds them gone and drops them. It's missing some intelligence like "hey, everyone is gone suddenly. Um - could it be that I am the one gone actually?". Short disconnects (like the 24h DSL dis/reconnect with IP change) are not so problematic.

Quote
It seems a bit strange to me a search is not started after a net disconnect/connect.
Disconnecting/reconnecting Server or KAD shouldn't influence your sources, so the source search is not retriggered. An a net disconnect is not really detected at all I'm afraid.

(I'm way on the guessing side with most of the details - I don't know the networking code well enough.)

Quote
I have (any suggestion welcome!!!!!!) to fire up a browser (e.g.: Firefox) and manually login.
Should be a piece of cake with Perl. At least if the login page is html and nothing fancy (flash, silverlight, whatever). :)

Quote
If you have just a few stable looking sources for one file you could write down their hashes/IPs and then check after stop/resume if the IPs have changed to see if my idea is right.
Please verify this, and also if your sources are all complete sources (if they are still downloading they should reconnect to you and you should also get source exchange).

What I'd like to change in the networking code:
  • Periodic (hourly) hard KAD restart if it is down. I've often seen it permanently disconnected after network problems even though network was fine again.
  • Don't drop sources right away if they are unreachable, keep them for a cycle.
  • Try to detect network problem (suddenly nobody reachable). Freeze state then, don't drop anybody. Recheck periodically. If it's back again recheck your non-dropped clients.
  • Detect changed external IP address. Notify all sources and queue members about it.

It would be nice if you could keep aMule running through a two week vacation.  :-\
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon