Causal Ordering of Messages in Distributed System
Last Updated :
29 Dec, 2022
Causal ordering of messages is one of the four semantics of multicast communication namely unordered, totally ordered, causal, and sync-ordered communication. Multicast communication methods vary according to the message's reliability guarantee and ordering guarantee. The causal ordering of messages describes the causal relationship between a message send event and a message receive event.
For example, if send(M1) -> send(M2) then every recipient of both the messages M1 and M2 must receive the message M1 before receiving the message M2. In Distributed Systems the causal ordering of messages is not automatically guaranteed.
Reasons that may lead to violation of causal ordering of messages
- It may happen due to a transmission delay.
- Congestion in the network.
- Failure of a system.
Protocols that are used to provide causal ordering of messages
- Birman Schipher Stephenson Protocol
- Schipher Eggli Sandoz Protocol
Both protocol's algorithm requires that the messages be delivered reliably and both prefer that there is no network partitioning between the systems. The general idea of both protocols is to deliver a message to a process only if the message immediately preceding it has been delivered to the process. Otherwise, the message is not delivered immediately instead it is stored in a buffer memory until the message preceding it has been delivered.
The ISIS System
The ISIS system was developed by Ken Birman and Joseph in 1987 and 1993. It is a framework for reliable distributed communication which is achieved through the help of process groups. It is a programming toolkit whose basic features consist of process group management calls and ordered multicast primitives for communicating with the process group members. ISIS provides multicast facilities such as unordered multicast (FBCAST), casually ordered multicast (CBCAST), totally ordered multicast (ABCAST), and sync-ordered multicast (GBCAST).
The ISIS CBCAST Protocol
ISIS uses vector timestamps to implement causally ordered multicast between the members of a process group. It is assumed that all the messages are multicast to all the members of the group including the sender. ISIS uses UDP/IP protocol as its basic transport facility and sends acknowledgments and retransmits packets as necessary to achieve reliability. Messages from a given member are sequenced and delivered in order. There is no assumption that hardware support for broadcast or multicast exists. If IP multicast is implemented, then ISIS can exploit it to send a single UDP packet to the appropriate multicast address. IP multicast takes advantage of hardware like ethernet, for multicast facilities. Otherwise, packets are sent point-to-point to the individual group members.
Let the members of the group be p1,p2,p3,...pn. Once more we shall define, for each pi, a vector timestamp denoted by VTi which is used to order multicast delivery. It will turn out that VT[i] is the count of multicast messages sent by pi that causally lead up to the latest message delivered to pj. The following is the vector timestamp update algorithm:
- All the processes pi initialize VTi to zeroes.
- When pi multicasts a new message, it first increments VT[i] by 1. Then it piggybacks the value vt = VTi on the message.
- When a message bearing a timestamp vt is delivered to pj, pj's timestamp is updated as VTj = merge(VTj, vt).
Every multicast message can be delivered to its sender immediately since it is by definition in causal order with respect to the messages already delivered to it. A multicast message arriving at pj's site from pi (pj != pj), however, has to be placed on the hold-back queue until it can be delivered in causal order. The incoming message's timestamp vt is examined and the following criteria are used for transferring the message to pj's delivery queue:
- The message must be the next in sequence expected from pi, that is, vt[i] = VTj[i]+1 .
- All causally prior messages that have been delivered to pi when it sent the message, should have been delivered to pj, that is, VTj[k] >= vt[k] for k != i.
It is straightforward to show that these criteria are necessary and sufficient to satisfy the safety property of causal ordering being assured. Liveness can be established if:
- All members of the group are destinations for every message.
- Multicast delivery is atomic.
Otherwise, a message delivered to pj might never be delivered to pj and so some messages might indefinitely fail the second criteria mentioned above.
Similar Reads
Message Passing in Distributed System
Message passing in distributed systems refers to the communication medium used by nodes (computers or processes) to communicate information and coordinate their actions. It involves transferring and entering messages between nodes to achieve various goals such as coordination, synchronization, and d
9 min read
Features of Distributed Operating System
A Distributed Operating System manages a network of independent computers as a unified system, providing transparency, fault tolerance, and efficient resource management. It integrates multiple machines to appear as a single coherent entity, handling complex communication, coordination, and scalabil
9 min read
Event Ordering in Distributed System
In this article, we will look at how we can analyze the ordering of events in a distributed system. As we know a distributed system is a collection of processes that are separated in space and which can communicate with each other only by exchanging messages this could be processed on separate compu
4 min read
Multidatagram Messages in Distributed System
In this article, we will go through the concept of Multidatagram messages in Distributed Systems in detail. In distributed systems, communication is carried out between processes by passing messages from one process to another. A message-passing system gives a collection of message-based IPC protoco
3 min read
Resource Sharing in Distributed System
Resource sharing in distributed systems is very important for optimizing performance, reducing redundancy, and enhancing collaboration across networked environments. By enabling multiple users and applications to access and utilize shared resources such as data, storage, and computing power, distrib
7 min read
Features of Good Message Passing in Distributed System
Message passing is the interaction of exchanging messages between at least two processors. The cycle which is sending the message to one more process is known as the sender and the process which is getting the message is known as the receiver. In a message-passing system, we can send the message by
3 min read
Design Issues of Distributed System
Distributed systems are used in many real-world applications today, ranging from social media platforms to cloud storage services. They provide the ability to scale up resources as needed, ensure data is available even when a computer fails, and allow users to access services from anywhere. However,
8 min read
What is a Distributed Operating System?
A Distributed Operating System refers to a model in which applications run on multiple interconnected computers, offering enhanced communication and integration capabilities compared to a network operating system. Important Topics for a Distributed Operating System What is a Distributed Operating Sy
8 min read
Back Pressure in Distributed Systems
Back Pressure in Distributed Systems explains how back pressure mechanisms help manage data flow in complex computer systems that span multiple servers or devices. When too much data is sent too quickly, it can overwhelm parts of the system, causing delays or failures. Back pressure works like traff
12 min read
Marshalling in Distributed System
A Distributed system consists of numerous components located on different machines that communicate and coordinate operations to seem like a single system to the end-user.External Data Representation:Data structures are used to represent the information held in running applications. The information
9 min read