Telnet for TCP/IP protocol

Source: Internet
Author: User
Tags control characters telnet program
1. A common C/S application (telnet is short for terminal Network), which allows users to log on to a remote computer and run the program over there, and then display the result back.

2. network virtual terminal (nvt): unified character sets for different systems.

(1) character sets use two types. One is equivalent to the value 0-of ASCII (that is, the value of a bit starting with 0 ).
One is the remote control character. The first bit is 1. For example, IAC is 0xff, se is 0xf0, AND Sb is 0xfa.

(2) embedded commands. In telnet, command data is mixed in common data. The separate mark is a special character IAC (0xff) before Command commands ), it means "interpreted as a command ".

(3) negotiate options with options

A. Options: allow both parties to provide corresponding options. For example, 0x01 indicates echo, and 0x18 indicates terminal type.

B. negotiation. The following control characters are used for negotiation: Will (0xfb), wont (0xfc), Do (0xfd), and dont (0xfe)

The option negotiation process is as follows:

Will, wont stands for "will provide, ask the other party whether to agree", the other party can only use do or dont to answer (note that wont's answer can only be dont)

Do, dont stands for "to request the other party to provide", and the other party uses will or wont for the answer (the answer to dont can only be wont)

Example:

Data is transmitted at one end as follows: (0xff 0xfd 0x01) IAC do echo. The response is as follows: (0xff 0xfb 0x01) IAC will echo

C. start and end of sub-options: marked as Sb (0xfa) and Se (0xf0)

3. Telnet process: the local input is driven by the terminal to the telnet program. The telnet program is replaced by the nvt character set and then encapsulated and sent to the remote machine. After the remote machine parses the package through the TCP protocol stack, start with the telnet program and run the nvt Character Set translation cost command. Then, the terminal input in disguise is passed to the terminal program for parsing, and the result is sent to the application to be prepared.

That is to say, commands and characters are interpreted by remote machines.

However, sometimes you need to control the local program process by using escape characters, such as interruptions. If you press [^ C], it is sent to a remote device. If you want a local program to be interrupted, use [^].

4. There are three operation modes: default mode, character mode, and line mode;

The default mode is that after a user presses a key, the client performs echo processing. After a row is pressed, the client sends the message, but it needs to wait for the GA controller (Half Duplex status ).

Character Mode: each time you press one key, the characters are transmitted to the server for processing, and the result is displayed again, wasting the network

Line Mode: Unlike the default mode, the GA controller (full duplex mode) is not used. Note that the row Terminator is expressed by cr lf ("/R/N.

Therefore, the current Telnet package usually has the 0x22 option (IAC do 0x22), (0x22 is the option to change to the row Mode)

5. Security issues are not safe.

6. Similar protocols: SSH (Secure Shell), rlogin, etc.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.