aMule Forum
English => aMule Help => Topic started by: named on January 31, 2008, 02:13:07 AM
-
I'm running latest SVN version and I'm having trouble connecting to Kad. Problem is that it's always disconnected, even if I try to bootstrap from known clients, even if I update the nodes.dat from http://emule-inside.net/nodes.dat. After some googling around I saw some inconclusive reports that there might be some problem with aMule-SVN and Kad. (If it is a kown issue, sorry for the spam.)
I checked and rechecked my setup (opened/forwarded ports, etc.). Everything seems to be ok. Still Kad's not working.
Finally I decided to give nmap a go. TCP port was ok, however, when I tried the UDP port:
nmap -sU -p 51111 127.0.0.1
I would sometimes get:
51111/udp closed unknown
and sometimes:
51111/udp open|filtered unknown
Regardless of nmap output, these messages cropped up in aMule log:
2008-01-31 03:03:36: MuleUDPSocket.cpp(308): MuleUDPSocket: Socket died. Recreating socket.
2008-01-31 03:03:36: MuleUDPSocket.cpp(87): MuleUDPSocket: Shutting down Client UDP-Socket
2008-01-31 03:03:36: MuleUDPSocket.cpp(79): MuleUDPSocket: Created Client UDP-Socket at port 51111
-
It would be greatly appreciated if anybody could corroborate or refute this.
-
Hi named,
I am not able to reproduce it here, Kad works fine for me.
About the messages you get, we can see that they are normal (in a wx sense >:( ), though it does not happen to me:
case wxSOCKET_INVSOCK:
// Once in a while, wxDatagram sockets have a tendency
// to suddenly become invalid. In order to work around
// this problem, we simply create a replacement socket.
AddDebugLogLineM(true, logMuleUDP, wxT("Socket died. Recreating socket."));
DestroySocket();
CreateSocket();
break;
The other two log messages come from DestroySocket() and CreateSocket() respectively.
If you ask me for a wild guess, there is some other program messing with iptables. Other than that, I can't imagine what is going on.
What is the wx version that you are using?
-
Thanks for the reply, phoenix,
My destop PC is behind a router/firewall and I have turned off iptables. (Port forwarding is okay, I have already confirmed that.) Do I have to have iptables running to get Kad connected? That would be strange. ???
Wx version is 2.8.7.
Edit: I have also turned off all firewall related options in my kernel setup. (If that could explain something.)
-
Hi named,
You seem to be doing everything correctly. You do not need iptables running, it is actually easier to set up without it running.
Is there any chance you could sniff the network with wireshark to try to figure out what condition triggers the UDP failure. With some filters set you could probably be able to catch only Kad traffic. This is not a simple task, but might worth the work.
-
Hi phoenix,
I followed your advice and gave wireshark a go. In order to be able to better see what was going on, I stopped all other network activities, disabled ed2k, so I had only Kad on. Following a fresh download of nodes.dat from http://emule-inside.net/nodes.dat, I could see a lot of outgoing UDP activity:
1447 805.345120 <my internal ip> <some external ip> eDonkey Kademlia UDP: KADEMLIA_REQ
1448 808.126311 <my internal ip> <some external ip> eDonkey Kademlia UDP: KADEMLIA_REQ
1449 809.907461 <my internal ip> <some external ip> UDP Source port: <my UDP port> Destination port: 9869
1450 810.688628 <my internal ip> <some external ip> eDonkey Kademlia UDP: KADEMLIA_REQ
1451 813.470115 <my internal ip> <some external ip> UDP Source port: <my UDP port> Destination port: vision_server
1452 815.251340 <my internal ip> <some external ip> eDonkey Kademlia UDP: KADEMLIA_REQ
1453 817.032526 <my internal ip> <some external ip> UDP Source port: <my UDP port> Destination port: 25472
...........................
However there were no incoming UDP packets. So I thought that it was the router after all that was faulty. Checked the forwarding rule again and tried an online port scanner - http://www.auditmypc.com/port-scanner.asp. This is what appeared:
1330 730.241144 130.94.69.111 <my internal ip> UDP Source port: vpvc Destination port: <my UDP port>
So apparently the router is configured properly and the port is forwarded to my internal ip address and my UDP port.
I am really at a loss here. Your help would be really appreciated.
-
Hi,
I experience the same behaviour. Both UDP sockets are open according to netstat but a local nmap shows that:
- the UDP port for extended server request is open just after starting aMule and closed some time after
- the extended client UDP port is always closed.
Not sure if this matters: box is running ubuntu gutsy x86_64, with amule 2.1.3 ad wx 2.8.4.
-
This seems to be caused (at least in part) by problems in the wxWidgets datagram-socket code ... I'm trying to figure out how to fix it, but we probably won't be able to do anything but work around it in aMule itself.
-
Ok, here's a bit of an explanation: The reason why nmap reports that the sockets are closed is that wxWidgets is buggy*, and the empty UDP packet sent by nmap causes the socket to close. However, I'm not sure if that is what causes your original problem, though I suspect that it's related. I'll try to improve the workaround for this situation, so that the sockets gets reoped as soon as its closed.
* I've submitted a patch, which should hopefully resolve this problem.
-
named,
Xaignar has committed a patch that improves handling of invalidated UDP sockets. But I must agree with him in that it is probably not what causes your original problem.
I don't know exactly how this port scanner works (btw, I will check, thanks for the link!), but I imagine that if he could pass a few UDP packets through the router, then it considers it forwarding.
I have had a problem here with a WRT54G model 5 router that was driving me crazy, made me call the ISP support and look like a fool. It simply could not handle the reasonable intense ( ?, over the mean to be fair!) UDP traffic, and was dropping some UDP packets. When aMule was not running, I got near 100% success. When aMule was running, it entered an "UDP Dropping Mode (TM)" and even after stoping aMule it would behave badly. Turning the router off and on was the only way to make it work again. I have discovered it the hardest way, by faults in other UDP applications I was running.
I soon found out that model 5 WRT54G was a totally different hardware/software than it's great successor, model 4. LinkSys, now under Cisco has fooled me by making me believe it was a minor improvement by bumping the model number, when in fact it had less memory than before and no longer used linux. With such a big changes, I would never consider it a sucessor. It was a new product and far from beeing mature. I have returned it to my local dealer and changed it by an equivalent 3Com. And lived happy ever after. :)
Sorry for the long post, but to resume what I think, do not discard the possibility that your router is dropping UDP traffic at random.
Please, test tomorrow svn and report any changes. Thanks again for your support and patience.
-
I compiled today's CVS and I'am happy to say there is an improvement: before the Kad connection was first firewalled then off. Now it's stay firewalled and if the socket gets 'corrupted' by a nmap packet it gets re-recreated. However it does not solves the problem. I see packets received on my UDP port in the tcpdump traces, so I guess my forwarding/firewall settings are correct, but there are very few of them compared to the large number of requests. Maybe my router drops packets like in your case ... but I can't see anything obvious from the logs.
-
I hate to reply to my own post, but just to notify that the Kad connection is now working. It just seems it took a long time, but this new SVN version fixes the problem in my case.
-
Replying to your own post is ok. This is really good news! Thank you for all the help.
-
I finally got around to sharing my latest experiences with amule+kad. Unforunately for me the problem still persists. I simply can't connect thru kad. In an attempt to pinpoint the problem I tried emule+wine using the same ports I assign in amule. emule connects kad immediately, searching thru kad works, downloads work with only kad enabled. emule online port test (http://www.emule-project.net/home/perl/general.cgi?rm=porttest&tcpport=XXXXX&udpport=XXXXX&lang=1033&l=1) reports all ports ok. So I have managed to definitely rule out my lan setup, port frowarding, fiewall, OS... Only thing that remains is amule itself.
When I closed emule, I tried amule again. Briefly it reported connected to kad. But I suspect that these were connections initiated by emule on the same ports. So not really amule's merit. Searching kad didn't work, downloads also. Soon kad was disconnected again and upon restart this time it simply stayed disconnected. I also tried emule's port test page with amule running (using the same ports). This time it failed.
There is something really strange. I can see amule sending out kad requests. On its own it never gets replies. With emule having initiated some connections amule detects the incoming udp traffic and reports itself connected. So maybe (and this is just a guess) kad packets sent out by amule get rejected by the other clients and amule can't connect. Maybe. But why? ???
-
Anybody with an idea?
How can I check if the kad requests/hellos amule sends out are valid?
-
After posting this: http://forum.amule.org/index.php?topic=14447.0 , today i installed the latest CVS from the vollstreckt repositories (Debian etch) and i noticed that after some minutes i get the kad connected. However after about 30/40 minutes Kad suddenly come back to a firewalled status and nodes.dat become a 4 bytes file!
I also noticed, thanks to tcpdump on udp 4665 port, that amuled seems to try to connect to every contact in the contact.dat and then stops to connect... Here some exapmples before tcpdump never log any more packets....
00:06:17.767100 IP (tos 0x0, ttl 49, id 64037, offset 0, flags [DF], proto: UDP (17), length: 62) EXTIP.8004 > MYIP.4665: [udp sum ok] UDP, length 34
00:06:17.774795 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto: UDP (17), length: 34) MYIP.4665 > EXTIP.8004: [udp sum ok] UDP, length 6
00:06:17.971741 IP (tos 0x0, ttl 49, id 35858, offset 0, flags [DF], proto: UDP (17), length: 96) EXTIP.8004 > MYIP.4665: UDP, length 68
00:06:23.715841 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto: UDP (17), length: 34) MYIP.4665 > EXTIP.4665: [udp sum ok] UDP, length 6
00:06:29.562418 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto: UDP (17), length: 34) MYIP.4665 > EXTIP.4669: [udp sum ok] UDP, length 6
00:06:29.677407 IP (tos 0x0, ttl 51, id 41803, offset 0, flags [none], proto: UDP (17), length: 62) EXTIP.4669 > MYIP.4665: [udp sum ok] UDP, length 34
00:06:29.774017 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto: UDP (17), length: 34) MYIP.4665 > EXTIP.4669: [udp sum ok] UDP, length 6
-
Seems you send packets and get no responses. chances are your router/modem/ISP chokes on heavy UDP use.
-
This is definitely not the case with my setup. After all wine+emule works. Amule still doesn't, even with the latest svn.
-
Well, seems you send packets and get no response. I send packets with the same aMule and get responses. So do thousands of other users. I highly doubt blaming the program is the correct step here.
Now, if you can show me that you actually receive responses for the packets you send, we could take a look at that. But right now, I'm going to stick to my opinion.
-
amlue sends packets and gets no response. emule under wine sends packets and gets responses. How can I show you that I get responses? What exactly do you need? I will provide all the info you need, just be more specific.
-
I have the same exact problem as named. It could be a library problem; what distribution are you running, named? I'm on Ubuntu Gutsy.
-
@arbrandes: Gentoo.
-
I have the same exact problem as named. It could be a library problem; what distribution are you running, named? I'm on Ubuntu Gutsy.
What version of aMule are you using?
-
What version of aMule are you using?
I'm currently using amule svn, built on 2008-02-17. But I had the same problem under 2.1.3.
-
2.1.3 had the same behavior for me too.
-
I'm sorry for this late response. I don't think that i have no response from clients node. Infact in my previous post i reported a piece of tcpdump where there are query and response from the same IP... of course i banned the real IP/DNS name.
For statistics: I'm running amuled CVS (24.02.2008) on a debian etch.
I add some infos... i also noticed (like named) that if i install MLDonkey i get Kad working and the same is with amule on my desktop.
So, i tried to disable firewall on the amuled-server but kad is still firewalled. Finally, i tried to change UDP and TCP ports but without good results... this is very strange.. is it possible that only few people have this problem?
-
Finnally... problem solved!
Kry was right when he said that this is our problem and not a bug of amule CVS. After a search i found that my firewall (PfSense) need a setup to the outbound nat.
For other people using PfSense you need to got to the Firewall->NAT->Outbound tab and setup the Advanced Outbound Nat. Then you make a new rule for the IP of the amule client checking the "Static Port" selection. The final step is to set this last rule as the first rule of the advanced outbound nat and you will get Kad connection OK:
aMulecmd$ status
> ed2k: Connesso a Razorback 3.2 [85.17.52.124:5000] con ID alto
> Kad: Connesso (ok)
...CUT...
Hope this help other people.
-
I'm glad to hear that zeno78200 has solved his problem. However this doesn't explain my situation. My desktop PC is behind an IPCop box and I am sure I have set up port forwarding correctly. After all emule under wine connects Kad.
I am able to connect to the ed2k with a high id and I'm getting decent download speeds. Not being able to connect Kad is more of a nuisance than a real problem. I started this thread in the hope that I might be of help somehow but now I feel that it has hit a dead end. So feel free to close/delete it. Thanks to everyone who tried t help.
-
named,
I don't think we should close or delete the thread. If you or anyone with the same problem ever finds the solution to this problem, you/he can post it here and will be more than welcome. Unfortunately there is not much I can do without reproducing it.
Cheers!
-
Sorry for bringing that old topic up, but I just want to report that Kad finally works for me. I even get high id.
I haven't used aMule for quite a while. Yesterday I upgraded to 2.2.1 and Kad was working. So definitely it was not my network setup. It remains unchanged since my initial complaints. The only thing that's changed is aMule's version. I'm also running a 2.6.25 kernel now but I don't think that made the difference.
Anyway, just wanted to thank you for fixing Kad. :)