3.0 TCP Encoding
This section describes the TCP encoding of the requests and responses. This encoding is not compatible with the historical TACACS protocol. However, it is somewhat more "modern" in that it has been updated to provide for current feature needs.
This protocol does not use a reserved port. Instead, it must be possible to configure the ports used by both the the client and server.
The basic request format is shown here. The request consists of four lines of ASCII text. All numeric values are expressed in ASCII as decimal integers.
<version> <type> <parameters>
<username>
<password>
<line>
Each line in the example corresponds to one line of text. That is,
the lines are separated with
The
The
In theory there are no line length limits. In practice, lines should
not exceed 255 characters (counting the
3.1. Fields
The VERSION field specifies the version number. It must be 1. Other values below 128 are reserved for future use. Values from 128 to 255 are reserved for local use.
The TYPE field encodes the request type. Values are:
AUTH
LOGIN
CONNECT
SUPERUSER
LOGOUT
SLIPON
SLIPOFF
I.e., the keyword simply encodes itself. It must be in upper case. Keywords that begin with the letter "X" are reserved for local use.
The USERNAME field contains the text of the username. Leading and
trailing
The PASSWORD field contains the text of the password. Leading and
trailing
The LINE field is set by the client to the line number that the request is for.
3.2. Responses
Appendix E of STD 10, RFC 821 describes the general theory of reply codes. The this protocol follows the format described in that document. In a nutshell, replies are of the form:
<number> <text>
Where
The three digit codes completely determine the response. The text should be considered an explanatory comment for human understanding. However, even without knowing all values, the first digit can be used to determine the overall nature of the response. The encodings are:
1 Positive Preliminary: the request is acceptable,
but no action will be taken until an additional
request is made (not used in this version of the
protocol)
2 Positive Completion
3 Positive Intermediate: the request is acceptable
so far, but has not been completely transferred
(not used in this version of the protocol)
4 Transient Negative: the request is not acceptable
for now. It is acceptable to retry, as another
instance may have a different result.
5 Permanent Negative: the request is not acceptable
The text portion is optional (i.e., may be the empty string) and it describes the meaning of the message in human readable form.
While different server implementations will result in different messages, the following are suggested:
201 accepted: # # #
202 accepted, password is expiring: # # #
401 no response; retry
501 invalid format
502 access denied
The ": # # #" in the first two messages is the suggested way of returning the three result codes for LOGIN and CONNECT requests.
3.3. What a Client Does
The client opens a TCP connection to the locally-configured address and port. It sends the request by sending:
- the character "1"
- one or more <SPACE> or <TAB> characters
- the request type as an ASCII string
- if an AUTH, send one or more <SPACE> or <TAB> characters
and the authentication style
- if a CONNECT, SLIPON, or SLIPOFF, send one or more <SPACE>
or <TAB> characters and the IP address in dotted decimal
notation
- if a CONNECT, send one or more <SPACE> or <TAB> characters
and the port number in decimal
- a <CR>/<LF>
- the username (or hostname for SLIPADDR)
- a <CR>/<LF>
- the password
- a <CR>/<LF>
- the line
- a <CR>/<LF>
Then read one line from the connection and close the connection. This encoding lets TCP take care of waiting, retries, and matching up requests and responses.
Examine the response line and take whatever action you deem correct.
3.4. What the Server Does
The server waits on the locally-specified port for requests. When one is made, it reads four lines of input.
It examines the first line for a valid version number and request. It also records any optional parameters.
It uses the username, password, and line number along with any other information it deems fit to determine its response.
It then sends exactly one line of response, terminated by a