RFC 2324

Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0)

๐Ÿ“… published April 1998, from ietf

Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0) โ˜•โœจ

okay bestie ๐Ÿซถ we're doing RFC 2324 and it is literally the most iconic doc ever ๐Ÿ˜ญ quick title-block tea: it's RFC number 2324, written by L. Masinter, dated 1 April 1998, and it's in the Informational category ๐Ÿ’– It came out through the Network Working Group ๐Ÿงš and the header doesn't list anything it obsoletes or updates, so it's not replacing or changing any other RFC ๐ŸŒธ

Status of this Memo โœจ

This memo is giving information for the Internet community ๐ŸŒˆ It does not specify an Internet standard of any kind ๐Ÿ’… And distribution of this memo is unlimited ๐Ÿฆ‹

Copyright (C) The Internet Society (1998). All Rights Reserved.

Abstract ๐ŸŽ€

This doc describes HTCPCP, a protocol for controlling, monitoring, and diagnosing coffee pots โ˜•

1. Rationale and Scope ๐ŸŒธ

okay so there is coffee all over the world โ˜•๐ŸŒ And as computing gets more and more everywhere, the computists want to make coffee too ๐Ÿ’ป Coffee brewing is an art, but ngl the distributed intelligence of the web-connected world transcends art ๐Ÿ˜ญ So there's a strong, dark, rich requirement for a protocol designed espressoly for brewing coffee โœจ Coffee gets brewed using coffee pots, and networked coffee pots need a control protocol if they're going to be controlled ๐Ÿซ–

Home and consumer devices are getting connected to the Internet more and more ๐Ÿ  Early networking experiments hooked up vending devices for status monitoring [COKE] ๐Ÿฅค One of the first remotely _operated_ machines to get hooked up to the Internet was the Internet Toaster, which was controlled via SNMP and debuted in 1990 [RFC2235] ๐Ÿž literally iconic behavior

The demand for ubiquitous appliance connectivity is what's causing the consumption of the IPv4 address space ๐Ÿ“ˆ Consumers want remote control of devices like coffee pots so they can wake up to freshly brewed coffee ๐ŸŒ… or have coffee get prepared at a precise time after dinner prep is done ๐Ÿ

This document specifies the Hyper Text Coffee Pot Control Protocol (HTCPCP), which permits the full requests and responses needed to control all devices that can make the popular caffeinated hot beverages ๐Ÿ’–

HTTP 1.1 ([RFC2068]) permits the transfer of web objects from origin servers to clients ๐ŸŒ The web is world-wide ๐ŸŒ HTCPCP is based on HTTP, and the reason is giving "HTTP is everywhere" energy ๐Ÿ˜Œ It could not be so pervasive without being good, so HTTP is good ๐Ÿ‘‘ If you want good coffee, HTCPCP needs to be good, and to make HTCPCP good, it's good to base it on HTTP โ˜•๐Ÿซถ

Future versions of this protocol may include extensions for espresso machines and similar devices ๐Ÿš€โ˜•

2. HTCPCP Protocol ๐ŸŽ€

okay so HTCPCP is built on top of HTTP, with a few new methods, header fields, and return codes ๐Ÿง All HTCPCP servers should be referred to with the "coffee:" URI scheme (Section 4) ๐Ÿฆ‹

2.1 HTCPCP Added Methods ๐Ÿ’…

2.1.1 The BREW method, and the use of POST

Commands to control a coffee pot get sent from client to coffee server using either the BREW or POST method, with a message body whose Content-Type is set to "application/coffee-pot-command" ๐Ÿ“จ

A coffee pot server MUST accept both the BREW and POST method equivalently ๐Ÿซถ However, using POST to make actions happen is deprecated ๐Ÿ™ˆ

Coffee pots heat water with electronic mechanisms, so there's no fire ๐Ÿ”ฅ๐Ÿšซ That means no firewalls are necessary, and firewall control policy is irrelevant ๐Ÿ˜Œ However, POST may be a trademark for coffee, so the BREW method got added ๐Ÿ’– The BREW method may be used with other HTTP-based protocols, like the Hyper Text Brewery Control Protocol ๐Ÿบโœจ

2.1.2 GET method

In HTTP, the GET method means "retrieve whatever information (in the form of an entity) identified by the Request-URI." If the Request-URI refers to a data-producing process, it's the produced data that shall be returned as the entity in the response, and not the source text of the process, unless that text happens to be the output of the process ๐Ÿง 

In HTCPCP though, the resources associated with a coffee pot are physical, not information resources ๐Ÿซ– The "data" for most coffee URIs contain no caffeine ๐Ÿ’€

2.1.3 PROPFIND method

If a cup of coffee is data, then metadata about the brewed resource gets discovered using the PROPFIND method [WEBDAV] ๐Ÿ”โ˜•

2.1.4 WHEN method

When coffee is poured and milk is offered, the holder of the recipient of milk needs to say "when" at the time when sufficient milk has been introduced into the coffee ๐Ÿฅ› So for this purpose, the "WHEN" method got added to HTCPCP ๐ŸŽ‰ Enough? Say WHEN. ๐Ÿ™Œ

2.2 Coffee Pot Header fields ๐ŸŽ€

okay so HTCPCP recommends several HTTP header fields and defines some new ones โœจ

2.2.1.1 The "safe" response header field.

[SAFE] defines an HTTP response header field, "Safe", that can be used to indicate that repeating an HTTP request is safe ๐Ÿ” Including a "Safe: Yes" header field lets a client repeat a previous request if the result of the request might be repeated ๐Ÿ’–

The actual safety of devices for brewing coffee varies wildly, and it might depend on conditions in the client instead of just the server ๐Ÿคทโ€โ™€๏ธ So this protocol includes an extension to the "Safe" response header:

          Safe                = "Safe" ":" safe-nature
          safe-nature         = "yes" | "no" | conditionally-safe
          conditionally-safe  = "if-" safe-condition
          safe-condition      = "user-awake" | token

This indication lets user agents handle retries of some safe requests, especially safe POST requests, in a more user-friendly way ๐Ÿซถ

2.2.2 New header fields

2.2.2.1 The Accept-Additions header field

In HTTP, the "Accept" request-header field is used to specify media types that are acceptable for the response ๐Ÿ“„ But in HTCPCP, the response might lead to additional actions from the automated pot ๐Ÿค– For this reason, HTCPCP adds a brand new header field, "Accept-Additions" ๐Ÿฅณ

       Accept-Additions = "Accept-Additions" ":"
                          #( addition-range [ accept-params ] )

        addition-type   = ( "*"
                          | milk-type
                          | syrup-type
                          | sweetener-type
                          | spice-type
                          | alcohol-type
                          ) *( ";" parameter )
        milk-type       = ( "Cream" | "Half-and-half" | "Whole-milk"
                          | "Part-Skim" | "Skim" | "Non-Dairy" )
        syrup-type      = ( "Vanilla" | "Almond" | "Raspberry"
                          | "Chocolate" )
        alcohol-type    = ( "Whisky" | "Rum" | "Kahlua" | "Aquavit" )

2.2.3 Omitted Header Fields

No options were given for decaffeinated coffee. What's the point? ๐Ÿ’€โ˜•

2.3 HTCPCP return codes ๐Ÿšจ

Normal HTTP return codes are used to indicate difficulties of the HTCPCP server ๐Ÿ› ๏ธ This section identifies the special interpretations and the new return codes ๐Ÿ‘€

2.3.1 406 Not Acceptable

This return code is normally interpreted as "The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request." ๐Ÿ™…โ€โ™€๏ธ In HTCPCP, this response code MAY be returned if the operator of the coffee pot can't comply with the Accept-Addition request ๐Ÿซ– Unless the request was a HEAD request, the response SHOULD include an entity containing a list of available coffee additions ๐Ÿ“‹

In practice though, most automated coffee pots can't currently provide additions ๐Ÿ˜ญ

2.3.2 418 I'm a teapot

Any attempt to brew coffee with a teapot should result in the error code "418 I'm a teapot" ๐Ÿซ–๐Ÿ™ˆ The resulting entity body MAY be short and stout ๐Ÿซก

3. The "coffee" URI scheme ๐ŸŒ

Coffee is international, so there are international coffee URI schemes ๐ŸŒโ˜• All coffee URL schemes are written with URL encoding of the UTF-8 encoding of the characters that spell the word for "coffee" in any of 29 languages, following the conventions for internationalization in URIs [URLI18N] ๐Ÿ’–

coffee-url  =  coffee-scheme ":" [ "//" host ]
                ["/" pot-designator ] ["?" additions-list ]

coffee-scheme = ( "koffie"                      ; Afrikaans, Dutch
                  | "q%C3%A6hv%C3%A6"          ; Azerbaijani
                  | "%D9%82%D9%87%D9%88%D8%A9" ; Arabic
               | "akeita"                   ; Basque
               | "koffee"                   ; Bengali
               | "kahva"                    ; Bosnian
               | "kafe"                     ; Bulgarian, Czech
               | "caf%C3%E8"                ; Catalan, French, Galician
                  | "%E5%92%96%E5%95%A1"       ; Chinese
                  | "kava"                     ; Croatian
               | "k%C3%A1va                 ; Czech
               | "kaffe"                    ; Danish, Norwegian, Swedish
               | "coffee"                   ; English
               | "kafo"                     ; Esperanto
                  | "kohv"                     ; Estonian
               | "kahvi"                    ; Finnish
               | "%4Baffee"                 ; German
               | "%CE%BA%CE%B1%CF%86%CE%AD" ; Greek
               | "%E0%A4%95%E0%A5%8C%E0%A4%AB%E0%A5%80" ; Hindi
               | "%E3%82%B3%E3%83%BC%E3%83%92%E3%83%BC" ; Japanese
               | "%EC%BB%A4%ED%94%BC"       ; Korean
               | "%D0%BA%D0%BE%D1%84%D0%B5" ; Russian
               | "%E0%B8%81%E0%B8%B2%E0%B9%81%E0%B8%9F" ; Thai
               )

pot-designator = "pot-" integer  ; for machines with multiple pots
additions-list = #( addition )

All alternative coffee-scheme forms are equivalent ๐Ÿซถ However, using coffee-scheme in various languages MAY be interpreted as an indication of the kind of coffee the pot produces โ˜•โœจ Also, while URL scheme names are case-independent, capitalization matters for German, so the initial "K" must be encoded ๐Ÿ‡ฉ๐Ÿ‡ช (bestie that's so specific and I'm obsessed ๐Ÿ˜ญ)

4. The "message/coffeepot" media type ๐Ÿ’œ

The entity body of a POST or BREW request MUST be of Content-Type "message/coffeepot" ๐Ÿ“จ Since most of the info for controlling the coffee pot is carried by the additional headers, the content of "message/coffeepot" only contains a coffee-message-body ๐Ÿซ–

coffee-message-body = "start" | "stop"

๐Ÿง Part 1 of 2 wraps here! Section 5 (Operational constraints, including the timing stuff and the Cambridge Coffee Pot ๐Ÿ“ทโ˜•) is coming up next in part 2 ๐Ÿ’–

5.2. Crossing firewalls ๐Ÿ”ฅ

okay so in most organizations HTTP traffic slides right through firewalls like it's nothing ๐Ÿ’… Modern coffee pots don't use fire ๐Ÿ™„ but a "firewall" is still useful for protecting any source from any kind of heat, not just fire. Every home computer network SHOULD be protected by a firewall from sources of heat ๐Ÿ›ก๏ธ And remote control of coffee pots matters from outside the house too ๐Ÿซ– So it's super important that HTCPCP can cross firewalls easily โœจ

by building HTCPCP on HTTP and using port 80, it gets all of HTTP's firewall-crossing perks ๐Ÿฆ‹ Sure, home firewalls will need reconfiguring or new versions to handle the HTCPCP-specific methods, headers, and trailers, but those upgrades are easy to add. Most home network admins drink coffee too, so they're totally willing to make room for tunneling HTCPCP โ˜•๐Ÿ’œ


6. System management considerations ๐Ÿง

coffee pot monitoring over HTTP was one of the earliest applications of the web, no cap ๐ŸŒ The very first version ran over ATM networks [CAM], which was a super fitting use ๐Ÿ˜ญ

the traditional setup [CAM] was to hook a frame-grabber up to a video camera and feed the images into a web server ๐Ÿ“ท It was a perfect match for ATM networks. The coffee pot lived in the Trojan Room at the Cambridge University labs, and that's where the web interface came from, so people could check on a common coffee pot โ˜•โœจ Some of us were doing related research, and being poor, broke academics, we only had one coffee filter machine between us. It lived in the corridor right outside the Trojan Room ๐Ÿ’€ But we were highly dedicated, hardworking academics, so we went through a LOT of coffee. And when a fresh pot got brewed, it did not last long ๐Ÿ˜ญ๐Ÿซถ

this service was built as the first app to use a brand new RPC mechanism from the Cambridge Computer Laboratory, called MSRPC2 ๐ŸŽ€ It runs over MSNL (Multi-Service Network Layer), which is a network layer protocol designed for ATM networks ๐Ÿงš

coffee pots on the Internet can be managed with the Coffee Pot MIB [CPMIB] ๐Ÿ’–


7. Security Considerations ๐Ÿ”

Anyone who gets in between me and my morning coffee should be insecure. ๐Ÿ˜คโ˜•

Unmoderated access to unprotected coffee pots from Internet users might lead to several kinds of "denial of coffee service" attacks. The improper use of filtration devices might admit trojan grounds. Filtration is not a good virus protection method.

putting coffee grounds into Internet plumbing may clog the plumbing, which would mean calling in an Internet Plumber [PLUMB], who would then need an Internet Plumber's Helper ๐Ÿ› ๏ธ๐Ÿ’€

access authentication will be discussed in a separate memo ๐Ÿ”‘


8. Acknowledgements ๐Ÿซถ

huge thanks to all the many contributors to this standard, including Roy Fielding, Mark Day, Keith Moore, Carl Uno-Manros, Michael Slavitch, and Martin Duerst ๐ŸŒธ The inspiration came from the Prancing Pony, the CMU Coke Machine, the Cambridge Coffee Pot, the Internet Toaster, and other computer-controlled remote devices, and that's how this valuable creation came to be ๐Ÿ‘‘โœจ


9. References ๐Ÿ“š

[RFC2068] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2068, January 1997.

[RFC2186] Wessels, D., and K. Claffy, "Internet Cache Protocol (ICP), version 2," RFC 2186, September 1997

[CPMIB] Slavitch, M., "Definitions of Managed Objects for Drip-Type Heated Beverage Hardware Devices using SMIv2", RFC 2325, 1 April 1998.

[HTSVMP] Q. Stafford-Fraser, "Hyper Text Sandwich Van Monitoring Protocol, Version 3.2". In preparation.

[RFC2295] Holtman, K., and A. Mutz, "Transparent Content Negotiation in HTTP", RFC 2295, March 1998.

[SAFE] K. Holtman. "The Safe Response Header Field", September 1997.

[CAM] "The Trojan Room Coffee Machine", D. Gordon and M. Johnson, University of Cambridge Computer Lab, <http://www.cl.cam.ac.uk/coffee/coffee.html>

[CBIO] "The Trojan Room Coffee Pot, a (non-technical) biography", Q. Stafford-Fraser, University of Cambridge Computer Lab, <http://www.cl.cam.ac.uk/coffee/qsf/coffee.html>.

[RFC2235] Zakon, R., "Hobbes' Internet Timeline", FYI 32, RFC 2230, November 1997. See also <http://www.internode.com.au/images/toaster2.jpg>

[NTP] Mills, D., "Network Time Protocol (Version 3) Specification, Implementation and Analysis", RFC 1305, March 1992.

[URLI18N] Masinter, L., "Using UTF8 for non-ASCII Characters in Extended URIs" Work in Progress.

[PLUMB] B. Metcalfe, "Internet Plumber of the Year: Jim Gettys", Infoworld, February 2, 1998.

[COKE] D. Nichols, "Coke machine history", C. Everhart, "Interesting uses of networking", <http://www-cse.ucsd.edu/users/bsy/coke.history.txt>.


10. Author's Address ๐Ÿ“ฎ

Larry Masinter
Xerox Palo Alto Research Center
3333 Coyote Hill Road
Palo Alto, CA 94304

EMail: masinter@parc.xerox.com

Copyright (C) The Internet Society (1998). All Rights Reserved.

this document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. however, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English ๐ŸŒˆ

the limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns ๐Ÿ’œ

this document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. ๐ŸŽ€

๐Ÿ“ฆ where this page comes from