home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_a_c / draft-ietf-avt-crtp-01.txt < prev    next >
Text File  |  1996-11-27  |  37KB  |  897 lines

  1.  
  2.  
  3.  
  4. Internet Engineering Task Force      Audio/Video Transport Working Group
  5. INTERNET-DRAFT                              S. Casner / Precept Software
  6. draft-ietf-avt-crtp-01.txt                            V. Jacobson / LBNL
  7.                                                        November 25, 1996
  8.                                                            Expires: 5/97
  9.  
  10.  
  11.        Compressing IP/UDP/RTP Headers for Low-Speed Serial Links
  12.  
  13. Status of this Memo
  14.  
  15. This document is an Internet-Draft.  Internet-Drafts are working docu-
  16. ments of the Internet Engineering Task Force (IETF), its areas, and its
  17. working groups.  Note that other groups may also distribute working
  18. documents as Internet-Drafts.
  19.  
  20. Internet-Drafts are draft documents valid for a maximum of six months
  21. and may be updated, replaced, or obsoleted by other documents at any
  22. time.  It is inappropriate to use Internet- Drafts as reference material
  23. or to cite them other than as "work in progress."
  24.  
  25. To learn the current status of any Internet-Draft, please check the
  26. "1id-abstracts.txt" listing contained in the Internet- Drafts Shadow
  27. Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe),
  28. munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or
  29. ftp.isi.edu (US West Coast).
  30.  
  31. Distribution of this document is unlimited.
  32.  
  33.                                 Abstract
  34.  
  35.      This document describes a method for compressing the headers of
  36.      IP/UDP/RTP datagrams to reduce overhead on low-speed serial links.
  37.      In many cases, all three headers can be compressed to 2-4 bytes.
  38.  
  39. Comments are solicited and should be addressed to the working group
  40. mailing list rem-conf@es.net and/or the author(s).  This draft updates
  41. draft-casner-jacobson-crtp-00.txt which was sent to the rem-conf list
  42. but was never officially posted as an Internet-Draft due to a mail los-
  43. sage that then left it out of date.  At the Montreal IETF meeting in
  44. June 1996, this proposal was accepted as a work item of the the
  45. Audio/Video Transport working group, hence the draft name change.
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.                             Expires May 1997                    [Page 1]
  56.  
  57. Internet Draft         draft-ietf-avt-crtp-01.txt          November 1996
  58.  
  59.  
  60. 1.  Introduction
  61.  
  62. Since the Real-time Transport Protocol was published as an RFC [1],
  63. there has been growing interest in using RTP as one step to achieve
  64. interoperability among different implementations of network audio/video
  65. applications.  However, there is also concern that the 12-byte RTP
  66. header is too large an overhead for 20-byte payloads when operating over
  67. low speed lines such as dial-up modems at 14.4 or 28.8 kb/s.  (Existing
  68. applications operating in this environment may use an application-
  69. specific protocol with a header of a few bytes that has reduced func-
  70. tionality relative to RTP.)
  71.  
  72. Header size may be reduced through compression techniques as has been
  73. done with great success for TCP [2].  In this case, compression might be
  74. applied to the RTP header alone, on an end-to-end basis, or to the com-
  75. bination of IP, UDP and RTP headers on a link-by-link basis.  Compress-
  76. ing the 40 bytes of combined headers together provides substantially
  77. more gain than compressing 12 bytes of RTP header alone because the
  78. resulting size is approximately the same (2-4 bytes) in either case.
  79. Compressing on a link-by-link basis also provides better performance
  80. because the delay and loss rate are lower.  Therefore, the method
  81. defined here is for combined compression of IP, UDP and RTP headers on a
  82. link-by-link basis.
  83.  
  84. This document defines a compression scheme that may be used with IPv4,
  85. IPv6 or packets encapsulated with more than one IP header, though the
  86. initial focus is on IPv4.  It is intended that the IP/UDP/RTP compres-
  87. sion defined here will fit within and be referenced by the the more com-
  88. plete compression framework [3] specified by Mikael Degermark, et. al.,
  89. which covers both IPv6 and IPv4 with TCP and non-TCP as two classes of
  90. transport above IP.  IP/UDP/RTP would be extracted as a third class from
  91. the non-TCP class.
  92.  
  93. 2.  Assumptions and Tradeoffs
  94.  
  95. The goal of this compression scheme is to reduce the IP/UDP/RTP headers
  96. to two bytes for most packets in the case where no UDP checksums are
  97. being sent, or four bytes with checksums.  It is motivated primarily by
  98. the specific problem of sending audio and video over 14.4 and 28.8
  99. dialup modems.  These links tend to provide full-duplex communication,
  100. so the protocol takes advantage of that fact, though this constraint
  101. could be removed.
  102.  
  103. This specification does not address segmentation and preemption of large
  104. packets to reduce the delay across the slow link experienced by small
  105. real-time packets, except to identify in Section 4 some interactions
  106. between segmentation and compression that may occur.  Segmentation
  107. schemes may be defined separately and used in conjunction with the
  108.  
  109.  
  110.  
  111.                             Expires May 1997                    [Page 2]
  112.  
  113. Internet Draft         draft-ietf-avt-crtp-01.txt          November 1996
  114.  
  115.  
  116. compression defined here.
  117.  
  118. It should be noted that implementation simplicity is an important factor
  119. to consider in evaluating the a compression scheme.  Communications
  120. servers may need to support compression over perhaps as many as 100
  121. dial-up modem lines using a single processor.  Therefore, it may be
  122. appropriate to make some simplifications in the design at the expense of
  123. generality, or to produce a flexible design that is general but can be
  124. subsetted for simplicity.  The next sections discuss some of the trade-
  125. offs listed here.
  126.  
  127. 2.1.  Simplex vs. Full Duplex
  128.  
  129. In the absence of other constraints, a compression scheme that worked
  130. over simplex links would be preferred over one that did not.  However,
  131. operation over a simplex link requires periodic refreshes with an
  132. uncompressed packet header to restore compression state in case of
  133. error.  If an explicit error signal can be returned instead, the delay
  134. to recovery may be shortened substantially.  The overhead in the no-
  135. error case is also reduced.  Some UDP applications may require only sim-
  136. plex communication, but RTP applications will frequently require full
  137. duplex communication.  The application may be 2-way, as in a telephone
  138. conversation, but even if data flows in only one direction there is a
  139. need for a return path to carry reception feedback in RTCP packets.
  140.  
  141. This specification includes an error indication on the reverse path,
  142. however it would be possible to use a periodic refresh instead.  When-
  143. ever the decompressor detected an error in a particular packet stream,
  144. it would simply discard all packets in that stream until an uncompressed
  145. header for was received for that stream, and then resume decompression.
  146. The penalty would be the potentially large number of packets discarded.
  147.  
  148. 2.2.  Segmentation and Layering
  149.  
  150. Delay induced by the time required to send a large packet over the slow
  151. link is not a problem for one-way audio, for example, because the
  152. receiver can adapt to the variance in delay.  However, for interactive
  153. conversations, minimizing the end-to-end delay is critical.  Segmenta-
  154. tion of large, none-real-time packets to allow small real-time packets
  155. to be transmitted between segments can reduce the delay.
  156.  
  157. This specification deals only with compression and assumes segmentation,
  158. if included, will be handled as a separate layer.  It seems inappropri-
  159. ate to integrate segmentation and compression in such a way that the
  160. compression could not be used by itself in situations where segmentation
  161. was deemed unnecessary or impractical.  Similarly, one would like to
  162. avoid any requirements for a reservation protocol.  The compression
  163. scheme can be applied locally on the two ends of a link independent of
  164.  
  165.  
  166.  
  167.                             Expires May 1997                    [Page 3]
  168.  
  169. Internet Draft         draft-ietf-avt-crtp-01.txt          November 1996
  170.  
  171.  
  172. any other mechanisms except for the requirements that the link layer
  173. provide some packet type codes, a packet length indication, and good
  174. error detection.
  175.  
  176. Conversely, separately compressing the IP/UDP and RTP layers loses too
  177. much of the compression gain that is possible by treating them together.
  178. Crossing these protocol layer boundaries is appropriate because the same
  179. function is being applied across all layers.
  180.  
  181. 3.  The Compression Algorithm
  182.  
  183. The compression algorithm defined in this document draws heavily upon
  184. the design of TCP/IP header compression as described in RFC 1144 [2].
  185. Readers are referred to that RFC for more information on the underlying
  186. motivations and general principles of header compression.
  187.  
  188. 3.1.  The basic idea
  189.  
  190. In TCP header compression, the first factor of two comes from the obser-
  191. vation that half of the bytes in the header remain constant over the
  192. life of the connection.  After sending the uncompressed header once,
  193. these fields may be elided from the compressed headers that follow.  The
  194. remaining compression comes from differential coding on the changing
  195. fields to reduce their size, and from eliminating the changing fields
  196. entirely for common cases by calculating the changes from the length of
  197. the packet.  This length is indicated by the link-level protocol.
  198.  
  199. For RTP header compression, some of the same techniques may be applied.
  200. However, the big gain comes from the observation that although several
  201. fields change in every packet, the difference from packet to packet is
  202. often constant and therefore the second-order difference is zero.  By
  203. maintaining both the uncompressed header and the first-order differences
  204. in the session state shared between the compressor and decompressor, all
  205. that must be communicated is an indication that the second-order differ-
  206. ence was zero.  The decompressor can reconstruct the original header
  207. without any loss of information.
  208.  
  209. Just as TCP/IP header compression maintains shared state for multiple
  210. simultaneous TCP connections, this IP/UDP/RTP compression must maintain
  211. state for multiple session contexts.  A session context is defined by
  212. the combination of the IP source and destination addresses, the UDP
  213. source and destination ports, and the RTP SSRC field.
  214.  
  215. Because the RTP compression is lossless, it may be applied to any UDP
  216. traffic that benefits from it.  Most likely, the only packets that will
  217. benefit are RTP packets, but it is acceptable to use heuristics to
  218. determine whether or not the packet is an RTP packet because no harm is
  219. done if the heurisic gives the wrong answer.  This does require
  220.  
  221.  
  222.  
  223.                             Expires May 1997                    [Page 4]
  224.  
  225. Internet Draft         draft-ietf-avt-crtp-01.txt          November 1996
  226.  
  227.  
  228. executing the compression algorithm for all UDP packets.  Most implemen-
  229. tations will need to maintain a negative cache of packet streams (iden-
  230. tified by addresses and ports but not the SSRC field) that have failed
  231. to compress as RTP packets for some number of attempts.  Failing to
  232. compress means that the fields that are expected to remain constant most
  233. of the time, such as the payload type field, keep changing.  Even if the
  234. other fields remain constant, a packet stream with a constantly changing
  235. SSRC field must be entered in the negative cache to avoid consuming all
  236. of the available session contexts.  When RTP compression fails, the IP
  237. and UDP headers may still be compressed.
  238.  
  239. In order to communicate packets in the various uncompressed and
  240. compressed forms, this protocol depends upon the link layer being able
  241. to provide an indication of four packet types in addition to the packet
  242. types that indicate IPv4 and IPv6:
  243.  
  244.      FULL_HEADER - communicates the uncompressed IP header plus any fol-
  245.      lowing headers and data to establish the uncompressed header state
  246.      in the decompressor for a particular context.  That context is
  247.      identified by an 8-bit session context ID.  In order to carry the
  248.      context ID without expanding the size of the header, the ID
  249.      replaces the low byte of the total length field in the IPv4 header
  250.      or IPv6 base header.  (The actual length may be inferred from the
  251.      length provided by the link layer.)  The FULL_HEADER packet type is
  252.      part of the compression framework defined in [3], which describes
  253.      compression of protocols other than UDP/RTP and encapsulation by
  254.      multiple IP headers as indicated by the IPv4 protocol field or the
  255.      IPv6 next header field.  A generation number is carried in the
  256.      FULL_HEADER for the COMPRESSED_NON_TCP packet type defined in [3].
  257.      The 4-bit sequence number defined in Section 3.3 of this document
  258.      is carried in the Data field of the FULL_HEADER as defined in Sec-
  259.      tion 5.3.2 and 12 of [3].
  260.  
  261.      COMPRESSED_NON_TCP - communicates the compressed IP and UDP headers
  262.      as defined in [3] without compressing the IPv4 ID field.  This
  263.      takes one or two bytes more than the COMPRESSED_UDP form listed
  264.      next, but may be more resilient to packet loss.  This packet type
  265.      can also carry in its Data field the 4-bit sequence number defined
  266.      in Section 3.3.
  267.  
  268.      COMPRESSED_UDP - communicates the IP and UDP headers compressed to
  269.      6 or fewer bytes (often 2 if UDP checksums are disabled), followed
  270.      by any subsequent headers (possibly RTP) in uncompressed form, plus
  271.      data.  This packet type is used when there are differences in the
  272.      usually constant fields of the (potential) RTP header.  It rede-
  273.      fines the SSRC field of the session context.  The format is shown
  274.      in section 3.4.
  275.  
  276.  
  277.  
  278.  
  279.                             Expires May 1997                    [Page 5]
  280.  
  281. Internet Draft         draft-ietf-avt-crtp-01.txt          November 1996
  282.  
  283.  
  284.      COMPRESSED_RTP - indicates that the RTP header is compressed along
  285.      with the IP and UDP headers.  The result may still be just two
  286.      bytes.  This packet type is used when the second-order difference
  287.      is zero and also to communicate first-order differences as delta
  288.      encodings.  The format is shown in section 3.3.
  289.  
  290.      CONTEXT_STATE - indicates a special packet sent from the decompres-
  291.      sor to the compressor to communicate a list of context IDs for
  292.      which synchronization has or may have been lost.  This packet is
  293.      only sent across the single link so it requires no IP header.  The
  294.      format is shown in section 3.6.
  295.  
  296. Assignment of numeric codes for these four packet types in the Point-
  297. to-Point Protocol [4] will be made by the Internet Assigned Numbers
  298. Authority.  Section 13 of [3] specifies that the FULL_HEADER packet will
  299. share the IPv6 packet type and demultiplex based on the IP version
  300. field.
  301.  
  302. 3.2.  Header Compression for RTP Data Packets
  303.  
  304. In the IPv4 header, only the total length, packet ID, and header check-
  305. sum fields will normally change.  The total length is redundant with the
  306. length provided by the link layer, and since this compression scheme
  307. must depend upon the link layer to provide good error detection (e.g.,
  308. PPP's CRC), the header checksum may also be elided.  This leaves only
  309. the packet ID, which, assuming no IP fragmentation, would not need to be
  310. communicated.  However, in order to maintain lossless compression,
  311. changes in the packet ID will be transmitted.  In the IPv6 base header,
  312. there is no packet ID nor header checksum and only the payload length
  313. field changes.
  314.  
  315. In the UDP header, the length field is redundant with the IP total
  316. length field and the length indicated by the link layer.  The UDP check-
  317. sum field will be a constant zero if the source elects not to generate
  318. UDP checksums.  Otherwise, the checksum must be communicated intact in
  319. order to preserve the lossless compression.  Maintaining end-to-end
  320. error detection for applications that require it is an important princi-
  321. ple.
  322.  
  323. In typical usage of the RTP header, the sequence number and the times-
  324. tamp will change from packet to packet.  If packets are not lost or
  325. misordered, the sequence number will increment by one for each packet.
  326. For audio packets of constant duration, the timestamp will increment by
  327. the number of sample periods conveyed in each packet.  For video, the
  328. timestamp will change on the first packet of each frame, but then stay
  329. constant for any additional packets in the frame.  If each video frame
  330. occupies only one packet, but the video frames are generated at a con-
  331. stant rate, then again the change in the timestamp from frame to frame
  332.  
  333.  
  334.  
  335.                             Expires May 1997                    [Page 6]
  336.  
  337. Internet Draft         draft-ietf-avt-crtp-01.txt          November 1996
  338.  
  339.  
  340. is constant.  Note that in each of these cases the second-order differ-
  341. ence of the sequence number and timestamp fields is often zero.  When
  342. that's not true, the magnitude of the change is usually much smaller
  343. than the full number of bits in the field, so the size can be reduced by
  344. encoding the difference rather than the absolute value.
  345.  
  346. The M bit will be set on the first packet of a talkspurt and the last
  347. packet of a video frame.  If it were treated as a constant field such
  348. that each change required sending the full RTP header, this would reduce
  349. the compression significantly.  Therefore, one bit in the compressed
  350. header will carry the M bit explicitly.
  351.  
  352. If the packets are flowing through an RTP mixer, most commonly for
  353. audio, then the CSRC list and CC count will also change.  However, the
  354. CSRC list will typically remain constant during a talkspurt or longer,
  355. so it need be sent only when it changes.
  356.  
  357. 3.3.  The protocol
  358.  
  359. When the second-order difference of the RTP header is zero, all that
  360. need be communicated is a small sequence number to maintain synchroniza-
  361. tion and detect packet loss between the compressor and decompressor.
  362. Each context has its own separate sequence number space so that a single
  363. packet loss need only invalidate one context.  To synchronize with the
  364. decompressor, the compressor inserts the current value of the sequence
  365. number into the Data field of the FULL_HEADER or COMPRESSED_NON_TCP
  366. packet whenever one of those is transmitted (see Sections 5.3.2 and 6 of
  367. [3]).
  368.  
  369. When the second-order difference of the RTP header is not zero for some
  370. fields, the new first-order difference for just those fields is communi-
  371. cated using a compact encoding.  The new first-order difference updates
  372. the uncompressed header in the decompressor's session context, and it is
  373. also stored explicitly in the context to be used for updating the field
  374. again on subsequent packets in which the second-order difference is
  375. zero.
  376.  
  377. In practice, the only fields for which it is useful to store the first-
  378. order difference are the IPv4 ID field and the RTP timestamp.  For the
  379. RTP sequence number field, the usual increment is 1.  If the sequence
  380. number changes by other than 1, the difference must be communicated but
  381. does not set the expected difference for the next packet.  Instead, the
  382. expected first-order difference remains fixed at 1 so that the differ-
  383. ence need not be explictly communicated on the next packet assuming it
  384. is in order,
  385.  
  386. For the RTP timestamp, when a FULL_HEADER, COMPRESSED_NON_TCP or
  387. COMPRESSED_UDP packet is sent to refresh the state, the stored first-
  388.  
  389.  
  390.  
  391.                             Expires May 1997                    [Page 7]
  392.  
  393. Internet Draft         draft-ietf-avt-crtp-01.txt          November 1996
  394.  
  395.  
  396. order difference is initialized to zero.  If the timestamp is the same
  397. on the next packet (e.g., same video frame), then the second-order
  398. difference is zero.  Otherwise, the difference between the timestamps of
  399. the two packets is transmitted as the new first-order difference.
  400.  
  401. Similarly, since the IPv4 ID field frequently increments by one, the
  402. first-order difference for that field is initialized to one when the
  403. state is refreshed.  Thereafter, whenever the first-order difference
  404. changes, it is transmitted and stored in the context.
  405.  
  406. A bit mask will be used to indicate which fields have changed by other
  407. than the expected difference.  In addition to the small link sequence
  408. number, the list of items to be conditionally communicated in the
  409. compressed IP/UDP/RTP header is as follows:
  410.  
  411.   I = IPv4 packet ID (always 0 if no IPv4 header)
  412.   U = UDP checksum
  413.   M = RTP marker bit
  414.   S = RTP sequence number
  415.   T = RTP timestamp
  416.   L = RTP CSRC count and list
  417.  
  418. If 4 bits are needed for the link sequence number to get a reasonable
  419. probability of loss detection, there are too few bits remaining to
  420. assign one bit to each of these items and still fit them all into a sin-
  421. gle byte to go along with the context ID.
  422.  
  423. It is not necessary to explicitly indicate the presence of the UDP
  424. checksum because a source will typically include checksums on all pack-
  425. ets of a session or none of them.  When the session state is initialized
  426. with an uncompressed header, if there is a nonzero checksum present, an
  427. unencoded 16-bit checksum will be appended to the compressed header in
  428. all subsequent packets until this setting is changed by sending another
  429. uncompressed packet.
  430.  
  431. Of the remaining items, the CSRC list may be the one least frequently
  432. used.  Rather than dedicating a bit to indicate CSRC change, an unusual
  433. combination of the other bits may be used instead.  This bit combination
  434. is denoted MSTI.  If all four of the bits for the IP packet ID, RTP
  435. marker bit, RTP sequence number and RTP timestamp are set, this as a
  436. special case indicating an extended form of the compressed RTP header
  437. will follow.  That header will include an additional byte containing the
  438. real values of the four bits plus the CC count.  The CSRC list, of
  439. length indicated by the CC count, will be included as in the
  440. uncompressed header.
  441.  
  442. The following diagram shows the compressed IP/UDP/RTP header with dotted
  443. lines indicating fields that are conditionally present.
  444.  
  445.  
  446.  
  447.                             Expires May 1997                    [Page 8]
  448.  
  449. Internet Draft         draft-ietf-avt-crtp-01.txt          November 1996
  450.  
  451.  
  452.  
  453.           0   1   2   3   4   5   6   7
  454.         +-------------------------------+
  455.         |        session context        |
  456.         +---+---+---+---+---+---+---+---+
  457.         | M | S | T | I |    sequence   |
  458.         +---+---+---+---+---+---+---+---+
  459.         :                               :
  460.         +         UDP checksum          +  (implicit)
  461.         :                               :
  462.         +...............................+
  463.         : M'| S'| T'| I'|      CC       :  (if MSTI)
  464.         +...............................+
  465.         :         delta IPv4 ID         :  (if I or I')
  466.         +...............................+
  467.         :      delta RTP sequence       :  (if S or S')
  468.         +...............................+
  469.         :      delta RTP timestamp      :  (if T or T')
  470.         +...............................+
  471.         :                               :
  472.         :           CSRC list           :  (if MSTI)
  473.         :                               :
  474.         :                               :
  475.         +...............................+
  476.         :                               :
  477.         :      RTP header extension     :  (if X set in context)
  478.         :                               :
  479.         :                               :
  480.         +---+---+---+---+---+---+---+---+
  481.         |            RTP data           |
  482.         :                               :
  483.  
  484. The delta fields are encoded with the following variable-length mapping
  485. for compactness:  A change of zero through 127 is represented directly
  486. in one byte.  If the most significant two bits of the byte are 10 or 11,
  487. this signals an extension to a two- or three-byte value, respectively.
  488. The least significant six bits of the first byte are combined, in
  489. decreasing order of significance, with the next one or two bytes to form
  490. a 14- or 22- bit value.  The encoding of decimal values to hex bytes is
  491. shown in the following table:
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.                             Expires May 1997                    [Page 9]
  504.  
  505. Internet Draft         draft-ietf-avt-crtp-01.txt          November 1996
  506.  
  507.  
  508.  
  509.       Decimal  Hex
  510.  
  511.             0  00
  512.             :  :
  513.           127  7F
  514.           128  80 80
  515.             :  :
  516.         16383  BF FF
  517.         16384  C0 40 00
  518.             :  :
  519.       4194303  FF FF FF
  520.  
  521. A change in the RTP timestamp value greater than 4194303 forces the RTP
  522. header to be sent uncompressed using a FULL_HEADER, COMPRESSED_NON_TCP
  523. or COMPRESSED_UDP packet type.
  524.  
  525. The context that must be maintained for each ID is as follows:
  526.  
  527.   o The full IP, UDP and RTP headers.  Multiple IP headers may be
  528.     included on encapsulated packets.
  529.   o The first difference for the IPv4 ID field, initialized to 1.
  530.   o The first difference for the RTP timestamp field, initialized to 0.
  531.   o The current 4-bit sequence number.
  532.   o The current generation number (see [3]).
  533.  
  534.  
  535. 3.4.  Compression of non-RTP UDP Packets
  536.  
  537. If there is a change in any of the fields of the RTP header that are
  538. normally constant (such as the payload type field), then an uncompressed
  539. RTP header must be sent.  This header may be carried in a COMPRESSED_UDP
  540. packet rather than a FULL_HEADER packet.  The COMPRESSED_UDP packet has
  541. the same format as the COMPRESSED_RTP packet except that the M, S and T
  542. bits are always 0 and the corresponding fields are not present:
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.                             Expires May 1997                   [Page 10]
  560.  
  561. Internet Draft         draft-ietf-avt-crtp-01.txt          November 1996
  562.  
  563.  
  564.  
  565.           0   1   2   3   4   5   6   7
  566.         +-------------------------------+
  567.         |        session context        |
  568.         +---+---+---+---+---+---+---+---+
  569.         | 0 | 0 | 0 | I |    sequence   |
  570.         +---+---+---+---+---+---+---+---+
  571.         :                               :
  572.         +         UDP checksum          +  (implicit)
  573.         :                               :
  574.         +...............................+
  575.         :         delta IPv4 ID         :  (if I)
  576.         +---+---+---+---+---+---+---+---+
  577.         |           UDP data            |
  578.         :   (uncompressed RTP header)   :
  579.  
  580. Note that this constitutes a form of IP/UDP header compression different
  581. from COMPRESSED_NON_TCP packet type defined in [3].  The motivation is
  582. to allow reaching the target of two bytes when UDP checksums are dis-
  583. abled, as IPv4 allows.  The protocol in [3] does not use differential
  584. coding for UDP packets, so in the IPv4 case, two bytes of IP ID, and two
  585. bytes of UDP checksum if nonzero, would always be transmitted in addi-
  586. tion to two bytes of compression prefix.
  587.  
  588. 3.5.  Compression of RTCP Control Packets
  589.  
  590. By relying on the RTP convention that data is carried on an even port
  591. number and the corresponding RTCP packets are carried on the next higher
  592. (odd) port number, one could tailor separate compression schemes to be
  593. applied to RTP and RTCP packets.  For RTCP, the compression could apply
  594. not only to the header but also the "data", that is, the contents of the
  595. different packet types.  The numbers in Sender Report (SR) and Receiver
  596. Report (RR) RTCP packets would not compress well, but the text informa-
  597. tion in the Source Description (SDES) packets could be compressed down
  598. to a bit mask indicating each item that was present but compressed out
  599. (for timing purposes on the SDES NOTE item and to allow the end system
  600. to measure the average RTCP packet size for the interval calculation).
  601.  
  602. However, in the compression scheme defined here, no compression will be
  603. done on RTCP packets for several reasons.  Since the RTP protocol
  604. specification suggests that the RTCP packet interval be scaled so that
  605. the aggregate RTCP bandwidth used by all participants in a session will
  606. be no more than 5% of the session bandwidth, there is not much to be
  607. gained from RTCP compression.  Compressing out the SDES items would
  608. require a significant increase in the shared state that must be stored
  609. for each context ID.  And, in order to allow compression when SDES
  610. information for several sources was sent through an RTP "mixer", it
  611. would be necessary to maintain a separate RTCP session context for each
  612.  
  613.  
  614.  
  615.                             Expires May 1997                   [Page 11]
  616.  
  617. Internet Draft         draft-ietf-avt-crtp-01.txt          November 1996
  618.  
  619.  
  620. SSRC identifier.  In a session with more than 255 participants, this
  621. would cause perfect thrashing of the context cache even when only one
  622. participant was sending data.
  623.  
  624. 3.6.  Error Recovery
  625.  
  626. Whenever the 4-bit sequence number for a particular context increments
  627. by other than 1, except when set by a FULL_HEADER or COMPRESSED_NON_TCP
  628. packet, the decompressor must invalidate that context and send a
  629. CONTEXT_STATE packet back to the compressor indicating that the context
  630. has been invalidated.  All packets for the invalid context must be dis-
  631. carded until a FULL_HEADER or COMPRESSED_NON_TCP packet is received for
  632. that context.
  633.  
  634. When an error occurs on the link, the link layer will usually discard
  635. the packet that was damaged (if any), but may provide an indication of
  636. the error.  Some time may elapse before another packet is delivered for
  637. the same context, and then that packet would have to be discarded by the
  638. decompressor when it is observed to be out of sequence, resulting in at
  639. least two packets lost.  To allow faster recovery if the link does pro-
  640. vide an explicit error indication, the decompressor may optionally send
  641. a CONTEXT_STATE packet listing the last valid sequence number and gen-
  642. eration number for one or more recently active contexts.  For a given
  643. context, if the compressor has sent no compressed packet with a higher
  644. sequence number, no corrective action is required.  Otherwise, the
  645. compressor may mark the context invalid so that the next packet is sent
  646. in FULL_HEADER or COMPRESSED_NON_TCP mode.  If the generation number
  647. does not match the current generation of the COMPRESSED_NON_TCP packet,
  648. then the FULL_HEADER must be sent.
  649.  
  650. The format of the CONTEXT_STATE packet is shown in the following
  651. diagram.  The first byte is a type code to allow the CONTEXT_STATE
  652. packet type to be shared for compression of other protocols in the IPv6
  653. scheme [3].  For this IP/UDP/RTP compression scheme, the remainder of
  654. the CONTEXT_STATE packet is structured as a list of blocks to allow the
  655. state for multiple contexts to be indicated, preceded by a one-byte
  656. count of the number of blocks.
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.                             Expires May 1997                   [Page 12]
  672.  
  673. Internet Draft         draft-ietf-avt-crtp-01.txt          November 1996
  674.  
  675.  
  676.  
  677.           0   1   2   3   4   5   6   7
  678.         +---+---+---+---+---+---+---+---+
  679.         |      compression type = 1 *   |
  680.         +---+---+---+---+---+---+---+---+
  681.         |         context count         |
  682.         +---+---+---+---+---+---+---+---+
  683.         +---+---+---+---+---+---+---+---+
  684.         |        session context        |
  685.         +---+---+---+---+---+---+---+---+
  686.         | I | 0 | 0 | 0 |    sequence   |
  687.         +---+---+---+---+---+---+---+---+
  688.         | 0 |         generation        |
  689.         +---+---+---+---+---+---+---+---+
  690.                        ...
  691.         +---+---+---+---+---+---+---+---+
  692.         |        session context        |
  693.         +---+---+---+---+---+---+---+---+
  694.         | I | 0 | 0 | 0 |    sequence   |
  695.         +---+---+---+---+---+---+---+---+
  696.         | 0 |         generation        |
  697.         +---+---+---+---+---+---+---+---+
  698.  
  699.     * Other compression types to be defined in [3].
  700.  
  701. The bit labeled "I" is set to one for contexts that have been marked
  702. invalid and require a FULL_HEADER of COMPRESSED_NON_TCP packet to be
  703. transmitted.  If the I bit is zero, the context state is advisory.
  704.  
  705. Since the CONTEXT_STATE packet itself may be lost, retransmission of one
  706. or more blocks is allowed.  It is expected that retransmission will be
  707. triggered only by receipt of another packet, but if the line is near
  708. idle, retransmission might be triggered by a relatively long timer (on
  709. the order of 1 second).
  710.  
  711. If a CONTEXT_STATE block for a given context is retransmitted, it may
  712. cross paths with the FULL_HEADER or COMPRESSED_NON_TCP packet intended
  713. to refresh that context.  In that case, the compressor may choose to
  714. ignore the error indication.
  715.  
  716. In the case where UDP checksums are being transmitted, the decompressor
  717. could attempt to use the "twice" algorithm described in section 10.1 of
  718. [3].  In this algorithm, the delta is applied more than once on the
  719. assumption that the delta may have been the same on the missing
  720. packet(s) and the one subsequently received.  For the scheme defined
  721. here, the difference in the 4-bit sequence number tells number of times
  722. the delta must be applied.  Note, however, that there is a nontrivial
  723. risk of an incorrect positive indication.  It may be advisable to
  724.  
  725.  
  726.  
  727.                             Expires May 1997                   [Page 13]
  728.  
  729. Internet Draft         draft-ietf-avt-crtp-01.txt          November 1996
  730.  
  731.  
  732. request a FULL_HEADER or COMPRESSED_NON_TCP packet even if the "twice"
  733. algorithm succeeds.
  734.  
  735. Some errors may not be detected, for example if 16 packets are lost in a
  736. row and the link level does not provide an error indication.  In that
  737. case, the decompressor will generate packets that are not valid.  If UDP
  738. checksums are being transmitted, the receiver will probably detect the
  739. invalid packets and discard them, but the receiver does not have any
  740. means to signal the decompressor.  Therefore, it is recommended that the
  741. decompressor verify the UDP checksum periodically, perhaps one out of 16
  742. packets.  If an error is detected, the decompressor would invalidate the
  743. context and signal the compressor with a CONTEXT_STATE packet.
  744.  
  745. 4.  Interaction With Segmentation
  746.  
  747. A segmentation scheme may be used in conjunction with RTP header
  748. compression to allow small, real-time packets to interrupt large,
  749. presumably non-real-time packets in order to reduce delay.  It is
  750. assumed that the large packets bypass the compressor and decompressor
  751. since the interleaving would modify the sequencing of packets at the
  752. decompressor and cause the appearance of errors.  Header compression
  753. should be less important for large packets since the overhead ratio is
  754. smaller.
  755.  
  756. If some packets from an RTP session context are selected for segmenta-
  757. tion (perhaps based on size) and some are not, there is a possibility of
  758. re-ordering.  This would reduce the compression efficiency because the
  759. large packets would appear as lost packets in the sequence space.  How-
  760. ever, this should not cause more serious problems because the RTP
  761. sequence numbers should be reconstructed correctly and will allow the
  762. application to correct the ordering.
  763.  
  764. Link errors detected by the segmentation scheme using its own sequencing
  765. information may be indicated to the compressor with an advisory
  766. CONTEXT_STATE message just as for link errors detected by the link layer
  767. itself.
  768.  
  769. The context ID byte is placed first in the COMPRESSED_RTP header so that
  770. this byte may be shared with the segmentation layer if such sharing is
  771. feasible and has been negotiated.  Since the context ID may have any
  772. value, it can be set to match context information from the segmentation
  773. layer.
  774.  
  775. 5.  Negotiating Compression
  776.  
  777. The use of IP/UDP/RTP compression over a particular link is a function
  778. of the link-layer protocol.  It is expected that such negotiation will
  779. be defined separately for PPP [4], for example.
  780.  
  781.  
  782.  
  783.                             Expires May 1997                   [Page 14]
  784.  
  785. Internet Draft         draft-ietf-avt-crtp-01.txt          November 1996
  786.  
  787.  
  788. 6.  Acknowledgments
  789.  
  790. Several people have contributed to the design of this compression scheme
  791. and related problems.  Scott Petrack initiated discussion of RTP header
  792. compression in the AVT working group at Los Angeles in March, 1996.
  793. Carsten Bormann has developed an overall achitecture for compression in
  794. combination with traffic control across a low-speed link, and made
  795. several specific contributions to the scheme described here.  David Oran
  796. independently developed a note based on similar ideas, and suggested the
  797. use of PPP Multilink protocol for segmentation.  Mikael Degermark has
  798. contributed advice on integration of this compression scheme with the
  799. IPv6 compression framework.
  800.  
  801. 7.  References:
  802.  
  803.  
  804. [1] H. Shulzrinne, S. Casner, R. Frederick, and V. Jacobson, "RTP:
  805.     A Transport Protocol for real-time applications," RFC 1889.
  806.  
  807. [2] V. Jacobson, "TCP/IP Compression for Low-Speed Serial Links,"
  808.     RFC 1144.
  809.  
  810. [3] M. Degermark, B. Nordgren, and S. Pink, "Header Compression for
  811.     IPv6," work in progress.
  812.  
  813. [4] W. Simpson, "The Point-to-Point Protocol (PPP)", RFC 1548.
  814.  
  815.  
  816. 8.  Security Considerations
  817.  
  818. Because encryption eliminates the redundancy that this compression
  819. scheme tries to exploit, there is some inducement to forgo encryption in
  820. order to achieve operation over a low-bandwidth link.  However, for
  821. those cases where encryption of data and not headers is satisfactory,
  822. RTP does specify an alternative encryption method indicated by different
  823. payload types.
  824.  
  825. 9.  Authors' Addresses
  826.  
  827.    Stephen L. Casner
  828.    Precept Software, Inc.
  829.    1072 Arastradero Road
  830.    Palo Alto, CA 94304
  831.    United States
  832.    EMail: casner@precept.com
  833.  
  834.    Van Jacobson
  835.    MS 46a-1121
  836.  
  837.  
  838.  
  839.                             Expires May 1997                   [Page 15]
  840.  
  841. Internet Draft         draft-ietf-avt-crtp-01.txt          November 1996
  842.  
  843.  
  844.    Lawrence Berkeley National Laboratory
  845.    Berkeley, CA 94720
  846.    United States
  847.    EMail: van@ee.lbl.gov
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.                             Expires May 1997                   [Page 16]
  896.  
  897.