Re: [ftpext] End byte of transfer in FTP

John C Klensin <john-ietf@jck.com> Sun, 28 November 2010 23:39 UTC

Return-Path: <john-ietf@jck.com>
X-Original-To: ftpext@core3.amsl.com
Delivered-To: ftpext@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id E00A828B56A for <ftpext@core3.amsl.com>; Sun, 28 Nov 2010 15:39:45 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -102.582
X-Spam-Level:
X-Spam-Status: No, score=-102.582 tagged_above=-999 required=5 tests=[AWL=0.017, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YIKVH-jcyR4G for <ftpext@core3.amsl.com>; Sun, 28 Nov 2010 15:39:43 -0800 (PST)
Received: from bs.jck.com (ns.jck.com [209.187.148.211]) by core3.amsl.com (Postfix) with ESMTP id 6DF593A69A7 for <ftpext@ietf.org>; Sun, 28 Nov 2010 15:39:43 -0800 (PST)
Received: from [127.0.0.1] (helo=localhost) by bs.jck.com with esmtp (Exim 4.34) id 1PMqrS-000B84-0U; Sun, 28 Nov 2010 18:40:50 -0500
Date: Sun, 28 Nov 2010 18:40:49 -0500
From: John C Klensin <john-ietf@jck.com>
To: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>, ftpext@ietf.org
Message-ID: <8F4BB4C1C1895841414414D0@PST.JCK.COM>
In-Reply-To: <AANLkTi=_OsGPMsC=BHtOyHzTTM5vJ1=yW9fYk_Tp1xm7@mail.gmail.com>
References: <AANLkTi=_OsGPMsC=BHtOyHzTTM5vJ1=yW9fYk_Tp1xm7@mail.gmail.com>
X-Mailer: Mulberry/4.0.8 (Win32)
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Subject: Re: [ftpext] End byte of transfer in FTP
X-BeenThere: ftpext@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <ftpext.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/ftpext>, <mailto:ftpext-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/ftpext>
List-Post: <mailto:ftpext@ietf.org>
List-Help: <mailto:ftpext-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ftpext>, <mailto:ftpext-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 28 Nov 2010 23:39:46 -0000

--On Monday, November 29, 2010 01:21 +0900 Tatsuhiro Tsujikawa
<tatsuhiro.t@gmail.com> wrote:

> Hi,
> 
> In FTP, user can set start byte of transfer by REST command.

This is a misuse of the intent of the command and some
historical FTP implementations won't permit it.  In particular,
REST is defined only for Block and Compressed modes (neither of
which is widely used these days) and starts only from a
server-specified checkpoint marker.   While I can believe that
some implementations might construe REST followed by an integer
in stream mode as a byte offset to be used in a subsequent STOR
or RETR command, that usage is certainly not guaranteed by
anything in RFC 959.

Note that design is quite intentional and necessary to reflect a
wide variety of different file system organizations, including
files that are not organized sequentially on the remote or local
host.

As the most trivial example, FTP doesn't even guarantee that the
bits of a sequential file will be transferred in the order in
which they appear in their original form.

> But it seems it lacks the feature to set end byte of transfer,
> like HTTP's Range request.
> Does it really lack this feature? Are there any ftp
> server/client support this?

It seems to me that you are looking for a remote file management
protocol that supports a much more specific file abstraction
than is the case with FTP, which is purely and simply a file
transfer protocol for entire files, not fragments of them.  HTTP
does assume a particular type of file organization model, which
is one reason byte-oriented fragment identifiers work.  If that
model serves your needs, why not just use HTTP?   If you need
the more general organizational model of FTP, you will need to
either transfer the entire file and then extract whatever you
need (using whatever local access method is appropriate to that
file) or find/ use/ design a file management protocol, rather
than a file transfer one.

> A example of utilization this feature is Metalink download.
> In Metalink, it contains several URIs for one file. So we can
> download it from several sources. From each server, client
> downloads non-overlapping segment. For example, when
> downloading 1 file using 2 FTP servers. We can use REST
> command for second half of the download and it downloads given
>  point to the end of file. This is fine. The control
> connection can be reused. For the first half of the download,
> since we cannot set end byte, we have to close connection
> entirely after first half of file is downloaded. The control
> connection cannot be reused this time.
> We can use ABOR, but it has drawback as I mentioned earlier.

And, again, why not use HTTP?

    john