メインコンテンツまでスキップ

II. Telnet プロトコルの定義

Telnet プロトコルの目的は、あるサイトの端末デバイスを別のサイトのプロセスに接続するための標準的な方法を提供することである。

Telnet プロトコルは三つの主要な下位構造から成る。第一に初期接続プロトコル (Initial Connection Protocol, ICP)、第二にネットワーク仮想端末 (NVT)、第三に本文書で説明する Telnet 制御信号である。

Telnet のユーザ・プロセスとサーバ・プロセスは、接続を確立するために ICP に従う。「Logger」という用語は、サービス提供側システムにおいて ICP に応答し、名前やパスワードの取得といった最初のやり取りを行う一連のプロセスを指して使われてきた。ICP、ならびに初期ソケット番号とバイトサイズのパラメータは、「Current Network Protocols」(NIC #7104) で定義されている。

ユーザ・プログラムとサーバ・プログラムの間 (およびその逆) で伝送されるデータは、制御信号が埋め込まれた文字ストリームとして扱われる。

すべてのコード値は 10 進数で示す点に注意。

Telnet 制御信号​

NAME             CODE    MEANING

DATA MARK        128     Used to mark a point in the data stream.
                         Used in conjunction with INS.  See SYNCH.

BREAK            129     User-to-Server:  Has the same meaning to
                         the server as the "Break," "Interrupt," or
                         "Attention" button found on many terminals.

                         Server-to-User:  Has the same meaning to
                         to use as the "reverse break" used with
                         some terminals.

NOP              130     No Operation.

NO ECHO          131     User-to-Server:  Asks the server not to
                         return Echos of the transmitted data.

                         Server-to-User:  States that the server is
                         not sending echos of the transmitted data.
                         Sent only as a reply to ECHO or NO ECHO,
                         or to end the hide your input.

ECHO             132     User-to-Server:  Asks the server to send
                         Echos of the transmitted data.

                         Server-to User:  States that the server is
                         sending echos of the transmitted data.
                         Sent only as a reply to ECHO or NO ECHO.

Hide your input  133     The intention is that a server will send
                         this signal to a user system which is
                         echoing locally (to the user) when the user
                         is about to type something secret (e.g. a
                         password).  In this case, the user system
                         is to suppress local echoing or overprint
                         the input (or something) until the server
                         sends a NOECHO signal.  In situations where
                         the user system is not echoing locally,
                         this signal must not be sent by the server.

INS              ---     This is the "Interrupt on Send" signal,
                         defined by the Host-to-Host protocol and
                         implemented by the Network Control Program
                         (NCP).  See SYNCH.

SYNCH            ---     This is a condition indicated by the
                         combination of the DATA MARK and the INS.

                         User-to-Server:  The Server is to examine
                         the input data stream looking for a DATA
                         MARK signal; if a DATA MARK is found, the
                         server must not process further until an
                         INS is received.  If the server receives an
                         INS, it is required to examine the data
                         stream at once, taking any appropriate
                         action on "break type" characters (e.g.
                         etx, sub, BREAK), up to a DATA MARK signal
                         and thereupon continue its normal processing.
                         The passed over characters may be discarded.

                         Server-to-User:  If the user finds a DATA
                         MARK in the data stream, it must wait for
                         an INS.  If the user receives an INS, it
                         must examine and discard characters up to
                         and including a DATA MARK.

データ型​

Telnet は通常 ASCII 文字を扱うが、他の符号系へエスケープするための規定がある。これらのエスケープのいずれかが使われた場合、Telnet 信号がなお意味を持つかどうか、あるいは ASCII に戻る方法さえも、(ここでは) 定義されていない。符号系の変更を示すために使われる Telnet 信号は次のとおりである。

CODE          MEANING

160 ASCII - Standard Telnet
161 Transparent
162 EBCDIC

ユーザ Telnet 信号​

次の信号は、ユーザ Telnet に示された動作を行わせるために、人間のユーザが利用できなければならない。

Transmit Now         -  Transmit all data entered and locally
buffered now. Intended to be used with line
mode.

Suppress end-of-line - Transmit all data entered and locally
buffered now, and do not transmit the
end-of-line immediately following this signal.

標準 Telnet 実装​

利用側サイト (Using Site)

  1. ユーザはすべての ASCII コードを入力し送信できる。
  2. ユーザは Telnet 信号 BREAK、SYNCH、ECHO、NOECHO を送信させることができる。
  3. ユーザ Telnet 信号 (例: Transmit Now) を提供する。
  4. CR LF 行末規約を実装する。
  5. ローカルのユーザ端末にローカル・エコーを提供する。
  6. サーバから受信した Telnet 信号 BREAK、SYNCH、NOP、ECHO、NOECHO、Hide Your Input を正しく処理する。

サービス提供側サイト (Serving Site)

  1. ASCII とローカルの文字セットとの対応付けを提供する。
  2. Telnet 信号 BREAK、SYNCH、NOP、NOECHO、ECHO を正しく処理する。
  3. CR LF 行末規約を実装する。
  4. 利用側サイトがエコーを提供するものと想定する。サーバ・エコー・モードを提供してもよい。

最小 Telnet 実装​

利用側サイト (Using Site)

  1. ユーザはすべての ASCII コードを入力し送信できなければならない。
  2. サービス提供側サイトからの Telnet 信号をすべて無視し削除する。
  3. ローカルのユーザ端末にローカル・エコーを提供する。
  4. CR LF 行末規約を実装する。
  5. ユーザ Telnet 信号を提供する。

サービス提供側サイト (Serving Site)

  1. ASCII とローカルの文字セットとの対応付けを提供する。
  2. 利用側サイトからの Telnet 信号をすべて無視し削除する。
  3. 利用側サイトがエコーを提供するものと想定する。
  4. CR LF 行末規約を実装する。