Presentation is loading. Please wait.

Presentation is loading. Please wait.

Netprog: TELNET1 The TELNET Protocol Mozafar Bag mohammadi.

Similar presentations


Presentation on theme: "Netprog: TELNET1 The TELNET Protocol Mozafar Bag mohammadi."— Presentation transcript:

1 Netprog: TELNET1 The TELNET Protocol Mozafar Bag mohammadi

2 Netprog: TELNET2 Telnet n Telnet date back to late 1960s is generally consider the first network application. –There are several RFCs are listed at the end of the lecture. n 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. n They don’t open a telnet connection, just use the protocol.

3 Netprog: TELNET3 Telnet (2) n While telnet should be a very simple protocol, it’s not. –It has to deal with all communications methods that different terminal and computers use. –It ensures compatibility between the terminal types and computers and still allow the special features used.

4 Netprog: TELNET4 TELNET vs. telnet n 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. telnet is a program that supports the TELNET protocol over TCP.

5 Netprog: TELNET5 The TELNET Protocol n TCP connection n data and control over the same connection. n Network Virtual Terminal n negotiated options

6 Netprog: TELNET6 Network Virtual Terminal n 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 for the operation of the protocol

7 Netprog: TELNET7 Network Virtual Terminal NVT NVT ServerProcess TCP TCP

8 Netprog: TELNET8 Telnet

9 9 NVT ASCII Control Codes n 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

10 Netprog: TELNET10 NVT ASCII Control Codes(2) n 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

11 Netprog: TELNET11 NVT ASCII Control Codes(3) n 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.

12 Netprog: TELNET12 Negotiated Options n All NVTs support a minimal set of capabilities. n Some terminals have more capabilities than the minimal set. n The 2 endpoints negotiate a set of mutually acceptable options (character set, echo mode, etc).

13 Netprog: TELNET13 Negotiated Options n The protocol for requesting optional features is well defined and includes rules for eliminating possible negotiation “loops”. n The set of options is not part of the TELNET protocol, so that new terminal features can be incorporated without changing the TELNET protocol.

14 Netprog: TELNET14 Option examples n Line mode vs. character mode n echo modes n character set (EBCDIC vs. ASCII)

15 Netprog: TELNET15 Control Functions n TELNET includes support for a series of control functions commonly supported by servers. n This provides a uniform mechanism for communication of (the supported) control functions.

16 Netprog: TELNET16 Control Functions n Interrupt Process (IP) –suspend/abort process. n Abort Output (AO) –process can complete, but send no more output to user’s terminal. n Are You There (AYT) –check to see if system is still running.

17 Netprog: TELNET17 More Control Functions n Erase Character (EC) –delete last character sent –typically used to edit keyboard input. n Erase Line (EL) –delete all input in current line.

18 Netprog: TELNET18 Command Structure n All TELNET commands and data flow through the same TCP connection. n Commands start with a special character called the Interpret as Command escape character (IAC). n The IAC code is 255. n If a 255 is sent as data - it must be followed by another 255.

19 Netprog: TELNET19 Looking for Commands n Each receiver must look at each byte that arrives and look for IAC. n If IAC is found and the next byte is IAC - a single byte is presented to the application/terminal (a 255). n If IAC is followed by any other code - the TELNET layer interprets this as a command.

20 Netprog: TELNET20 commands n WILL option (to Enable an option) –Response is either »DO option, indicate agreement and enable option »DONT option, initiator must not use the option. n WONT option (to disable option) –Response must be »DONT option, option is disabled.

21 Netprog: TELNET21 Command Codes n IP243 n AO 244 n AYT245 n EC246 n EL247 n WILL251 n WON’T252 n DO253 n DON’T254 n IAC255

22 Netprog: TELNET22 Telnet Options n When a option needs more parameters –Use SB (subnegotiation) and SE (end subnegotiation )command n Example: negotiate the terminal type –(IAC is interpret as command) n IAC WILL Terminal-type n IAC DO Terminal-type n IAC SB terminal-type SEND IAC SE n IAC SB TERINAL-TYPE IS IAC SE

23 Netprog: TELNET23 Playing with TELNET You can use the telnet program to play with the TELNET protocol. You can use the telnet program to play with the TELNET protocol. telnet is a generic TCP client. 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).

24 Netprog: TELNET24 Some TCP Servers you can play with n Many Unix systems have these servers running (by default): –echo port 7 –discard port 9 –daytime port 13 –chargen port 19

25 Netprog: TELNET25 telnet hostname port > telnet rcs.rpi.edu 7 Trying 128.113.113.33... Connected to cortez.sss.rpi.edu (128.113.113.33). Escape character is '^]'. Hi dave stop it ^] telnet> quit Connection closed.

26 Netprog: TELNET26 telnet vs. TCP n 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. 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.

27 Netprog: TELNET27 RFCs n The first RFC specifically defining Telnet was RFC 97, First Cut at a Proposed Telnet Protocol, published in February 1971. n Telnet Protocol Specification, was published as RFC 854 in May 1983. n Telnet Option Specifications, RFC 855


Download ppt "Netprog: TELNET1 The TELNET Protocol Mozafar Bag mohammadi."

Similar presentations


Ads by Google