Re: Issue with "bytes" Range Unit and live streaming

Remy Lebeau <remy@lebeausoftware.org> Fri, 15 April 2016 19:27 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1909B12DB2F for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 15 Apr 2016 12:27:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.917
X-Spam-Level:
X-Spam-Status: No, score=-7.917 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.996, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HJFdDnxwxy8v for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 15 Apr 2016 12:27:04 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EF2A712DAD6 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Fri, 15 Apr 2016 12:27:03 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1ar9K8-00071n-03 for ietf-http-wg-dist@listhub.w3.org; Fri, 15 Apr 2016 19:22:36 +0000
Resent-Date: Fri, 15 Apr 2016 19:22:36 +0000
Resent-Message-Id: <E1ar9K8-00071n-03@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <remy@lebeausoftware.org>) id 1ar9K3-00070n-Hk for ietf-http-wg@listhub.w3.org; Fri, 15 Apr 2016 19:22:31 +0000
Received: from p3plsmtpa12-02.prod.phx3.secureserver.net ([68.178.252.231]) by lisa.w3.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <remy@lebeausoftware.org>) id 1ar9K1-0005N9-Tg for ietf-http-wg@w3.org; Fri, 15 Apr 2016 19:22:31 +0000
Received: from [192.168.1.13] ([108.184.46.71]) by p3plsmtpa12-02.prod.phx3.secureserver.net with id ijN11s00F1Y8uW401jN2lR; Fri, 15 Apr 2016 12:22:02 -0700
To: ietf-http-wg@w3.org
References: <57102718.7010900@ecaspia.com> <571041E0.5020401@lebeausoftware.org> <2D09D61DDFA73D4C884805CC7865E61142655F7B@GAALPA1MSGUSRBF.ITServices.sbc.com> <D3370313.258AE%goran.ap.eriksson@ericsson.com>
From: Remy Lebeau <remy@lebeausoftware.org>
Organization: Lebeau Software
Message-ID: <57113F4E.6040503@lebeausoftware.org>
Date: Fri, 15 Apr 2016 12:21:50 -0700
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2
MIME-Version: 1.0
In-Reply-To: <D3370313.258AE%goran.ap.eriksson@ericsson.com>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=68.178.252.231; envelope-from=remy@lebeausoftware.org; helo=p3plsmtpa12-02.prod.phx3.secureserver.net
X-W3C-Hub-Spam-Status: No, score=-3.9
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: lisa.w3.org 1ar9K1-0005N9-Tg 721f730868054ec03d47e8eef14497a0
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Issue with "bytes" Range Unit and live streaming
Archived-At: <http://www.w3.org/mid/57113F4E.6040503@lebeausoftware.org>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/31479
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

 > You mean response must contain content length?

Not a Content-Length header, no.  A "Transfer-Encoding: chunked" header 
can be used to represent an open-ended response.  But apparently the 
Content-Range response header can't be open-ended for a requested 
open-ended range.  It provides the requested first-byte-pos and the 
current last-byte-pos.  However, it can report an instance length of * 
to indicate the server does not know the full length of the entity being 
requested.

Remy Lebeau
Lebeau Software

On 4/15/2016 12:03 PM, Göran Eriksson AP wrote:
> Hi,
>
> Have a similar use case in a slightly different context. I find the draft
> and discussion useful.
>
> A few questions inline.
>
>
>
>> AFAICT, the existing ABNF for byte ranges *does* already support what you
>> are looking for, without having to introduce a new unit type:
>>
>>     byte-range-spec = first-byte-pos "-" [ last-byte-pos ]
>>
>> Simply omit the * and leave the second value empty:
>>     Range: bytes=1234567-
>>
>>
>>
>> RFC 2616 Section 14.35.1 says:
>>
>> "If the last-byte-pos value is absent, or if the value is greater than or
>> equal to the current length of the entity-body, last-byte-pos is taken to
>> be equal to one less than the current length of the entity- body in
>> bytes."
>>
>> <bhs> Yes the client can make an open-ended request. The problem is the
>> server has no means of providing an open-ended response.
>
> You mean response must contain content length?
>
>> RFC 7233 Section 2.1 says:
>>
>> "If the last-byte-pos value is absent, or if the value is greater than or
>> equal to the current length of the representation data, the byte range is
>> interpreted as the remainder of the representation (i.e., the server
>> replaces the value of last-byte-pos with
>> a value that is one less than the current length of the selected
>> representation)."
>>
>> <bhs> Correct. The server is required to provide an actual value for
>> last-byte-pos. And that value is based on the current length. If the
>> server is recording
>> the content from a live stream, whatever value the server provides will
>> no longer be the last byte almost as soon as the value is sent. The
>> actual endpoint is constantly increasing.
>>
>> Since the media is being recorded while streaming, the client can
>> randomly jump around within the recorded portion of the media all it
>> wants. Once jumped, it would simply be receiving media from the
>> recording, not the live feed.  To jump back to the live feed,
>> simply omit the "Range" header.
>>
>> <bhs> The use case is not one of the client recording the stream. It is
>> of the server recording the stream. Let me see if I can explain the use
>> case better.
>> The user is watching content on a client that is being streamed from a
>> server. The server is recording the content from a live stream.
>> The client has limited
>> memory and can only buffer about 15 seconds worth of content.
>> The user pauses watching the content and comes back after 1 minute to
>> resume. The client sends the server a request to provide content from the
>> paused byte position
>> to “-“.
>> The server is required to provide a response that has an actual last byte
>> value. The only last byte value the server has is the one for the precise
>> moment of
>> the request. After a minute, the server has a minute more of content but
>> has provided the client with the content up to that responded last byte.
> Isn’t the server providing the client with a new manifest with the latest
> ‘last byte’ every 15 seconds or so? Or are you after a solution where this
> approach is not used, instead with an “open request” in the request
> template?
>
> Would be good to know what kind of media player behaviour is assumed here,
> especially the manifest part of it.
>
>> Shouldn’t the server stop sending bytes once it gets to the value of its
>> responded last-byte-pos? Even though
>> it has now a whole lot more bytes and we know that the user just wants
>> to keep watching? Should the client be expected to make continual
>> requests to keep up with the ever-increasing endpoint?
>> The purpose of this proposal is to allow the server to provide an
>> open-ended response, so the server can send bytes that it didn’t have at
>> the time of the original
>> request.
>>
>> Barbara
>>