home *** CD-ROM | disk | FTP | other *** search
- User-To-User Message Transfer Protocol (UMTP)
-
- by Jim Frost
-
- May 18, 1988
-
- INTRODUCTION
-
- In order to facilitate a real-time user-to-user communication system
- between networked hosts, the User-To-User Message Transfer Protocol
- (UMTP) was developed. When fully implemented, it supports manual
- routing, remote broadcasts, and remote terminal selection.
-
- PROTOCOL DESCRIPTION
-
- UMTP works on a request-reply basis. Every request must have a reply.
- Requests are always send to a host, replies always come from a host.
-
- MESSAGE REQUEST PACKETS
-
- A message request packet is structured as follows:
-
- u_short taddrlen; /* length of taddr string */
- u_short tttylen; /* length of ttty string */
- u_short msglen; /* length of msg string */
- u_short fwdcount; /* forwarding count */
- u_short mode; /* mode bits */
- char taddr[taddrlen]; /* "to" address string */
- char ttty[tttylen]; /* "to" tty string */
- char msg[msglen]; /* message string */
-
- U_short's are unsigned short integers in network byte order.
-
- Strings are non-null terminated ASCII. Their lengths are determined
- by the length fields that preceed them.
-
- The "taddr" field describes the user name that the packet is being
- sent to on the daemon's host. Optionally a packet can be routed by
- appending "@host" to the user's name (eg "madd@bu-it"). Each daemon
- receiving a routed packet should strip the destination host out of the
- taddr field and send the remainder of the field.
-
- As an example of how the taddr field should be treated at successive
- stops, consider the user request to deliver a message to
- "madd@bu-it@bucsf". The client will strip off the "@bucsf", connect
- to the bucsf daemon, and transmit a packet with the taddr field set to
- "madd@bu-it". Bucsf will in turn strip off the "@bu-it" and transmit
- a packet with the taddr field set to "madd". Bu-it will then attempt
- to deliver the message to user "madd".
-
- The taddr field cannot be longer than 1024 characters.
-
- After making the original connection, all subsequent message packets
- should have the same taddr field. Some hosts may allow different
- taddr fields, but it is not recommended and should be avoided.
-
- The "ttty" field is only used when sending to a particular terminal
- (see the section on the mode field, which follows). It is ignored
- otherwise; tttylen should be zero (indicating no ttty field). The
- ttty field should contain the minimum necessary string to identify the
- destination terminal (eg "tty01" and "console" on BSD UNIX systems).
- The ttty field cannot be longer than 10 characters.
-
- The "msg" field is used to store the message to be sent in its
- entirety. The message should contain the text string that is to
- be written to the destination user's terminal. The string should
- contain a "signature" which indicates (at a minimum) the sender's name
- and machine. A good example msg field is:
-
- "madd@bu-it: this is an example message"
-
- Valid ASCII characters are 7, 9, 10, and 32 through 126. These are
- ^G (bell), ^I (tab), ^J (newline), and space through tilde (~). A
- null string (msglen zero) indicates that the packet is to be sent to
- the destination daemon (including any routing) but not processed at
- that point. This is usually used to request the closing of an open
- connection. The msg field cannot be longer than 1024 characters.
-
- The "mode" field gives information describing what to do with the
- incoming packet.
-
- SM_CLOSE 1 /* close connection after reply */
- SM_TTY 2 /* send to tty */
- SM_BROADCAST 4 /* broadcast */
-
- If SM_CLOSE is specified, the network connection is to be closed
- following the reply packet; if it is not specified, the connection
- must remain open.
-
- If SM_TTY is specified, the message should not be sent to a user, but
- instead to a particular terminal. The ttty field must have the
- terminal description. If a user name is given in the taddr field, it
- should be ignored.
-
- If SM_BROADCAST is specified, a broadcast message is te be attempted
- on the destination host. If a user name is given in the taddr field
- or a terminal name in the ttty field, it should be ignored. If
- SM_BROADCAST is specified in conjunction with SM_TTY, SM_TTY is
- ignored. SM_BROADCAST requests should always return a reply error
- number of RE_OK (message delivered) or RE_NOBROAD (broadcasting
- disabled).
-
- The "fwdcount" field is used when a destination host allows users to
- forward messages automatically (in a way similar to the BSD UNIX
- .forward file). Whenever a message is forwarded automatically (as
- opposed to manual routing), this field should be incremented by one.
- After 5 hops, RE_FWDLOOP should be returned. This insures that
- automatic forwarding cannot cause an infinite loop of message
- forwards. If the message is not being automatically forwarded, this
- field should be passed without change.
-
- REPLY PACKETS
-
- A reply packet is structured as follows:
-
- u_short errno; /* error number */
- u_short msglen; /* length of msg field */
- char msg[msglen]; /* text string describing the error (if any) */
-
- Valid error numbers are:
-
- RE_OK 0 /* message delivered ok */
- RE_SYSERR 1 /* system error */
- RE_NOUSER 2 /* user doesn't exist on this host */
- RE_NOMSGS 3 /* user's terminal may not be written to */
- RE_NOTTHERE 4 /* user is not logged on at the destination */
- RE_NOROUTE 5 /* routing is denied at this host */
- RE_NOBROAD 6 /* broadcasting is denied at this host */
- RE_FWDLOOP 7 /* forwarding loop (too many forwards) */
- RE_INTERR 8 /* something really really bad happened */
-
- RE_OK indicates that all went well. This is the only error that does
- not cause automatic termination of a connection.
-
- RE_SYSERR indicates that some kind of system error occurred which
- caused delivery to fail.
-
- RE_NOUSER indicates that the requested user does not have an account
- on the destination machine.
-
- RE_NOMSGS indicates that the requested user is logged on, but is not
- receiving messages at any of his terminals.
-
- RE_NOTTHERE indicates that the requested user is not logged on.
-
- RE_NOROUTE indicates that routing is disabled at one of the daemons
- along the route.
-
- RE_NOBROAD indicates that system broadcasts are not allowed at the
- destination host.
-
- RE_FWDLOOP indicates that automatic message forwarding went more than
- 5 hops before finding the end of user message forwarding requests.
-
- RE_INTERR indicates that the message packet caused an internal error
- in the daemon.
-
- All errors returned (except RE_OK) must have a description of the
- error in the "msg" field. The "msg" field may not be longer than 1024
- characters.
-
- TIMEOUTS
-
- To prevent the accumulation of dead or idle daemons on any host,
- connections time out after ten minutes. No network traffic indicates
- a timeout -- it should be done independently at each client and
- daemon. This insures a long enough time to deliver a message over
- long distances and through heavy traffic, but keeps idle or dead
- connections to a minimum.
-
- If you want to keep a connection from idling out, send packets with a
- zero msglen at intervals of less than ten minutes, but be sure that no
- other packet is being transmitted at the same time.
-