home *** CD-ROM | disk | FTP | other *** search
/ Internet Core Protocols / Oreilly-InternetCoreProtocols.iso / RFCs / rfc2159.txt < prev    next >
Encoding:
Text File  |  1999-10-14  |  11.6 KB  |  396 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                  H. Alvestrand
  8. Request for Comments: 2159                                   UNINETT
  9. Category: Standards Track                               January 1998
  10.  
  11.  
  12.                         A MIME Body Part for FAX
  13.  
  14. Status of this Memo
  15.  
  16.    This document specifies an Internet standards track protocol for the
  17.    Internet community, and requests discussion and suggestions for
  18.    improvements.  Please refer to the current edition of the "Internet
  19.    Official Protocol Standards" (STD 1) for the standardization state
  20.    and status of this protocol.  Distribution of this memo is unlimited.
  21.  
  22. Copyright Notice
  23.  
  24.    Copyright (C) The Internet Society (1998).  All Rights Reserved.
  25.  
  26. 1.  Introduction
  27.  
  28.    This document contains the definitions, originally contained in RFC
  29.    1494, on how to carry CCITT G3Fax in MIME, and how to translate it to
  30.    its X.400 representation.
  31.  
  32.    NOTE: At the moment, this format does not seem appropriate for a
  33.    "general purpose image format for the Internet", if such a beast can
  34.    exist. It exists only to carry information that is already in G3 Fax
  35.    format, and may be usefully converted to other formats when used in
  36.    specific contexts.
  37.  
  38. 2.  The image/g3fax content-type
  39.  
  40.    This content-type is defined to carry G3 Facsimile byte streams.
  41.  
  42.    In general, a G3Fax image contains 3 pieces of information:
  43.  
  44.      (1)   A set of flags indicating the particular coding scheme.
  45.            CCITT Recommendation T.30 defines how the flags are
  46.            transmitted over telephones.  In this medium, the flags are
  47.            carried as parameters in the MIME content-type header
  48.            field.
  49.  
  50.      (2)   A structure that divides the bits into pages.  CCITT
  51.            recommendation T.4 describes a "return to command mode"
  52.            string; this is used here to indicate page breaks.
  53.  
  54.  
  55.  
  56.  
  57.  
  58. Alvestrand                  Standards Track                     [Page 1]
  59.  
  60. RFC 2159                 MIME Body Part for FAX             January 1998
  61.  
  62.  
  63.      (3)   For each page, a sequence of bits that form the encoding of
  64.            the image.  CCITT recommendation T.4 defines the bit image
  65.            format.  This is used without change.  The highest bit of
  66.            the first byte is the first bit of the T.4 bitstream.
  67.  
  68. 2.1.  G3Fax Parameters
  69.  
  70.    The following parameters are defined:
  71.  
  72.       (1)   page-length - possible values: A4, B4 and Unlimited
  73.  
  74.       (2)   page-width - possible values: A3, A4, B4
  75.  
  76.       (3)   encoding - possible values: 1-dimensional, 2-dimensional,
  77.             Uncompressed
  78.  
  79.       (4)   resolution - possible values: Fine, Coarse
  80.  
  81.       (5)   DCS - a bit string, represented in Base64.
  82.  
  83.       (6)   pages - an integer, giving the number of pages in the
  84.             document
  85.  
  86.    If nothing is specified, the default parameter settings are:
  87.  
  88.       page-length=A4
  89.       page-width=A4
  90.       encoding=1-dimensional
  91.       resolution=Coarse
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114. Alvestrand                  Standards Track                     [Page 2]
  115.  
  116. RFC 2159                 MIME Body Part for FAX             January 1998
  117.  
  118.  
  119.    It is possible (but misleading) to view the representation of these
  120.    values as single-bit flags. They correspond to the following bits of
  121.    the T.30 control string and X.400 G3FacsimileParameters:
  122.  
  123.        Parameter               T.30 bit        X.400 bit
  124.  
  125.        page-length=A4             no bit set
  126.        page-length=B4          19              21
  127.        page-length=Unlimited   20              20
  128.  
  129.        page-width=A4              no bit set
  130.        page-width=A3           18              22
  131.        page-width=B4           17              23
  132.  
  133.        encoding=1-dimensional     no bit set
  134.        encoding=2-dimensional  16              8
  135.        encoding=Uncompressed   26              30
  136.  
  137.        resolution=Coarse          no bit set
  138.        resolution=Fine         15              9
  139.  
  140.    The reason for the different bit numbers is that X.400 counts bits in
  141.    an octet from the MSB down to the LSB, while T.30 uses the opposite
  142.    numbering scheme.
  143.  
  144.    If any bit but these are set in the Device Control String, the DCS
  145.    parameter should be supplied.
  146.  
  147. 2.2.  Content Encoding
  148.  
  149.    X.400 defines the g3-facsimile data stream as a SEQUENCE of BIT
  150.    STRINGs. Each BIT STRING is a page of facsimile image data, encoded
  151.    as defined by Recommendation T.4.  The following content encoding is
  152.    reversible between MIME and X.400 and ensures that page breaks are
  153.    honored in the MIME representation.
  154.  
  155.    An EOL is defined as a bit sequence of
  156.  
  157.        000000000001 (eleven zeroes and a one).
  158.  
  159.  
  160.    Each page of the message is delimited by a sequence of six (6) EOLs
  161.    that MUST start on a byte boundary.  The image bit stream is padded
  162.    with zeroes as needed to achieve this alignment.
  163.  
  164.    Searching for the boundary is a matter of searching for the byte
  165.    sequence (HEX) 00 10 01 00 10 01 00 10 01, which cannot occur inside
  166.    the image.
  167.  
  168.  
  169.  
  170. Alvestrand                  Standards Track                     [Page 3]
  171.  
  172. RFC 2159                 MIME Body Part for FAX             January 1998
  173.  
  174.  
  175.    See Section 7.5 for the algorithm on conversion between this encoding
  176.    and the X.400 encoding.
  177.  
  178.    The Base64 content-transfer-encoding is appropriate for carrying this
  179.    content-type.
  180.  
  181. 3.  g3-facsimile - image/g3fax
  182.  
  183.    X.400 Body part: g3-facsimile
  184.    MIME Content-Type: image/g3fax
  185.    Conversion Type: nearly Byte copy
  186.    Comments:
  187.  
  188.    The Parameters of the X.400 G3Fax body part are mapped to the
  189.    corresponding Parameters on the MIME Image/G3Fax body part and vice
  190.    versa.  Note that:
  191.  
  192.       (1)   If fineResolution is not specified, pixels will be twice as
  193.             tall as they are wide
  194.  
  195.       (2)   If any bit not corresponding to a specially named option is
  196.             set in the G3Fax NonBasicParameters, the "DCS" parameter
  197.             must be used.
  198.  
  199.       (3)   Interworking is not guaranteed if any bit apart from those
  200.             specially named are used in the NonBasicParameters
  201.  
  202.    From X.400 to G3Fax, the body is created in the following way:
  203.  
  204.       (1)   Any trailing EOL markers on each bitstring is removed. The
  205.             bit order is changed to conform to the most common Internet
  206.             encoding (highest bit of first byte = first bit of the
  207.             G3Fax). The bitstring is padded to a byte boundary.
  208.  
  209.       (2)   6 consecutive EOL markers are appended to each bitstring.
  210.  
  211.       (3)   The padded bitstrings are concatenated together
  212.  
  213.    An EOL marker is the bit sequence 000000000001 (11 zeroes and a
  214.    one).
  215.  
  216.    From G3Fax to X.400, the body is created in the following way:
  217.  
  218.       (1)   The body is split into bitstrings at each occurrence of 6
  219.             consecutive EOL markers. Trailing EOLs must NOT be removed,
  220.             since the X.400 Implementor Guide recommends that each page
  221.             should end with 6 consecutive EOLs.  (This is a change from
  222.             RFC 1494).
  223.  
  224.  
  225.  
  226. Alvestrand                  Standards Track                     [Page 4]
  227.  
  228. RFC 2159                 MIME Body Part for FAX             January 1998
  229.  
  230.  
  231.       (2)   Each bitstring is made into an ASN.1 BITSTRING, reversing
  232.             the order of bits within each byte to conforom to the X.400
  233.             Implementors Guide recommendation for bit order in the
  234.             G3Fax body part.
  235.  
  236.       (3)   The bitstrings are made into an ASN.1 SEQUENCE, which forms
  237.             the body of the G3Fax body part.
  238.  
  239. 4.  Usability of G3Fax body parts
  240.  
  241.    This section is not part of the proposed standard, but is intended as
  242.    guidance for people implementing G3Fax handling, so that they know a
  243.    little about what to expect.
  244.  
  245.    The DCS bitstring is a LONG thing; the T.30 Recommendation (1993)
  246.    gives 67 bits with specific functions, SG8 Report R33 extends this to
  247.    75 bits, and Report R41 (approved in 1995) extends it to 79 bits.
  248.    (For curiosity - bit 68 says that the coding is JPEG; bit 27 is
  249.    "error correcting mode). No sane implementor will send such things
  250.    without being able to negotiate them down if the recipient doesn't
  251.    support it, but there is no guarantee that messages with such bits
  252.    set in the DCS won't arrive through X.400.
  253.  
  254.    The ISO P2 profile from 1995 [PROFILE] says that the profile makes
  255.    support for reception of two-dimensional and fine-resolution
  256.    mandatory if g3-facsimile is supported at all. Research by Andrew
  257.    Gordon of Net-Tel indicates that it is easy for an access unit to
  258.    support fine resolution, unlimited length and B4 length, while
  259.    support for B4 width is nearly impossible, and A3 width is hard.
  260.  
  261.    Another interesting point is that some fax machines have trouble if
  262.    the scan lines do not contain exactly the declared number of pixels
  263.    on each scan line, so "omitting right-hand white space" is likely to
  264.    give trouble.
  265.  
  266. 5.  Security Considerations
  267.  
  268.    There are no known security issues specific to the FAX body part.
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282. Alvestrand                  Standards Track                     [Page 5]
  283.  
  284. RFC 2159                 MIME Body Part for FAX             January 1998
  285.  
  286.  
  287. 6.  References
  288.  
  289.    [MIME]
  290.        Freed, N., and N. Borenstein, "Multipurpose Internet Mail
  291.        Extensions (MIME) Part One: Format of Internet Message Bodies",
  292.        RFC 2045, November 1996.
  293.  
  294.    [GUIDE]
  295.        X.400 Implementor's Guide, version 8.
  296.  
  297.    [PROFILE]
  298.        ISO/IEC ISP 12062-2: 1995:
  299.  
  300.    [T.30]
  301.        ITU-T Recommendation T.30 (1993): Procedures for document
  302.        facsimile transmission in the general switched telephone network.
  303.  
  304. 7. Author's Address
  305.  
  306.    Harald Tveit Alvestrand
  307.    UNINETT
  308.    P.O.box 6883 Elgeseter
  309.    N-7002 Trondheim
  310.    NORWAY
  311.  
  312.    EMail: Harald.T.Alvestrand@uninett.no
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338. Alvestrand                  Standards Track                     [Page 6]
  339.  
  340. RFC 2159                 MIME Body Part for FAX             January 1998
  341.  
  342.  
  343. 8.  Full Copyright Statement
  344.  
  345.    Copyright (C) The Internet Society (1998).  All Rights Reserved.
  346.  
  347.    This document and translations of it may be copied and furnished to
  348.    others, and derivative works that comment on or otherwise explain it
  349.    or assist in its implementation may be prepared, copied, published
  350.    and distributed, in whole or in part, without restriction of any
  351.    kind, provided that the above copyright notice and this paragraph are
  352.    included on all such copies and derivative works.  However, this
  353.    document itself may not be modified in any way, such as by removing
  354.    the copyright notice or references to the Internet Society or other
  355.    Internet organizations, except as needed for the purpose of
  356.    developing Internet standards in which case the procedures for
  357.    copyrights defined in the Internet Standards process must be
  358.    followed, or as required to translate it into languages other than
  359.    English.
  360.  
  361.    The limited permissions granted above are perpetual and will not be
  362.    revoked by the Internet Society or its successors or assigns.
  363.  
  364.    This document and the information contained herein is provided on an
  365.    "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
  366.    TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
  367.    BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
  368.    HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
  369.    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. Alvestrand                  Standards Track                     [Page 7]
  395.  
  396.