RFC 1312
Message Send Protocol 2
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 theRECIPIENTpart is empty butRECIP-TERMis not, the message is written on the specified terminal. If both theRECIPIENTandRECIP-TERMparts 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 theSENDERpart 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 userSENDERat terminalSENDER-TERMon 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 theSIGNATUREpart 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
- ietf: rfc1312 1992-04
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms