<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY I-D.hellstrom-textpreview SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.hellstrom-textpreview.xml">
<!ENTITY rfc2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY rfc3261 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3261.xml">
<!ENTITY rfc3629 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3629.xml">
<!ENTITY rfc4566 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4566.xml">
<!ENTITY rfc4975 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4975.xml">
<!ENTITY rfc4103 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4103.xml">
]>
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-hellstrom-simple-text-transmission-00"
     ipr="full3978">
  <front>
    <title abbrev="Transmission of text in MSRP sessions">Coding and
    transmission of text in real-time and en-bloc mode based on MSRP</title>

    <author fullname="Gunnar Hellstrom" initials="G" surname="Hellstrom">
      <organization>Omnitor</organization>

      <address>
        <postal>
          <street>Box 92054</street>

          <city>Stockholm</city>

          <code>12006</code>

          <region></region>

          <country>Sweden</country>
        </postal>

        <phone>+46 8 589 000 56</phone>

        <facsimile>+46 8 589 000 51</facsimile>

        <email>gunnar.hellstrom@omnitor.se</email>
      </address>
    </author>

    <author fullname="Paul Jones" initials="P" surname="Jones">
      <organization>Cisco Systems, Inc.</organization>

      <address>
        <postal>
          <street>7025 Kit Creek Rd.</street>

          <city>Research Triangle Park,</city>

          <region>NC</region>

          <code>27709</code>

          <country>USA</country>
        </postal>

        <phone>+1 919 392 6948</phone>

        <facsimile></facsimile>

        <email>paulej@packetizer.com</email>

        <uri></uri>
      </address>
    </author>

    <author fullname="Gregg Vanderheiden" initials="G" surname="Vanderheiden">
      <organization>Trace R&amp;D Center, University of
      Wisconsin-Madison</organization>

      <address>
        <postal>
          <street>1550 Engineering Drive</street>

          <city>Madison</city>

          <region>Wi</region>

          <code>53706</code>

          <country>USA</country>
        </postal>

        <phone></phone>

        <facsimile></facsimile>

        <email>gv@trace.wisc.edu</email>

        <uri>http://www.engr.wisc.edu/ie/faculty/vanderheiden_gregg.html</uri>
      </address>
    </author>

    <date day="9" month="January" year="2008" />

    <area>Real time Applications and Infrastructure Area</area>

    <workgroup></workgroup>

    <keyword>real-time text; MSRP; sampled; en-bloc</keyword>

    <keyword>SIP</keyword>

    <abstract>
      <t>This memo describes conventions for exchange and presentation of text
      in SIP sessions through the Message Session Relay Protocol MSRP. It
      covers two different methods for taking the initiative to transmit.
      These methods are timer initiated real-time text and user requested
      en-bloc transmission in Messaging. The document gives specific guidance
      on handling of text presentation and presentation control of
      conversational sessions. It specifies how the capability to conduct MSRP
      sessions with real-time text is declared so that session negotiation can
      make decisions on what transport protocol to use and how to route the
      calls to get the desired support for text communication.</t>
    </abstract>

    <note title="Requirements Language">
      <t>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 <xref
      target="RFC2119">RFC 2119</xref>.</t>
    </note>
  </front>

  <middle>
    <section title="Consistent view of text communication based on MSRP">
      <t>A set of mechanisms must be defined in order to assure consistent
      user experience when using MSRP <xref target="RFC4975">RFC 4975</xref>
      for text communication in SIP <xref target="RFC3261"></xref> sessions.
      One style of usage of MSRP based text sessions is the real-time text
      conversation that makes use of time sampled transmission. Another style
      is Instant Messaging with user initiated transmission of complete
      messages. MSRP is a general transport method mainly intended for
      messages. The capability for real-time text transmission needs to be
      indicated, so that the users can agree on a common view of the
      conversation. A time sampling of 500 ms or less is required in order to
      achieve the end to end delay of less than 1 second that is needed for
      effective real time text conversation, . Requirements for presentation
      of conversations using real-time text is found in
      [draft-hellstrom-textpreview] <xref
      target="I-D.hellstrom-textpreview"></xref>. Traditionally the real-time
      text medium can be transmitted with RTP, as specified in RFC 4103<xref
      target="RFC4103"></xref>. This specification describes how to implement
      these functions with MSRP.User initiated transmission of MSRP text
      messages also need to follow presentation conventions in order to be
      presented as expected by the sending user. It is specifically the
      following features that need to be defined:</t>

      <t><list>
          <t>Functional requirements.</t>

          <t>Media type and subtype specification and negotiating.</t>

          <t>Presentation coding.</t>

          <t>Text</t>

          <t>Erasure</t>

          <t>New lines</t>

          <t>Other presentation control functions</t>

          <t>Indication and negotiation of the time-sampled transmission
          capability</t>

          <t>Time sampled transmission</t>

          <t>Routing of calls to real-time text capable devices.</t>

          <t>Sessions including MSRP-based real-time text and other media.</t>

          <t>Performance</t>

          <t>Security</t>

          <t></t>
        </list></t>
    </section>

    <section title="Functional requirements">
      <t>The procedures defined in this specification are intended to provide
      a text transport mechanism fulfilling the following requirements.</t>

      <section title="Common requirements">
        <t><list style="symbols">
            <t>Presentation of text shall be possible in one internationally
            useable character set.</t>

            <t>Presentation within messages shall be done contiguously so that
            it is easily read.</t>

            <t>It shall be possible to use the text transport method in a
            session together with other media.</t>

            <t>It shall be possible to use the text transmission in SIP
            sessions.</t>

            <t>A set of characters shall be defined for any specific language
            environment to cause end of message.</t>

            <t>It shall be possible to protect the text contents from reading
            and modification from others than authorised adressees.</t>

            <t>It shall be possible to guide routing of calls who may need
            text to specific devices capable of handling text
            transmission.</t>
          </list></t>
      </section>

      <section title="Requirements on real-time text mode">
        <t></t>
      </section>

      <t><list style="symbols">
          <t>The real-time transmission and presentation of text shall be done
          in a way so that the users experience a flow of text approximately
          as it is typed.</t>

          <t>The delay from character entry to remote display needs to be less
          than 1 s in order to maintain effective real-time conversation.
          Therefore the maximum delay before transmission of any character
          shall not be longer than 500 ms.</t>

          <t>It shall be possible to erase already transmitted text in the
          current message.[see issues-list]</t>

          <t>It shall be possible to negotiate between MSRP and other
          SIP-based standardised transport methods for real-time text at
          session setup.</t>

          <t>It shall be possible to transmit at least 30 characters per
          second.</t>

          <t>It shall be possible to guide routing of calls who may need
          real-time text to specific devices capable of handling this text
          transmission mode. The main purpose of this requirement comes from
          the requirment to find a text capable gateway to PSTN for text
          telephony.</t>

          <t>It shall be possible to use the real-time text transmission in
          SIP sessions.</t>
        </list></t>

      <t></t>

      <section title="Requirements on en-bloc mode">
        <t><list style="symbols">
            <t>The transmission and presentation of text shall be done so that
            the users experience a transmission of text when a specific
            transmission action is made.</t>
          </list></t>
      </section>
    </section>

    <section title="Media type and subtype specification">
      <t>In SIP<xref target="RFC3261"></xref> sessions, SDP<xref
      target="RFC4566"></xref> MUST indicate the media type 'message'.</t>

      <t>The Content-type is specified in the MSRP header.</t>

      <t>For real-time text, support MUST be provided for content-types
      text/plain and for message/cpim with text/plain content.</t>

      <t>In addition, other content-types MAY be supported in real-time text
      mode.<figure>
          <preamble>SDP Examples</preamble>

          <artwork><![CDATA[
   Endpoint A wishes to invite Endpoint B to an MSRP session.  A offers
   the following session description:

    v=0
    o=usera 2890844526 2890844527 IN IP4 alice.example.com
    s= -
    c=IN IP4 alice.example.com
    t=0 0
    m=message 7394 TCP/MSRP *
    a=accept-types:message/cpim text/plain
    a=real-time-text
    a=path:msrp://alice.example.com:7394/2s93i93idj;tcp

   B responds with its own URI:

    v=0
    o=userb 2890844530 2890844532 IN IP4 bob.example.com
    s= -
    c=IN IP4 bob.example.com
    t=0 0
    m=message 8493 TCP/MSRP *
    a=accept-types:message/cpim text/plain
    a=real-time-text
    a=path:msrp://bob.example.com:8493/si438dsaodes;tcp

]]></artwork>

          <postamble>Figure: SDP example for a text-only session</postamble>
        </figure></t>

      <t>The MSRP messages and chunks contain headers indicating the media
      type and subtype actually used.</t>

      <t>For the real-time text usage a send request MAY look like this:</t>

      <t><figure>
          <preamble>MSRP Chunk exaMPLE</preamble>

          <artwork><![CDATA[   MSRP a786hjs2 SEND
   To-Path: msrp://biloxi.example.com:12763/kjhd37s2s20w2a;tcp
   From-Path: msrp://atlanta.example.com:7654/jshA7weztas;tcp
   Message-ID: 87652491
   Byte-Range: 1-5/*
   Content-Type: text/plain; charset=utf-8

   Hey B
   -------a786hjs2+
]]></artwork>

          <postamble>Example: MSRP chunk</postamble>
        </figure></t>
    </section>

    <section title="Presentation coding">
      <t></t>

      <section title="Text">
        <t>Text shall be coded with an internationally applicable character
        set. The text/plain MIME type is defined to be used according to this
        specification. Coding with utf-8 shall be used. <xref
        target="RFC3629">RFC 3629</xref></t>
      </section>

      <section title="Time division">
        <t>When operating in real-time text mode, text shall be collected for
        transmission during a time interval and then transmitted as an MSRP
        chunk. The maximum delay of any character before transmission MUST be
        500ms. For good flow it SHOULD be 300 ms.</t>

        <t>For en-bloc mode, no timer-initiated tansmissions are required.
        Text MAY be sent in chunks, and recombined in complete messages by the
        receiver.</t>
      </section>

      <section title="New Line">
        <t>It shall be possible to insert a new line in the text. A new line
        serves as message delimiter. Unicode Line Separator (UCS-16 2028) or
        CRLF SHALL be used for transmission. In reception, Line Separator, CR,
        CRLF, LF shall all have the same effect and be regarded as one
        operation.</t>

        <t></t>
      </section>

      <section title="Alert in session">
        <t>BEL may be sent to cause an external alerting action from the
        receiving terminal, but shall otherwise be treated as a non-printable
        character and have no impact on the display.</t>

        <t></t>
      </section>

      <section title="End of Message">
        <t>The following actions MAY cause the End of Message condition:</t>

        <t>Pressing Enter, pressing Return and pressing a Send button.</t>

        <t>The actual selection of end of message reasons is a sending
        application decision.</t>

        <t>At the End of Message condition, any unsent characters in the
        session MUST be transmitted with an End of Message indication in
        MSRP.</t>
      </section>

      <section title="Erasure">
        <t>Erasure of the last character shall be signalled by a 'BS'
        character. Erasure shall have effect on the local and remote
        presentation of text. Locally inserted new lines by presentation logic
        only for layout purposes shall not be transmitted and therefore do not
        require any specific erasing action. New Lines inserted by the sending
        user MUST require one BS to be erased. The complete current message
        MUST be kept available for erasure. Characters that do not occupy a
        position in the display shall not require any BS for erasure, but if
        they have any effect on the presentation, they shall be regarded to be
        erased when the character before it is erased. BEL is one such
        character. Completed messages are not available for erasure.[see
        issues-list]</t>

        <t>[To issues-list: The relation between character position
        indications in MSRP headers and real printable position in a message
        needs to be defined. Possible alternative erasing action by chunk
        position and new character for replacement may be introduced]</t>
      </section>

      <section title="Other presentation controls">
        <t>When using the media format text/plain, no other presentation
        controls than the ones described above can be conveyed in
        communication. Both users may vary their presentation locally.</t>
      </section>
    </section>

    <section title="Indication and negotiation of the real-time text transmission capability">
      <t>The capability to present and transmit real-time text with MSRP MUST
      be declared by the following means:</t>

      <t>a. An attribute a=real-time-text, in the media description for the
      media=message declaration intended for the real-time text
      conversation.</t>

      <t>b. A Content-disposition=immediate-presentation to be included in the
      MSRP headers in the chunks and messages.</t>

      <t>c. The capability to present and transmit real-time text by any
      transport SHALL be declared by a media feature tag
      sip.real-time-text=&lt;any defined value&gt; in the SIP Contact header.
      This tag is also used by other text transports and may be used to
      determine if there is any real-time text support in the remote
      device.</t>
    </section>

    <section title="Time sampled transmission">
      <t>The availability of characters ready for transmission MUST be checked
      at regular time intervals. The interval MUST be set to 300 ms for good
      user experience.</t>

      <t>When there is something to transmit at the end of an interval, the
      text SHALL be transmitted in an MSRP message chunk. No extra character
      SHALL be added to the text before transmission.</t>

      <t>When an End of Message condition is detected, the last characters of
      the message shall be sent immediately, with an End of Message MSRP
      indication.</t>

      <t>[see issues list]The chunk position counter shall be regarded to
      point at a position in a message transmission buffer including all
      characters that have been transmitted for that message. BS and BEL shall
      thus increase the chunk position value as any other characters. The
      Chunk position MUST NOT be used to directly address any presentation
      position on a display of the text.[see issues list]</t>

      <figure>
        <preamble>Example:</preamble>

        <artwork><![CDATA[
    MSRP dkei38sd SEND
    Message-ID: 4564dpWd
    Byte-Range: 1-2/*
    Content-Type: text/plain; Charset=utf-8

    He
    -------dkei38sd+

    MSRP dkei38ia SEND
    Message-ID: 4564dpWd
    Byte-Range: 3-9/9
    Content-Type: text/plain; Charset=utf-8

    y Bob!

    -------dkei38ia$]]></artwork>

        <postamble>Figure: Real-time text chunks.</postamble>
      </figure>
    </section>

    <section title="Presentation of received text">
      <t>Text received from one session participant MUST be presented with
      some indication of the source.</t>

      <t>Text received within one message MUST be presented in one contiguous
      area.</t>

      <t>MSRP Chunks of the same message MUST be presented consecutively as
      soon as possible after reception, with no inserted character or editing
      control between the chunks.</t>

      <t>Characters MAY be added to a display singly so as to smooth
      presentation.</t>

      <t>Local presentation conventions MAY be applied to e.g break lines with
      word-wrapping.</t>
    </section>

    <section title="Routing of calls to real-time text capable devices.">
      <t>A real-time text indicator in the SIP header MAY be used for routing
      of calls to real-time text capable devices, using the principles of
      caller capabilities and callee preferences from RFC 3840 and 3841.</t>

      <t></t>
    </section>

    <section title="Sessions including MSRP based real-time text and other media.">
      <t>Other media MAY be negotiated in the same SIP session setup as the
      MSRP session.</t>

      <t></t>
    </section>

    <section title="Security">
      <t></t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>This specifications register the following new items:</t>

      <t>MSRP SDP attribute</t>

      <t>a=real-time text Indicates capability to use real-time text.</t>

      <t>[see issues-list] Contents-disposition=immediate indicates that if
      fragments of the complete text message is received, the fragments shall
      be presented without waiting for later fragments.[see issues-list]</t>

      <t>Note to RFC Editor: this section may be removed on publication as an
      RFC.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t></t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t></t>

      <t></t>
    </section>

    <section title="Temporary section - issues list">
      <t>This chapter contains a collection of issues that have been discussed
      and not yet been resolved. The intention is to delete this section after
      resolving the issues.</t>

      <t>1. Erasure 1. A possibility to erase back over message borders may be
      appreciated. One of the tensions appearing in traditional IM is of the
      non-erasable characteristics of sent text. Technically it gets complex
      to allow erasure further back, because MSRP does not have any defined
      way to address earlier messages than the current one. Also in
      interpreting the presentation of a dialogue after modification can cause
      confusion. But, it is a desired feature. A check with users is needed to
      decide on the functionality. A proposed function is to allow erasure
      represented by the earlier completed message being brought back for
      editing, but only erasure is allowed, and shall have te effect of
      replacing characters with xxx. When new text is then typed. The
      partially erased message is closed and a new message begun.</t>

      <t>2. Erasure 2. The use of charater position within chunk and message
      must be explored and defined. It must also be explained how it is
      affected by erasure. Shall BS always be translated into a replacement of
      a previously sent character by its position?</t>

      <t>3.Erasure 3. Is the wording of handling of non-printable characters
      during erasure sufficiently described.</t>

      <t>4. The use of chunks for time sampled transmission of text has been
      questioned. The primary intent of the chunk concept was said to be for
      avoiding congestion situations. It needs to be agreed if the reason to
      get a progressive presentation of a growing message is also an
      appropriate use of chunks.</t>

      <t></t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      &I-D.hellstrom-textpreview;

      &rfc2119;

      &rfc3261;

      &rfc3629;

      &rfc4566;

      &rfc4975;
    </references>

    <references title="Informative References">
      &rfc4103;
    </references>
  </back>
</rfc>