home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_i / draft-ietf-ipp-protocol-00.txt < prev    next >
Text File  |  1997-07-16  |  68KB  |  1,861 lines

  1.  
  2.  
  3.  
  4. INTERNET-DRAFT
  5.  
  6.  
  7.                                                  Robert Herriot (editor)
  8.                                                         Sun Microsystems
  9.                                                            Sylvan Butler
  10.                                                          Hewlett-Packard
  11.                                                               Paul Moore
  12.                                                               Microsoft.
  13.                                                             Randy Turner
  14.                                                               Sharp Labs
  15.                                                            July 14, 1997
  16.  
  17.          Internet Printing Protocol/1.0: Protocol Specification
  18.                      draft-ietf-ipp-protocol-00.txt
  19.  
  20. Status of this Memo
  21.  
  22. This document is an Internet-Draft.  Internet-Drafts are working
  23. documents of the Internet Engineering Task Force (IETF), its areas, and
  24. its working groups.  Note that other groups may also distribute working
  25. documents as Internet-Drafts.
  26.  
  27. Internet-Drafts are draft documents valid for a maximum of six months
  28. and may be updated, replaced, or obsoleted by other documents at any
  29. time.  It is inappropriate to use Internet-Drafts as reference material
  30. or to cite them other than as "work in progress".
  31.  
  32. To learn the current status of any Internet-Draft, please check the
  33. "1id-abstracts.txt" listing contained in the Internet-Drafts Shadow
  34. Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe),
  35. munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or
  36. ftp.isi.edu (US West Coast).
  37.  
  38. Abstract
  39.  
  40. This document is one of a set of documents, which together describe all
  41. aspects of a new Internet Printing Protocol (IPP).  IPP is an
  42. application level protocol that can be used for distributed printing
  43. using Internet tools and technology.  The protocol is heavily influenced
  44. by the printing model introduced in the Document Printing Application
  45. (ISO/IEC 10175 DPA) standard.  Although DPA specifies both end user and
  46. administrative features, IPP version 1.0 is focused only on end user
  47. functionality.
  48.  
  49. The full set of IPP documents includes:
  50.  
  51.   Internet Printing Protocol: Requirements
  52.   Internet Printing Protocol/1.0: Model and Semantics
  53.   Internet Printing Protocol/1.0: Security
  54.   Internet Printing Protocol/1.0: Protocol Specification
  55.   Internet Printing Protocol/1.0: Directory Schema
  56.  
  57. The requirements document takes a broad look at distributed printing
  58. functionality, and it enumerates real-life scenarios that help to
  59. clarify the features that need to be included in a printing protocol for
  60.  
  61. Herriot, Butler,             July 14, 1997,                    [Page 1]
  62. Moore and Turner        Expires January 14, 1998
  63.  
  64.  
  65. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  66.  
  67.  
  68. the Internet.  It identifies requirements for three types of users: end
  69. users, operators, and administrators.  The requirements document calls
  70. out a subset of end user requirements that MUST be satisfied in the
  71. first version of IPP.  Operator and administrator requirements are out
  72. of scope for v1.0. The model and semantics document describes a
  73. simplified model with abstract objects, their attributes, and their
  74. operations. The model introduces a Printer object and a Job object.  The
  75. Job object supports multiple documents per job.  The security document
  76. covers potential threats and proposed counters to those threats.  The
  77. protocol specification is formal document which incorporates the ideas
  78. in all the other documents into a concrete mapping using clearly defined
  79. data representations and transport protocol mappings that real
  80. implementers can use to develop interoperable client and server side
  81. components. Finally, the directory schema document shows a generic
  82. schema for directory service entries that represent instances of IPP
  83. Printers.
  84.  
  85. This document is the "Internet Printing Protocol/1.0: Protocol
  86. Specification" document.
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123. Herriot, Butler,             July 14, 1997,                    [Page 2]
  124. Moore and Turner        Expires January 14, 1998
  125.  
  126.  
  127. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  128.  
  129.  
  130.                            Table of Contents
  131.  
  132. 1. Introduction........................................................4
  133. 2. Conformance Terminology.............................................4
  134. 3. Encoding of  the Operation Layer....................................4
  135.    3.1 Picture of the Encoding.........................................4
  136.    3.2 Syntax of Encoding..............................................7
  137.    3.3 Version.........................................................8
  138.    3.4 Mapping of Operations...........................................8
  139.    3.5 Mapping of Status-code..........................................8
  140.    3.6 Tags............................................................9
  141.    3.7 Name-Lengths...................................................11
  142.    3.8 Mapping of Parameter Names.....................................11
  143.    3.9 Value Lengths..................................................12
  144.    3.10 Mapping of Attribute and Parameter Values.....................13
  145.    3.11 Data..........................................................14
  146. 4. Encoding of Transport Layer........................................14
  147.    4.1 General Headers................................................15
  148.    4.2 Request  Headers...............................................16
  149.    4.3 Response Headers...............................................17
  150.    4.4 Entity  Headers................................................17
  151. 5. Security Considerations............................................18
  152. 6. Appendix A: Protocol Examples......................................18
  153.    6.1 Print-Job Request..............................................18
  154.    6.2 Print-Job Response (successful)................................19
  155.    6.3 Print-Job Response (failure)...................................19
  156.    6.4 Print-URI Request..............................................20
  157.    6.5 Create-Job Request.............................................20
  158.    6.6 Get-Jobs Request...............................................21
  159.    6.7 Get-Jobs Response..............................................21
  160. 7. Appendix B: Requirements without HTTP/1.1 as a Transport Layer.....22
  161.    7.1 Additional Parameter-group for HTTP header information.........22
  162.    7.2 Chunking of Data...............................................23
  163.    7.3 Revised Picture for the Operation Layer........................24
  164.    7.4 Revised Syntax for the Operation Layer.........................24
  165. 8. Appendix C: Mapping of Each Operation in the Encoding..............25
  166. 9. References.........................................................27
  167. 10. Author's Address..................................................28
  168. 11. Other Participants:...............................................29
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185. Herriot, Butler,             July 14, 1997,                    [Page 3]
  186. Moore and Turner        Expires January 14, 1998
  187.  
  188.  
  189. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  190.  
  191.  
  192.  
  193. 1. Introduction
  194.  
  195. This document contains the rules for encoding IPP operations and
  196. describes two layers: the transport layer and the operation layer.
  197.  
  198. The transport layer consists of an  HTTP/1.1 request or response. RFC
  199. 2068 [27] describes HTTP/1.1. This document specifies the HTTP headers
  200. that an IPP implementation supports.
  201.  
  202. The operation layer consists of  a message body in an HTTP request or
  203. response.  The document "Internet Printing Protocol/1.0: Model and
  204. Semantics" [21] defines the semantics of such a message body and the
  205. supported values. This document specifies the encoding of an IPP
  206. operation. The aforementioned document [21] is henceforth referred to as
  207. the "IPP model document"
  208.  
  209.  
  210. 2. Conformance Terminology
  211.  
  212. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  213. "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and  "OPTIONAL" in this
  214. document are to be interpreted as described in RFC 2119 [25].
  215.  
  216.  
  217. 3. Encoding of  the Operation Layer
  218.  
  219. The operation layer SHALL contain a single operation request or
  220. operation response.
  221.  
  222. The encoding consists of two primitive types.  integers and characters,
  223. on which all other data types are built. Every character in this
  224. encoding SHALL be a member of the UCS-2 coded character set and SHALL be
  225. encoded using UTF-8  Every integer in this encoding SHALL be encoded in
  226. binary as a signed integer with big-endian format (also known as
  227. "network order" and "most significant byte first"). The number of bytes
  228. for an integer SHALL be a power of 2, that is, 1, 2 and 4.
  229.  
  230. The following two sections present the operation layer in two ways
  231.  
  232.   .  informally through pictures and description
  233.   .  formally through Augmented Backus-Naur Form (ABNF), as specified by
  234.      draft-ietf-drums-abnf-02.txt [29]
  235.  
  236.  
  237. 3.1 Picture of the Encoding
  238.  
  239. The encoding for an operation request or response consists of:
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247. Herriot, Butler,             July 14, 1997,                    [Page 4]
  248. Moore and Turner        Expires January 14, 1998
  249.  
  250.  
  251. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  252.  
  253.  
  254.   -----------------------------------------------
  255.   |                    version                  |   2 bytes  - required
  256.   -----------------------------------------------
  257.   |operation (request) or status-code (response)|   2 bytes  - required
  258.   -----------------------------------------------------------
  259.   |                 parameter-tag               |   1 byte  |
  260.   -----------------------------------------------           |- optional
  261.   |               parameter-sequence            |   m bytes |
  262.   -----------------------------------------------------------
  263.   |                 attribute-tag               |   1 byte  |
  264.   -----------------------------------------------           |-0 or more
  265.   |               attribute-sequence            |   n bytes |
  266.   -----------------------------------------------------------
  267.   |                  data-tag                   |   1 byte   - required
  268.   -----------------------------------------------
  269.   |                     data                    |   q bytes  - optional
  270.   -----------------------------------------------
  271.  
  272. The parameter-tag and parameter-sequence may be omitted if the operation
  273. has no parameters. The attribute-tag and attribute-sequence may be
  274. omitted if the operation has no attributes or it may be replicated for
  275. an operation that contains attributes for multiple objects. The data is
  276. omitted from some operations, but the data-tag is present even when the
  277. data is omitted. Note, the parameter-tag, attribute-tag and data-tag are
  278. called `delimiter-tags'.
  279.  
  280. A parameter-sequence consists of  a sequence of zero or more compound-
  281. parameters.
  282.  
  283.   -----------------------------------------------
  284.   |               compound-parameter            |   r bytes - 0 or more
  285.   -----------------------------------------------
  286.  
  287. An attributes-sequence consists of zero or more compound-attributes.
  288.  
  289.   -----------------------------------------------
  290.   |              compound-attribute             |   s bytes - 0 or more
  291.   -----------------------------------------------
  292.  
  293. A compound-parameter consists of a parameter with a single value
  294. optionally followed by zero or more additional values. A compound-
  295. attribute consists an attribute with a single value followed by zero or
  296. more additional values.
  297.  
  298. Each parameter or attribute consists of:
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309. Herriot, Butler,             July 14, 1997,                    [Page 5]
  310. Moore and Turner        Expires January 14, 1998
  311.  
  312.  
  313. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  314.  
  315.  
  316.   -----------------------------------------------
  317.   |                   value-tag                 |   1 byte
  318.   -----------------------------------------------
  319.   |               name-length  (value is u)     |   2 bytes
  320.   -----------------------------------------------
  321.   |                     name                    |   u bytes
  322.   -----------------------------------------------
  323.   |              value-length  (value is v)     |   2 bytes
  324.   -----------------------------------------------
  325.   |                     value                   |   v bytes
  326.   -----------------------------------------------
  327.  
  328. An additional value consists of:
  329.  
  330.   -----------------------------------------------------------
  331.   |                   value-tag                 |   1 byte  |
  332.   -----------------------------------------------           |
  333.   |            name-length  (value is 0x0000)   |   2 bytes |
  334.   -----------------------------------------------           |-0 or more
  335.   |              value-length (value is w)      |   2 bytes |
  336.   -----------------------------------------------           |
  337.   |                     value                   |   w bytes |
  338.   -----------------------------------------------------------
  339.  
  340. Note: an additional value is like a parameter or attribute whose name-
  341. length is 0.
  342.  
  343. From the standpoint of a parsing loop, the encoding consists of:
  344.  
  345.   -----------------------------------------------
  346.   |                    version                  |   2 bytes  - required
  347.   -----------------------------------------------
  348.   |operation (request) or status-code (response)|   2 bytes  - required
  349.   -----------------------------------------------------------
  350.   |        tag (delimiter-tag or value-tag)     |   1 byte  |
  351.   -----------------------------------------------           |-0 or more
  352.   |      empty or rest of parameter/attribute   |   x bytes |
  353.   -----------------------------------------------------------
  354.   |                   data-tag                  |   2 bytes  - required
  355.   -----------------------------------------------
  356.   |                     data                    |   y bytes  - optional
  357.   -----------------------------------------------
  358.  
  359.  
  360. The value of the tag determines whether the bytes following the tag are:
  361.  
  362.   .  parameters
  363.   .  attributes
  364.   .  data
  365.   .  the remainder of a single parameter or attribute where the tag
  366.      specifies the type of the value.
  367.  
  368.  
  369.  
  370.  
  371. Herriot, Butler,             July 14, 1997,                    [Page 6]
  372. Moore and Turner        Expires January 14, 1998
  373.  
  374.  
  375. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  376.  
  377.  
  378. 3.2 Syntax of Encoding
  379.  
  380. The syntax below is ABNF except `strings of literals' SHALL be case
  381. sensitive. For example `a' means lower case  `a' and not upper case `A'.
  382. In addition, two-byte binary signed integer fields are represented as
  383. `%x' values which show their range of values.
  384.  
  385.   ipp-message = ipp-request / ipp-response
  386.   ipp-request = version operation
  387.        [parameter-tag parameter-sequence ]
  388.        *(attribute-tag  attribute-sequence) data-tag data
  389.      ipp-response = version status-code
  390.      [parameter-tag parameter-sequence ]
  391.      *(attribute-tag attribute-sequence)  data-tag  data
  392.  
  393.   version = major-version minor-version
  394.   major-version = SIGNED-BYTE  ; initially %d1
  395.   minor-version = SIGNED-BYTE  ; initially %d0
  396.  
  397.   operation = SIGNED-SHORT    ; mapping from model defined below
  398.   status-code = SIGNED-SHORT  ; mapping from model defined below
  399.  
  400.   parameter-sequence = *compound-parameter
  401.   attribute-sequence = *compound-attribute
  402.   compound-parameter = parameter *additional-values
  403.   compound-attribute = attribute *additional-values
  404.  
  405.   parameter = value-tag name-length name value-length value
  406.   attribute = value-tag name-length name value-length value
  407.   additional-values = value-tag zero-name-length value-length value
  408.  
  409.   name-length = SIGNED-SHORT    ; number of octets of `name'
  410.   name = LALPHA *( LALPHA / DIGIT / "-" / "_" )
  411.   value-length = SIGNED-SHORT   ; number of octets of `value'
  412.   value = OCTET-STRING
  413.  
  414.   data = OCTET-STRING
  415.  
  416.   zero-name-length = %x00.00       ; name-length of 0
  417.   parameter-tag = %x01             ; tag of 1
  418.   attribute-tag =  %x02            ; tag of 2
  419.   data-tag = %x03                  ; tag of 3
  420.   value-tag = %x10..%xFF
  421.  
  422.   SIGNED-BYTE = %x00..%xFF
  423.   SIGNED-SHORT = %x00..%xFF %x00..%xFF
  424.   DIGIT = "0".."9"
  425.   LALPHA = "a".."z"
  426.   BYTE = %x00..%xFF
  427.   OCTET-STRING = *BYTE
  428.  
  429. The syntax allows a parameter-tag to be present when the parameter-
  430. sequence that follows is empty. The same is true for the attribute-tag
  431.  
  432.  
  433. Herriot, Butler,             July 14, 1997,                    [Page 7]
  434. Moore and Turner        Expires January 14, 1998
  435.  
  436.  
  437. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  438.  
  439.  
  440. and the attribute-sequence that follows. The syntax is defined this way
  441. to allow for the response of Get-Jobs where no attributes are returned
  442. for some job-objects.  Although it is RECOMMENDED that the sender not
  443. send a parameter-tag if there are no parameters and not send an
  444. attribute-tag if there are no attributes (except in the Get-Jobs
  445. response just mentioned), the receiver MUST be able to decode such
  446. syntax.
  447.  
  448.  
  449. 3.3 Version
  450.  
  451. The version SHALL consist of a major and minor version, each of which
  452. SHALL be represented by a one byte signed integer. The protocol
  453. described in this document SHALL have a major version of 1 (0x01) and a
  454. minor version of  0 (0x00).  The ABNF for these two bytes SHALL be
  455. %x01.00.
  456.  
  457.  
  458. 3.4 Mapping of Operations
  459.  
  460. The following SHALL be the mapping of operations names to integer values
  461. which are encoded as two byte binary signed integers. The operations are
  462. defined in the IPP model document  The table below includes a range of
  463. values for future extensions to the protocol and a separate range for
  464. private extensions.  It is RECOMMENDED that the private extension values
  465. be used for temporary experimental implementations and not for deployed
  466. products.
  467.  
  468.  
  469.    Encoding (hex)   Operation
  470.  
  471.    0x0              reserved (not used)
  472.    0x1              Get-Operations
  473.    0x2              Print-Job
  474.    0x3              Print-URI
  475.    0x4              Validate-Job
  476.    0x5              Create-Job
  477.    0x6              Send-Document
  478.    0x7              Send-URI
  479.    0x8              Cancel-Job
  480.    0x9              Get-Attributes
  481.    0xA              Get-Jobs
  482.    0xB-0x3FFF       reserved for future operations
  483.    0x4000-0xFFFF    reserved for private extensions
  484.  
  485. 3.5 Mapping of Status-code
  486.  
  487. The following SHALL be the mapping of status-code names to integer
  488. values which are encoded as two byte binary signed integers. The status-
  489. code names are defined in the IPP model document.
  490.  
  491.  
  492.  
  493.  
  494.  
  495. Herriot, Butler,             July 14, 1997,                    [Page 8]
  496. Moore and Turner        Expires January 14, 1998
  497.  
  498.  
  499. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  500.  
  501.  
  502. If an IPP status-code is returned, then the HTTP Status-Code MUST be 200
  503. (OK). With any other HTTP Status-Code value, the HTTP response SHALL NOT
  504. contain an IPP message-body, and thus no IPP status-code is returned.
  505.  
  506. Note: the integer encodings below were chosen to be similar to
  507. corresponding Status-Code values in HTTP. The IPP client and server
  508. errors have the same relative offset to their base as corresponding HTTP
  509. errors, but the IPP base is a multiple of 0x100 whereas the HTTP base is
  510. a multiple of 100. Despite this similarity,  the Status-Code returned at
  511. the HTTP level will always be different except in the case where `OK' is
  512. returned at both levels, 200 (OK) in HTTP and 0 (successful-OK) in IPP.
  513.  
  514. Note: some status-code values, such as client-error-unauthorized, may
  515. be returned at the transport (HTTP) level rather than the operation
  516. level.
  517.  
  518. ISSUE: as implementations proceed, we will learn what error code need to
  519. be supported at the IPP level.
  520.  
  521.  
  522.    Encoding (hex)  Status-Code Name
  523.  
  524.    0               successful-OK
  525.    0x400           client-error-bad-request
  526.    0x401           client-error-unauthorized
  527.    0x403           client-error-forbidden
  528.    0x404           client-error-not-found
  529.    0x405           client-error-method-not-allowed
  530.    0x408           client-error-timeout
  531.    0x40A           client-error-gone
  532.    0x40D           client-error-request-entity-too-large
  533.    0x40E           client-error-request-URI-too-long
  534.    0x40F           client-error-unsupported-document-format
  535.    0x410           client-error-attribute-not-supported
  536.    0x500           server-error-internal-server-error
  537.    0x501           server-error-operation-not-implemented
  538.    0x503           server-error-service-unavailable
  539.    0x504           server-error-timeout
  540.    0x505           server-error-version-not-supported
  541.    0x506           server-error-printer-error
  542.    0x507           server-error-temporary-error
  543.  
  544. 3.6 Tags
  545.  
  546. There are two kinds of tags:
  547.  
  548.   .  delimiter tags: delimit major sections of the protocol, namely
  549.      parameters, attributes and data
  550.   .  value tags: specify the type of each parameter or attribute value
  551.  
  552. The following table specifies the values for the delimiter tags:
  553.  
  554.  
  555.  
  556.  
  557. Herriot, Butler,             July 14, 1997,                    [Page 9]
  558. Moore and Turner        Expires January 14, 1998
  559.  
  560.  
  561. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  562.  
  563.  
  564.  
  565.    Tag Value (Hex)   Delimiter
  566.  
  567.    0x00              reserved
  568.    0x01              parameter-tag
  569.    0x02              attribute-tag
  570.    0x03              data-tag
  571.    0x04-0x0F         reserved for future delimiters
  572.  
  573. The remaining tables show values for the value-tag, which is the first
  574. octet of  a parameter or attribute. The value-tag specifies the type of
  575. the value of the parameter or attribute. The value of the value-tag of a
  576. parameter or attribute SHALL either be a type value specified in the
  577. model document or an "out-of-band" value, such as "unsupported" or
  578. "default". If  the value of value-tag for a attribute or parameter is
  579. not "out-of-band" and differs from the value type specified by the model
  580. document, then a server receiving such a request MAY reject it, and  a
  581. client receiving such a response MAY ignore the attribute or parameter.
  582.  
  583. The following table specifies the "out-of-band" values for the value-
  584. tag.
  585.  
  586.  
  587.    Tag Value (Hex)    Meaning
  588.  
  589.    0x10               unsupported
  590.    0x11               default
  591.    0x12-0x1F          reserved for future "out-of-band" values.
  592.  
  593. The "unsupported" value SHALL be used in the attribute-sequence of an
  594. error response for those attributes which the server does not support.
  595. The "default" value is reserved for future use of setting value back to
  596. their default value.
  597.  
  598. The following table specifies the integer values for the value-tag
  599.  
  600.  
  601.    Tag Value (Hex)   Meaning
  602.  
  603.    0x20              reserved
  604.    0x21              integer (up to 4 bytes)
  605.    0x22              boolean
  606.    0x23              seconds
  607.    0x24              milliseconds
  608.    0x25              enum
  609.    0x26-0x3F         reserved for future integer types
  610.  
  611. NOTE: 0x20 is reserved for "generic integer" if should ever be needed.
  612.  
  613. The following table specifies the character-string values for the value-
  614. tag
  615.  
  616.  
  617.  
  618.  
  619. Herriot, Butler,             July 14, 1997,                   [Page 10]
  620. Moore and Turner        Expires January 14, 1998
  621.  
  622.  
  623. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  624.  
  625.  
  626.  
  627.    Tag Value (Hex)   Meaning
  628.  
  629.    0x40              reserved
  630.    0x41              text
  631.    0x42              name
  632.    0x43              filename
  633.    0x44              keyword
  634.    0x45              uri
  635.    0x46              uriScheme
  636.    0x47              dateTime
  637.    0x48-0x7F         reserved for future character string types
  638.  
  639. NOTE: 0x40 is reserved for "generic character-string" if should ever be
  640. needed.
  641.  
  642. The values 0x80-0xFF are reserved for future types.
  643.  
  644.  
  645. 3.7 Name-Lengths
  646.  
  647. The name-length field SHALL consist of a two byte binary signed integer
  648. in big endian order. This field SHALL specify the number of octets in
  649. the name field which follows the name-length field, excluding the two
  650. bytes of the name-length field.
  651.  
  652. If a name-length field has a value of zero, the following name field
  653. SHALL be empty, and the following value SHALL be treated as an
  654. additional value for the preceding parameter. Within a parameter-
  655. sequence, if two parameters have the same name, the first occurrence
  656. SHALL be ignored. Within an attribute-sequence, if two attributes have
  657. the same name, the first occurrence SHALL be ignored. The zero-length
  658. name is the only mechanism for multi-valued parameters and attributes.
  659.  
  660.  
  661. 3.8 Mapping of Parameter Names
  662.  
  663. Some parameters are encoded in a special position.  These parameters
  664. are:
  665.  
  666.   .  "request-URI": The request-URI of each operation in the IPP model
  667.      document SHALL be specified outside of  the operation layer as the
  668.      request-URI on the Request-Line at the HTTP level, and SHALL not be
  669.      specified within the operation layer.
  670.   .  "document-content": The parameter named "document-content" in the
  671.      IPP model document SHALL become the "data" in the operation layer.
  672.   .  "status-code": The parameter named "status-code" in the IPP model
  673.      document SHALL become the "status-code" field in the operation
  674.      layer response.
  675.  
  676. ISSUE: Should the request-URI that is the target object of the operation
  677. be outside the operation layer, or should it be inside as a parameter
  678. and a separate print server URI outside in the HTTP Request-Line?
  679.  
  680.  
  681. Herriot, Butler,             July 14, 1997,                   [Page 11]
  682. Moore and Turner        Expires January 14, 1998
  683.  
  684.  
  685. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  686.  
  687.  
  688. The remaining parameters are encoded in the parameter-sequence or the
  689. attribute-sequence.  The parameter-sequence is for actual operation
  690. parameters and the attribute-sequence is for object attributes. Of the
  691. parameters defined in the IPP model document, some represent an actual
  692. operation parameters and others represent a collection of object
  693. attributes.
  694.  
  695. A parameter in the IPP model document SHALL represent a collection of
  696. object attributes if its name contains the word "attributes"
  697. immediately preceded by a space; otherwise it SHALL represent an actual
  698. operation parameter. Note, some actual operation parameters contain the
  699. word "attributes" preceded by a hyphen ("-").  They are not a collection
  700. of attributes.
  701.  
  702. If a parameter in IPP model document represents an actual operation
  703. parameter and is not in a special position, it SHALL be encoded in the
  704. parameter-sequence using the text name of the parameter specified in the
  705. IPP model document.
  706.  
  707. If a parameter in IPP model document represents a collection of object
  708. attributes, the attributes SHALL be encoded in the attribute-sequence
  709. using the text names of the attributes specified in the IPP model
  710. document. The IPP model document specifies the members of such attribute
  711. collections, but  does not require that all members of a collection be
  712. present in an operation.
  713.  
  714. If an operation contain attributes from exactly one object, there SHALL
  715. be exactly one attribute-sequence. If an operation contains attributes
  716. from more than one object (e.g. Get-Jobs response), the attributes from
  717. each object SHALL be in a separate attribute-sequence, such that the
  718. attributes from the ith object are in the ith attribute-sequence.
  719.  
  720. See  Section 8 "Appendix C: Mapping of Each Operation in the Encoding"
  721. for table showing the application of the rules above.
  722.  
  723.  
  724. 3.9 Value Lengths
  725.  
  726. Each parameter value SHALL be preceded by a two byte binary signed
  727. integer in big endian order which SHALL specify the number of octets in
  728. the value which follows this length, exclusive of the two bytes
  729. specifying the length.
  730.  
  731. For any of the types represented by binary signed integers, the sender
  732. MAY encode the value in fewer than the maximum 4 bytes, but the number
  733. of bytes for the encoding MUST be a power of two, i.e. 1, 2 or 4, and
  734. representation MUST be as a signed integer in the fewer bytes.
  735.  
  736. ISSUE: allowing 4 byte integers to be transmitted in 1 or 2 bytes, at
  737. client discretion, may be more trouble than the saved bytes are worth.
  738. Do we really want this?
  739.  
  740.  
  741.  
  742.  
  743. Herriot, Butler,             July 14, 1997,                   [Page 12]
  744. Moore and Turner        Expires January 14, 1998
  745.  
  746.  
  747. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  748.  
  749.  
  750. For any of the types represented by character-strings, the sender MUST
  751. encode the value with all the characters of the string and without any
  752. padding characters.
  753.  
  754. If a value-tag contains an "out-of-band" value, such as "unsupported",
  755. the value-length SHALL be 0 and the value empty -- the value has no
  756. meaning when the value-tag has an "out-of-band" value. If a server or
  757. client receives an operation with a nonzero value-length in this case,
  758. it SHALL ignore the value field.
  759.  
  760.  
  761. 3.10 Mapping of Attribute and Parameter Values
  762.  
  763. The following SHALL be the mapping of attribute and parameter values to
  764. their IPP encoding in the value field. The syntax types are defined in
  765. the IPP model document.
  766.  
  767.    Syntax of
  768.    Attribute Value  Encoding
  769.  
  770.    text             an octet string where each character is
  771.                     a member of the UCS-2 coded character
  772.                     set and is encoded using UTF-8. The
  773.                     text is encoded in "network byte order"
  774.                     with the first character in the text
  775.                     (according to reading order) being the
  776.                     first character in the encoding.
  777.    name             same as text
  778.    fileName         same as text
  779.    keyword          same as text. Allowed text values are
  780.                     defined in the IPP model document
  781.    uri              same as text
  782.    uriScheme        same as text
  783.    boolean          one binary octet where 0x00 is `false'
  784.                     and 0x01 is `true'
  785.    integer          number of octets is a power of 2 (i.e.
  786.                     1, 2 or 4). These octets represent a
  787.                     binary signed integer in big endian
  788.                     order (also known as  "network byte
  789.                     order" and MSB first).
  790.    enum             same as integer. Allowed integer values
  791.                     are defined in the IPP model document
  792.    dateTime         same as text. Syntax of data and time
  793.                     is defined by ISO 8601
  794.                     ISSUE: should ISO 8601 be called out in
  795.                     the IPP model document?
  796.    seconds          same as integer
  797.    milliseconds     same as integer
  798.    1setOf  X        encoding according to the rules for a
  799.                     parameter with more than more value.
  800.                     Each value X is encoded according to
  801.                     the rules for encoding its type.
  802.    rangeOf  X       same 1setOf  X where the number of
  803.  
  804.  
  805. Herriot, Butler,             July 14, 1997,                   [Page 13]
  806. Moore and Turner        Expires January 14, 1998
  807.  
  808.  
  809. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  810.  
  811.  
  812.    Syntax of
  813.    Attribute Value  Encoding
  814.  
  815.                     values is 2.
  816.  
  817. The type of the value in the model document determines the encoding in
  818. the value and the value of the value-tag.
  819.  
  820.  
  821. 3.11 Data
  822.  
  823. The data part SHALL include any data required by the operation
  824.  
  825.  
  826. 4. Encoding of Transport Layer
  827.  
  828. HTTP/1.1 shall be the transport layer for this protocol.
  829.  
  830. The operation layer has been designed with the assumption that the
  831. transport layer contains the following information:
  832.  
  833.   .  the URI of the target job or printer operation
  834.   .  the total length of the data in the operation layer, either as a
  835.      single length or as a sequence of chunks each with a length.
  836.   .  the client's language, the character-set and the transport
  837.      encoding.
  838.  
  839. Each HTTP operation shall use the POST method where the request-URI is
  840. the object target of the operation, and where the "Content-Type" of the
  841. message-body in each request and response shall be "application/ipp".
  842. The message-body shall contain the operation layer and shall have the
  843. syntax described in section 3.2 "Syntax of Encoding".
  844.  
  845. A client implementation SHALL adhere to the rules for a client described
  846. in RFC 2068. A server implementation SHALL adhere the rules for an
  847. origin server described in RFC 2068.
  848.  
  849. In the following sections, there are a tables of all HTTP headers which
  850. describe their use in an IPP client or server.  The following is an
  851. explanation of each column in these tables.
  852.  
  853.   .  the "header" column contains the name of a header
  854.   .  the "request/client" column indicates whether a client sends the
  855.      header.
  856.   .  the "request/server" column indicates whether a server supports the
  857.      header when received.
  858.   .  the "response/server" column indicates whether a server sends the
  859.      header.
  860.   .  the "response /client" column indicates whether a client supports
  861.      the header when received.
  862.   .  the "values and conditions" column specifies the allowed header
  863.      values and the conditions for the header to be present in a
  864.      request/response.
  865.  
  866.  
  867. Herriot, Butler,             July 14, 1997,                   [Page 14]
  868. Moore and Turner        Expires January 14, 1998
  869.  
  870.  
  871. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  872.  
  873.  
  874. The table for "request headers" does not have columns for responses, and
  875. the table for "response headers" does not have columns for requests.
  876.  
  877. The following is an explanation of the values in the "request/client"
  878. and "response/server" columns.
  879.  
  880.   .  must: the client or server MUST send the header,
  881.   .  must-if: the client or server MUST send the header when the
  882.      condition described in the "values and conditions" column is met,
  883.   .  may: the client or server MAY send the header
  884.   .  not: the client or server SHOULD NOT send the header. It is not
  885.      relevant to an IPP implementation.
  886.  
  887. The following is an explanation of the values in the "response/client"
  888. and "request/server" columns.
  889.  
  890.   .  must: the client or server MUST support the header,
  891.   .  may: the client or server MAY support the header
  892.   .  not: the client or server SHOULD NOT support the header. It is not
  893.      relevant to an IPP implementation.
  894.  
  895. 4.1 General Headers
  896.  
  897. The following is a table for the general headers.
  898.  
  899. ISSUE: an HTTP expert should review these tables for accuracy.
  900.  
  901.  
  902. General-     Request          Response        Values and Conditions
  903. Header
  904.  
  905.  
  906.              Client   Server  Server  Client
  907.  
  908. Cache-       must     not     must    not     "no-cache" only
  909. Control
  910. Connection   must-if  must    must-if must    "close" only. Both
  911.                                               client and server
  912.                                               SHOULD keep a
  913.                                               connection for the
  914.                                               duration of a sequence
  915.                                               of operations. The
  916.                                               client and server MUST
  917.                                               include this header
  918.                                               for the last operation
  919.                                               in such a sequence.
  920. Date         may      may     must    may     per RFC 1123 [9]
  921. Pragma`      must     not     must    not     "no-cache" only
  922. Transfer-    must-if  must    must-if must    "chunked" only .
  923. Encoding                                      Header MUST be present
  924.                                               if Content-Length is
  925.                                               absent.
  926. Upgrade      not      not     not     not
  927.  
  928.  
  929. Herriot, Butler,             July 14, 1997,                   [Page 15]
  930. Moore and Turner        Expires January 14, 1998
  931.  
  932.  
  933. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  934.  
  935.  
  936.  
  937. General-     Request          Response        Values and Conditions
  938. Header
  939.  
  940.  
  941.              Client   Server  Server  Client
  942.  
  943. Via          not      not     not     not
  944.  
  945.  
  946. 4.2 Request  Headers
  947.  
  948. The following is a table for the request headers.
  949.  
  950.  
  951. Request-Header Client  Server  Request Values and Conditions
  952.  
  953. Accept         may     must    "application/ipp" only.  This value
  954.                                is the default if the client omits it
  955. Accept-Charset may     must    per IANA Character Set registry.
  956.                                ISSUE: is this useful for IPP?
  957. Accept-        may     must    empty and per RFC 2068 [27] and IANA
  958. Encoding                       registry for content-codings
  959. Accept-        may     must    see RFC 1766 [26]. A server SHOULD
  960. Language                       honor language requested by returning
  961.                                the values status-message, job-state-
  962.                                message and printer-state-reason in
  963.                                one of requested languages.
  964. Authorization  must-   must    per RFC 2068. A client MUST send this
  965.                if              header when it receives a 401
  966.                                "Unauthorized" response and does not
  967.                                receive a  "Proxy-Authenticate"
  968.                                header.
  969. From           not     not     per RFC 2068. Because RFC recommends
  970.                                sending this header only with the
  971.                                user's approval, it is not very
  972.                                useful
  973. Host           must    must    per RFC 2068
  974. If-Match       not     not
  975. If-Modified-   not     not
  976. Since
  977. If-None-Match  not     not
  978. If-Range       not     not
  979. If-Unmodified- not     not
  980. Since
  981. Max-Forwards   not     not
  982. Proxy-         must-   not     per RFC 2068. A client MUST send this
  983. Authorization  if              header when it receives a 401
  984.                                "Unauthorized" response and a "Proxy-
  985.                                Authenticate" header.
  986. Range          not     not
  987. Referer        not     not
  988. User-Agent     not     not
  989.  
  990.  
  991. Herriot, Butler,             July 14, 1997,                   [Page 16]
  992. Moore and Turner        Expires January 14, 1998
  993.  
  994.  
  995. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  996.  
  997.  
  998. 4.3 Response Headers
  999.  
  1000. The following is a table for the request headers.
  1001.  
  1002.  
  1003. Response-       Server   Client  Response Values and Conditions
  1004. Header
  1005.  
  1006. Accept-Ranges   not      not
  1007. Age             not      not
  1008. Location        must-if  may     per RFC 2068. When URI needs
  1009.                                  redirection.
  1010. Proxy-          not      must    per RFC 2068
  1011. Authenticate
  1012. Public          may      may     per RFC 2068
  1013. Retry-After     may      may     per RFC 2068
  1014. Server          not      not
  1015. Vary            not      not
  1016. Warning         may      may     per RFC 2068
  1017. WWW-            must-if  must    per RFC 2068. When a server needs
  1018. Authenticate                     to authenticate a client.
  1019.  
  1020. 4.4 Entity  Headers
  1021.  
  1022. The following is a table for the entity headers.
  1023.  
  1024.  
  1025. Entity-Header Request         Response         Values and Conditions
  1026.  
  1027.  
  1028.               Client   Server Server   Client
  1029.  
  1030. Allow         not      not    not      not
  1031. Content-Base  not      not    not      not
  1032. Content-      may      must   must     must    per RFC 2068 and IANA
  1033. Encoding                                       registry for content
  1034.                                                codings.
  1035. Content-      may      must   must     must    see RFC 1766 [26].
  1036. Language
  1037. Content-      must-if  must   must-if  must    the length of the
  1038. Length                                         message-body per RFC
  1039.                                                2068. Header MUST be
  1040.                                                present if Transfer-
  1041.                                                Encoding is absent..
  1042. Content-      not      not    not      not
  1043. Location
  1044. Content-MD5   may      may    may      may     per RFC 2068
  1045. Content-Range not      not    not      not
  1046. Content-Type  must     must   must     must    "application/ipp"
  1047.                                                only
  1048. ETag          not      not    not      not
  1049. Expires       not      not    not      not
  1050. Last-Modified not      not    not      not
  1051.  
  1052.  
  1053. Herriot, Butler,             July 14, 1997,                   [Page 17]
  1054. Moore and Turner        Expires January 14, 1998
  1055.  
  1056.  
  1057. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  1058.  
  1059.  
  1060. 5. Security Considerations
  1061.  
  1062. When utilizing HTTP 1.1 as a transport of IPP, the security
  1063. considerations outlined in RFC 2068 apply.  Specifically, IPP servers
  1064. can generate a 401 "Unauthorized" response code to request client
  1065. authentication and IPP clients should correctly respond with the proper
  1066. "Authorization" header.  Both Basic Authentication (RFC 2068) and Digest
  1067. Authentication (RFC 2069) flavors of authentication should be supported.
  1068. The server chooses which type(s) of authentication to accept.  Digest
  1069. Authentication is a more secure method, and is always preferred to Basic
  1070. Authentication.
  1071.  
  1072. For secure communication (privacy in particular), IPP should be run
  1073. using a secure communications channel.  Both Transport Layer Security -
  1074. TLS (draft-ietf-tls-protocol-03) and IPSec (RFC 1825) provide necessary
  1075. features for security.  It is possible to combine the two techniques,
  1076. HTTP 1.1 client authentication (either basic or digest) with secure
  1077. communications channel (either TLS or IPSec).  Together the two are more
  1078. secure than client authentication and they perform user authentication.
  1079.  
  1080. Complete discussion of IPP security considerations can be found in the
  1081. IPP  Security document
  1082.  
  1083.  
  1084. 6. Appendix A: Protocol Examples
  1085.  
  1086.  
  1087. 6.1 Print-Job Request
  1088.  
  1089. The following is an example of a Print-Job request with job-name,
  1090. copies, and sides specified.
  1091.  
  1092.  
  1093. Octets              Symbolic Value        Protocol field
  1094.  
  1095. 0x0100              1.0                   version
  1096. 0x0002              PrintJob              operation
  1097. 0x02                start attributes      attribute tag
  1098. 0x42                name type             value-tag
  1099. 0x0008                                    name-length
  1100. job-name            job-name              name
  1101. 0x0006                                    value-length
  1102. foobar              foobar                value
  1103. 0x21                integer type          value-tag
  1104. 0x0005                                    name-length
  1105. copies              copies                name
  1106. 0x0001                                    value-length
  1107. 0x14                20                    value
  1108. 0x44                keyword type          value-tag
  1109. 0x0005                                    name-length
  1110. copies              sides                 name
  1111. 0x0001                                    value-length
  1112. two-sided-long-edge two-sided-long-edge   value
  1113.  
  1114.  
  1115. Herriot, Butler,             July 14, 1997,                   [Page 18]
  1116. Moore and Turner        Expires January 14, 1998
  1117.  
  1118.  
  1119. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  1120.  
  1121.  
  1122.  
  1123. Octets              Symbolic Value        Protocol field
  1124.  
  1125. 0x03                start-data            data-tag
  1126. %!PS...             <PostScript>          data
  1127.  
  1128. 6.2 Print-Job Response (successful)
  1129.  
  1130. Here is an example of a Print-Job response which is successful:
  1131.  
  1132.  
  1133. Octets           Symbolic Value    Protocol field
  1134.  
  1135. 0x0100           1.0               version
  1136. 0x0000           OK (successful)   status-code
  1137. 0x01             start parameters  parameter tag
  1138. 0x41             text type         value-tag
  1139. 0x000E                             name-length
  1140. status-message   status-message    name
  1141. 0x0002                             value-length
  1142. OK               OK                value
  1143. 0x45             uri type          value-tag
  1144. 0x0008                             name-length
  1145. job-uri          job-uri           name
  1146. 0x000E                             value-length
  1147. http://foo/123   http://foo/123    value
  1148. 0x02             start attributes  attribute tag
  1149. 0x25             name type         value-tag
  1150. 0x0008                             name-length
  1151. job-state        job-state         name
  1152. 0x0001                             value-length
  1153. 0x03             pending           value
  1154. 0x03             start-data        data-tag
  1155.  
  1156. 6.3 Print-Job Response (failure)
  1157.  
  1158. Here is an example of a Print-Job response which fails because the
  1159. printer does not support sides and because the value 20 for copies is
  1160. not supported:
  1161.  
  1162.  
  1163. Octets           Symbolic Value           Protocol field
  1164.  
  1165. 0x0100           1.0                      version
  1166. 0x0400           client-error-bad-request status-code
  1167. 0x01             start parameters         parameter tag
  1168. 0x41             text type                value-tag
  1169. 0x000E                                    name-length
  1170. status-message   status-message           name
  1171. 0x000D                                    value-length
  1172. bad-request      bad-request              value
  1173. 0x02             start attributes         attribute tag
  1174. 0x21             integer type             value-tag
  1175.  
  1176.  
  1177. Herriot, Butler,             July 14, 1997,                   [Page 19]
  1178. Moore and Turner        Expires January 14, 1998
  1179.  
  1180.  
  1181. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  1182.  
  1183.  
  1184.  
  1185. Octets           Symbolic Value           Protocol field
  1186.  
  1187. 0x0005                                    name-length
  1188. copies           copies                   name
  1189. 0x0001                                    value-length
  1190. 0x14             20                       value
  1191. 0x10             unsupported  (type)      value-tag
  1192. 0x0005                                    name-length
  1193. sides            sides                    name
  1194. 0x0000                                    value-length
  1195. 0x03             start-data               data-tag
  1196.  
  1197. 6.4 Print-URI Request
  1198.  
  1199. The following is an example of Print-URI request with copies and job-
  1200. name parameters.
  1201.  
  1202. Octets              Symbolic Value     Protocol field
  1203. 0x0100              1.0                version
  1204. 0x0003              Print-URI          operation
  1205. 0x01                start-parameters   parameter tag
  1206. 0x45                uri type           value-tag
  1207. 0x000A                                 name-length
  1208. document-uri        document-uri       name
  1209. 0x11                                   value-length
  1210. ftp://foo.com/foo   ftp://foo.com/foo  value
  1211. 0x02                start-attributes   attribute tag
  1212. 0x42                name type          value-tag
  1213. 0x0008                                 name-length
  1214. job-name            job-name           name
  1215. 0x0006                                 value-length
  1216. foobar              foobar             value
  1217. 0x21                integer type       value-tag
  1218. 0x0005                                 name-length
  1219. copies              copies             name
  1220. 0x0001                                 value-length
  1221. 0x01                1                  value
  1222. 0x03                start-data         data-tag
  1223. %!PS...             <PostScript>       data
  1224.  
  1225. 6.5 Create-Job Request
  1226.  
  1227. The following is an example of Create-Job request with no parameters and
  1228. no attributes
  1229.  
  1230. Octets       Symbolic Value   Protocol field
  1231. 0x0100       1.0              version
  1232. 0x0005       Create-Job       operation
  1233. 0x03         start-data       data-tag
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239. Herriot, Butler,             July 14, 1997,                   [Page 20]
  1240. Moore and Turner        Expires January 14, 1998
  1241.  
  1242.  
  1243. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  1244.  
  1245.  
  1246. 6.6 Get-Jobs Request
  1247.  
  1248. The following is an example of Get-Jobs request with parameters but no
  1249. attributes.
  1250.  
  1251. Octets                Symbolic Value         Protocol field
  1252. 0x0100                1.0                    version
  1253. 0x000A                Get-Jobs               operation
  1254. 0x01                  start-parameters       parameter-tag
  1255. 0x21                  integer type           value-tag
  1256. 0x0005                                       name-length
  1257. limit                 limit                  name
  1258. 0x0001                                       value-length
  1259. 0x32                  50                     value
  1260. 0x44                  keyword type           value-tag
  1261. 0x0014                                       name-length
  1262. requested-attributes  requested-attributes   name
  1263. 0x0007                                       value-length
  1264. job-uri               job-uri                value
  1265. 0x44                  keyword type           value-tag
  1266. 0x0000                additional value       name-length
  1267. 0x0008                                       value-length
  1268. job-name              job-name               value
  1269. 0x03                  start-data             data-tag
  1270.  
  1271. 6.7 Get-Jobs Response
  1272.  
  1273. The following is an of Get-Jobs response from previous request with 3
  1274. jobs. The Printer returns no information about the second job.
  1275.  
  1276. Octets         Symbolic Value                  Protocol field
  1277. 0x0100         1.0                             version
  1278. 0x0000         OK (successful)                 status-code
  1279. 0x01           start-parameters                parameter-tag
  1280. 0x41           text type                       value-tag
  1281. 0x000E                                         name-length
  1282. status-message status-message                  name
  1283. 0x0002                                         value-length
  1284. OK             OK                              value
  1285. 0x02           start-attributes (1st object)   attribute-tag
  1286. 0x45           uri type                        value-tag
  1287. 0x0007                                         name-length
  1288. job-uri        job-uri                         name
  1289. 0x000E                                         value-length
  1290. http://foo/123 http://foo/123                  value
  1291. 0x42           name type                       value-tag
  1292. 0x0008                                         name-length
  1293. job-name       job-name                        name
  1294. 0x0003                                         name-length
  1295. foo            foo                             name
  1296. 0x02           start-attributes (2nd object)   attribute-tag
  1297. 0x02           start-attributes (3rd object)   attribute-tag
  1298. 0x45           uri type                        value-tag
  1299.  
  1300.  
  1301. Herriot, Butler,             July 14, 1997,                   [Page 21]
  1302. Moore and Turner        Expires January 14, 1998
  1303.  
  1304.  
  1305. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  1306.  
  1307.  
  1308. Octets         Symbolic Value                  Protocol field
  1309. 0x0007                                         name-length
  1310. job-uri        job-uri                         name
  1311. 0x000E                                         value-length
  1312. http://foo/124 http://foo/124                  value
  1313. 0x42           name type                       value-tag
  1314. 0x0008                                         name-length
  1315. job-name       job-name                        name
  1316. 0x0003                                         name-length
  1317. bar            bar                             name
  1318. 0x03           start-data                      data-tag
  1319.  
  1320. 7. Appendix B: Requirements without HTTP/1.1 as a Transport Layer
  1321.  
  1322. The operation layer defined above assumed certain services would be
  1323. provided by the HTTP transport layer.  Without that layer, information,
  1324. such as length, request-URI and Content-Encoding are absent.
  1325.  
  1326. This section specifies the modifications to the operation-layer encoding
  1327. for raw TCP/IP. The following changes would have to made. All of these
  1328. changes are upward compatible with the encoding defined in section 3
  1329. "Encoding of  the Operation Layer".
  1330.  
  1331.  
  1332. 7.1 Additional Parameter-group for HTTP header information
  1333.  
  1334. There is an additional header-sequence which is like a parameter-
  1335. sequence. The header-sequence SHALL appear the  before  the parameter-
  1336. sequence, and it SHALL contain the "request-URI" along with relevant
  1337. HTTP header information, including those shown below. This header-
  1338. sequence SHALL be preceded by a header-tag to mark that a header-
  1339. sequence follows.
  1340.  
  1341. The following table shows the mapping of  HTTP headers to parameters in
  1342. the operation layer.
  1343.  
  1344.  
  1345. HTTP header or other    IPP header name          Syntax Type of header
  1346. concept
  1347.  
  1348. URI                     request-URI              uri
  1349. Connection              Close-Connection         Boolean
  1350. Accept-Charset          Accept-Charset           keyword
  1351. Accept-Encoding         Accept-Encoding          keyword
  1352. Accept-Language         Accept-Language          keyword
  1353. Content-Encoding        Content-Encoding         keyword
  1354. Content-Language        Content-Language         keyword
  1355. charset parameter       Content-Charset          keyword
  1356. miscellaneous security  if needed at this level
  1357.  
  1358. The first parameter in the header-sequence for a request SHALL be the
  1359. attribute "request-URI" which is the target object of the operation.
  1360.  
  1361.  
  1362.  
  1363. Herriot, Butler,             July 14, 1997,                   [Page 22]
  1364. Moore and Turner        Expires January 14, 1998
  1365.  
  1366.  
  1367. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  1368.  
  1369.  
  1370. Except for Content-Encoding, the headers  SHALL take effect at the
  1371. beginning of the parameter-sequence and apply to the rest of the
  1372. operation. If a header is Content-Encoding, then the encoding SHALL
  1373. apply only to the `full-data' or `data-segment's as defined by the
  1374. syntax below and the resulting decoded data SHALL have the syntax of all
  1375. octets that follow a header-sequence. The syntax in a section below
  1376. defines the syntax following a header-sequence to be:
  1377.  
  1378.      [ parameter-tag parameter-sequence ]
  1379.      *(attribute-tag attribute-sequence) data
  1380.  
  1381. From a decoding point of view, if Content-Encoding is specified, the
  1382. operation's data is decoded using the algorithm specified by Content-
  1383. Encoding.  The resulting octet stream is parsed as if it were the octets
  1384. following a header-sequence.
  1385.  
  1386. NOTE: This rule for Content-Encoding allows a client or server to encode
  1387. the parameter-sequence and attribute-sequences  or to transmit them un-
  1388. encoded.
  1389.  
  1390. ISSUE: should the status-message be in the header-sequence instead of
  1391. the parameter-group for responses?
  1392.  
  1393.  
  1394. 7.2 Chunking of Data
  1395.  
  1396. There is a new delimiter-tag called `chunked-data-tag' which denotes
  1397. that the following data is chunked. Chunked data consists of a sequence
  1398. of data-segment-lengths and data-segments.  A data-segment-length of  0
  1399. denotes the end of the data.
  1400.  
  1401. The following is the informal picture of  chunked-data:
  1402.  
  1403.   -----------------------------------------------------------
  1404.   |             data-segment-length             |   2 bytes |
  1405.   -----------------------------------------------           |-0 or more
  1406.   |                data-segment                 |   n bytes |
  1407.   -----------------------------------------------------------
  1408.   |             0x0000 (end-of-data)            |   2 bytes  - required
  1409.   -----------------------------------------------
  1410.  
  1411. The syntax for the chunked-data using ABNF is:
  1412.  
  1413.   chunked-data = *data-chunk end-of-data
  1414.   data-chunk = data-segment-length data-segment
  1415.  
  1416.   data-segment-length = SIGNED-SHORT    ; number of octets
  1417.                                         ; of the data in binary
  1418.   data-segment = OCTET-STRING
  1419.  
  1420.   end-of-data = %x00.00
  1421.  
  1422.  
  1423.  
  1424.  
  1425. Herriot, Butler,             July 14, 1997,                   [Page 23]
  1426. Moore and Turner        Expires January 14, 1998
  1427.  
  1428.  
  1429. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  1430.  
  1431.  
  1432. A data-segment contains fragments of the data. When all the data-
  1433. segments are concatenated together, they form the complete data.
  1434.  
  1435.  
  1436. 7.3 Revised Picture for the Operation Layer
  1437.  
  1438. The encoding for an operation request or response consists of:
  1439.  
  1440.   -----------------------------------------------
  1441.   |                    version                  |   2 bytes  - required
  1442.   -----------------------------------------------
  1443.   |operation (request) or status-code (response)|   2 bytes  - required
  1444.   -----------------------------------------------------------
  1445.   |                   header-tag                |   1 byte  |
  1446.   -----------------------------------------------           |- optional
  1447.   |                header-sequence              |   k bytes |
  1448.   -----------------------------------------------------------
  1449.   |                 parameter-tag               |   1 byte  |
  1450.   -----------------------------------------------           |- optional
  1451.   |               parameter-sequence            |   m bytes |
  1452.   -----------------------------------------------------------
  1453.   |                 attribute-tag               |   1 byte  |
  1454.   -----------------------------------------------           |-0 or more
  1455.   |               attribute-sequence            |   n bytes |
  1456.   -----------------------------------------------------------
  1457.   |                  data-tag                   |   1 byte   - required
  1458.   -----------------------------------------------
  1459.   |                     data                    |   q bytes  - optional
  1460.   -----------------------------------------------
  1461.  
  1462. The definition of all fields above is the same as defined in section 3.1
  1463. "Picture of the Encoding" except
  1464.  
  1465.   .  `data' which either has the form defined in the preceding section
  1466.      (7.3 "Revised Picture for the Operation Layer") or the form
  1467.      described in section 3.1 "Picture of the Encoding".
  1468.   .  `header-tag' which is new and defined like parameter-tag.
  1469.   .  `header-sequence' which is new and defined like parameter-sequence.
  1470.  
  1471. 7.4 Revised Syntax for the Operation Layer
  1472.  
  1473. The following is the revised syntax for the operation layer.
  1474.  
  1475.   ipp-message = ipp-request / ipp-response
  1476.   ipp-request = version operation
  1477.      [ header-tag  header-sequence ]
  1478.      [ parameter-tag parameter-sequence ]
  1479.      *(attribute-tag attribute-sequence) data
  1480.   ipp-response = version status-code
  1481.      [ header-tag header-sequence ]
  1482.      [ parameter-tag parameter-sequence ]
  1483.      *(attribute-tag attribute-sequence) data
  1484.  
  1485.  
  1486.  
  1487. Herriot, Butler,             July 14, 1997,                   [Page 24]
  1488. Moore and Turner        Expires January 14, 1998
  1489.  
  1490.  
  1491. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  1492.  
  1493.  
  1494.   version = major-version minor-version
  1495.   major-version = SIGNED-BYTE  ; initially %d1
  1496.   minor-version = SIGNED-BYTE  ; initially %d0
  1497.  
  1498.   operation = SIGNED-SHORT         ; mapping from model defined below
  1499.   status-code = SIGNED-SHORT       ; mapping from model defined below
  1500.  
  1501.   header-sequence = *compound-header
  1502.   parameter-sequence = *compound-parameter
  1503.   attribute-sequence = *compound-attribute
  1504.  
  1505.   compound-header = header *(additional-values)
  1506.   compound-parameter = parameter *(additional-values)
  1507.   compound-attribute = attribute *(additional -values)
  1508.  
  1509.   header = value-tag name-length name value-length value
  1510.   parameter = value-tag name-length name value-length value
  1511.   attribute = value-tag name-length name value-length value
  1512.   additional-values = value-tag zero-name-length value-length value
  1513.  
  1514.   name-length = SIGNED-SHORT    ; number of octets of `name'
  1515.   name = LALPHA *( LALPHA / DIGIT / "-" / "_" )
  1516.   value-length = SIGNED-SHORT  ; number of octets of `value'
  1517.   value = OCTET-STRING
  1518.  
  1519.   data = (data-tag  full-data ) / (chunked-data-tag chunked-data )
  1520.   full-data = OCTET-STRING
  1521.   chunked-data = *data-chunk END-OF-DATA
  1522.   data-chunk = data-segment-length data-segment
  1523.   data-segment-length = SIGNED-SHORT   ; number of octets of the data
  1524.   in binary
  1525.   data-segment = OCTET-STRING
  1526.  
  1527.   zero-name-length = %x00.00       ; name-length of 0
  1528.   parameter-tag =  %x01            ; tag of 1
  1529.   attribute-tag =  %x02            ; tag of 2
  1530.   data-tag = %x03                  ; tag of 3
  1531.   chunked-data-tag = %x04          ; tag of 4
  1532.   header-tag = %x05                ; tag of 5
  1533.   value-tag = %x10..%xFF
  1534.   end-of-data = %x00.00
  1535.  
  1536.   SIGNED-BYTE = %x00..%xFF
  1537.   SIGNED-SHORT = %x00..%xFF %x00..%xFF
  1538.   DIGIT = "0".."9"
  1539.   LALPHA = "a".."z"
  1540.   BYTE = %x00..%xFF
  1541.   OCTET-STRING = *BYTE
  1542.  
  1543. 8. Appendix C: Mapping of Each Operation in the Encoding
  1544.  
  1545. The next three tables show the results of applying the rules above to
  1546. the operations defined in the IPP model document. There is no
  1547.  
  1548.  
  1549. Herriot, Butler,             July 14, 1997,                   [Page 25]
  1550. Moore and Turner        Expires January 14, 1998
  1551.  
  1552.  
  1553. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  1554.  
  1555.  
  1556. information in these tables that cannot be derived from the rules
  1557. presented in Section 3.8 "Mapping of Parameter Names".
  1558.  
  1559. The following table shows the mapping of all IPP model document request
  1560. parameters (except request-URI) to a parameter-sequence, attribute-
  1561. sequence  or special position in the protocol.
  1562.  
  1563.  
  1564. Operation       parameter-       attribute-         special position
  1565.                 sequence         sequence
  1566.  
  1567. Get-Operations
  1568. Print-Job                        job-template       document-content
  1569.                                  attributes
  1570. Validate-Job                     job-template
  1571. or Create-Job                    attributes
  1572. Print-URI       document-uri     job-template
  1573.                                  attributes
  1574. Send-Document   last-document    document           document-content
  1575.                                  attributes
  1576. Send-URI        last-document    document
  1577.                 document-uri     attributes
  1578. Cancel-Job      message
  1579. Get-Attributes  document-format
  1580.                 requested-
  1581.                 attributes
  1582. Get-Jobs        limit
  1583.                 requested-
  1584.                 attributes
  1585.  
  1586.  
  1587. The following table shows the mapping of all IPP model document response
  1588. parameters to a parameter-sequence, attribute-sequence or special
  1589. position in the protocol.
  1590.  
  1591.  
  1592. Operation      parameter-sequence   attribute-sequence    special
  1593.                                                           position
  1594.  
  1595. Get-Operations status-message                             status-code
  1596.                supported-
  1597.                operations
  1598.  
  1599. Print-Job,     status-message       job-status            status-code
  1600. Print-URI or   job-uri              attributes
  1601. Create-Job
  1602.  
  1603. Send-Document  status-message       job-status            status-code
  1604. or Send-URI                         attributes
  1605.  
  1606. Validate-Job   status-message                             status-code
  1607.  
  1608.  
  1609.  
  1610.  
  1611. Herriot, Butler,             July 14, 1997,                   [Page 26]
  1612. Moore and Turner        Expires January 14, 1998
  1613.  
  1614.  
  1615. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  1616.  
  1617.  
  1618.  
  1619. Operation      parameter-sequence   attribute-sequence    special
  1620.                                                           position
  1621.  
  1622. Cancel-Job     status-message                             status-code
  1623.  
  1624. Get-Attributes status-message       requested attributes  status-code
  1625.  
  1626. Get-Jobs       status-message       requested attributes  status-code
  1627.                                     (see the Note below)
  1628.  
  1629.  
  1630. Note for Get-Jobs: there is a separate attribute-sequence containing
  1631. requested-attributes for each job object in the response
  1632.  
  1633. The following table shows the mapping of all IPP model document error
  1634. response parameters to a parameter-sequence, attribute-sequence or
  1635. special position in the protocol. Those operations omitted don't have
  1636. special parameters for an error return.
  1637.  
  1638.  
  1639. Operation        parameter-        attribute-       special position
  1640.                  sequence          sequence
  1641.  
  1642. Print-Job,       status-message    unsupported      status-code
  1643. Print-URI,                         attributes
  1644. Validate-Job,
  1645. Create-Job,
  1646. Send-Document
  1647. or Send-URI
  1648.  
  1649. 9. References
  1650.  
  1651. [1]  Smith, R., Wright, F., Hastings, T., Zilles, S., and Gyllenskog,
  1652.      J., "Printer MIB", RFC 1759, March 1995.
  1653.  
  1654. [2]  Berners-Lee, T, Fielding, R., and Nielsen, H., "Hypertext Transfer
  1655.      Protocol - HTTP/1.0", RFC 1945, August 1995.
  1656.  
  1657. [3]  Crocker, D., "Standard for the Format of ARPA Internet Text
  1658.      Messages", RFC 822, August 1982.
  1659.  
  1660. [4]  Postel, J., "Instructions to RFC Authors", RFC 1543, October 1993.
  1661.  
  1662. [5]  ISO/IEC 10175 Document Printing Application (DPA), June 1996.
  1663.  
  1664. [6]  Herriot, R. (editor), X/Open A Printing System Interoperability
  1665.      Specification (PSIS), August 1995.
  1666.  
  1667. [7]  Kirk, M. (editor), POSIX System Administration - Part 4: Printing
  1668.      Interfaces, POSIX 1387.4 D8, 1994.
  1669.  
  1670.  
  1671.  
  1672.  
  1673. Herriot, Butler,             July 14, 1997,                   [Page 27]
  1674. Moore and Turner        Expires January 14, 1998
  1675.  
  1676.  
  1677. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  1678.  
  1679.  
  1680. [8]  Borenstein, N., and Freed, N., "MIME (Multi-purpose Internet Mail
  1681.      Extensions) Part One: Mechanism for Specifying and Describing the
  1682.      Format of Internet Message Bodies", RFC 1521, September, 1993.
  1683.  
  1684. [9]  Braden, S., "Requirements for Internet Hosts - Application and
  1685.      Support", RFC 1123, October, 1989,
  1686.  
  1687. [10] McLaughlin, L. III, (editor), "Line Printer Daemon Protocol" RFC
  1688.      1179, August 1990.
  1689.  
  1690. [11] Berners-Lee, T., Masinter, L., McCahill, M. , "Uniform Resource
  1691.      Locators (URL)", RFC 1738, December, 1994.
  1692.  
  1693. [20] Wright, F. D., "Internet Printing Protocol: Requirements"
  1694.  
  1695. [21] Isaacson, S, deBry, R, Hasting, T, Herriot, R, Powell, P, "Internet
  1696.      Printing Protocol/1.0: Model and Semantics"
  1697.  
  1698. [22] Internet Printing Protocol/1.0: Security
  1699.  
  1700. [23] Herriot, R, Butler, S, Moore, P, Turner, R, "Internet Printing
  1701.      Protocol/1.0: Protocol Specification"  (This document)
  1702.  
  1703. [24] Carter, K, Isaacson, S, "Internet Printing Protocol/1.0: Directory
  1704.      Schema"
  1705.  
  1706. [25] S. Bradner, "Key words for use in RFCs to Indicate Requirement
  1707.      Levels", RFC 2119 , March 1997
  1708.  
  1709. [26] H. Alvestrand, " Tags for the Identification of Languages", RFC
  1710.      1766, March 1995.
  1711.  
  1712. [27]       R Fielding, et al, "Hypertext Transfer Protocol " HTTP/1.1"
  1713.      RFC 2068, January 1997
  1714.  
  1715. [28]       Marcus Kuhn, "International Standard Date and Time Notation",
  1716.      ISO 8601,
  1717.      http://www.ft.uni-erlangen.de/~mskuhn/iso-time.html
  1718.  
  1719. [29] D. Crocker et al., "Augmented BNF for Syntax Specifications: ABNF",
  1720.      draft-ietf-drums-abnf-02.txt.
  1721.  
  1722.  
  1723. 10. Author's Address
  1724.  
  1725.      Robert Herriot (editor)
  1726.      Sun Microsystems Inc.
  1727.      901 San Antonio.Road, MPK-17
  1728.      Palo Alto, CA 94303
  1729.  
  1730.      Phone: 415-786-8995
  1731.      Fax:  415-786-7077
  1732.      Email: robert.herriot@eng.sun.com
  1733.  
  1734.  
  1735. Herriot, Butler,             July 14, 1997,                   [Page 28]
  1736. Moore and Turner        Expires January 14, 1998
  1737.  
  1738.  
  1739. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  1740.  
  1741.  
  1742.  
  1743.      Sylvan Butler
  1744.      Hewlett-Packard
  1745.      11311 Chinden Blvd.
  1746.      Boise, ID 83714
  1747.  
  1748.      Phone: 208-396-6000
  1749.      Fax:  208-396-3457
  1750.      Email: sbutler@boi.hp.com
  1751.  
  1752.      Paul Moore
  1753.      Microsoft
  1754.      One Microsoft Way
  1755.      Redmond, WA 98053
  1756.  
  1757.      Phone: 425-936-0908
  1758.      Fax: 425-93MS-FAX
  1759.      Email: paulmo@microsoft.com
  1760.  
  1761.      Randy Turner
  1762.      Sharp Laboratories
  1763.      5750 NW Pacific Rim Blvd
  1764.      Camas, WA 98607
  1765.  
  1766.      Phone: 360-817-8456
  1767.      Fax: : 360-817-8436
  1768.      Email: rturner@sharplabs.com
  1769.  
  1770.      IPP Mailing List:  ipp@pwg.org
  1771.      IPP Mailing List Subscription:  ipp-request@pwg.org
  1772.      IPP Web Page:  http://www.pwg.org/ipp/
  1773.  
  1774.  
  1775. 11. Other Participants:
  1776.  
  1777.      Chuck Adams - Tektronix
  1778.      Ron Bergman - Data Products
  1779.      Keith Carter - IBM
  1780.      Angelo Caruso - Xerox
  1781.      Jeff Copeland - QMS
  1782.      Roger Debry - IBM
  1783.      Lee Farrell - Canon
  1784.      Sue Gleeson - Digital
  1785.      Charles Gordon - Osicom
  1786.      Brian Grimshaw - Apple
  1787.      Jerry Hadsell - IBM
  1788.      Richard Hart - Digital
  1789.      Tom Hastings - Xerox
  1790.      Stephen Holmstead
  1791.      Zhi-Hong Huang - Zenographics
  1792.      Scott Isaacson - Novell
  1793.      Rich Lomicka - Digital
  1794.      David Kellerman - Northlake Software
  1795.  
  1796.  
  1797. Herriot, Butler,             July 14, 1997,                   [Page 29]
  1798. Moore and Turner        Expires January 14, 1998
  1799.  
  1800.  
  1801. INTERNET-DRAFT      IPP/1.0: Protocol Specification       July 14, 1997
  1802.  
  1803.  
  1804.      Robert Kline - TrueSpectra
  1805.      Dave Kuntz - Hewlett-Packard
  1806.      Takami Kurono - Brother
  1807.      Rich Landau - Digital
  1808.      Greg LeClair - Epson
  1809.      Harry Lewis - IBM
  1810.      Tony Liao - Vivid Image
  1811.      David Manchala - Xerox
  1812.      Carl-Uno Manros - Xerox
  1813.      Jay Martin - Underscore
  1814.      Larry Masinter - Xerox
  1815.      Bob Pentecost - Hewlett-Packard
  1816.      Patrick Powell - SDSU
  1817.      Jeff Rackowitz - Intermec
  1818.      Xavier Riley - Xerox
  1819.      Gary Roberts - Ricoh
  1820.      Stuart Rowley - Kyocera
  1821.      Richard Schneider - Epson
  1822.      Shigern Ueda - Canon
  1823.      Bob Von Andel - Allegro Software
  1824.      William Wagner - Digital Products
  1825.      Jasper Wong - Xionics
  1826.      Don Wright - Lexmark
  1827.      Rick Yardumian - Xerox
  1828.      Lloyd Young - Lexmark
  1829.      Peter Zehler - Xerox
  1830.      Frank Zhao - Panasonic
  1831.      Steve Zilles - Adobe
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859. Herriot, Butler,             July 14, 1997,                   [Page 30]
  1860. Moore and Turner        Expires January 14, 1998
  1861.