METHOD FOR CAUSAL ORDERING IN A DISTRIBUTED NETWORK

Abstract: A system and method for causal ordering in a distributed network with a minimum amount of delay. In a distributed network having three interconnected nodes, each having synchronized clocks, the second node sends a message to the first node. Before it sends the message, however, the second node attaches a time stamp t2 to the message. To determine when the first node can provide a causally ordered response, the method first determines a minimum message latency f from the third node to the second node. The method then adds the value of the time stamp t2 to the message latency f to calculate a minimum response time t1. On or after the time t1, the first node can provide the causally ordered response.

Description: METHOD FOR CAUSAL ORDERING IN A DISTRIBUTED NETWORK Technical Field This invention relates generally to distributed networks, and in particular, to a system and method for causal ordering in a distributed network with a mimmum amount of delay. Background of the Invention Distributed networks are continually becoming larger in their coverage area and faster in their message delivery. However, the tendency of distributed systems to cover large areas naturally reduces the speed of message delivery, i.e., increases message latency. Part of this speed reduction is a result of physical limitations, e.g., messages cannot travel faster than the speed of light and therefore message latency inherently increases with distance. However, message latency is further increased due to the overhead of a causally ordered network. Causal ordering is a property that guarantees a certain order of message delivery. If a node receives a first message, it may respond to it by sending out a second message. .Any node in a causal ordered network that receives both messages will receive the first message before it receives the second message. In a causally ordered network, when a node receives a message, before the node can respond to the message it must be certain that it will not receive any other message from any other node that causally proceeds that message. Therefore, the node must utilize some type of ordering scheme to signify when it can respond. One common scheme attaches a marker to a message for indicating the causal ordering of the message. However, this scheme is not desirable due to the bandwidth overhead required by the markers and the difficulty in implementation. Another scheme uses the creation time of the message to impose causal order by attaching time stamps to the message. This scheme works well because the time stamps consume very little bandwidth. However, the use of time-stamps do incur additional message delay. For example, when a node N receives a time-stamped message m, it must wait until it receives a message from every other node in the network with a time stamp equal to or greater than the one of message m. In this way, node N is certain that a causally ordered response to the message m does not depend on another message on its way to the node N but not yet received. Once the node N has received messages from all the remaining nodes with time-stamps greater than or equal to the time-stamp of the message m, causal ordering is thereby assured. The delay in waiting for messages from the remaining nodes can be extensive. For example, in a network spanning the United States, a delay between the farthest-most nodes, even using optical fibers, is often greater than 25 milliseconds (ms). As a result, the causal response to every message, even those that are received in less than 25 ms, must be delayed for at least 25ms. This problem is exacerbated by the discrepancy of clock readings from node to node. Typically each node has either a logical clock or a physical clock. though logical clocks, such as Lamport clocks, are easy to maintain and do not suffer from significant skew or drift, they do not allow the network to exploit knowledge about minimum message delay used by each node. Furthermore, independent physical clocks, such as a separate clock in each node, experience a significant amount of skew and drift between the different nodes. Even by applying sophisticated synchronization algorithms, the difference in the physical clock readings from node to node often cause a significant increase to message latency. Therefore, what is needed is a system and method that allows a node to respond as quickly as possible to a received message, while still being assured that the response is causally ordered. Summary of the Invention The foregoing problems are solved and a technical advance is achieved by a system and method for causal ordering in a distributed network with a minimum amount of delay. For example, in a distributed network having three interconnected nodes, each having its own clock, the second node sends a message to the first node. Before it sends the message, however, the second node attaches a time stamp t2 to the message. To determine when the first "~ node can provide a causally ordered response, the method adds a minimum message latency f3,2 from the third node to the second node to a time stamp t3 attached to a message from the third node. After the first node receives the message from the third node with a time stamp t3 such that t3 ≥ t2 - f3,2, the first node can provide the causally ordered response to the message from the second node. In another embodiment, the network has a fourth node and the method must also account for messages from that node. The method adds the minimum message latency f3,2 to time stamps attached to messages from the third node to the first node and adds a minimum message latency f4,2 to time stamps attached to messages from the forth node to the first node in a manner as described above. As a result, the first node can provide a causally ordered response to the message from the second node after it receives the message from the third node with a time stamp t3 such that t3 ≥ t2 - f3,2, and receives the message from the forth node with a time stamp t4 such that t4 ≥ t2 - f4,2. In another embodiment, the clocks for each of the nodes are synchronized by a global clocking system, such as a system of global positioning satellites. In this way, the skew and drift between the different clocks is negligible, such as an order of magnitude less than the largest of all minimum message latencies between any two nodes in the network. In many instances, the addition of the corresponding minimum message latency allows a node to provide a causal ordered response immediately after receiving the message from the second node. In the remaining instances, the amount of time the first node must wait before it can respond is significantly reduced. Brief Description of the Drawings Fig. la is a directed, weighted graph for illustrating an exemplary distributed network embodying features of the present invention. Fig. lb is a block diagram of one node of the distributed network of Fig. la. Fig. 2 is a flowchart illustrating a routine initially run by the nodes of Fig. 1. Fig. 3 is a flowchart illustrating a routine used by a node of Fig. 1 to assure a causally ordered response from a received message. Description of the Preferred Embodiment Referring to Fig. la, the reference numeral 10 designates a simplified network having nodes distributed throughout the United States. For the sake of example, the distributed network 10 includes five nodes A, B, C, D, and E. Each node includes several first-in first-out (FIFO) channels that support their interconnection. The channels are represented by directed paths (i ), where the first index i refers to the node sending a message and the second index j refers to the node receiving the message. The messages are designated by the node that sent them and include a time stamp from that node. Furthermore, each node includes a local clock, each clock being closely synchronized by a global clocking system, such as one that utilizes signals from a global positioning satellite (GPS) system. Referring also to Fig. lb, for example, the node A includes receivers 10, 12 and 14 and senders 11, 13 and 15. The receiver 10 is connected to directed path (b,a) and the sender 11 is connected to directed path (a,b). Likewise, receivers 12, 14 and senders 13, 15 are connected to directed paths (d,a), (e,a) and (a,d), (α,e), respectively. The node A uses the sender 10 and directed path (a,b) for sending a message a, having a time stamp t a , to node B. In such a manner, each of the nodes A-E are interconnected with paths, with the exception that no direct path exists between nodes A and C and nodes E and C. The node A also includes a GPS receiver 16 and a clock 18. The GPS receiver 16 receives signals from a satellite system (not shown) and converts these signals into an incremental sequence of time units measured in milliseconds (ms), e.g., 10ms, 11ms, 12ms, . . . for use by the clock 18. As a result, the time stamp t a is accurately s5mchronized with the clock of node B. Furthermore, it is understood that the relative accuracy of GPS-based technology is likely to improve, thereby providing even less clock skew between the nodes A-E. jAssuming for the moment that the clock skew between the nodes A-E is negligible, when a node receives a message, the local time of the receiving node equals or exceeds the tagged time plus a delay associated with the path, or message latency. Continuing with the example above, if node A sends the message a to node B at a time t a = 70ms, and the path (a,b) has a latency of 5ms, then node B receives the message a on or after a time 75ms. Conventionally, node B cannot provide a causally ordered response until it has received messages c, d, and e, each with a time-stamp greater than or equal to 70ms. Therefore, using conventional procedures, the response must at least be delayed for the longest message latency of paths (c,b), (d,b), and (e,b). Once the messages c, d, and e (each having a time-stamp greater than or equal to 70ms) are received, node B is assured that there is no additional message coming from any node that could causally affect message a. JAS will be discussed in greater detail below, by utilizing features of the present invention, node B can actually respond much sooner. In general, the message latency for each of the paths of the distributed network 10 can be represented in a distance matrix F such that: F = fj NXN , (1) where f is the latency for path (ij) and N denotes the number of nodes in the network. Each path is assigned a minimum message latency and if two nodes are not connected, such as nodes A and C of the network 10, then a latency of +∞ is assigned thereto. The matrix F can also describe completely connected networks (f tJ < +∞), symmetric networks (f l = f j ), and causal networks that do not allow negative weighted edges (f tJ ≥ 0). Given the matrix F, it is possible to construct a shortest message latency matrix P where: by computing the shortest path from a node i to a node j. For entries between non-connected nodes, such as between nodes A and C, the shortest path equals the shortest combination of message latencies from existing paths that can deliver a message between the two nodes. Therefore, all values of P are - smaller than +∞ (there exists at least one path between any two nodes) and greater than -∞ (no loops exist with a total weight less than zero). However, the values p j do not consider time offset and clock skew, discussed in greater detail, below. For the sake of general reference, let a node R be the receiver of a message s sent by a node S and tagged with a time-stamp t s . Furthermore, let a node H represents any third node of the network. If the . clocks at nodes R and S are synchronous, node R is assured that no message h from the node H can causally precedes the message s if the message h was sent at a time t h ≥ t s - p H . The value p HS can be used as an offset which is added to the time-stamp t h of incoming messages to derive a causal time-stamp t h * , with respect to each node H where t A * = t Λ + o H „ and with the offset matrix O defined: O = P (3) Therefore, as soon as all causal time-stamps t Λ * are equal to or greater than t s , the node R is assured a causally ordered response to the message s. For all instances in which the shortest message latency between two nodes is positive, the causal time-stamp t Λ * is greater than the actual time-stamp t h — which means that the requirement that each causal time-stamp t ή * ≥ t s is met before t h ≥ t M . To evaluate the effectiveness of the above procedure, assume that the times assigned to the links are exact times, i.e., a message traveling from node S to node R is "on the fly" for exactly f S R time units. If every node sends out a message to every other node at least every τ time units, node R receives a message h from node H with t h ≥ t s - p H „ at a time t h recυ , such that: (4) However, message s will be on the fly for f s R time units and node R will receive message s at time t s ncv = t s + f S R . Consequently: < t - - f f ~(5 ) T h,recv ≤ T s,recv PH,S ,R + JH R +X For real networks, the argument ( ~p HS - f S R + f HR ) adds up to a number less than or equal to zero because the message latency from node H to node R over node S is larger than the message latency directly between nodes Hand R: P HS + fs R ≥ f HR - -^ a resu l > node R does not need to wait longer than τ units after receiving message s. Since node H can be any node in the network, s can be delivered in causal order at a time t s elwer such that: s,deliver ~ ^^ ^ s,recv> h,recv ' (C\ ≤ ma ( + naxi-PT. -f s , R + f H , R ) + τ) Strictly speaking, a network based on physical clocks cannot be implemented without any clock skew. However, the clocks in each node A-E are based on GPS technology and therefore have very little skew, e.g., an order of magnitude less than the message latency. The skew between the clocks on any two nodes can be illustrated in a matrix G. The elements g t are positive numbers which define an interval size. At any given point in time, the absolute value of the difference of node i's and node s clock must not be greater than g j . A symmetric matrix G (g t j = g t ) is a direct result of this definition. Dealing with clock skew, equation (3) has to be modified as follows: After receiving the message s from the node S with time-stamp t s , the node R can guarantee causal delivery after having received each message h from each of the nodes H with time-stamps t h ≥ t s - p H S + g HS . Therefore, the offset matrix O can be redefined as: (3 1 ) °H.S PH.S 8H.S which can be added to all time-stamps t h : t Λ * = t h +o HS . As discussed above, the message s from node S can be delivered as soon as the receiver receives messages h from all other nodes H with t Λ * ≥ f Similar to the case without clock skew, by assuming that channel latencies are exact, the node R can receive message s during a time t s recv such that: (7) '_■ + fs j t ~ S S<R ≤ t s recv ≤ t s + f SJt + g SJi . Furthermore, the node R can receive message h during a time t h>recυ such that: Φ) { s ~ ° H J + f Hf i ~ S HJi ≤ t recv ≤ t s - o HJ! + f HΑ + g HιR + τ The combination of the left half of equation (7) and the right half of equation (8) results in the expression: (9) .recv ≤ f s,recv PH£ Jsjl + JH l + HJI. + /7 + S l + T Again, for real networks the term "-p H ς - f S + f H 7 is less than or equal to zero. Therefore, the delay for delivering the message s is in the range of the clock skew or the time τ, whichever is larger. Equation 10 gives an upper limit for when the time message s can be delivered in causal order. t s, d .el 7 i J .ver = max( vt jr, recv, t h., recv )' . ≤ m * X ( t s,recv > t s,rec V + x(~P H J> ~ fs* + ^ ( } + S HΑ + g Hβ + n* + τ) Referring also to Fig. 2, the distributed network 10 is first initialized using a method 20. For the sake of example, representative channel latencies for the distributed network 10 are listed below in matrix F of Table 1 and the clock skew between the nodes is listed below in matrix G of Table 2. Furthermore, τ equals zero and a maximum clock skew of 1ms exists for each node of the network 10, i.e., the slowest and the fastest clock do not differ by more than 1ms. Table 1: Channel latency matrix F. Receiver Sender Table 2: Clock skew matrix G. Receiver Sender At step 22, the shortest message latency between any two nodes is computed. In the present example, a matrix P of Table 3 is computed using the matrix F of Table 1. For entries between non-connected nodes, such as between nodes A and C, the shortest message latency equals the shortest combination of message latencies using existing paths that can deliver a message between the two nodes. At step 24, an offset which can be used to deliver a message s in causal order is created. In the present example, an offset matrix O of Table 4 is created by combining the matrixes P and G. The matrix O shows the offsets that any receiver node R of a message s can add to the time-stamp t h coming from the third node H. The values o HS are calculated by using equation (3') and are independent of the receiver node R. Therefore, having only positive elements in matrix P that are greater than the corresponding clock skew between two nodes, none of the entries in matrix O of Table 4 is less than zero. Table 3: Shortest message latency matrix P. Receiver Sender Table 4: Time-stamp offset matrix O. Receiver Sender Referring to Fig. 3, once the distributed network 10 has been initialized and the above matrices have been created, an operation method 50 may be implemented. At step 52, the node R receives the message s with the time stamp t s from node S. At step 54, node R checks that it has received message h with time stamps t h ≥ t s - o H S . A message h confirming that no third node H can affect the causal order of the message s, can only be created at least o τs milliseconds before the message s was sent. In the present example, the times f H R - o H s for all combinations of nodes R, S, and H are shown in the 3-dimensional Table 5. All numbers within a ^ table entry give the arrival time of messages relative to the creation of a message s. Positive numbers mean that the message h will arrive after the message s was created and negative numbers mean that the message h arrived before the message s was created. The sender node S specifies the row, the receiver node R the column, and the third node H which number in the sequence (e.g., the third number in column B, row A refers to a constellation in which B receives a message from A and needs a time-stamp t c ≥ t a from node C). The R th number of all entries of the R th row denotes the delivery time for message s to itself. It is always equal to channel latency f SR since the diagonal elements of the offset matrix O are zero (S = H =*> o HS = 0). Table 5: Arrival time of messages h compared to the creation time of message s for each node A, B, C, D, E. Receiver Sender In the present example, the third number of all entries in column A equals +∞. This is also true for the first and fifth numbers in column C and the third numbers in column E. This is caused by the missing links between nodes A and C and nodes C and E. It is understood that a receiver node R will never get a message from a third node H with which it is not connected. Therefore, the worst case number +∞ can be replaced by a best case number -∞. However, the case in which node H equals node S describes the delivery of the message s itself. Therefore the S' h number of all entries of row S keeps the value +oo. Furthermore, the first number in row A, column C, the third number in row C, column A, the third number in row C, column E, and the fifth number in row E, column C also keeps the value +∞. A total delay for each node must then be determined. The total delay is the time the receiving node R must wait for causal ordering. In the present example, a total delay matrix K of Table 6, below, shows the receive time of the last message h that is required for causal ordering. It is derived from Table 5 by choosing the maximum number of each entry after replacing the +∞ values with -oo values, as directed above. For most entries, the times are identical to the channel latencies (matrix F, Table 1). In cases where the message latency of a path over a third node is equal to that of a direct path (e.g., f DΛ = f Dt E + f E> A and f B E = f B D + f Dr E ), the delivery time equals the channel latency plus the clock skew (E sends to A, D send to E). In these cases the receiver must hold the message s for lms in the buffer before delivery. Table 6: Total delay matrix K for message delivery. Receiver Sender Although a node can deliver its own message immediately after having created it, the table indicates a delay of lms. This is caused by the fact that ° H,S = H,R ~ S H,R and if R = S, then f HR - o HS = g HR . The clock skew is incorporated into the offset to deal with the worst case. In reality, the clock skew can be neglected because it affects the channel latency in exactly the same way than it affects the offset. Subtracting one from the other, the clock skew drops out. Therefore, all the diagonal elements (k where i=j) of Table 6 can be replaced with zeros. If at step 54 a determination can not be made that the messages h from all the other connected nodes has been received such that t h ≥ t s - o H S , execution proceeds to step 56. At step 56, the node R holds the message s, execution returns to step 54, and node R waits for the next message h. If, however, t h ≥ t s - o HS , execution proceeds to step 58 where node R delivers message s. Causal ordering of message s is thus guaranteed. Although illustrative embodiments of the invention have been shown and described, other modifications, changes, and substitutions are intended in the foregoing disclosure. Accordingly, it is appropriate that the appended claims be construed broadly and in a manner consistent with the scope of the invention.

Claims: WHAT IS CLAIMED IS: 1. A causally ordered network comprising: three nodes; a path between the first and second nodes; a path between the third and second nodes; a path between third and first nodes with an associated minimum latency £3,1; means for producing a response by the second node causally ordered from a message sent by the first node and having a time stamp tl as soon as the second node receives a message from the third node having a time stamp t3 such that: t3 ≥ tl - £3,l. 2. The network of claim 1 wherein each of the three nodes includes a clock having a maximum skew less than or approximate to one-tenth of the latency £3,1. 3. The network of claim 2 wherein the clocks are synchronized using a global clocking system. 4. The network of claim 2 wherein the clocks are synchronized using global positioning satellites. 5. The network of claim 2 wherein the latency £3,1 is adjusted to account for the maximum clock skew. 6. The network of claim 1 wherein each of the paths is a directed path. 7. The network of claim 1 wherein the path between the first and second nodes is routed through a fourth node. 8. A method for initiating a causally ordered response to a message received by a first node from a second node, both nodes being part of a distributed network, the method comprising the steps of: synchronizing the first and second nodes; determining an offset time f3,2 from a message latency of a third node of the distributed network to the second node; retrieving a message start time ts when the message was sent by the second node; and initiating the causally ordered response after receiving a message start time t3 from the third node such that t3 ≥ ts - f3,2. 9. The method of claim 8 further comprising: determining an offset time f4,2 from a message latency of a fourth node of the distributed network to the second node; initiating the causally ordered response also after receiving a message start time t4 from the fourth node such that t4 ≥ ts - f4,2. 10. The method of claim 8 wherein the first and second nodes each have a clock synchronized to have an offset less than or approximate to one-tenth of the delay time. 11. The method of claim 8 wherein the nodes are synchronized using a global clocking system. 12. The method of claim 8 wherein the nodes are synchronized using global positioning satellites. 13. The method of claim 9 wherein the delay time is adjusted to account for the clock offset. 14. A system for initiating a causally ordered response to a message received by a first node from a second node, both nodes being part of a distributed network, the system comprising: means for synchronizing the first and second nodes; means for determining an offset time f3,2 from a message latency of a third node of the distributed network to the second node; means for retrieving a message start time ts when the message was sent by the second node; and means for initiating the causally ordered response after receiving a message start time t3 from the third node such that t3 ≥ ts - f3,2. 15. The system of claim 13 further comprising means for determining an offset time f4,2 from a message latency of a fourth node of the distributed network to the second node; wherein the means for initiating the causally ordered response initiates the response also after receiving a message start time t4 from the fourth node such that t4 ≥ ts - f4,2. 16. The system of claim 13 wherein the first and second nodes each have a clock synchronized by the synchronizing means. 17. The system of claim 13 wherein the synchronizing means utilizes a global clocking system. 18. The system of claim 15 further comprising means for adjusting the delay time by the clock offset. AMENDED CLAIMS [received by the International Bureau on 22 February 1999 (22.02.99); original claims 3, 11 and 16 amended; remaining claims unchanged (3 pages)] 1. A causally ordered network comprising: three nodes; a path between the first and second nodes- a path between the third and second nodes; a path between third and first nodes with an associated minimum latency £3,1; means for producing a response by the second node causally ordered from a message sent by the first node and having a time stamp tl as soon as the second node receives a message from the third node having a time stamp t3 such that: t3 > tl - £3,1. 2. The network of claim 1 wherein each of the three nodes includes a clock having a maximum skew less than or approximate to one-tenth of the latency £3,1. 3. The network of claim 2 wherein the clocks are synchronized. 4. The network of claim 2 wherein the clocks are synchronized using global positioning satellites. 5. The network of claim 2 wherein the latency £3,1 is adjusted to account for the maximum clock skew. 6. The network of claim 1 wherein each of the paths is a directed path. 7. The network of claim 1 wherein the path between the first and second nodes is routed through a fourth node. 8. A method for initiating a causally ordered response to a message received by a first node from a second node, both nodes being part of a distributed network, the method comprising the steps of: synchronizing the first and second nodes; determining an offset time f3,2 from a message latency of a third node of the distributed network to the second node; retrieving a message start time ts when the message was sent by the second node; and initiating the causally ordered response after receiving a message start time t3 from the third node such that t3 ≥ ts - f3,2. 9. The method of claim 8 further comprising: determining an offset time f4,2 from a message latency of a fourth node of the distributed network to the second node; initiating the causally ordered response also after receiving a message start time t4 from the fourth node such that t4 ≥ ts - f4,2. 10. The method of claim 8 wherein the first and second nodes each have a clock synchronized to have an offset less than or approximate to one-tenth of the delay time. 11. The method of claim 8 wherein the nodes are synchronized . 12. The method of claim 8 wherein the nodes are synchronized using global positioning satellites. 13. The method of claim 9 wherein the delay time is adjusted to account for the clock offset. 14. A system for initiating a causally ordered response to a message received by a first node from a second node, both nodes being part of a distributed network, the system comprising: means for synchronizing the first and second nodes; means for determimng an offset time f3,2 from a message latency of a third node of the distributed network to the second node; means for retrieving a message start time ts when the message was sent by the second node; and means for initiating the causally ordered response after receiving a message start time t3 from the third node such that t3 ≥ ts - f3,2. 15. The system of claim 13 further comprising means for determining an offset time f4,2 from a message latency of a fourth node of the distributed network to the second node; wherein the means for initiating the causally ordered response initiates the response also after receiving a message start time t4 from the fourth node such that t4 ≥ ts - f4,2. 16. The system of claim 13 wherein the first and second nodes each have a synchronized clock. 17. The system of claim 13 wherein the synchronizing means utilizes a global clocking system. 18. The system of claim 15 further comprising means for adjusting the delay time by the clock offset.

Inventors: KOCH RUPPERT ROLF, KOCH, RUPPERT, ROLF
Applicants: KOCH RUPPERT ROLF, NORTHERN TELECOM LTD, KOCH, RUPPERT, ROLF, NORTHERN TELECOM LIMITED
Application year: 1998
Main classification: H04J3
IPC codes: G06F9, H04J3