The present invention generally relates to information system technology. Particularly, the present invention relates to technology for maintaining a telnet session in a computer network system. More particularly, the present invention relates to a method, and system for suspending and resuming a telnet session.
Telnet is known as a protocol for sending/receiving character information to/from a remote server, thereby to use resources of the remote server. Telnet allows a computer on the client's side to remotely login to a server connected via TCP/IP so as to be used as a virtual terminal of the remote server. Thus, in a TCP/IP based network environment, as long as a server opens a telnet port, any authorized client can use the server through the telnet port.
In a telnet session in an UNIX computer system, however, if a user's local system is crashed or the Internet connection is dropped, the user's telnet session will be terminated immediately and cannot be resumed anymore, and all activities in it will be lost, because a conventional UNIX computer system wants a telnet session to end immediately when the session is failed and does not support a telnet client to resume a telnet session.
With the recent developments, there are two kinds of methods for resuming a telnet session:
The first method is as disclosed in U.S. Pat. No. 5,881,239 in a title of “Network System with Resilient Virtual Fault Tolerant Sessions” filed by Tandem. Moreover, now there is a telnet server named as “Georgia SoftWorks Telnet Server” (http://www.georgiasoftworks.com/docs/UTS/UTS userguide.doc), which has the same features as that described in above granted patent. A telnet server can maintain a failed telnet session for a set period of time before completely closing it down. In this method that may resume a telnet session, an enhanced new telnet server must be used to replace the conventional UNIX telnet server. Actually, it is always impossible to apply this method because of security and compatibility reasons.
The second method is to create a “GNU Screen” (http://www.gnu.org/software/screen/), which will not be terminated when a telnet session terminates, as a user's virtual terminal. A telnet client connects a telnet server executes a shell (e.g. Bourne Again Shell), and runs the “GNU Screen” application. Later each running application will be executed “inside” the “GNU Screen”. When a telnet session terminates, the “GNU Screen” survives and each application “inside” the “GNU Screen” also survives. The “GNU Screen” suspends each application running inside it, and the telnet client can resume the applications later. This method must install a “GNU Screen” daemon in the same machine where telnet server is running, and actually it is always impossible to apply this method because of security and compatibility reasons.
Thus, in order to solve above problems, the present invention provides a method, system and program product with telnet session resumption function for maintaining a telnet session in a computer network system. When a user experiences a local system crash or a dropped Internet connection, the method and system for maintaining a telnet session according to the present invention will suspend the telnet session, keep all activities in it, and enable the telnet client to resume it later. Compared with the method for maintaining telnet session in existing computer systems, the present invention is transparent to conventional UNIX telnet clients and servers, unnecessary to modify the conventional UNIX telnet clients and servers, and not limited to be deployed on the same machine where the telnet server is running, that is, the invention is not limited to be deployed at the same node in a computer network system where the telnet server is running.
According to an aspect of the invention, there is provided a method for maintaining a telnet session in a computer network system comprising at least a telnet client, at least a telnet server, and a telnet agency, the method comprising:
creating sessions with the telnet client and the telnet server respectively by the telnet agency based on a telnet request from the telnet client, and maintaining a telnet session between the telnet client and the telnet server through transmitting data between the sessions; and
suspending the telnet session, keeping all activities of the telnet session in the telnet agency, and resuming the telnet session later according to a request from the telnet client, by the telnet agency, if the telnet client becomes offline during the telnet session.
Preferably, the method according to the present invention further comprises the following steps:
determining by the telnet agency whether the telnet client requests to create a new session or requests to resume a suspended session;
creating a first session with the telnet client and a second session with the telnet server respectively, by the telnet agency, if it is determined that the telnet client requests to create a new session, and beginning to transmit data between the first session and the second session;
finding out the corresponding suspended session and all kept activities thereof, creating a third session with the telnet client, resuming the suspended session, by the telnet agency, if it is determined that the telnet client requests to resume a suspended session, and beginning to transmit data between the third session and the resumed session.
Preferably, the telnet agency determines whether the telnet client requests to create a new session or requests to resume a suspended session according to a resumption identification in a telnet request from the telnet client.
Preferably, the telnet agency creates the session with the telnet server according to the IP address and the port number of the telnet server inputted by the telnet client.
Preferably, the telnet agency automatically maps a local IP address and port to the IP address and port of the telnet server, thereby creating the session with the telnet server.
Preferably, the telnet agency suspending the telnet session comprises periodically sending NOP (no operation) messages to the telnet server.
Preferably, the telnet agency keeping all activities in the telnet session comprises caching negotiated options and session data related to the telnet session.
Preferably, the telnet agency and the telnet server are located at different nodes of the computer network system respectively.
According to another aspect of the present invention, there is provided a telnet agency for maintaining a telnet session in a computer network system, comprising:
a listen module configured to listen to a telnet request from a telnet client and detect whether the telnet client is offline;
a connection module configured to create connection with a destined telnet server and receive/send data from/to it; and
a control module configured to suspend a telnet session and resume a telnet session.
Preferably, the listen module is further used to verify a resumption identification.
Preferably, the control module comprises:
a map module configured to map a local IP address and port to an IP address and port of a destined telnet server;
a cache module configured to cache all activities in a telnet session; and
a relay module configured to transmit data between a telnet client and a telnet server.
Preferably, the cache module is used to cache options and data negotiated for telnet sessions, re-negotiate telnet options with the telnet server and the telnet client, and transmit the latest cached telnet screen to the telnet client while the telnet client is resuming a suspended telnet session.
According to another aspect of the present invention, there is provided a computer network system, comprising at least a telnet client, at least a telnet server, and above-mentioned telnet agency.
The present invention is transparent to conventional UNIX telnet clients and servers, and can be deployed on another machine instead of the same machine where the telnet server is running, so as to avoid security and compatibility problems.
The features of the invention believed to be novel are set forth in the appended claims. The invention itself, however, as well as preferred modes of use, further objectives and advantages thereof, will be best understood with reference to the following detailed description of illustrative embodiments when read in conjunction with the accompanying drawings, wherein:
With reference now to the figures,
In the described example, servers 104 and 106 are connected to the network 107. Besides, clients 101, 102, and 103 are also connected to the network 107. These clients 101, 102, and 103 may be, for instance, personal computers or network computers. For the purpose of this application, a network computer may be any computer connected to the network that may receive a program or other application from another computer connected to the network. In the described example, a telnet service program resides on the server 104 and provides telnet services to the server 106. Thus, in the described example, the server 104 is called as a telnet server. The clients 101, 102, and 103 are used as telnet clients of the telnet server 104. The server 106 is used as a telnet agency of the clients 101, 102, and 103 for creating telnet sessions between the clients 101, 102, and 103 and the telnet server 104 based on the requests from the clients 101, 102 and, 103, and keeping all activities of suspended telnet sessions so as to enable telnet clients to resume the suspended sessions later. Thus, in the described example, the server 106 is called as a telnet agency. The distributed data processing system 100 may further comprise other servers, clients, and other devices not shown, and combine the servers 104 and 106 into one that provides both of telnet services and telnet agency services.
In the described example, the distributed data processing system 100 may be a computer system connected via the Internet, wherein the network 107 represents a worldwide collection of networks and gateways that use the TCP/IP suite of protocols to communicate with each other. At the heart of the Internet is a backbone of high-speed data communication lines between the major nodes or host computers, composed of thousands of commercial, government, education and other computer systems that route data and messages. Of course, the distributed data processing system 100 may also be implemented as a number of different types of networks, such as, for example, an intranet, a local area network (LAN) or a wide area network (WAN).
From above description it can be seen that, in the present invention, due to applying a telnet agency to cache negotiated option data for a suspended telnet session, it is possible to resume the suspended telnet session later. Besides, the present invention is transparent to conventional UNIX telnet clients and servers, and can be deployed on another machine instead of the same machine where the telnet server is running, so as to avoid security and compatibility problems.
Next, in conjunction with
It should be noticed that, in above process, the telnet agency creates a session with the telnet server based on the telnet server's IP address and port inputted by the telnet client. Besides, in order to make the present invention be transparent to conventional UNIX telnet clients and servers, in the case that the telnet agency s includes a map module, it is possible to use the map module to map the local IP address and port number inputted by the telnet client to the IP address and port number of the telnet server, thereby creating a session with the telnet server.
Next, in conjunction with
The invention can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment containing both hardware and software elements. In a preferred embodiments the invention is implemented in software, which includes but is not limited to firmware, resident software, microcode, etc.
Furthermore, the invention can take the form of a computer program product accessible from a computer-usable or computer-readable medium providing program code for use by or in connection with a computer or any instruction execution system. For the purposes of this description, a computer-usable or computer readable medium can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
The medium can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, (or apparatus or device) or a propagation medium. Examples of a computer-readable medium include a semiconductor or solid state memory, magnetic tape, a removable computer diskette, a random access memory (RAM), a read-only memory (ROM), a rigid magnetic disk and an optical disk. Current examples of optical disks include compact disk—read only memory (CD-ROM), compact disk—read/write (CD-R/W) and DVD.
A data processing system suitable for storing and/or executing program code will include at least one processor coupled directly or indirectly to memory elements through a system bus. The memory elements can include local memory employed during actual execution of the program code, bulk storage, and cache memories which provide temporary storage of at least some program code in order to reduce the number of times code must be retrieved from bulk storage during execution.
Input/output or I/O devices (including but not limited to keyboards, displays, pointing devices, etc.) can be coupled to the system either directly or through intervening I/O controllers.
Network adapters may also be coupled to the system to enable the data processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Modems, cable modem and Ethernet cards are just a few of the currently available types of s network adapters.
The description of the present invention has been presented for purposes of illustration and description but is not intended to exhaust or limit the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.
Number | Date | Country | Kind |
---|---|---|---|
200510127413.7 | Dec 2005 | CN | national |