TCP port service Multiplexer (TCPMUX)
A single TCP port that routes client requests to different services by name.
Lottor, M., "TCP port service Multiplexer (TCPMUX)", RFC 1078, DOI 10.17487/RFC1078, November 1988, <https://www.rfc-editor.org/info/rfc1078>.
@misc{rfc1078,
series = {Request for Comments},
number = 1078,
howpublished = {RFC 1078},
publisher = {RFC Editor},
doi = {10.17487/RFC1078},
url = {https://www.rfc-editor.org/info/rfc1078},
author = {M. Lottor},
title = {{TCP port service Multiplexer (TCPMUX)}},
pagetotal = 2,
year = 1988,
month = nov,
} RFC text
Contents
Network Working Group M. Lottor
Request For Comments: 1078 SRI-NIC
November 1988
TCP Port Service Multiplexer (TCPMUX)
Status of this Memo
This RFC proposes an Internet standard which can be used by future
TCP services instead of using 'well-known ports'. Distribution of
this memo is unlimited.
Overview
Ports are used in the TCP to name the ends of logical connections
which carry long term conversations. For the purpose of providing
services to unknown callers, a service contact port is defined. The
contact port is sometimes called the "well-known port". Standard TCP
services are assigned unique well-known port numbers in the range of
0-255. These ports are of limited number and are typically only
assigned to official Internet protocols.
This RFC defines a protocol to contact multiple services on a single
well-known TCP port using a service name instead of a well-known
number. In addition, private protocols can make use of the service
without needing an official TCP port assignment.
The Protocol
A TCP client connects to a foreign host on TCP port 1. It sends the
service name followed by a carriage-return line-feed <CRLF>. The
service name is never case sensitive. The server replies with a
single character indicating positive ("+") or negative ("-")
acknowledgment, immediately followed by an optional message of
explanation, terminated with a <CRLF>. If the reply was positive,
the selected protocol begins; otherwise the connection is closed.
Service Names
The name "HELP" is reserved. If received, the server will output a
multi-line message and then close the connection. The reply to the
name "HELP" must be a list of the service names of the supported
services, one name per line.
The names listed in the "Protocol and Service Names" section of the
current edition of "Assigned Numbers" (RFC-1010 at this time) are
reserved to have exactly the definitions specified there. Services
with distinct assigned ports must be available on those ports and may
optionally be available via this port service multiplexer on port 1.
Private protocols should use a service name that has a high chance of
being unique. A good practice is to prefix the protocol name with
the name of your organization.
Multiple versions of a protocol can suffix the service name with a
protocol version number.
Implementation Notes
A negative reply will typically be returned by the port-multiplexing
process when it can't find the requested service. A positive reply
will typically be returned by the process invoked by the port
multiplexer for the requested service.
AI ELI5
On this page
§1The Port Shortage
Well-known TCP ports are assigned for standard services and are limited in number. TCPMUX proposes a solution: use a single well-known port (port 1) to contact multiple services by name instead of assigning each service a unique port. This allows future services and private protocols to be accessed without requesting official port assignments.
Port numbers are scarce. This idea lets one port handle many services if you tell it the service name.
§2How TCPMUX Works
A client connects to port 1 on a remote host and sends the service name followed by carriage return and line feed. The server replies with a single character: "+" for success or "-" for failure, optionally followed by an explanation message and a line feed. If the reply is positive, the requested protocol begins. If negative, the connection closes.
The client says the service name, the server says yes or no, and if yes, the real conversation starts.
§3Service Names and Conventions
The reserved name "HELP" instructs the server to list all supported services, one per line. Service names are case-insensitive. Standard services defined in RFC 1010 are reserved to their published definitions. Private services should use names prefixed with the organization's name to avoid conflicts. Multiple versions of a protocol can suffix the name with a version number.
Anyone can ask for "HELP" to see what services are available. Unofficial services should use unique names to avoid confusion.
§4Negative and Positive Replies
When TCPMUX cannot find a requested service, it sends a negative reply ("-") from the port-multiplexing process. When the requested service is found and can handle the connection, a positive reply ("+") comes from the service process itself. The character is sent immediately, optionally followed by an explanation message and a line feed.
The server answers quickly with yes or no. If yes, the real conversation starts. If no, the connection closes.