Passa al contenuto principale

II. Definizione del protocollo Telnet

Lo scopo del protocollo Telnet è fornire un metodo standard per collegare dispositivi terminali presenti in un sito a processi presenti in un altro sito.

Il protocollo Telnet è costruito a partire da tre sottostrutture principali: primo, l'Initial Connection Protocol (ICP); secondo, il Network Virtual Terminal (NVT); terzo, i segnali di controllo Telnet qui descritti.

I processi Telnet utente e server seguono l'ICP per stabilire le connessioni. Il termine «Logger» è stato associato all'insieme dei processi del sistema servente che rispondono all'ICP ed eseguono le interazioni iniziali, ad esempio ottenere un nome e una password. L'ICP, insieme al numero di socket iniziale e ai parametri della dimensione del byte, è definito in «Current Network Protocols» (NIC #7104).

I dati trasmessi tra i programmi utente e server (e viceversa) sono trattati come un flusso di caratteri con segnali di controllo incorporati.

Si noti che tutti i valori di codice sono espressi in decimale.

Segnali di controllo 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.

Tipi di dati​

Telnet tratta normalmente caratteri ASCII, ma sono previste possibilità di passare ad altri insiemi di codici. Se si usa uno di questi passaggi, non è definito (qui) se i segnali Telnet abbiano ancora un significato né come tornare all'insieme ASCII. I segnali Telnet usati per indicare un cambio di insieme di codici sono:

CODE          MEANING

160 ASCII - Standard Telnet
161 Transparent
162 EBCDIC

Segnali Telnet dell'utente​

I seguenti segnali devono essere resi disponibili all'utente umano per indurre il Telnet utente a compiere l'azione indicata.

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.

Implementazione Telnet standard​

Sito utilizzatore (Using Site)

  1. L'utente è in grado di immettere e trasmettere tutti i codici ASCII.
  2. L'utente è in grado di far trasmettere i segnali Telnet BREAK, SYNCH, ECHO e NOECHO.
  3. Fornisce i segnali Telnet dell'utente (ad es. Transmit Now).
  4. Implementa la convenzione di fine riga CR LF.
  5. Fornisce l'eco locale per i terminali degli utenti locali.
  6. Elabora correttamente i segnali Telnet BREAK, SYNCH, NOP, ECHO, NOECHO e Hide Your Input ricevuti dal server.

Sito servente (Serving Site)

  1. Fornisce una corrispondenza tra ASCII e l'insieme di caratteri locale.
  2. Elabora correttamente i segnali Telnet BREAK, SYNCH, NOP, NOECHO e ECHO.
  3. Implementa la convenzione di fine riga CR LF.
  4. Presume che il sito utilizzatore fornisca l'eco. Può fornire una modalità di eco del server.

Implementazione Telnet minima​

Sito utilizzatore (Using Site)

  1. L'utente deve essere in grado di immettere e trasmettere tutti i codici ASCII.
  2. Ignorare ed eliminare tutti i segnali Telnet provenienti dal sito servente.
  3. Fornire l'eco locale per i terminali degli utenti locali.
  4. Implementa la convenzione di fine riga CR LF.
  5. Fornire i segnali Telnet dell'utente.

Sito servente (Serving Site)

  1. Fornire una corrispondenza tra ASCII e l'insieme di caratteri locale.
  2. Ignorare ed eliminare tutti i segnali Telnet provenienti dal sito utilizzatore.
  3. Presumere che il sito utilizzatore fornisca l'eco.
  4. Implementa la convenzione di fine riga CR LF.