Unit 2 Message Passing Part 1
Unit 2 Message Passing Part 1
COMPUTING
Logical Time: Physical Clock Synchronization: NTP – A Framework for a System of Logical
Clocks – Scalar Time – Vector Time;
Message Ordering and Group Communication: Message Ordering Paradigms – Asynchronous
Execution with Synchronous Communication – Synchronous Program Order on Asynchronous
System – Group Communication – Causal Order – Total Order;
Global State and Snapshot Recording Algorithms: Introduction – System Model and Definitions –
Snapshot Algorithms for FIFO Channels.
How interaction takes place in distributed system? 3 types of message
passing
on receiving
on sending
when order of execution changes
the message is received wrong
● Non-FIFO transmission : On any logical link between two nodes in the system, messages
may be delivered in any order, not necessarily first-in first-out. Such executions are also known
as non-FIFO executions.
● Although each physical link typically delivers the messages sent on it in FIFO order due to the
physical properties of the medium, a logical link may be formed as a composite of physical
links and multiple paths may exist between the two end points of the logical link.
messages can be received on any order
Message Ordering Paradigms
2. FIFO Execution
occurs at same process
casulally dependent
● On any logical link in the system, messages are necessarily delivered in the order in which
they are sent. Although the logical link is inherently non-FIFO, most network protocols
provide a connection-oriented service at the transport layer.
● Design FIFO algo over non-FIFO channel:
○ separate numbering scheme to sequence the messages on each logical channel.
○ The sender assigns and appends a sequence_num, connection_id tuple to each message.
○ The receiver uses a buffer to order the incoming messages as per the sender’s sequence numbers, and
accepts only the “next” message in sequence.
Message Ordering Paradigms
3. Causally Ordered
● If two send events s and s are related by causality ordering (not physical
time ordering), then a causally ordered execution requires that their
corresponding receive events r and r occur in the same order at all
common destinations.
3. Causally Ordered Examples
Delivery Event
● To implement CO, we distinguish between the arrival of a message and its
delivery.
● A message m that arrives in the local OS buffer at Pi may have to be delayed
until the messages that were sent to Pi causally before m was sent (the
“overtaken” messages) have arrived and are processed by the application.
● The delayed message m is then given to the application for processing.
● The event of an application processing an arrived message is referred to as a
delivery event (instead of as a receive event) for emphasis.
Other Definitions
4. Synchronous execution (SYNC)
send and receive events that occur simultaneously
Key Points
● When all the communication between pairs of processes uses synchronous
send and receive primitives, the resulting order is the synchronous order.
● As each synchronous communication involves a handshake between the
receiver and the sender, the corresponding send and receive events can be
viewed as occuring instantaneously and atomically
Synchronous program order on an asynchronous system
1. A receive call can receive a message from any sender who has sent a
message, if the expected sender is not specified.
2. Multiple send and receive calls which are enabled at a process can be
executed in an interchangeable order.
Rendezvous
● Each communication command may be a part of a guard Gi, and may also
appear within the statement block CLi. A guard Gi is a boolean expression.
● If a guard Gi evaluates to true then CLi is said to be enabled, otherwise CLi is
said to be disabled.
● A send command of local variable x to process Pk is denoted as “x !Pk.”
● A receive from process Pk into local variable x is denoted as “Pk ? x.”
Observations about synchronous communication under
binary rendezvous
1. For the receive command, the sender must be specified.
2. However, multiple receive commands can exist.
3. A type check on the data is implicitly performed.
4. Send and received commands may be individually disabled or enabled. A
command is disabled if it is guarded and the guard evaluates to false. The
guard would likely contain an expression on some local variables.
5. Synchronous communication is implemented by scheduling messages under
the covers using asynchronous communication.
6. Scheduling involves pairing of matching send and receive commands that are
both enabled.
7. The communication events for the control messages under the covers do not
alter the partial order of the execution.
Algorithm for binary rendezvous
Constraints: