Source: http://www.cnpaf.net/
RemoteLogin is one of the most widely used applications on the Internet. We can log on to (Register) a host first, and then remotely log on to any other network host through the network, you do not need to connect to a hardware terminal for each host (of course, you must have a Logon account ).
In TCP/IP networks, two types of applications provide remote logon.
1) Telnet is a standard application that provides the remote login function. Almost every TCP/IP implementation provides this function. It can run between hosts of different operating systems. Telnet uses the option negotiation mechanism between the client process and the server process to determine the features that can be provided by both parties.
2) Rlogin originated from Berkeley Unix and started to work only between Unix systems. Now it can run on other operating systems. In this chapter, we will introduce Telnet and Rlogin. First, we will introduce Rlogin, because Rlogin is relatively simple. Telnet is the oldest Internet application, originated from ARPANET in 1969. Its name is the abbreviation of "telecommunicationnetworkprotocol. Remote login using the Customer Login J Jian M26-1 shows a typical Telnet client and server connection diagram (for Rlogin customer and server connection diagram, we can draw more simple ).
Client-server mode Telnet Diagram
Note the following points in this figure:
1) The Telnet client process interacts with the end user and the TCP/IP module at the same time. Generally, any information we type is transmitted over TCP connections, and any returned information of the connection is output to the terminal.
2) Telnet server processes often have to deal with a pseudo-terminal device, at least on Unix systems. This allows the shell process to be directly called by the Telnet server process, in addition, any program running in the Process of logging on to the shell feels that it interacts directly with a terminal. For applications such as the full screen editor, it is just like dealing with terminals directly. In fact, how to process the Login Shell Process of the server process makes it seem to be directly interacting with the terminal, which is often one of the most difficult aspects in the preparation of remote login server process programs.
3) Only one TCP connection is used. Because customer processes must communicate with server processes multiple times (and vice versa), some methods are required to describe commands and user data transmitted over connections. In the following content, we will introduce how Telnet and Rlogin solve this problem.
4) Note that in Figure 26-1, we use a dotted box to frame the Terminal Driver process and Pseudo Terminal Driver process. In TCP/IP implementation, the content of the dotted box is generally part of the operating system kernel. Telnet client processes and server processes generally only belong to user applications.
5) The purpose of the login shell process of the server process is to show that when we want to log on to the system, we must have an account, which is the case for Telnet and Rlogin.
For Telnet and Rlogin, if you compare the number of source code of the client process and the server process, you can know the complexity of the two. Figure 26-2 shows the number of Telnet and Rlogin client processes and server process source codes in different versions of Berkeley.
Number of lines of source code
Compare the source code quantity of Telnet/Rlogin/client process/server process
Now, new Telnet options are added to Telnet, which greatly increases the number of source code implemented by Telnet, while Rlogin remains unchanged, which is relatively simple.
Remote Login is not the kind of application with a large amount of data transmission. As we mentioned earlier, most groups for interaction between Client Processes and server processes are relatively small. [Paxson1993] the ratio of the number of bytes sent by the client process (the information you typed on the terminal) to the number of bytes sent by the server process is. This is because the short command we typed on the terminal often produces a lot of output from the server process.