draft-ietf-httpbis-rand-access-live-04.txt   draft-ietf-httpbis-rand-access-live-latest.txt 
HTTP Working Group C. Pratt HTTP Working Group C. Pratt
Internet-Draft Internet-Draft
Intended status: Experimental D. Thakore Intended status: Experimental D. Thakore
Expires: September 7, 2019 CableLabs Expires: January 7, 2025 CableLabs
B. Stark B. Stark
AT&T AT&T
March 6, 2019 July 6, 2024
HTTP Random Access and Live Content HTTP Random Access and Live Content
draft-ietf-httpbis-rand-access-live-04 draft-ietf-httpbis-rand-access-live-latest
Abstract Abstract
To accommodate byte range requests for content that has data appended To accommodate byte-range requests for content that has data appended
over time, this document defines semantics that allow a HTTP client over time, this document defines semantics that allow an HTTP client
and server to perform byte-range GET and HEAD requests that start at and a server to perform byte-range GET and HEAD requests that start
an arbitrary byte offset within the representation and ends at an at an arbitrary byte offset within the representation and end at an
indeterminate offset. indeterminate offset.
Editorial Note (To be removed by RFC Editor before publication) Editorial Note (To be removed by RFC Editor before publication)
Discussion of this draft takes place on the HTTPBIS working group Discussion of this draft takes place on the HTTPBIS working group
mailing list (ietf-http-wg@w3.org), which is archived at mailing list (ietf-http-wg@w3.org), which is archived at
<https://lists.w3.org/Archives/Public/ietf-http-wg/>. <https://lists.w3.org/Archives/Public/ietf-http-wg/>.
Working Group information can be found at <http://httpwg.github.io/>; Working Group information can be found at <http://httpwg.github.io/>;
source code and issues list for this draft can be found at source code and issues list for this draft can be found at
skipping to change at page 1, line 47 skipping to change at page 1, line 47
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on September 7, 2019. This Internet-Draft will expire on January 7, 2025.
Copyright Notice Copyright Notice
Copyright (c) 2019 IETF Trust and the persons identified as the Copyright (c) 2024 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1. Requirements Language . . . . . . . . . . . . . . . . . . 3 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3
1.2. Notational Conventions . . . . . . . . . . . . . . . . . 3 2. Performing Range Requests on Random-Access Aggregating (Live)
2. Performing Range requests on Random-Access Aggregating Content . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
("live") Content . . . . . . . . . . . . . . . . . . . . . . 4
2.1. Establishing the Randomly Accessible Byte Range . . . . . 4 2.1. Establishing the Randomly Accessible Byte Range . . . . . 4
2.2. Byte-Range Requests Beyond the Randomly Accessible Byte 2.2. Byte-Range Requests beyond the Randomly Accessible Byte
Range . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Range . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3. Other Applications of Random-Access Aggregating Content . . . 7 3. Other Applications of Random-Access Aggregating Content . . . 7
3.1. Requests Starting at the Aggregation ("Live") Point . . . 7 3.1. Requests Starting at the Aggregation/Live Point . . . . . 7
3.2. Shift Buffer Representations . . . . . . . . . . . . . . 8 3.2. Shift-Buffer Representations . . . . . . . . . . . . . . 8
4. Recommendations for Very Large Values . . . . . . . . . . . . 10 4. Recommendations for Byte-Range Request last-byte-pos Values . 9
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10
6. Security Considerations . . . . . . . . . . . . . . . . . . . 10 6. Security Considerations . . . . . . . . . . . . . . . . . . . 10
7. References . . . . . . . . . . . . . . . . . . . . . . . . . 11 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 10
7.1. Normative References . . . . . . . . . . . . . . . . . . 11 7.1. Normative References . . . . . . . . . . . . . . . . . . 10
7.2. Informative References . . . . . . . . . . . . . . . . . 11 7.2. Informative References . . . . . . . . . . . . . . . . . 11
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 11 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 11
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 12 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 11
1. Introduction 1. Introduction
Some Hypertext Transfer Protocol (HTTP) clients use byte-range Some Hypertext Transfer Protocol (HTTP) clients use byte-range
requests (Range requests using the "bytes" Range Unit) to transfer requests (range requests using the "bytes" range unit) to transfer
select portions of large representations ([RFC7233]). And in some select portions of large representations [RFC7233]. In some cases,
cases large representations require content to be continuously or large representations require content to be continuously or
periodically appended - such as representations consisting of live periodically appended, such as representations consisting of live
audio or video sources, blockchain databases, and log files. Clients audio or video sources, blockchain databases, and log files. Clients
cannot access the appended/live content using a Range request with cannot access the appended/live content using a range request with
the bytes range unit using the currently defined byte-range semantics the "bytes" range unit using the currently defined byte-range
without accepting performance or behavior sacrifices which are not semantics without accepting performance or behavior sacrifices that
acceptable for many applications. are not acceptable for many applications.
For instance, HTTP clients have the ability to access appended For instance, HTTP clients have the ability to access appended
content on an indeterminate-length resource by transferring the content on an indeterminate-length resource by transferring the
entire representation from the beginning and continuing to read the entire representation from the beginning and continuing to read the
appended content as it's made available. Obviously, this is highly appended content as it's made available. Obviously, this is highly
inefficient for cases where the representation is large and only the inefficient for cases where the representation is large and only the
most recently appended content is needed by the client. most recently appended content is needed by the client.
Alternatively, clients can also access appended content by sending Alternatively, clients can access appended content by sending
periodic open-ended bytes Range requests using the last-known end periodic, open-ended byte-range requests using the last known end
byte position as the range start. Performing low-frequency periodic byte position as the range start. Performing low-frequency periodic
bytes Range requests in this fashion (polling) introduces latency byte-range requests in this fashion (polling) introduces latency
since the client will necessarily be somewhat behind the aggregated since the client will necessarily be somewhat behind in transferring
content - mimicking the behavior (and latency) of segmented content the aggregated content, effectively resulting in the same kind of
representations such as "HTTP Live Streaming" (HLS, [RFC8216]) or latency issues with the segmented content transfer mechanisms in
"Dynamic Adaptive Streaming over HTTP" (MPEG-DASH, [DASH]). And "HTTP Live Streaming" (HLS) [RFC8216] and "Dynamic Adaptive Streaming
while performing these Range requests at higher frequency can reduce over HTTP" [MPEG-DASH]. While performing these range requests at
this latency, it also incurs more processing overhead and HTTP higher frequency can reduce this latency, it also incurs more
exchanges as many of the requests will return no content - since processing overhead and HTTP exchanges as many of the requests will
content is usually aggregated in groups of bytes (e.g. a video frame, return no content, since content is usually aggregated in groups of
audio sample, block, or log entry). bytes (e.g., a video frame, audio sample, block, or log entry).
This document describes a usage model for range requests which This document describes a usage model for range requests that enables
enables efficient retrieval of representations that are appended to efficient retrieval of representations that are appended to over time
over time by using large values and associated semantics for by using large values and associated semantics for communicating
communicating range end positions. This model allows representations range end positions. This model allows representations to be
to be progressively delivered by servers as new content is added. It progressively delivered by servers as new content is added. It also
also ensures compatibility with servers and intermediaries that don't ensures compatibility with servers and intermediaries that don't
support this technique. support this technique.
1.1. Requirements Language 1.1. Notational Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 [RFC2119].
1.2. Notational Conventions
This document cites productions in Augmented Backus-Naur Form (ABNF) This document cites Augmented Backus-Naur Form (ABNF) productions
productions from [RFC7233], using the notation defined in [RFC5234]. from [RFC7233], using the notation defined in [RFC5234].
2. Performing Range requests on Random-Access Aggregating ("live") 2. Performing Range Requests on Random-Access Aggregating (Live)
Content Content
This document recommends a two-step process for accessing resources This document recommends a two-step process for accessing resources
that have indeterminate length representations. that have indeterminate-length representations.
Two steps are necessary because of limitations with the Range request Two steps are necessary because of limitations with the range request
header fields and the Content-Range response header fields. A server header fields and the Content-Range response header fields. A server
cannot know from a range request that a client wishes to receive a cannot know from a range request that a client wishes to receive a
response that does not have a definite end. More critically, the response that does not have a definite end. More critically, the
header fields do not allow the server to signal that a resource has header fields do not allow the server to signal that a resource has
indeterminate length without also providing a fixed portion of the indeterminate length without also providing a fixed portion of the
resource. resource.
A client first learns that the resource has a representation of A client first learns that the resource has a representation of
indeterminate length by requesting a range of the resource. The indeterminate length by requesting a range of the resource. The
server responds with the range that is available, but indicates that server responds with the range that is available but indicates that
the length of the representation is unknown using the existing the length of the representation is unknown using the existing
Content-Range syntax. See Section 2.1 for details and examples. Content-Range syntax. See Section 2.1 for details and examples.
Once the client knows the resource has indeterminate length, it can Once the client knows the resource has indeterminate length, it can
request a range with a very large end position from the resource. request a range with a very large end position from the resource.
The client chooses an explicit end value larger than can be The client chooses an explicit end value larger than can be
transferred in the foreseeable term. A server which supports range transferred in the foreseeable term. A server that supports range
requests of indeterminate length signals its understanding of the requests of indeterminate length signals its understanding of the
client's indeterminate range request by indicating that the range it client's indeterminate range request by indicating that the range it
is providing has a range end that exactly matches the client's is providing has a range end that exactly matches the client's
requested range end rather than a range that is bounded by what is requested range end rather than a range that is bounded by what is
currently available. See Section 2.2 for details. currently available. See Section 2.2 for details.
2.1. Establishing the Randomly Accessible Byte Range 2.1. Establishing the Randomly Accessible Byte Range
Establishing if a representation is continuously aggregating ("live") Determining if a representation is continuously aggregating ("live")
and determining the randomly-accessible byte range can both be and determining the randomly accessible byte range can both be
determined using the existing definition for an open-ended byte-range performed using the existing definition for an open-ended byte-range
request. Specifically, Section 2.1 of [RFC7233] defines a byte-range request. Specifically, Section 2.1 of [RFC7233] defines a byte-range
request of the form: request of the form:
byte-range-spec = first-byte-pos "-" [ last-byte-pos ] byte-range-spec = first-byte-pos "-" [ last-byte-pos ]
which allows a client to send a HEAD request with a first-byte-pos which allows a client to send a HEAD request with a first-byte-pos
and leave last-byte-pos absent. A server that receives a satisfiable and leave last-byte-pos absent. A server that receives a satisfiable
byte-range request (with first-byte-pos smaller than the current byte-range request (with first-byte-pos smaller than the current
representation length) may respond with a 206 status code (Partial representation length) may respond with a 206 status code (Partial
Content) with a Content-Range header field indicating the currently Content) with a Content-Range header field indicating the currently
satisfiable byte range. For example: satisfiable byte range. For example:
HEAD /resource HTTP/1.1 HEAD /resource HTTP/1.1
Host: example.com Host: example.com
Range: bytes=0- Range: bytes=0-
returns a response of the form: returns a response of the form:
HTTP/1.1 206 Partial Content HTTP/1.1 206 Partial Content
Content-Range: bytes 0-1234567/* Content-Range: bytes 0-1234567/*
from the server indicating that (1) the complete representation from the server indicating that (1) the complete representation
length is unknown (via the "*" in place of the complete-length field) length is unknown (via the "*" in place of the complete-length field)
and (2) that only bytes 0-1234567 were accessible at the time the and (2) only bytes 0-1234567 were accessible at the time the request
request was processed by the server. The client can infer from this was processed by the server. The client can infer from this response
response that bytes 0-1234567 of the representation can be requested that bytes 0-1234567 of the representation can be requested and
and returned in a timely fashion (the bytes are immediately transfer can be performed immediately.
available).
2.2. Byte-Range Requests Beyond the Randomly Accessible Byte Range 2.2. Byte-Range Requests beyond the Randomly Accessible Byte Range
Once a client has determined that a representation has an Once a client has determined that a representation has an
indeterminate length and established the byte range that can be indeterminate length and established the byte range that can be
accessed, it may want to perform a request with a start position accessed, it may want to perform a request with a start position
within the randomly-accessible content range and an end position at within the randomly accessible content range and an end position at
an indefinite "live" point - a point where the byte-range GET request an indefinite/live point -- a point where the byte-range GET request
is fulfilled on-demand as the content is aggregated. is fulfilled on-demand as the content is aggregated.
For example, for a large video asset, a client may wish to start a For example, for a large video asset, a client may wish to start a
content transfer from the video "key" frame immediately before the content transfer from the video "key" frame immediately before the
point of aggregation and continue the content transfer indefinitely point of aggregation and continue the content transfer indefinitely
as content is aggregated - in order to support low-latency startup of as content is aggregated, in order to support low-latency startup of
a live video stream. a live video stream.
Unlike a byte-range Range request, a byte-range Content-Range Unlike a byte-range request header field, a byte-content-range
response header field cannot be "open ended", per Section 4.2 of response header field cannot be "open-ended", per Section 4.2 of
[RFC7233]: [RFC7233]:
byte-content-range = bytes-unit SP byte-content-range = bytes-unit SP
( byte-range-resp / unsatisfied-range ) ( byte-range-resp / unsatisfied-range )
byte-range-resp = byte-range "/" ( complete-length / "*" ) byte-range-resp = byte-range "/" ( complete-length / "*" )
byte-range = first-byte-pos "-" last-byte-pos byte-range = first-byte-pos "-" last-byte-pos
unsatisfied-range = "*/" complete-length unsatisfied-range = "*/" complete-length
complete-length = 1*DIGIT complete-length = 1*DIGIT
Specifically, last-byte-pos is required in byte-range. So in order Specifically, last-byte-pos is required in byte-range. So, in order
to preserve interoperability with existing HTTP clients, servers, to preserve interoperability with existing HTTP clients, servers,
proxies, and caches, this document proposes a mechanism for a client proxies, and caches, this document proposes a mechanism for a client
to indicate support for handling an indeterminate-length byte-range to indicate support for handling an indeterminate-length byte-range
response, and a mechanism for a server to indicate if/when it's response and a mechanism for a server to indicate if/when it's
providing an indeterminate-length response. providing an indeterminate-length response.
A client can indicate support for handling indeterminate-length byte- A client can indicate support for handling indeterminate-length byte-
range responses by providing a very large value for the last-byte-pos range responses by providing a very large value for the last-byte-pos
in the byte-range request. For example, a client can perform a byte- in the byte-range request. For example, a client can perform a byte-
range GET request of the form: range GET request of the form:
GET /resource HTTP/1.1 GET /resource HTTP/1.1
Host: example.com Host: example.com
Range: bytes=1230000-999999999999 Range: bytes=1230000-999999999999
where the last-byte-pos in the request is much larger than the last-
where the last-byte-pos in the Request is much larger than the last-
byte-pos returned in response to an open-ended byte-range HEAD byte-pos returned in response to an open-ended byte-range HEAD
request, as described above, and much larger than the expected request, as described above, and much larger than the expected
maximum size of the representation. See Section 6 for range value maximum size of the representation. See Section 6 for range value
considerations. considerations.
In response, a server may indicate that it is supplying a In response, a server may indicate that it is supplying a
continuously aggregating ("live") response by supplying the client continuously aggregating/live response by supplying the client
request's last-byte-pos in the Content-Range response header field. request's last-byte-pos in the Content-Range response header field.
For example: For example:
GET /resource HTTP/1.1 GET /resource HTTP/1.1
Host: example.com Host: example.com
Range: bytes=1230000-999999999999 Range: bytes=1230000-999999999999
returns returns
HTTP/1.1 206 Partial Content HTTP/1.1 206 Partial Content
Content-Range: bytes 1230000-999999999999/* Content-Range: bytes 1230000-999999999999/*
from the server to indicate that the response will start at byte from the server to indicate that the response will start at byte
1230000 and continues indefinitely to include all aggregated content, 1230000 and continue indefinitely to include all aggregated content,
as it becomes available. as it becomes available.
A server that doesn't support or supply a continuously aggregating A server that doesn't support or supply a continuously aggregating/
("live") response will supply the currently satisfiable byte range, live response will supply the currently satisfiable byte range, as it
as it would with an open-ended byte request. would with an open-ended byte request.
For example: For example:
GET /resource HTTP/1.1 GET /resource HTTP/1.1
Host: example.com Host: example.com
Range: bytes=1230000-999999999999 Range: bytes=1230000-999999999999
will return returns
HTTP/1.1 206 Partial Content HTTP/1.1 206 Partial Content
Content-Range: bytes 1230000-1234567/* Content-Range: bytes 1230000-1234567/*
from the server to indicate that the response will start at byte from the server to indicate that the response will start at byte
1230000 and end at byte 1234567 and will not include any aggregated 1230000, end at byte 1234567, and not include any aggregated content.
content. This is the response expected from a typical HTTP server - This is the response expected from a typical HTTP server -- one that
one that doesn't support byte-range requests on aggregating content. doesn't support byte-range requests on aggregating content.
A client that doesn't receive a response indicating it is A client that doesn't receive a response indicating it is
continuously aggregating must use other means to access aggregated continuously aggregating must use other means to access aggregated
content (e.g. periodic byte-range polling). content (e.g., periodic byte-range polling).
A server that does return a continuously aggregating ("live") A server that does return a continuously aggregating/live response
response should return data using chunked transfer coding and not should return data using chunked transfer coding and not provide a
provide a Content-Length header field. A 0-length chunk indicates Content-Length header field. A 0-length chunk indicates the end of
the end of the transfer, per Section 4.1 of [RFC7230]. the transfer, per Section 4.1 of [RFC7230].
3. Other Applications of Random-Access Aggregating Content 3. Other Applications of Random-Access Aggregating Content
3.1. Requests Starting at the Aggregation ("Live") Point 3.1. Requests Starting at the Aggregation/Live Point
A client that wishes to only receive newly-aggregated portions of a A client that wishes to only receive newly aggregated portions of a
resource (i.e., start at the "live" point), can use a HEAD request to resource (i.e., start at the live point) can use a HEAD request to
learn what range the server has currently available and initiate an learn what range the server has currently available and initiate an
indeterminate-length transfer. For example: indeterminate-length transfer. For example:
HEAD /resource HTTP/1.1 HEAD /resource HTTP/1.1
Host: example.com Host: example.com
Range: bytes=0- Range: bytes=0-
With the Content-Range response header field indicating the range (or with the Content-Range response header field indicating the range (or
ranges) available. For example: ranges) available. For example:
206 Partial Content 206 Partial Content
Content-Range: bytes 0-1234567/* Content-Range: bytes 0-1234567/*
The client can then issue a request for a range starting at the end The client can then issue a request for a range starting at the end
value (using a very large value for the end of a range) and receive value (using a very large value for the end of a range) and receive
only new content. only new content.
GET /resource HTTP/1.1 For example:
Host: example.com
Range: bytes=1234567-999999999999 GET /resource HTTP/1.1
Host: example.com
Range: bytes=1234567-999999999999
with a server returning a Content-Range response indicating that an with a server returning a Content-Range response indicating that an
indeterminate-length response body will be provided indeterminate-length response body will be provided:
206 Partial Content 206 Partial Content
Content-Range: bytes 1234567-999999999999/* Content-Range: bytes 1234567-999999999999/*
3.2. Shift Buffer Representations 3.2. Shift-Buffer Representations
Some representations lend themselves to front-end content removal in Some representations lend themselves to front-end content removal in
addition to aggregation. While still supporting random access, addition to aggregation. While still supporting random access,
representations of this type have a portion at the beginning (the "0" representations of this type have a portion at the beginning (the "0"
end) of the randomly-accessible region that become inaccessible over end) of the randomly accessible region that becomes inaccessible over
time. Examples of this kind of representation would be an audio- time. Examples of this kind of representation would be an audio-
video time-shift buffer or a rolling log file. video time-shift buffer or a rolling log file.
For example a Range request containing: For example, a range request containing:
HEAD /resource HTTP/1.1 HEAD /resource HTTP/1.1
Host: example.com Host: example.com
Range: bytes=0- Range: bytes=0-
returns returns
206 Partial Content 206 Partial Content
Content-Range: bytes 1000000-1234567/* Content-Range: bytes 1000000-1234567/*
indicating that the first 1000000 bytes were not accessible at the indicating that the first 1000000 bytes were not accessible at the
time the HEAD request was processed. Subsequent HEAD requests could time the HEAD request was processed. Subsequent HEAD requests could
return: return:
Content-Range: bytes 1000000-1234567/* Content-Range: bytes 1000000-1234567/*
Content-Range: bytes 1010000-1244567/* Content-Range: bytes 1010000-1244567/*
Content-Range: bytes 1020000-1254567/* Content-Range: bytes 1020000-1254567/*
Note though that the difference between the first-byte-pos and last- Note though that the difference between the first-byte-pos and last-
byte-pos need not be constant. byte-pos need not be constant.
The client could then follow-up with a GET Range request containing The client could then follow up with a GET range request containing:
GET /resource HTTP/1.1
Host: example.com GET /resource HTTP/1.1
Range: bytes=1020000-999999999999 Host: example.com
Range: bytes=1020000-999999999999
with the server returning with the server returning
206 Partial Content 206 Partial Content
Content-Range: bytes 1020000-999999999999/* Content-Range: bytes 1020000-999999999999/*
with the response body returning bytes 1020000-1254567 immediately with the response body returning bytes 1020000-1254567 immediately
and aggregated ("live") data being returned as the content is and aggregated/live data being returned as the content is aggregated.
aggregated.
A server that doesn't support or supply a continuously aggregating
("live") response will supply the currently satisfiable byte range,
as it would with an open-ended byte request.
For example: A server that doesn't support or supply a continuously aggregating/
live response will supply the currently satisfiable byte range, as it
would with an open-ended byte request. For example:
GET /resource HTTP/1.1 GET /resource HTTP/1.1
Host: example.com Host: example.com
Range: bytes=0-999999999999 Range: bytes=0-999999999999
will return returns
HTTP/1.1 206 Partial Content HTTP/1.1 206 Partial Content
Content-Range: bytes 1020000-1254567/* Content-Range: bytes 1020000-1254567/*
from the server to indicate that the response will start at byte from the server to indicate that the response will start at byte
1020000, end at byte 1254567, and will not include any aggregated 1020000, end at byte 1254567, and not include any aggregated content.
content. This is the response expected from a typical HTTP server - This is the response expected from a typical HTTP server -- one that
one that doesn't support byte-range requests on aggregating content. doesn't support byte-range requests on aggregating content.
Note that responses to GET requests against shift-buffer Note that responses to GET requests performed on shift-buffer
representations using Range can be cached by intermediaries, since representations using Range headers can be cached by intermediaries,
the Content-Range response header indicates which portion of the since the Content-Range response header indicates which portion of
representation is being returned in the response body. However GET the representation is being returned in the response body. However,
requests without a Range header cannot be cached since the first byte GET requests without a Range header cannot be cached since the first
of the response body can vary from request to request. To ensure byte of the response body can vary from request to request. To
Range-less GET requests against shift-buffer representations are not ensure GET requests without Range headers on shift-buffer
cached, servers hosting a shift-buffer representation should either representations are not cached, servers hosting a shift-buffer
not return a 200-level response (e.g. sending a 300-level redirect representation should either not return a 200-level response (e.g.,
response with a URI that represents the current start of the shift- send a 300-level redirect response with a URI that represents the
buffer) or indicate the response is non-cacheable. See HTTP Caching current start of the shift buffer) or indicate the response is non-
([RFC7234]) for details on HTTP cache control. cacheable. See [RFC7234] for details on HTTP cache control.
4. Recommendations for Very Large Values 4. Recommendations for Byte-Range Request last-byte-pos Values
While it would be ideal to define a single numerical Very Large While it would be ideal to define a single large last-byte-pos value
Value, there's no single value that would work for all applications for byte-range requests, there's no single value that would work for
and platforms. e.g. JavaScript numbers cannot represent all integer all applications and platforms. For example, JavaScript numbers
values above 2^^53, so a JavaScript application may want to use cannot represent all integer values above 2^^53, so a JavaScript
2^^53-1 for a Very Large Value. This value, however, would not be application may want to use 2^^53-1 for last-byte-pos. This value,
sufficient for all applications, such as continuously-streaming high- however, would not be sufficient for all applications, such as long-
bitrate streams. So the value 2^^53-1 (9007199254740991) is duration high-bitrate streams. So 2^^53-1 (9007199254740991) is
recommended as a Very Large Value unless an application has a good recommended as a last-byte-pos unless an application has a good
justification to use a smaller or larger value. e.g. If it's always justification to use a smaller or larger value. For example, if it
known that the resource won't exceed a value smaller than the is always known that the resource won't exceed a value smaller than
recommended Very Large Value for an application, a smaller value can the recommended last-byte-pos for an application, a smaller value can
be used. And if it's likely that an application will utilize be used. If it's likely that an application will utilize resources
resources larger than the recommended Very Large Value - such as a larger than the recommended last-byte-pos (such as a continuously
continuously aggregating high-bitrate media stream - a larger value aggregating high-bitrate media stream), a larger value should be
should be used. used.
Note that, in accordance with the semantics defined above, servers Note that, in accordance with the semantics defined above, servers
that support random-access live content will need to return the last- that support random-access live content will need to return the last-
byte-pos provided in the Range request in some cases - even if the byte-pos provided in the byte-range request in some cases -- even if
last-byte-pos cannot be represented as a numerical value internally the last-byte-pos cannot be represented as a numerical value
by the server. As is the case with any live/continuously aggregating internally by the server. As is the case with any continuously
resource, the server should terminate the content transfer when the aggregating/live resource, the server should terminate the content
end of the resource is reached - whether the end is due to transfer when the end of the resource is reached -- whether the end
termination of the content source or the content length exceeds the is due to termination of the content source or the content length
server's maximum representation length. exceeds the server's maximum representation length.
5. IANA Considerations 5. IANA Considerations
This document has no actions for IANA. This document has no IANA actions.
6. Security Considerations 6. Security Considerations
As described above, servers need to be prepared to receive last-byte- As described above, servers need to be prepared to receive last-byte-
pos values in Range requests that are numerically larger than the pos values in range requests that are numerically larger than the
server implementation supports - and return these values in Content- server implementation supports and return these values in Content-
Range response header fields. Servers should check the last-byte-pos Range response header fields. Servers should check the last-byte-pos
value before converting and storing them into numeric form to ensure value before converting and storing them into numeric form to ensure
the value doesn't cause an overflow or index incorrect data. The the value doesn't cause an overflow or index incorrect data. The
simplest way to satisfy the live-range semantics defined in this simplest way to satisfy the live-range semantics defined in this
document without potential overflow issues is to store the last-byte- document without potential overflow issues is to store the last-byte-
pos as a string value and return it in the byte-range Content-Range pos as a string value and return it in the byte-range Content-Range
response header's last-byte-pos field. response header's last-byte-pos field.
7. References 7. References
7.1. Normative References 7.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
Requirement Levels", BCP 14, RFC 2119, Specifications: ABNF", STD 68, RFC 5234,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC5234, January 2008,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc5234>.
[RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer
Protocol (HTTP/1.1): Message Syntax and Routing", Protocol (HTTP/1.1): Message Syntax and Routing",
RFC 7230, DOI 10.17487/RFC7230, June 2014, RFC 7230, DOI 10.17487/RFC7230, June 2014,
<https://www.rfc-editor.org/info/rfc7230>. <https://www.rfc-editor.org/info/rfc7230>.
[RFC7233] Fielding, R., Ed., Lafon, Y., Ed., and J. Reschke, Ed., [RFC7233] Fielding, R., Ed., Lafon, Y., Ed., and J. Reschke, Ed.,
"Hypertext Transfer Protocol (HTTP/1.1): Range Requests", "Hypertext Transfer Protocol (HTTP/1.1): Range Requests",
RFC 7233, DOI 10.17487/RFC7233, June 2014, RFC 7233, DOI 10.17487/RFC7233, June 2014,
<https://www.rfc-editor.org/info/rfc7233>. <https://www.rfc-editor.org/info/rfc7233>.
[RFC7234] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, [RFC7234] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke,
Ed., "Hypertext Transfer Protocol (HTTP/1.1): Caching", Ed., "Hypertext Transfer Protocol (HTTP/1.1): Caching",
RFC 7234, DOI 10.17487/RFC7234, June 2014, RFC 7234, DOI 10.17487/RFC7234, June 2014,
<https://www.rfc-editor.org/info/rfc7234>. <https://www.rfc-editor.org/info/rfc7234>.
7.2. Informative References 7.2. Informative References
[DASH] ISO, "Information technology -- Dynamic adaptive streaming [MPEG-DASH]
ISO, "Information technology -- Dynamic adaptive streaming
over HTTP (DASH) -- Part 1: Media presentation description over HTTP (DASH) -- Part 1: Media presentation description
and segment formats", ISO/IEC 23009-1:2014, May 2014, and segment formats", ISO/IEC 23009-1, August 2019,
<http://standards.iso.org/ittf/PubliclyAvailableStandards/ <https://www.iso.org/standard/75485.html>.
c065274_ISO_IEC_23009-1_2014.zip>.
[RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
Specifications: ABNF", STD 68, RFC 5234,
DOI 10.17487/RFC5234, January 2008,
<https://www.rfc-editor.org/info/rfc5234>.
[RFC8216] Pantos, R., Ed. and W. May, "HTTP Live Streaming", [RFC8216] Pantos, R., Ed. and W. May, "HTTP Live Streaming",
RFC 8216, DOI 10.17487/RFC8216, August 2017, RFC 8216, DOI 10.17487/RFC8216, August 2017,
<https://www.rfc-editor.org/info/rfc8216>. <https://www.rfc-editor.org/info/rfc8216>.
Acknowledgements Acknowledgements
Mark Nottingham, Patrick McManus, Julian Reschke, Remy Lebeau, Rodger The authors would like to thank Mark Nottingham, Patrick McManus,
Combs, Thorsten Lohmar, Martin Thompson, Adrien de Croy, K. Morgan, Julian Reschke, Remy Lebeau, Rodger Combs, Thorsten Lohmar, Martin
Roy T. Fielding, Jeremy Poulter. Thompson, Adrien de Croy, K. Morgan, Roy T. Fielding, and Jeremy
Poulter.
Authors' Addresses Authors' Addresses
Craig Pratt Craig Pratt
Portland, OR 97229 Portland, OR 97229
US United States of America
Email: pratt@acm.org Email: pratt@acm.org
Darshak Thakore Darshak Thakore
CableLabs CableLabs
858 Coal Creek Circle 858 Coal Creek Circle
Louisville, CO 80027 Louisville, CO 80027
US United States of America
Email: d.thakore@cablelabs.com Email: d.thakore@cablelabs.com
Barbara Stark Barbara Stark
AT&T AT&T
Atlanta, GA Atlanta, GA
US United States of America
Email: barbara.stark@att.com Email: barbara.stark@att.com
 End of changes. 82 change blocks. 
215 lines changed or deleted 202 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/