DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-04-23 17:43:44

bodbod
Member
Registered: 2007-11-22
Posts: 109

Disconnection on Pure FTP

Hi all,

I have a boring issue that I can't resolve by myself, I am constantly disconnected from my FTP server every 20-40 sec when I am uploading data from another computer (from another location). I have setup the idle time of the server to 10min but it does not change anything.
On my FTP client software, I have enable the NOOP option but it looks like this command is not understood by the FTP server. When I run the FEAT command, it lists the supported commands below :

[R] FEAT
[R] 211-Extensions supported:
[R]  EPRT
[R]  IDLE
[R]  MDTM
[R]  SIZE
[R]  REST STREAM
[R]  MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
[R]  MLSD
[R]  TVFS
[R]  ESTP
[R]  PASV
[R]  EPSV
[R]  SPSV
[R]  ESTA
[R] 211 End.

Before I was thinking that the issue would come from the fact that both of the actors are behind a router but neither active or passive option change something

thx to help me on that if you have encountered this kind of problem.

helllllllp !

Offline

 

#2 2008-04-24 13:47:10

bodbod
Member
Registered: 2007-11-22
Posts: 109

Re: Disconnection on Pure FTP

Any idea please ?

Offline

 

#3 2008-04-24 15:43:14

fordem
Member
Registered: 2007-01-26
Posts: 1938

Re: Disconnection on Pure FTP

Well - this is going to be a tough one to troubleshoot, and much more so to troubleshoot remotely - and frankly I think you're looking in the wrong direction.

You're establishing a connection, but it fails repeatedly every 20~40 seconds, and you're looking at a bunch of options & fiddling with them, apparently without taking the time or trouble to understand them, not a good idea in my opinion.

Why should the default idle time of 2 mins be the cause of a disconnection every 20~40 seconds?  Why would you think that increasing it to 10 mins would solve your problem?  What is the "idle time" anyway?  What does "NOOP" do and why should it solve your problem?

For starters - the "idle time" is pretty much what it suggests - after an idle (as in not being used) period of "x" minutes, the server will drop the connection - if the connection is not idle, the server will not disconnect the connection, this is not your problem - if the disconnect is occuring repeatedly at intervals shorter than the idle time, this is not your problem.  NOOP by the way is "no operation" - it's a command that basically says "do nothing" and it's used to keep the connection active, so that the server doesn't consider it "idle" and disconnect it - look elsewhere for your problem.

Now - you say that you are constantly disconnected .... every 20~40 seconds, and that implies that you are getting a connection.  If this is in fact so, then don't play with active & passive modes unless you're willing to do the research into what they are, why they exist and when to use them - just accept that because you get the initial connection that whichever mode you're using at the time works - if there is a problem with either mode and you need to use the other, you'll never get beyond establishing the control connection - look elsewhere for your problem.

Where should you look - that's the tough question.

If you are getting a connection and losing it every 20~40 seconds - then I would think you have a very sick network somewhere between the client and server - and that you should have seen other symptoms - so - for me the questions to consider are ...

Are you actually getting a connection?  Can you actually transfer data?  Or is it that you are establishing the control connection and never the data connection (in which case active/passive mode may hold the key)?

Offline

 

#4 2008-04-24 18:33:33

oxygen
Member
Registered: 2008-03-01
Posts: 320
Website

Re: Disconnection on Pure FTP

I guess it's the NAT / Firewall who's destroying the eonnection after a timeout. Not the Server.

Offline

 

#5 2008-04-24 19:13:39

fordem
Member
Registered: 2007-01-26
Posts: 1938

Re: Disconnection on Pure FTP

oxygen wrote:

I guess it's the NAT / Firewall who's destroying the eonnection after a timeout. Not the Server.

Just out of curiosity - why do you feel that a NAT/firewall would/should destroy an established connection, assuming it is active, after a timeout of 20~40 seconds.

I have been able to do ftp transfers from my DNS-323, behind a NAT/firewall to a Windows server also behind a NAT/firewall, separated by a "logical" distance of some 45,000 miles (one of them is on a satellite link) and the connection will stay up until I terminate it, or the 2 min idle disconnect elapses - oh - for clarity, the Windows server was the client and it was an "active mode" ftp connection.

If we move away from the DNS-323 to ftp in general, I've maintained ftp transfers for time spans exceeding sixteen (16) hours, with the client behind a NAT/firewall - this is a evaluation download from Microsoft, so I would assume that the server is behind a firewall of some sort, but it's not likely to be a NAT/firewall.

Yes - firewalls & especially NAT can be a significant issue for ftp - but in my experience they are more likely to prevent a connection from being made rather than destroy an established active connection, so unless there is evidence to point to the firewall, I don't think it should be a prime suspect.

ftp is unusual in that a transfer requires two connections - a control connection and a data connection.  With active ftp the control connection is created by the client and the data connection by the server - frequently the NAT/firewall at the client side cannot recognize the incoming data connection as belonging to the already established outgoing control connection and discards it - this is actually why passive ftp exists - with passive ftp, both the control and the data connection are established by the client, and are allowed by the client side NAT/firewall but the data connection ports are not "well known" ports and cannot be forwarded at the server side NAT/firewall with the same ease as the control connection, and the end result is essentially the same - control connection established but no data connection.

The crucial factor here is whether or not both the control and data connections are actually being made - if they are then the NAT/firewall is not likely to be the problem, if they're not, especially if only the control connection is being made, then there is a very strong probability, that one or the other (or both) NAT/firewall is responsible.

My point is that "guesses" are not a good way to troubleshoot connection problems - the first step is to establish what is or is not happening and then determine the cause, it is a multistep process and there may be mutliple things not happening and multiple causes, but it starts with the first step - defining what is not happening.

Offline

 

#6 2008-04-25 02:10:25

bodbod
Member
Registered: 2007-11-22
Posts: 109

Re: Disconnection on Pure FTP

Bonsoir guys,

First Thx for taking time for my problem; here are more details below for trying to understand it more precisely :

the client establish the connexion and list well in passive or active more
transfer of data is processing, no problem, it is writing on the HDD.
the DNS-323 is plugged to the router by an ethernet cable, so no wifi interaction on that part of the network.
client used is flashxp
same problem in local than from internet access
i did not have this problem before i upgrade the firmware to 1.04b63 (it was another ftp server before i think in the version 1.03)
the router has not been changed, same config NAT/FW

logs of what is happening :

FlashFXP v3.1.7 build 1060 [BETA RELEASE]
Support Forums at http://forum.flashfxp.com

WinSock 2.0 -- OpenSSL 0.9.7e 25 Oct 2004
[R] Connecting to bodbod upload -> DNS=xxxxxxxxxxxxx.xxx IP=xx.xxx.xxx.xxx PORT=21
[R] Connected to bodbod upload
[R] 220---------- Welcome to Pure-FTPd ----------
[R] 220-You are user number 1 of 4 allowed.
[R] 220-Local time is now 22:42. Server port: 21.
[R] 220 You will be disconnected after 10 minutes of inactivity.
[R] USER upload
[R] 331 User upload OK. Password required
[R] PASS (hidden)
[R] 230 OK. Current restricted directory is /
[R] SYST
[R] 215 UNIX Type: L8
[R] FEAT
[R] 211-Extensions supported:
[R]  EPRT
[R]  IDLE
[R]  MDTM
[R]  SIZE
[R]  REST STREAM
[R]  MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
[R]  MLSD
[R]  TVFS
[R]  ESTP
[R]  PASV
[R]  EPSV
[R]  SPSV
[R]  ESTA
[R] 211 End.
[R] PWD
[R] 257 "/" is your current location
[R] TYPE A
[R] 200 TYPE is now ASCII
[R] PASV
[R] 227 Entering Passive Mode (xx,xxx,xxx,xxx,175,57)
[R] Opening data connection IP: xx.xxx.xxx.xxx PORT: 44857
[R] LIST -al
[R] 150 Accepted data connection
[R] 226-Options: -a -l
[R] 226 16 matches total
[R] List Complete: 1 KB in 0.05 seconds (24.4 KB/s)
[R] TYPE I
[R] 200 TYPE is now 8-bit binary
[R] PASV
[R] 227 Entering Passive Mode (xx,xxx,xxx,xxx,107,245)
[R] Opening data connection IP: xx.xxx.xxx.xxx PORT: 27637
[R] STOR lfc-inft.ISO
[R] 150 Accepted data connection
[R] 421 Timeout (no new data for 600 seconds)
[R] Connection lost: bodbod upload
[R] Transfer Failed!
[R] Attempting to Reconnect.
[R] Connecting to bodbod upload -> DNS=bodbod.myftp.biz IP=xx.xxx.xxx.xxx PORT=21 (attempt # 1)
[R] Connected to bodbod upload
[R] 220---------- Welcome to Pure-FTPd ----------
[R] 220-You are user number 1 of 4 allowed.
[R] 220-Local time is now 22:44. Server port: 21.
[R] 220 You will be disconnected after 10 minutes of inactivity.
[R] USER upload
etc...

Now some explanations of my first post, i apologies in advance if i am saying stupid things but i am not a IT specialist as fordem looks like to be...
i was talking about the NOOP commands because i know that a ftp needs to get 2 connexions normally in passive mode (data flow + commands)
my first "guess" as you said was that both connexions were opening and working fine at the beginning; the disconnection for me was coming from the fact that i was loosing the "command" connection because of idle timing or so... that's why I was trying to enable the noop in order to send packets to the ftp server for telling him to not kick me so quickly.

I tried in active mode as well for not having a question from somebody asking me if i tried in this mode but as it is listing correctly i understand that itwas already not the problem... anyway.

I thought that the FEAT command was listing the available commands on the server but i read later on that pure ftp was supporting the noop  command too, so it is my mystake, appologies...

I hope with those details above, it will give you more clues about the issue.

thx in advance

Offline

 

#7 2008-04-25 03:48:16

fordem
Member
Registered: 2007-01-26
Posts: 1938

Re: Disconnection on Pure FTP

OK - a couple of things don't quite make sense here.

First ...

same problem in local than from internet access

What this says to me is that you have the same problem with a local connection - maybe I'm misunderstanding you - but if you're having this problem locally, then that immediately eliminates the firewalls and NAT.

Second - towards the bottom of your listing, the following line appears ....

[R] 421 Timeout (no new data for 600 seconds)

This suggests that the connection is being terminated by the ftp server for inactivity after 600 seconds and should not be happening every 20~40 seconds as originally stated, it would point to some sort of problem with the ftp server.

BUT .....

I brought up the ftp server on my DNS-323 and attempted to duplicate the problem and discovered that several of the commands in the list provided do not work - SYST, LIST, PASV, STOR - all return an invalid command message.  I was especially curious about SYST, since in the list provided it returned

[R] 215 UNIX Type: L8

which is not quite what I would have expected from the DNS-323 which runs linux.

Finally - I deliberately left the control connection to my DNS-323 open beyond the timeout and there was no error message - until I sent the next command, and the error message reads "421 Timeout - try typing a little faster next time", followed by "Connection closed by remote host"

I have to assume that either you are not connected to a DNS-323 or you are not connected to a DNS-323 running the standard firmware and ftp server.

Offline

 

#8 2008-04-25 13:59:35

bodbod
Member
Registered: 2007-11-22
Posts: 109

Re: Disconnection on Pure FTP

Fordem,

When I am saying : "same problem in local than from internet access", it really means what it means, i connect from my computer from the local network to the router which goes to the DNS-323. I did this test in order to eliminate a possible issue with the computer which uploads. The conclusion for me was that the FTP server or the router gives the trouble; but, as no changes have been done on the router since i upgraded the DNS-323 and as it was working perfectly before with v1.03, i presume that it is the FTP giving troubles.

Your remark about the timeout is actually my problem, i am kicked out after 30-40 sec but I have set up the idle time to 10 min (600 sec).  Weird, isn't it ?

Finally, i can assure you about the fact that i am using the DNS-323 with its original firwmare without any modification, no fun plug as everything i need is working fine (UPNP server fixed in V1.04 with my PS3).
In order to make you able to see and control directly the issue, i am going to PM you the login/pass of my server for uploading a test file.

Thx for spending time on my ftp issue

Offline

 

#9 2008-04-25 15:54:35

fordem
Member
Registered: 2007-01-26
Posts: 1938

Re: Disconnection on Pure FTP

bodhod

Trying to connect to a forwarded port from inside the same LAN can sometimes produce very puzzling results, and may or may not work, depending on the feature set and configuration of the router being used.

I was able to connect to your ftp server and downloaded the two smallest files, the idea being to see if it would boot me off in the 20~40 second time frame that you mentioned (it doesn't), and I successfully uploaded a small .pdf which took just less than 9 minutes - based on that I would say your problem is at the client side or in between, it's certainly not your DNS-323 or the DNS-323 side NAT/firewall or network.

Now - I'm just being curiosity here - there are a couple of hints in your posts that suggests a "french connection" - but - your physical location suggest otherwise.

Offline

 

#10 2008-04-25 16:48:27

bodbod
Member
Registered: 2007-11-22
Posts: 109

Re: Disconnection on Pure FTP

Ok fordem,
I will try another client just in case. My issue is only when I upload BIG files (400 Mo for my test) from the Wan or Lan (Lan was just for the test).
Anyway, you did a test of 9 meg and I think it is enough for staying at least 1 min on it and encounter the issue explained above.

I will maybe disable the Ftp if nothing changes in my tests, i have the possibility to install one on the router directly (SD extension) - it would be the ultimate solution.

Thx for your help and the wasted time.

PS: by the way, yes I am french but I am living in Dublin. Sorry for my english (or French as they say here), i did not realized it was so obvious smile

Last edited by bodbod (2008-04-25 16:59:33)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB