TRANSMITTING DATA RELIABLY AND EFFICIENTLY

Abstract: A method and mechanism is described for reliably transmitting messages over an unreliable transport mechanism. A sender transmits a first message over an unreliable mechanism to a receiver, and a second message that identifies the first is transported over a reliable transport mechanism to the receiver. When the receiver receives the second message, the receiver determines whether it has received the first message. If not, the receiver requests retransmission of the first message.

Description: TRANSMITTING DATA RELIABLY AND EFFICIENTLY FIELD OF THE INVENTION The present invention relates to transmitting data, and in particular, transmitting data efficiently in a manner that guarantees delivery. BACKGROUND OF THE INVENTION One critical function performed by a computer system is transmitting data between processes that may reside on the same or different computer systems. To transmit data between processes, the processes use a transport mechanism. A transport mechanism is a combination software and hardware that is used to transport data between processes. A transport mechanism may include a combination of, for example, a network, a network card, and interface software that allows a process to transmit data over the network. Often, transport mechanisms are accessed through the use of utilities provided by an operating system, such as sockets available in UNIX. To transmit data, a process invokes an operating system utility, which in turn communicates with the hardware of the computer system to transmit data over a network to another computer. Transport mechanisms follow a protocol when transmitting data. A protocol is a set of rules, procedures, and conventions that govern the process of transmitting data. Examples of conventional protocols are the Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). Protocols involve a tradeoff between two competing transport mechanism characteristics -- reliability and speed. Reliability refers to a transport mechanism's ability to guarantee delivery of data transmitted by a sender to a receiver. A sender is a process that invokes a transport mechanism to transmit data to another process referred to as the receiver. A reliable transport mechanism guarantees delivery of data transmitted by a sender to a receiver. Transport mechanisms that use TCP are examples of reliable transport mechanisms. An unreliable transport mechanism does not guarantee delivery of data. Transport mechanisms that use UDP are examples of unreliable transport mechanisms. In general, reliable transport mechanisms are not as fast as unreliable transport mechanisms. Reliable transport mechanisms invoke procedures, such as handshaking algorithms, that ensure that data transmitted is delivered. These procedures, while ensuring delivery, cause greater overhead and latency. For example, a reliable transport mechanism is used to transmit data over a network from a sending node to a receiving node. Data transmitted over the network to the receiving node is stored in buffers. When the receiving node receives the data, it transmits an acknowledgement to the sending node. When the sending node receives the acknowledgement, it releases the buffers, enabling them to be used for other purposes. If the sending node does not receive an acknowledgement from the receiving node after a period of time, then the sending node retransmits the data to the receiving node. Based on the foregoing, it is clearly desirable to provide a method and mechanism for reliably transporting data without incurring the overhead incurred by conventional reliable transport mechanisms. SUMMARY OF THE INVENTION A method and mechanism is described for reliably transmitting messages over an unreliable transport mechanism. According to an aspect of the present invention, a sender transmits a first message over an unreliable mechanism to a receiver, and a second message that identifies the first is transported over a reliable transport mechanism to the receiver. When the receiver receives the second message, the receiver determines whether it has received the first message. If not, the receiver requests retransmission of the first message. BRIEF DESCRIPTION OF THE DRAWINGS The present invention is illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which like reference numerals refer to similar elements and in which: FIG. 1 is a block diagram of an exemplary message transmission system upon which an embodiment of the present invention may implemented; FIG. 2 is a flow chart depicting a process for reliably transmitting data over an unreliable transport mechanism; and FIG. 3 is a exemplary computer system upon which an embodiment of the present invention may be implemented. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT A method and apparatus for transmitting data is described. In the following description, for the purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced without these specific details. In other instances, well-known structures and devices are shown in block diagram form in order to avoid unnecessarily obscuring the present invention. EXEMPLARY MESSAGE TRANSMISSION SYSTEM FIG. 1 shows an exemplary message transmission system 100 according to an embodiment of the present invention. Receiver 190 and sender 180 are processes that reside on nodes 102 and 104, respectively. Sender 180 transmits messages to receiver 190 over unreliable transport mechanism 150 and reliable transport mechanism 160. A message is an identifiable set of data transmitted from a process to another process. Specifically, sender 180 transmits application messages, such application messages 120, to receiver 190 over unreliable transport mechanism 150, and transmits verification messages, such as verification messages 124, over reliable transport mechanism 160. A verification message is a message transported over a transport mechanism that identifies to the receiver of the message another message that should be received by the receiver over another transport mechanism. An application message is a message identified by a verification message. For example, receiver 190 and sender 180 may be a processes under the control of a database system. Sender 180 sends to receiver 190 data blocks over unreliable transport mechanism 150 in the form of application messages 120. To indicate to receiver 190 that the application messages 120 have been sent, sender 180 transmits verification messages 124 to identifying application messages 120. Verification messages 124-1, 124-2, and 124-3 identify application messages 120-1, 120-2, 120-3, respectively. Typically, the quantity of data required to identify an application message is much smaller than the quantity of data in the application message. Consequently, the verification message is smaller than the application message it identifies. In addition, a verification message may identify more than one application message. The amount of time needed to transmit a message from a sender to a receiver is referred to herein as latency. Even though an application message is greater in size, under normal operating conditions, the latency for transmitting an application message over an unreliable transport mechanism is less than the latency for transmitting a verification message because of the overhead associated with the reliable transport mechanism. Unreliable transport mechanism 150 and reliable transport mechanism 160 may transmit data over the same or different network links. For example, while unreliable transport mechanism 150 and reliable transport mechanism 160 may transmit data over the same LAN, they may transmit data using different protocols. In addition, the network links used may be packet based. Thus, when unreliable transport mechanism 150 and reliable transport mechanism 160 transmit an application message or verification message, the message may be transmitted as one or more smaller messages in the form of packets. A received message list, such as received message list 110, contains application messages received by receiver 190 that are part of a set of messages to be received as a unit. When a member of the set is received, it is added to the list. The application message is then processed by the receiver for the purpose the message was transmitted. As shall be explained in greater detail, receiver 190 uses the received message list 110 to track which members of a set of application messages have been received. Received message list 110 includes application messages 120-1, 120-2, and 120-3. USE OF BUFFERS BY THE TRANSPORT MECHANISMS R Buffers 187 are used by reliable transport mechanism 160 to store copies of verification messages that it transmits from node 104 to node 102 over the network link used by reliable transport mechanism 160. Reliable transport mechanism 160 stores a copy of a verification message it transmits over the network link until reliable transport mechanism 160 determines whether or not the verification message has been successfully received by node 102. If reliable transport mechanism 160 determines that the verification message was not successfully received, reliable transport mechanism 160 gets the message from the R Buffer 187 containing a copy of the verification message, and retransmits it over the network link. If reliable transport mechanism 160 determines that the verification message was successfully received, then the R Buffer 187 that contained a copy of the transmitted verification message is released to be used for other purposes. On the other hand, unreliable transport mechanism 150 does not store a copy of an application message after transmitting it to the network link used by unreliable transport mechanism 150. TRANSMITTING MESSAGES FIG. 2 is flow chart that shows a process for reliably transmitting messages over an unreliable transport mechanism. The steps are illustrated using exemplary message transmission system 100. At step 210, sender 180 transmits application message 120-1 via unreliable transport mechanism 150 to receiver 190. At step 216, sender 180 transmits a verification message identifying application message 120-1. Specifically, sender 180 transmits verification message 124-1 via reliable transport mechanism 160 to receiver 190. Typically an application message will arrive before the corresponding verification message even though the verification message is smaller, because the application message is transported over the much faster unreliable transport mechanism 150. When application message 120 is received by receiver 190 via unreliable transport mechanism 150, it is added to the received message list 110. At step 250, receiver 190 receives the verification message 124-1. At step 254, it is determined whether the application message identified by verification message 124-1 (i.e. application message 120-1) is in received message list 110. Because the application message 120-1 is in the received message list 110, control flows to step 262, where application message 120-1 is deleted from the received message list 110. If, on the other hand, receiver 190 had not received application message 120-1 and inserted it into received message list 110, then at step 250, it would be determined that application message 120-1 is not in received message list 110. In this case, control flows to step 258. At step 258, receiver 190 transmits a request to sender 180 to retransmit the application message identified by the verification message 124-1. At step 220, the request for retransmission of the application message is received by sender 180. Control flows to step 210, where the application message is retransmitted, and then to step 216, where another verification message for the application message is retransmitted. The process illustrated by FIG. 2 has various advantages. First, transmission of an application message is guaranteed even though the application message is transmitted over an unreliable transport mechanism. Specifically, a verification message is reliably transmitted to the receiver, guaranteeing that the receiver will, at a minimum, be informed that an application message has been transmitted. If the receiver determines that is has not received the application message, then the receiver requests retransmission of the application message. Receiving verification messages and requesting retransmission when the receiver determines it has not received the application message is a process that is repeated until the receiver determines that it has received the application message. Furthermore, the transmission of the application message is guaranteed while avoiding the cost of transmitting the application message over a reliable transport. While a verification message corresponding to the application message is generated and transmitted over a reliable transport mechanism, the verification message is smaller then its respective application message. Consequently, less data is transmitted over a reliable transport mechanism. Handshaking, use of buffers to store copies of messages until their delivery is verified, and other forms of overhead incurred to reliably transport data, is reduced. TOLERANCE OF APPLICATION MESSAGES LOST DURING TRANSMISSION Unreliable transport mechanism 150 does not store a copy of an application message after transmitting it to the network link used by unreliable transport mechanism 150. Consequently, an application must be able to tolerate the loss of an application message during transmission, as long as the application is informed of the loss. For example, an application may tolerate the loss of an application message that is repeatable. The term repeatable refers to data that may be recreated without causing undesirable side affects. To illustrate a repeatable message, the following example is provided. A message transmission system may be used to transport messages in a banking system. The application messages include messages that confirm withdrawals, and messages that specify a list of transactions recorded for a period time. A message that confirms withdrawals can only be regenerated by causing another withdrawal -- an undesirable side affect. Therefore, messages that confirm withdrawals are not repeatable. On the other hand, the generation of messages that list transactions recorded for a given period of time cause no side affects, and are therefore repeatable. The present invention is not limited to use of repeatable application messages. The techniques disclosed herein for transmitting data may be used to transmit any application message whose loss during transmission may be tolerated by an application that is informed of the loss. Therefore, it is understood that the present invention is not limited to application messages that are repeatable. A verification message may contain information used by an application to reprocess application messages ("reprocessing information"). The term reprocess refers to operations performed by an application to retransmit a message, and includes operations for regenerating an application message, preparing an application message for retransmission to the sender, and re-transmitting the message to the sender. When a receiver requests retransmission of an application message, the receiver transmits the reprocessing information to the receiver. In the example about application messages that specifies transactions recorded for a period of time, reprocessing information may include data that specifies a period of time, an account, and the sender. VERIFICATION MESSAGES THAT ARRIVE EARLY In some operational contexts, a verification message may be transported over a reliable transport mechanism that is relatively fast compared to the unreliable transport mechanism. The difference in latency between the reliable and unreliable transport mechanism may be relatively small. For example, an unreliable transport mechanism 150 may use a general purpose LAN. Reliable transport mechanism 160, on the other hand, may use a special purpose network link that is able to transmit data reliably at greater speeds. Under such circumstances, it may not be unusual for a verification message to arrive before the corresponding application message, even though no problems occurred in the transportation of the application message over unreliable transport mechanism 150. When a verification message arrives before the application message arrives and is inserted into the received message list 110, receiver 190 may request retransmission of the application message, even though no problem occurred during its transmission. The generation of requests for and retransmission of application messages may occur at an undesirably high frequency. To reduce the frequency of retransmitting application messages, a timeout mechanism may be used. Specifically, after receiver 190 determines that an application message identified by a verification message is not in received message list 1 10, receiver 190 waits for a period of time. After the period of time expires, receiver 190 then determines whether the received message list 110 now includes the application message, and proceeds as previously described. Alternatively, after transmitting an application message, sender 180 defers transmitting the corresponding verification message. The deferral ensures that the application message arrives before the verification message. The present invention is not limited to use of transport mechanisms that transmit data over networks or any particular medium for transport of data. For example, the sender and receiver may be processes executing on the same computer. The techniques described herein may be used to reliably transmit data between processes over a bus. Alternatively, the techniques may be used to transmit data between processes that are transferring data over a modem. HARDWARE OVERVIEW Figure 3 is a block diagram that illustrates a computer system 300 upon which an embodiment of the invention may be implemented. Computer system 300 includes a bus 302 or other communication mechanism for communicating information, and a processor 304 coupled with bus 302 for processing information. Computer system 300 also includes a main memory 306, such as a random access memory (RAM) or other dynamic storage device, coupled to bus 302 for storing information and instructions to be executed by processor 304. Main memory 306 also may be used for storing temporary variables or other intermediate information during execution of instructions to be executed by processor 304. Computer system 300 further includes a read only memory (ROM) 308 or other static storage device coupled to bus 302 for storing static information and instructions for processor 304. A storage device 310, such as a magnetic disk or optical disk, is provided and coupled to bus 302 for storing information and instructions. Computer system 300 may be coupled via bus 302 to a display 312, such as a cathode ray tube (CRT), for displaying information to a computer user. An input device 314, including alphanumeric and other keys, is coupled to bus 302 for communicating information and command selections to processor 304. Another type of user input device is cursor control 316, such as a mouse, a trackball, or cursor direction keys for communicating direction information and command selections to processor 304 and for controlling cursor movement on display 312. This input device typically has two degrees of freedom in two axes, a first axis (e.g., x) and a second axis (e.g., y), that allows the device to specify positions in a plane. The invention is related to the use of computer system 300 for implementing the techniques described herein. According to one embodiment of the invention, those techniques are implemented by computer system 300 in response to processor 304 executing one or more sequences of one or more instructions contained in main memory 306. Such instructions may be read into main memory 306 from another computer-readable medium, such as storage device 310. Execution of the sequences of instructions contained in main memory 306 causes processor 304 to perform the process steps described herein. In alternative embodiments, hard- wired circuitry may be used in place of or in combination with software instructions to implement the invention. Thus, embodiments of the invention are not limited to any specific combination of hardware circuitry and software. The term "computer-readable medium" as used herein refers to any medium that participates in providing instructions to processor 304 for execution. Such a medium may take many forms, including but not limited to, non- volatile media, volatile media, and transmission media. Non-volatile media includes, for example, optical or magnetic disks, such as storage device 310. Volatile media includes dynamic memory, such as main memory 306. Transmission media includes coaxial cables, copper wire and fiber optics, including the wires that comprise bus 302. Transmission media can also take the form of acoustic or light waves, such as those generated during radio-wave and infra-red data communications. Common forms of computer-readable media include, for example, a floppy disk, a flexible disk, hard disk, magnetic tape, or any other magnetic medium, a CD-ROM, any other optical medium, punchcards, papertape, any other physical medium with patterns of holes, a RAM, a PROM, and EPROM, a FLASH-EPROM, any other memory chip or cartridge, a carrier wave as described hereinafter, or any other medium from which a computer can read. Various forms of computer readable media may be involved in carrying one or more sequences of one or more instructions to processor 304 for execution. For example, the instructions may initially be carried on a magnetic disk of a remote computer. The remote computer can load the instructions into its dynamic memory and send the instructions over a telephone line using a modem. A modem local to computer system 300 can receive the data on the telephone line and use an infra-red transmitter to convert the data to an infra-red signal. An infra-red detector can receive the data carried in the infra-red signal and appropriate circuitry can place the data on bus 302. Bus 302 carries the data to main memory 306, from which processor 304 retrieves and executes the instructions. The instructions received by main memory 306 may optionally be stored on storage device 310 either before or after execution by processor 304. Computer system 300 also includes a communication interface 318 coupled to bus 302. Communication interface 318 provides a two-way data communication coupling to a network link 320 that is connected to a local network 322. For example, communication interface 318 may be an integrated services digital network (ISDN) card or a modem to provide a data communication connection to a corresponding type of telephone line. As another example, communication interface 318 may be a local area network (LAN) card to provide a data communication connection to a compatible LAN. Wireless links may also be implemented. In any such implementation, communication interface 318 sends and receives electrical, electromagnetic or optical signals that carry digital data streams representing various types of information. Network link 320 typically provides data communication through one or more networks to other data devices. For example, network link 320 may provide a connection through local network 322 to a host computer 324 or to data equipment operated by an Internet Service Provider (ISP) 326. ISP 326 in turn provides data communication services through the world wide packet data communication network now commonly referred to as the "Internet" 328. Local network 322 and Internet 328 both use electrical, electromagnetic or optical signals that carry digital data streams. The signals through the various networks and the signals on network link 320 and through communication interface 318, which carry the digital data to and from computer system 300, are exemplary forms of carrier waves transporting the information. Computer system 300 can send messages and receive data, including program code, through the network(s), network link 320 and communication interface 318. In the Internet example, a server 330 might transmit a requested code for an application program through Internet 328, ISP 326, local network 322 and communication interface 318. In accordance with the invention, one such downloaded application implements the techniques described herein. The received code may be executed by processor 304 as it is received, and/or stored in storage device 310, or other non- volatile storage for later execution. In this manner, computer system 300 may obtain application code in the form of a carrier wave. In the foregoing specification, the invention has been described with reference to specific embodiments thereof. It will, however, be evident that various modifications and changes may be made thereto without departing from the broader spirit and scope of the invention. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense.

Claims: CLAIMS What is claimed is: 1. A method of transmitting one or more messages from a sender to a receiver, the method comprising the steps of: transmitting over an unreliable transport mechanism said one or more messages to said receiver; and transmitting over a reliable transport mechanism a verification message that identifies said one or more messages to said receiver to indicate that said one or more messages have been transmitted to said receiver. 2. The method of Claim 1, further including the steps of: receiving a response from said receiver that indicates that said one or more messages have not been received by said receiver; and in response to receiving said response, retransmitting said one or more messages to said receiver. 3. The method of Claim 2, further including the steps of: in response to receiving said response, regenerating data that comprises said one or more messages, and retransmitting to said receiver said data as said one or more messages. 4. The method of Claim 1 , wherein said verification message includes data used by said sender to reprocess at least one message of said one or more messages in response to said receiver receiving a request from said sender to retransmit said at least one message. 5. The method of Claim 1 , wherein the step of transmitting over an unreliable transport mechanism includes transmitting over a network. 6. The method of Claim 1 , wherein the step of transmitting over a reliable transport mechanism includes transmitting over a network. 7. The method of Claim 1 , wherein the step of: transmitting over an unreliable transport mechanism includes transmitting using a protocol that provides unreliable transport of data; and transmitting over a reliable transport mechanism includes transmitting using a protocol that provides reliable transport of data. 8. The method of Claim 1 , wherein the performance of the step of transmitting over a reliable transport mechanism is delayed for a period of time after transmitting said one or more messages over said unreliable transport mechanism. 9. The method of Claim 1 , wherein the steps of: transmitting over an unreliable transport mechanism includes a first process transmitting over an unreliable transport mechanism one or more messages to a receiver that is a second process, wherein said first process is controlled by an operating system of a computer and said second process is controlled by said operating system; and transmitting over a reliable transport mechanism includes said first process transmitting over said reliable transport mechanism said verification message to said second process. 10. The method of Claim 1 , wherein the step of transmitting over an unreliable transport mechanism one or more messages includes transmitting one or more messages that each include one or more packets of data. 11. A method of receiving one or more messages sent by a sender to a receiver, the method comprising the steps of: receiving over a reliable transport mechanism a verification message from said sender that indicates that one or more messages have been transmitted over an unreliable transport mechanism to said receiver; and in response to receiving said verification message, said receiver ensuring that said one or more messages are received. 12. The method of Claim 11 , wherein the step of ensuring includes: determining whether said one or more messages have been received; and if said one or more messages have not been received, then transmitting a request to said sender to retransmit said one or more messages. 13. The method of Claim 12, wherein the step of transmitting a request to said sender is performed when said one or more messages have not been received for a period of time after receiving said verification message. 14. A computer-readable medium carrying one or more sequences of one or more instructions for transmitting one or more messages from a sender to a receiver, the one or more sequences of one or more instructions including instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of: transmitting over an unreliable transport mechanism said one or more messages to said receiver; and transmitting over a reliable transport mechanism a verification message that identifies said one or more messages to said receiver to indicate that said one or more messages have been transmitted to said receiver. 15. The computer-readable medium of Claim 14, further including sequences of instructions for performing the steps of: receiving a response from said receiver that indicates that said one or more messages have not been received by said receiver; and in response to receiving said response, retransmitting said one or more messages to said receiver. 16. The computer-readable medium of Claim 15, further including the steps of: in response to receiving said response, regenerating data that comprises said one or more messages, and retransmitting to said receiver said data as said one or more messages. 17. The computer-readable medium of Claim 14, wherein said verification message includes data used by said sender to reprocess at least one message of said one or more messages in response to said receiver receiving a request from said sender to retransmit said at least one message. 18. The computer-readable medium of Claim 14, wherein the step of transmitting over an unreliable transport mechanism includes transmitting over a network. 19. A computer-readable medium carrying one or more sequences of one or more instructions for receiving one or more messages sent by a sender to a receiver, the one or more sequences of one or more instructions including instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of: receiving over a reliable transport mechanism a verification message from said sender that indicates that one or more messages have been transmitted over an unreliable transport mechanism to said receiver; and in response to receiving said verification message, said receiver ensuring that said one or more messages are received. 20. The computer-readable medium of Claim 19, wherein the step of ensuring includes: determining whether said one or more messages have been received; and if said one or more messages have not been received, then transmitting a request to said sender to retransmit said one or more messages.

Inventors: BAMFORD ROGER, BAMFORD, ROGER
Applicants: ORACLE CORP, ORACLE CORPORATION
Application year: 2000
Main classification: H04L29
IPC codes: H04L1, H04L12, H04L29