RFC 1312

Message Send Protocol 2

๐Ÿ“… published April 1992, from ietf

RFC 1312: Message Send Protocol 2 ๐Ÿ’Œ

okay bestie, this is RFC 1312 ๐ŸŽ€ It's called "Message Send Protocol 2" and it was written by R. Nelson from Crynwr Software and G. Arnold from Sun Microsystems, Inc. ๐ŸŒธ It came out of the Network Working Group in April 1992 ๐Ÿ“… It's an Experimental Protocol โœจ and it obsoletes RFC 1159 ๐Ÿ’…

Status of this Memo ๐Ÿ“‹

This memo defines an Experimental Protocol for the Internet community ๐Ÿฆ‹ Discussion and suggestions for improvement are requested, so bring your ideas ๐Ÿ’ก For the standardization state and status of this protocol, check the current edition of the "IAB Official Protocol Standards" ๐Ÿ” Distribution of this memo is unlimited ๐Ÿ’–

Discussion ๐Ÿ’ฌ

The Message Send Protocol is used to send a short message to a given user on a given terminal on a given host ๐Ÿ’Œ Unix's write command gives you a limited version of this through its host-local write command ๐Ÿ–ฅ๏ธ Some hosts call this service "SEND" โœจ

As the Internet grows, more and more people are on hosts that don't run Internet protocols all the time ๐ŸŒ These hosts MAY be able to use a simple protocol that runs on UDP and IP ๐Ÿงš The Message Send Protocol is one of those simple protocols ๐Ÿ‘‘

Note that a message sending protocol is already defined over TCP ๐Ÿ‘€ SMTP has a "SEND" command that will direct mail to a user's terminal. But it's not useful here, because SMTP's SEND isn't implemented by the majority of vendors at this time, and it's hard for unskilled users to use ๐Ÿ’€ So for standardization, we're including a TCP based Message Send Service ๐Ÿซถ

Message Syntax ๐Ÿ“ฆ

The message is made up of several parts, and all of which MUST be present. The first part is a single octet showing the protocol revision: currently decimal 66, which is 'B' ๐Ÿ”ข The remaining parts are null-terminated sequences of eight-bit characters in the ISO 8859/1 alphabet. Some parts MAY be empty. All comparisons of parts (e.g., recipient, cookie, etc.) are case-insensitive. The parts are:

  • RECIPIENT: The name of the user the message is directed to. If this part is empty, the message MAY be delivered to any user of the destination system. ๐ŸŽฏ
  • RECIP-TERM: The name of the terminal the message is to be delivered to. The syntax and semantics of terminal names are outside the scope of this specification. If this part is empty, the "right" terminal is chosen, and this is a system-dependent function. If this part consists of the string *, all terminals on the destination system are implied. If the RECIPIENT part is empty but RECIP-TERM is not, the message is written on the specified terminal. If both the RECIPIENT and RECIP-TERM parts are empty, the message SHOULD be written on the "console", which is defined as some place where the message is most likely to be seen by a human operator or administrator. ๐Ÿ–ฅ๏ธ
  • MESSAGE: The actual message ๐Ÿ’ฌ The server need not preserve the formatting and white-space content of the message if this is necessary to display it. New lines SHOULD be represented using the usual Netascii CR + LF. (Following the Internet tradition, a server SHOULD probably be prepared to accept a message in which some other end-of-line convention is followed, but a conforming client MUST use CR + LF.)

The message text MAY only contain printable characters from the ISO 8859/1 set, which is upward compatible from USASCII, plus CR, LF and TAB. No other control codes or escape sequences MAY be included: the client SHOULD strip them from the message before it is transmitted, and the server MUST check each incoming message for illegal codes. (A server MAY choose to display the message after stripping out such codes, or MAY reject the entire message.) If the MESSAGE part is empty, the message MAY be discarded by the server. ๐Ÿšซ

  • SENDER: The username of the sender. (This and subsequent parts were not present in version 1 of the Message Send Protocol.) This part SHOULD NOT be empty. A server MAY choose to accept, reject or ignore messages in which the SENDER part is empty. ๐Ÿง‘
  • SENDER-TERM: The name of the sending user's terminal. This part MAY be empty. The intention is that a recipient MAY reply to a message by sending the reply to the user SENDER at terminal SENDER-TERM on the originating system. (The sender's hostname SHOULD be retrieved from the transport software.) ๐Ÿ”
  • COOKIE: A magic cookie ๐Ÿช This part MUST be present in all messages, but it's only significant for the UDP service. The combination of the sender's UDP port number and this cookie SHOULD be unique. A client MAY elect to transmit a particular message several times to increase the chances of its reception, and a server MAY use the cookie and port to identify duplicate messages and discard them. A reasonable cookie is the time of day represented in a readable format. The maximum length of a cookie is 32 octets, excluding the terminating null. โฐ
  • SIGNATURE: A token which, if present, MAY be used by the server to verify the identity of the sender. The use of the SIGNATURE part is discussed further in the section on Security, below. ๐Ÿ”

The total length of the message SHALL be less than 512 octets. This includes all eight parts, and any terminating nulls. UDP packets are limited to 512 octets. ๐Ÿ“

If this protocol is changed, the revision number will be changed. ๐Ÿ”ข

Heads up bestie: the total length is capped at 512 octets, and UDP packets are limited to 512 octets too. ๐Ÿšจ

TCP Based Message Send Service ๐Ÿ”Œ

One Message Send Service is defined as a connection based application on TCP. A server listens for TCP connections on TCP port 18. Once a connection is established, the client sends a message over that connection ๐Ÿ“จ

The server replies with a single character indicating positive ("+") or negative ("-") acknowledgment, immediately followed by an OPTIONAL message of explanation, terminated with a null. A positive acknowledgement means the message was successfully delivered to some user/terminal. A negative acknowledgement means the message was NOT delivered to any terminal. โœ…โŒ

The positive acknowledgement message can contain information about what user and terminal the message was delivered to, in the case of incomplete user/terminal fields in the message. The negative acknowledgement can contain information about WHY the message was not delivered (no such user/terminal, system failure, user doesn't accept messages, etc). ๐Ÿ•ต๏ธโ€โ™€๏ธ

Multiple messages can be sent over the same channel. The client SHOULD close first (the server MAY/SHOULD NOT close directly after the acknowledgement is sent), and the server MAY close after some timeout on the order of minutes. If the server is unable to decode a message, or no message is received within a suitable timeout, it MAY close the channel, on the assumption that the sender may have formatted the data incorrectly. ๐Ÿšช

UDP Based Message Send Service ๐Ÿ“ก

Another Message Send Service is defined as a datagram based application on UDP. A server listens for UDP datagrams on UDP port 18. When a datagram is received by the server, an answering datagram MAY be sent back to the client. If the message was addressed to a particular user (i.e., the RECIPIENT part was non-empty) and was successfully delivered to that user, a positive acknowledgement SHOULD be sent (as described above). If the message was directed at any user (i.e., the RECIPIENT part is empty), or if the message could not be delivered for some reason, no reply is sent. ๐Ÿคซ

The reason for this policy is that the UDP service MAY be used to broadcast messages addressed to a particular user on an unknown system, or to all users on all systems. In either case, it is inappropriate for all servers to send replies. An alternative approach might have been to require that a server only send a reply if a message was addressed explicitly to that system and was not broadcast. Unfortunately, the most popular network programming API does not provide an easy way for an application to determine this. Furthermore, such a policy would provide no feedback to the sender of a broadcast message to a particular recipient. The approach adopted here provides a reasonable compromise. ๐Ÿค

Example of Message Encoding โœ๏ธ

Consider a situation in which the user "sandy" is logged into the console of system "alpha", and wishes to send a message to the user "chris". "chris" is known to be logged in on the system "beta", but the exact terminal is unknown. The message consists of two lines of text, "Hi" followed by "How about lunch?" ๐Ÿ’Œ

The message would be encoded as follows:

          +--------+---------+---------+---------+
        0 |    B   |    c    |    h    |    r    |
          +--------+---------+---------+---------+
        4 |    i   |    s    |  <NULL> |  <NULL> |
          +--------+---------+---------+---------+
        8 |    H   |    i    |   <CR>  |   <LF>  |
          +--------+---------+---------+---------+
       12 |    H   |    o    |    w    |         |
          +--------+---------+---------+---------+
       16 |    a   |    b    |    o    |    u    |
          +--------+---------+---------+---------+
       20 |    t   |         |    l    |    u    |
          +--------+---------+---------+---------+
       24 |    n   |    c    |    h    |    ?    |
          +--------+---------+---------+---------+
       28 |  <NULL>|    s    |    a    |    n    |
          +--------+---------+---------+---------+
       32 |    d   |    y    |  <NULL> |    c    |
          +--------+---------+---------+---------+
       36 |    o   |    n    |    s    |    o    |
          +--------+---------+---------+---------+
       40 |    l   |    e    |  <NULL> |    9    |
          +--------+---------+---------+---------+
       44 |    1   |    0    |    8    |    0    |
          +--------+---------+---------+---------+
       48 |    6   |    1    |    2    |    1    |
          +--------+---------+---------+---------+
       52 |    3   |    2    |    5    |  <NULL> |
          +--------+---------+---------+---------+
       56 | <NULL> |
          +--------+

Note that the RECIP-TERM and SIGNATURE parts are empty. The COOKIE is the string "910806121325", which in this implementation indicates that the message was sent at 12:13:25 on the 6th of August, 1991. ๐Ÿ• The identity of the sending and receiving systems is not included in the message, so the server MUST obtain this information from the transport service. ๐Ÿชช

Advisories โš ๏ธ

Okay so, client and server implementations MUST follow the character set restrictions from the MESSAGE part description ๐Ÿซถ. If they don't, the receiver's terminal can get messed up ๐Ÿ˜ญ, and worse, it can open up a seriously big security "hole" ๐Ÿ’€. The checks have to happen on any part of the message that could get displayed, including the sender's name and terminal โœจ. This is literally the one spot where "be liberal in what you accept" is not applicable ๐Ÿ™…โ€โ™€๏ธ. A server MAY choose to run extra checks on incoming messages and reject any message that might pose a security risk ๐Ÿ›ก๏ธ. For example, a system using a PostScript-based display MAY reject a message that could be interpreted as an executable PostScript program ๐Ÿ–จ๏ธโœจ.

The underlying transport, TCP or UDP, is expected to provide checksums for the message and any response ๐Ÿ”.

ngl, the RECIPIENT and RECIP-TERM combos can be kinda confusing ๐Ÿ™ˆ. The * wildcard in the RECIP-TERM part is the iconic bit ๐ŸŒˆ. It lets you send a message to all terminals on the designated system (if RECIPIENT is empty), or to all terminals where a particular recipient has logged in ๐Ÿ’œ.

A positive acknowledgement may indicate only that the Message Send server managed to successfully invoke a local message delivery service ๐Ÿ“ฌ. It may not be possible to infer true end-to-end semantics from it ๐Ÿคทโ€โ™€๏ธ.

For example, a Message Send server may use a local delivery mechanism that calls on a window system to show the message in a pop-up window ๐ŸชŸ. This can take some significant time to finish, and it's unclear whether it's useful for the server to wait an indeterminate period before sending back an acknowledgement โณ. So this specification does not prescribe whether the acknowledgement is tied to delivery of the message to the local service, to the message being displayed, or to the user confirming they've read it (like, e.g., dismissing the pop-up window) ๐ŸŽ€.


Security Considerations ๐Ÿ”

Those who plan to implement this service MUST ensure that the following issues are reflected in the documentation of their products ๐Ÿ“š. Their implementations also need enough configuration controls so systems and network administrators can reach the right levels of usability and security โš™๏ธ.

First, this service may let someone write on a user's terminal without the user giving permission ๐Ÿ˜ฌ. Where possible, users SHOULD be given a way to turn this off ๐Ÿ™…โ€โ™€๏ธ.

Second, it is extremely important for implementors to follow the rules for filtering message text discussed under Message Syntax above ๐Ÿงน. Skipping this may introduce major security holes ๐Ÿ’€.

Third, the verification of the sender's identity matters a lot ๐Ÿ•ต๏ธโ€โ™€๏ธ. If the recipient gets fooled into thinking a message is from a particular user, various security issues may come up ๐Ÿšจ. For example, the recipient may send back a reply containing confidential material ๐Ÿ˜ฑ.

This service is mainly meant for "open" environments ๐ŸŒธ: controlled local area networks used by reasonably trusted participants, where security considerations may be relaxed for the sake of ease of use and administration ๐Ÿซง. In that kind of environment, it's appropriate to trust the user name and source IP address as identifying the actual sender of the message โœจ.

Within more security-conscious environments, this assumption is probably unacceptable ๐Ÿ™…โ€โ™€๏ธ. As has been widely noted, the current Internet architecture has no way to ensure that the source address of an IP datagram is correct ๐Ÿซ . So it is entirely possible for someone to spoof the IP address ๐Ÿ‘ป.

The obvious, and simplest, answer is to disallow this protocol in such situations ๐Ÿšซ. A more constructive approach, though, is to build into the protocol some mechanism by which a server can reliably identify the sender ๐Ÿ’….

โš ๏ธ Spoofing is the reason the sender's identity can't simply be taken on faith. Treat the user name and source IP address as unverified in security-conscious environments.

In this version of the protocol specification, we define a SIGNATURE part within a message ๐ŸŽ€. If this part is empty, the identity of the sender cannot be verified, and the server implementation MAY elect to reject all such requests ๐Ÿ™ˆ. If the part is not empty, it is treated as a case-insensitive text encoding of some security token ๐Ÿ”‘. This RFC does not define the encoding or interpretation of this token ๐Ÿงฉ. We expect such matters to form part of future RFCs on security and privacy issues ๐Ÿ”ฎ, and at an appropriate time, this RFC will be re-issued to include references to those RFCs ๐Ÿ“Ž.


Acknowledgements ๐ŸŽ€

PostScript is a trademark of Adobe Systems, Inc. ๐Ÿ’–

Authors' Addresses ๐Ÿ’Œ

Russell Nelson
Crynwr Software
11 Grant St.
Potsdam, NY 13676

Phone:  (315) 268-1925
EMail:  nelson@crynwr.com
Geoff Arnold
Sun Microsystems, Inc.
2 Federal Street
Billerica, MA 01821

Phone:  (508) 671-0317
EMail:  geoff@east.sun.com
๐Ÿ“ฆ where this page comes from