Telnet

· TELNET is a general protocol, meant to support logging in from almost any type of terminal to almost any type of computer.
· It allows a user at one site to establish a TCP connection to a login server or terminal server at another site.
· A TELNET server generally listens on TCP Port 23.
How it works
· A user is logged in to the local system, and invokes a TELNET program (the TELNET client) by typing
·         telnet xxx.xxx.xxx
where xxx.xxx.xxx is either a host name or an IP address.

· The TELNET client is started on the local machine (if it isn't already running). That client establishes a TCP connection with the TELNET server on the destination system.
· Once the connection has been established, the client program accepts keystrokes from the user and relays them, generally one character at a time, to the TELNET server.
· The server on the destination machine accepts the characters sent to it by the client, and passes them to a terminal server.
 · A "terminal server" is just some facility provided by the operating system for entering keystrokes from a user's keyboard.
o The terminal server treats the remote user as it would any other user logged in to the system, including relaying commands to other applications.
o The terminal server passes outputs back to the TELNET server, which relays
them to the client, which displays them on the user's screen.
· In general, a TELNET server is implemented as a master server with some number of slave servers. The master server listens for service requests from clients. When it hears one, it spawns a slave server to handle that specific request, while the master goes back to listening for more requests.
· The only thing that makes TELNET hard to implement is the heterogeneity of the
terminals and operating systems that must be supported. Not all of them use the same control characters for the same purposes.
· To accomodate this heterogeneity, TELNET defines a Network Virtual Terminal (NVT). Any user TELNETting in to a remote site is deemed to be on an NVT, regardless of the actual terminal type being used.
· It is the responsibility of the client program to translate user keystrokes from the actual terminal type into NVT format, and of the server program to translate NVT characters into the format needed by the destination host. For data sent back from the destination host, the translation is the reverse.
· NVT format defines all characters to be 8 bits (one byte) long. At startup, 7 bit US ASCII is used for data; bytes with the high order bit = 1 are command sequences.
· The 128 7-bit long US ASCII characters are divided into 95 printable characters and 33 control codes. NVT maps the 95 printable characters into their defined values – decimal 65 = "A", decimal 97 = "a", etc.

· The 33 control codes are defined for NVT as:


0 comments