Application Layer · Computer Networks

SVGVector Architecture Diagram (SVG)
COMPUTER NETWORKS · Module 5 · Application Layer★ High PriorityIT Sem 6 · Code 100602TELNETMNEMONICTELNET = TErminal NETwork: remote login on TCP port 23, as if sitting at the remote host.Everything is PLAIN TEXT, so SSH (port 22) replaced it.Core BreakdownOverviewTELNET (RFC 854, 1969): early ARPANET protocol for remote login to a distant host.Client-server over TCP port 23; the server daemon (telnetd) spawns a pseudo-terminal.Why NVT?Different terminals use different character sets and newline rules (IBM 3270, DEC VT100).NVT (Network Virtual Terminal) is one common model: only 2 translations, not one per pair.NVT RulesData = 7-bit ASCII sent in 8-bit bytes (high bit = 0); end of line = CR LF.Control functions: IP (interrupt process), AO (abort output), AYT (are you there?).IACData and commands share one TCP stream, so byte 255 (0xFF) = IAC (Interpret As Command).Bytes after IAC are a command, not user data; a literal 255 is sent as IAC IAC.NegotiationClient and server negotiate options (terminal type, echo, window size) with four verbs:WILL (I offer), WONT (I refuse), DO (please enable), DONT (please disable).ModesDefault mode: the client echoes locally and sends a whole line when it is complete.Character mode: every key is sent at once, server echoes. Line mode: line editing at the client.SecurityNo encryption or integrity check: usernames and passwords travel in clear text and can be sniffed.Open to man-in-the-middle attacks, so it is avoided on modern networks.ReplacementSSH (Secure Shell, RFC 4251) on TCP port 22 encrypts the whole session.Uses public-key authentication (RSA / Ed25519) and symmetric ciphers (AES).Diagram: TELNET and NVTUser /TerminalTELNET Client(local → NVT)TELNET Server(NVT → remote)Remote OS / ShellTCP 23NVTClient: local terminal → NVT formatServer: NVT → remote host formatResult: any terminal ↔ any hostOption negotiation verbsWILLI will do itWONTI will NOT do itDOYou please do itDONTPlease stopIAC = 255 (0xFF) marks the next byte(s) as a commandPort 23 / TCP · 7-bit ASCII · line end = CR LFPlain text, so insecure → use SSH (port 22)⚠️ Exam Traps & Viva Favorites① What is NVT?A common virtual terminal: 7-bit ASCII,CR LF line end, standard control codes.Client and server translate to / from it.② What does IAC (255) do?IAC = Interpret As Command, byte 0xFF.The bytes after it are a command, notuser data. A real 255 is sent as IAC IAC.③ Why is TELNET unsafe?Passwords and keystrokes travel in cleartext (no encryption). Use SSH on port 22,which encrypts and authenticates.Tip: TELNET 23 (plain) · SSH 22 (safe)Master Revision Table(learn it row by row!)ItemPortTransportKey PointPitfallTELNET23TCPRemote login using NVTPlain text: easy to sniffNVTn/an/aCommon 7-bit ASCII terminal modelNeeded for interoperabilityIAC255in-band byteMarks a TELNET command byteA literal 255 must be doubledWILL / WONTn/aoption verbsSender offers / refuses a featureNot a request to the peerDO / DONTn/aoption verbsSender asks peer to enable / disablePairs with WILL / WONTSSH22TCPEncrypted remote loginNot compatible with TELNETQUICK FACTSTELNET: TCP 23 · RFC 854 (1969) · client-server · server = telnetd (pseudo-terminal)Verbs: WILL · WONT · DO · DONT · Command prefix: IAC = 255 (0xFF)Control functions: IP (interrupt) · AO (abort output) · AYT (are you there?)VERIFIED★ Golden rule: TELNET = remote login on TCP 23 via NVT, but plain text, so use SSH.

TELNET (Teletype Network) Protocol


1. Overview and Historical Role

TELNET (RFC 854) was developed in 1969 as one of the earliest Application Layer protocols on the ARPANET. It provides a bidirectional, interactive text-oriented communication facility, allowing a user at a local terminal to log into and execute commands on a remote host computer as if sitting directly in front of it (Remote Login).

  • Underlying Transport: Runs over TCP Port 23 (reliable, connection-oriented).
  • Client-Server Architecture:
    • TELNET Client: Runs on the user's local workstation, capturing keyboard strokes and displaying received text output.
    • TELNET Server: Runs as a background daemon (e.g., telnetd) on the remote host, spawning pseudo-terminals (PTYs) and executing shell commands.
MermaidDiagram
Rendering diagram…

2. The Network Virtual Terminal (NVT) Concept

In heterogeneous networks, different manufacturers manufactured proprietary hardware terminals with incompatible character encodings, newline behaviors ( vs ), and control key combinations (e.g., IBM 3270 vs DEC VT100).

To bridge this incompatibility without writing a translator for every pair of machines (O(n2)O(n^2) complexity), TELNET invented the Network Virtual Terminal (NVT):

MermaidDiagram
Rendering diagram…
  • NVT Character Set: Standard 7-bit ASCII embedded in 8-bit bytes (highest bit = 0).
  • Control Characters: Specific byte sequences define universal actions:
    • CR LF (Carriage Return + Line Feed): Universal end of line.
    • IP (Interrupt Process): Suspends the currently executing program (equivalent to Ctrl+C).
    • AO (Abort Output): Flushes output display while allowing the program to run.
    • AYT (Are You There?): Requests remote confirmation that the system is responsive.

3. Options Negotiation & TELNET Commands

TELNET allows clients and servers to dynamically negotiate terminal capabilities (such as terminal type, line width, character echo) using a symmetrical four-verb negotiation mechanism:

SVGVector Architecture Diagram (SVG)
Verb Meaning WILL Sender offers to enable a feature itself. WONT Sender refuses to enable (or disables) a feature. DO Sender requests that the receiver enable a feature. DONT Sender demands that the receiver disable a feature.
  • Interpret As Command (IAC): Because data and control commands share the same TCP stream, the special byte 255 (0xFF) is reserved as the IAC prefix. When the receiver sees 0xFF, it interprets the subsequent bytes as an internal command rather than text.

4. The Critical Vulnerability: Plaintext Transmission

TELNET was created in an era when the Internet was an academic, trusted network. It lacks any form of cryptographic encryption or integrity validation:

  • Every keystroke, including usernames, root passwords, and database queries, is sent in clear, unencrypted plaintext over TCP!
  • An attacker running a simple packet sniffer (like Wireshark or tcpdump) on any intermediate router or Wi-Fi hotspot can trivially read the administrative password in cleartext.

The Modern Replacement: Secure Shell (SSH)

Because of this fatal flaw, TELNET is strictly banned in modern network infrastructure and has been completely replaced by SSH (Secure Shell - RFC 4251):

  • Runs on TCP Port 22.
  • Uses public-key cryptography (RSA, Ed25519) and symmetric ciphers (AES-256) to encrypt all traffic end-to-end, guaranteeing confidentiality, authentication, and message integrity.

Frequently Asked Questions

QWhat is the Network Virtual Terminal (NVT) in TELNET?

An abstract, universal terminal model with standardized ASCII character sets and control commands. The client translates its local terminal format into NVT, and the server translates NVT into the remote operating system's native format, enabling interoperability across heterogeneous computers.

QWhat transport protocol and port does TELNET use?

TCP Port 23.

QExplain why TELNET is considered insecure and identify its replacement.

TELNET transmits all data, including credentials and administrative passwords, in unencrypted plaintext, leaving it vulnerable to packet sniffing and man-in-the-middle attacks. It has been superseded by SSH (Secure Shell) on TCP Port 22.

QWhat is the meaning of the IAC byte in TELNET?

IAC stands for Interpret As Command (value 255255 / 0xFF), indicating that the following bytes represent protocol commands rather than user data.

QWhat are the four TELNET option negotiation verbs?

WILL (sender offers to enable a feature), WONT (sender refuses or disables it), DO (sender requests the receiver to enable it) and DONT (sender demands the receiver disable it).

Student FinanceWeb Platform

Pocketly — Personal Finance for Students

Keep your hostel and college expenses under control. Track accounts, log spending in seconds, and stay within your monthly budget.

← All Computer Networks modules