rfc-5547

A Session Description Protocol (SDP) Offer/Answer Mechanism to Enable File Transfer

M. Garcia-Martin, M. Isomaki, G. Camarillo, S. Loreto, P. Kyzivat
date2009-05 streamIETF areaart wgmmusic statusPROPOSED STANDARD pages50 canonicalhttps://www.rfc-editor.org/rfc/rfc5547 doi10.17487/RFC5547 errataview
This document provides a mechanism to negotiate the transfer of one or more files between two endpoints by using the Session Description Protocol (SDP) offer/answer model specified in RFC 3264. SDP is extended to describe the attributes of the files to be transferred. The offerer can describe either the files it wants to send or the files it would like to receive. The answerer can either accept or reject the offer separately for each individual file. The transfer of one or more files is initiated after a successful negotiation. The Message Session Relay Protocol (MSRP) is defined as the default mechanism to actually carry the files between the endpoints. The conventions on how to use MSRP for file transfer are also provided in this document. [STANDARDS-TRACK]

Extracted elements (35)

design-rationale §4

Each file uses its own 'm=' line (and thus its own MSRP session) so the answerer can individually accept or reject each file by setting that line's port to zero; multiple MSRP sessions may still share a single TCP connection to avoid excessive resource use.

realtime

design-rationale §6

The 'file-range' attribute is intentionally distinct from the MSRP Byte-Range header: 'file-range' describes which portion of the file the application reads and passes to MSRP, while MSRP Byte-Range describes the portion of the resulting MSRP message carried in a single chunk. MSRP always counts from octet 1 of its message.

realtime

design-rationale §8.1

The 'file-transfer-id' attribute was introduced because SDP may be retransmitted unchanged for reasons unrelated to file transfer (e.g., SIP Session Timer re-INVITEs, addition of other media streams), and without it endpoints cannot determine whether a new file transfer is being requested or SDP is merely being repeated.

realtime

design-rationale §6

The hash value in the 'file-selector' attribute covers the whole file even when only a range is transferred, so that the hash can serve both as a file identifier for pull operations and as a post-transfer integrity check regardless of chunking.

realtime, crypto

interoperability-note §4

A regular MSRP endpoint that does not implement the file transfer extensions can still act as SDP answerer and file receiver for a push: it answers the offer ignoring extension attributes. However, the user experience is degraded because the recipient has no protocol means to identify the transfer or accept/reject based on file metadata.

realtime

interoperability-note §8.8

If a file receiver does not support multipart MIME bodies and rejects an SDP offer containing a 'file-icon' body part, it is RECOMMENDED that the file sender retry by removing the icon and sending a plain SDP body to improve backwards compatibility.

realtime, email

normative-requirement §8.2 MUST

An offerer wishing to send or receive files MUST build an SDP description containing one 'm=' line per file, and all media line attributes required by MSRP (e.g., 'a=path', 'a=accept-types') MUST be included.

realtime

normative-requirement §8.7 MUST NOT

File senders MUST NOT exceed the 'max-size' limit for any message sent in the resulting MSRP session; file receivers MAY add a 'max-size' attribute specifying the maximum MSRP message size they will accept.

realtime

normative-requirement §8.1 MUST

If an endpoint creates an SDP offer where the 'file-transfer-id' is unchanged but the file selector changes to select a new file, this is an error and the SDP answerer MUST abort the file transfer operation (e.g., by setting the port to zero).

realtime

normative-requirement §8.2.2 SHOULD

If the SDP answer contains a supported hashing algorithm in the 'hash' selector, the file receiver SHOULD compute the hash of the received file and verify it against the SDP answer; a mismatch means the transfer SHOULD be considered failed and the user informed.

realtime, security

normative-requirement §6 MUST

Implementations MUST add a 160-bit string resulting from SHA-1 computation if the 'hash' selector is present, and MUST be prepared to receive SDP containing more than a single 'hash' selector in the 'file-selector' attribute.

crypto, realtime

normative-requirement §5 MUST

Implementations MUST implement the 'file-selector' attribute, and SDP offers and answers for file transfer MUST contain a 'file-selector' media attribute that selects the file to be transferred.

realtime

normative-requirement §8.1 MUST

Implementations MUST include a 'file-transfer-id' attribute in SDP offers and answers. The offerer MUST select a new globally unique random identifier; the answerer MUST copy the value into the SDP answer.

realtime

normative-requirement §8.3.2 MUST NOT

In a pull operation, if the 'file-transfer-id' value has been previously used within the session, the file sender MUST NOT alert the user and MUST NOT start a new transfer of the file.

realtime

normative-requirement §8.2.2 MUST

In a pull operation, the file receiver MUST include a 'file-selector' with at least one selector, a 'file-transfer-id' with a new globally unique value, and a 'recvonly' attribute in the SDP offer.

realtime

normative-requirement §8.2.1 MUST

In a push operation, the file sender MUST add a 'file-selector' with at least one of 'type', 'size', or 'hash' selectors, a 'file-transfer-id' with a new globally unique value, and a 'sendonly' attribute to the SDP offer.

realtime

normative-requirement §8.7 MUST

Senders MUST only use the dedicated MSRP session to send the file described in the SDP offer or answer and MUST NOT send additional files over the same MSRP session. Implementations MUST include a single file in a single MSRP message.

realtime

normative-requirement §8.1 MUST

The file transfer identifier MUST be unique within the current session and is RECOMMENDED to be unique across different sessions; a relatively large random identifier (e.g., 32 characters) is RECOMMENDED to avoid duplications.

realtime

normative-requirement §8.5 MUST NOT

When indicating capability (Section 8.5), an endpoint SHOULD add an empty 'file-selector' media attribute to the 'm=message' line; the attribute MUST NOT contain any selector and no other file attributes MUST be added.

realtime

normative-requirement §8.3.1 MUST

When the answerer accepts a push, it MUST copy 'name', 'type', and 'size' selectors from the offer into the answer, copy the 'file-transfer-id', add 'recvonly', and MUST NOT include 'file-icon', 'file-disposition', or 'file-date' attributes in the SDP answer.

realtime

normative-requirement §8.8 MUST

When using the 'file-icon' attribute, the file sender MUST wrap the SDP body and icon bodies in a MIME multipart/related body, and implementations MUST implement the multipart/related MIME type. The SDP body MUST be the root body.

realtime, email

protocol-element §6

The 'file-date' attribute conveys creation, modification, and last-read timestamps of the file using RFC 5322 'date-time' format with numeric timezones; at most one of each date type ('creation', 'modification', 'read') is permitted.

realtime

protocol-element §6

The 'file-disposition' attribute suggests the intended rendering: 'render' (default, display automatically) or 'attachment' (do not display automatically, require user action). Absence of the attribute implies 'render'.

realtime

protocol-element §6

The 'file-icon' attribute contains a Content-ID URL (RFC 2392) pointing to a separate MIME body part carrying a small preview icon of the file, sent alongside the SDP in a multipart/related wrapper.

realtime

protocol-element §6

The 'file-range' attribute specifies start and stop byte offsets (1-based, inclusive) for partial file transfer, enabling interrupted transfers to be resumed. A '*' stop offset indicates unknown total size. Absence implies the whole file (1-*).

realtime

protocol-element §5

The 'file-selector' media attribute is a tuple of up to four selectors — 'name' (UTF-8 filename in double quotes), 'size' (octets), 'type' (MIME media type), and 'hash' (algorithm:value) — used to identify the file to be transferred.

realtime

protocol-element §6

The 'file-transfer-id' attribute contains a globally unique random token that distinguishes a new file transfer request from a repetition of the SDP, enabling endpoints to determine when an actual new transfer should begin.

realtime

registry §11.1

Section 11.1 registers six new SDP media-level attributes in the IANA SDP Parameters registry: 'file-selector', 'file-transfer-id', 'file-disposition', 'file-date', 'file-icon', and 'file-range', all defined in RFC 5547.

registry, realtime

security-consideration §6

The 'hash' selector (SHA-1) is suitable for file identification and post-transfer integrity verification, but should not be relied upon to protect file integrity against active attackers; endpoints requiring integrity protection should use a separate mechanism such as S/MIME.

security, crypto, realtime

security-consideration §6

The 'name' selector may contain characters meaningful to the remote operating system (e.g., '\', '/', ':') even if not significant locally. Implementations are responsible for sanitizing filenames received from remote endpoints before performing local file system operations, including percent-encoding OS-meaningful characters.

security, realtime

state-machine §8.4

Aborting a file transfer: the aborting party includes '#' in the MSRP SEND end-line continuation field to abort the MSRP message, then sends a new SDP offer setting the 'm=' port to zero while preserving the same 'file-transfer-id'. The receiving party mirrors the abort in its SDP answer.

realtime

state-machine §8.3.1

On receiving an SDP offer for a push, the answerer checks: (1) if port is zero, close and do nothing; (2) if port non-zero and 'file-transfer-id' already seen, keep existing session; (3) if port non-zero and 'file-transfer-id' is new, prompt user and initiate new file transfer.

realtime

wire-format §6

Filenames in the 'name' selector are UTF-8 encoded and enclosed in double quotes; characters not allowed by the grammar (double quotes, NUL, CR, LF, percent) and directory-separator characters MUST be percent-encoded using %HEXDIG HEXDIG encoding.

realtime

wire-format §6

The 'file-range' attribute is encoded as '<start-offset>-<stop-offset>' where both values are integers (RFC 4566 'integer') and the stop offset may be the literal '*'. The start offset of the first octet is 1.

realtime

wire-format §6

The 'hash' selector is encoded as 'hash:<algorithm>:<value>' where the value is the SHA-1 hash expressed as two-hex-digit bytes separated by colons (e.g., '72:24:5F:...'). Only 'sha-1' is currently supported; the algorithm token references the IANA Hash Function Textual Names registry.

realtime, crypto