Top Banner
1 The TELNET Protocol Mozafar Bag Mohammadi
26

1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

Dec 30, 2015

Download

Documents

Leslie Baker
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

1

The TELNET Protocol

Mozafar Bag Mohammadi

Page 2: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

2

Telnet Telnet is generally considered the first

network application. (late 1960s) Uses a client/server model to define a

standard way in which to interact with a remote system.

The telnet protocol is the basis for many protocols FTP, HTTP, SMTP, NTTP just to name a few.

They don’t open a telnet connection, just use the protocol.

Page 3: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

3

TELNET vs. telnet

TELNET is a protocol that provides “a

general, bi-directional, eight-bit byte

oriented communications facility”.

telnet is a program that supports the

TELNET protocol over TCP.

Page 4: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

4

The TELNET Protocol

TCP connection data and control over the same connection. Network Virtual Terminal negotiated options

Page 5: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

5

Network Virtual Terminal

All communications uses a standard terminal called NVT The client takes input, translates into NVT sends

it to the server, which translates to the representation that the computer uses.

Special Telnet commands are interspersed with the data to perform the functions needed to for the operation of the protocol

Page 6: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

6

Network Virtual Terminal

NVTNVT NVTNVT

ServerServerProcessProcess

TCPTCP TCPTCP

Page 7: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

7

Telnet

Page 8: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

8

NVT ASCII Control Codes

Three mandatory codes 0, Null

No operation, no effect on output 10, Line Feed

Moves printer to the next line, keep same print position

13, Carriage Return Moves the printer to the left margin of the current line

Page 9: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

9

NVT ASCII Control Codes(2)

Optional Codes 7, Bell 8, Back Space

Move the print position one character to the left 9, Horizontal tab 11, Vertical Tab

devices negotiate to agree on tab stops 12, Form Feed

next page or clear the screen and put cursor at the top

Page 10: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

10

NVT ASCII Control Codes(3)

End of line marker Since different computers use different standards

for the end of line marker, CR+LF is defined as the end of line marker.

Page 11: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

11

Negotiated Options

All NVTs support a minimal set of capabilities.

Some terminals have more capabilities than the minimal set.

The 2 endpoints negotiate a set of mutually acceptable options (character set, echo mode, etc).

Page 12: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

12

Negotiated Options

The protocol for requesting optional features is well defined and includes rules for eliminating possible negotiation “loops”.

The set of options is not part of the TELNET protocol, so that new terminal features can be incorporated without changing the TELNET protocol.

Page 13: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

13

Option examples

Line mode vs. character mode

echo modes

character set (EBCDIC vs. ASCII)

Page 14: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

14

Control Functions

TELNET includes support for a series of control functions commonly supported by servers.

This provides a uniform mechanism for communication of (the supported) control functions.

Page 15: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

15

Control Functions

Interrupt Process (IP) suspend/abort process.

Abort Output (AO) process can complete, but send no more output

to user’s terminal. Are You There (AYT)

check to see if system is still running.

Page 16: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

16

More Control Functions

Erase Character (EC) delete last character sent typically used to edit keyboard input.

Erase Line (EL) delete all input in current line.

Page 17: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

17

Command Structure

All TELNET commands and data flow through the same TCP connection.

Commands start with a special character called the “Interpret as Command” escape character (IAC).

The IAC code is 255. If a 255 is sent as data - it must be followed

by another 255.

Page 18: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

18

Looking for Commands

Each receiver must look at each byte that arrives and look for IAC.

If IAC is found and the next byte is IAC - a single byte is presented to the application/terminal (a 255).

If IAC is followed by any other code - the TELNET layer interprets this as a command.

Page 19: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

19

commands

WILL option (to Enable an option) Response is either

DO option, indicate agreement and enable option DONT option, initiator must not use the option.

WONT option (to disable option) Response must be

DONT option, option is disabled.

Page 20: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

20

Command Codes

IP 243 AO 244 AYT 245 EC 246 EL 247

WILLWILL 251251 WON’TWON’T 252252 DODO 253253 DON’TDON’T 254254 IACIAC 255255

Page 21: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

21

Telnet Options

When a option needs more parameters Use SB (subnegotiation) and SE (end

subnegotiation )command

Example: negotiate the terminal type (IAC is interpret as command)

IAC WILL Terminal-type IAC DO Terminal-type IAC SB terminal-type SEND IAC SE IAC SB TERINAL-TYPE IS <type> IAC SE

Page 22: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

22

Playing with TELNET

You can use the telnet program to play with the TELNET protocol.

telnet is a generic TCP client. Sends whatever you type to the TCP socket. Prints whatever comes back through the TCP

socket. Useful for testing TCP servers (ASCII based

protocols).

Page 23: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

23

Some TCP Servers you can play with

Many Unix systems have these servers running (by default): echo port 7 discard port 9 daytime port 13 chargen port 19

Page 24: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

24

telnet hostname port> telnet rcs.rpi.edu 7Trying 128.113.113.33...Connected to cortez.sss.rpi.edu (128.113.113.33).

Escape character is '^]'.Hi daveHi davestop itstop it^]telnet> quitConnection closed.

Page 25: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

25

telnet vs. TCP

Not all TCP servers talk TELNET (most don't)

You can use the telnet program to play with these servers, but the fancy commands won't do anything. type ^], then "help" for a list of fancy TELNET stuff you

can do in telnet.

Page 26: 1 The TELNET Protocol Mozafar Bag Mohammadi. 2 Telnet Telnet is generally considered the first network application. (late 1960s) Uses a client/server.

26

RFCs

The first RFC specifically defining Telnet was RFC 97, First Cut at a Proposed Telnet Protocol, published in February 1971.

Telnet Protocol Specification, was published as RFC 854 in May 1983.

Telnet Option Specifications, RFC 855