This document discusses interprocess communication (IPC) and message passing in distributed systems. It covers key topics such as:
- The two main approaches to IPC - shared memory and message passing
- Desirable features of message passing systems like simplicity, uniform semantics, efficiency, reliability, correctness, flexibility, security, and portability
- Issues in message passing IPC like message format, synchronization methods (blocking vs. non-blocking), and buffering strategies
File Replication : High availability is a desirable feature of a good distributed file system and file replication is the primary mechanism for improving file availability. Replication is a key strategy for improving reliability, fault tolerance and availability. Therefore duplicating files on multiple machines improves availability and performance.
Replicated file : A replicated file is a file that has multiple copies, with each copy located on a separate file server. Each copy of the set of copies that comprises a replicated file is referred to as replica of the replicated file.
Replication is often confused with caching, probably because they both deal with multiple copies of data. The two concepts has the following basic differences:
A replica is associated with server, whereas a cached copy is associated with a client.
The existence of cached copy is primarily dependent on the locality in file access patterns, whereas the existence of a replica normally depends on availability and performance requirements.
Satynarayanana [1992] distinguishes a replicated copy from a cached copy by calling the first-class replicas and second-class replicas respectively
File Replication : High availability is a desirable feature of a good distributed file system and file replication is the primary mechanism for improving file availability. Replication is a key strategy for improving reliability, fault tolerance and availability. Therefore duplicating files on multiple machines improves availability and performance.
Replicated file : A replicated file is a file that has multiple copies, with each copy located on a separate file server. Each copy of the set of copies that comprises a replicated file is referred to as replica of the replicated file.
Replication is often confused with caching, probably because they both deal with multiple copies of data. The two concepts has the following basic differences:
A replica is associated with server, whereas a cached copy is associated with a client.
The existence of cached copy is primarily dependent on the locality in file access patterns, whereas the existence of a replica normally depends on availability and performance requirements.
Satynarayanana [1992] distinguishes a replicated copy from a cached copy by calling the first-class replicas and second-class replicas respectively
Message and Stream Oriented CommunicationDilum Bandara
Message and Stream Oriented Communication in distributed systems. Persistent vs. Transient Communication. Event queues, Pub/sub networks, MPI, Stream-based communication, Multicast communication
Remote Procedure Call in Distributed SystemPoojaBele1
Presentation to give description about the remote procedure call in distributed systems
Presentation covers some points on remote procedure call in distributed systems
Real Life Applications of Distributed Systems:
1. Distributed Rendering in Computer Graphics
2. Peer-To-Peer Networks
3. Massively Multiplayer Online Gaming
About Naming Concepts in Distributed systems.
More about its services, its types & the approaches of implementation for Name Space & Name Resolution and Locating Entities Approaches with example diagrams.
4.1Introduction
- Potential Threats and Attacks on Computer System
- Confinement Problems
- Design Issues in Building Secure Distributed Systems
4.2 Cryptography
- Symmetric Cryptosystem Algorithm: DES
- Asymmetric Cryptosystem
4.3 Secure Channels
- Authentication
- Message Integrity and Confidentiality
- Secure Group Communication
4.4 Access Control
- General Issues
- Firewalls
- Secure Mobile Code
4.5 Security Management
- Key Management
- Issues in Key Distribution
- Secure Group Management
- Authorization Management
Agreement Protocols, Distributed Resource Management: Issues in distributed File Systems, Mechanism for building distributed file systems, Design issues in Distributed Shared Memory, Algorithm for Implementation of Distributed Shared Memory.
Threads,
system model,
processor allocation,
scheduling in distributed systems
Load balancing and
sharing approach,
fault tolerance,
Real time distributed systems,
Process migration and related issues
Replication in computing involves sharing information so as to ensure consistency between redundant resources, such as software or hardware components, to improve reliability, fault-tolerance, or accessibility.
This full detailed presentation on Enterprise message using JMS. This will provide details required from a junior programmer to architect level. Some of the information presented is inspired by some authors from various sources.
Message and Stream Oriented CommunicationDilum Bandara
Message and Stream Oriented Communication in distributed systems. Persistent vs. Transient Communication. Event queues, Pub/sub networks, MPI, Stream-based communication, Multicast communication
Remote Procedure Call in Distributed SystemPoojaBele1
Presentation to give description about the remote procedure call in distributed systems
Presentation covers some points on remote procedure call in distributed systems
Real Life Applications of Distributed Systems:
1. Distributed Rendering in Computer Graphics
2. Peer-To-Peer Networks
3. Massively Multiplayer Online Gaming
About Naming Concepts in Distributed systems.
More about its services, its types & the approaches of implementation for Name Space & Name Resolution and Locating Entities Approaches with example diagrams.
4.1Introduction
- Potential Threats and Attacks on Computer System
- Confinement Problems
- Design Issues in Building Secure Distributed Systems
4.2 Cryptography
- Symmetric Cryptosystem Algorithm: DES
- Asymmetric Cryptosystem
4.3 Secure Channels
- Authentication
- Message Integrity and Confidentiality
- Secure Group Communication
4.4 Access Control
- General Issues
- Firewalls
- Secure Mobile Code
4.5 Security Management
- Key Management
- Issues in Key Distribution
- Secure Group Management
- Authorization Management
Agreement Protocols, Distributed Resource Management: Issues in distributed File Systems, Mechanism for building distributed file systems, Design issues in Distributed Shared Memory, Algorithm for Implementation of Distributed Shared Memory.
Threads,
system model,
processor allocation,
scheduling in distributed systems
Load balancing and
sharing approach,
fault tolerance,
Real time distributed systems,
Process migration and related issues
Replication in computing involves sharing information so as to ensure consistency between redundant resources, such as software or hardware components, to improve reliability, fault-tolerance, or accessibility.
This full detailed presentation on Enterprise message using JMS. This will provide details required from a junior programmer to architect level. Some of the information presented is inspired by some authors from various sources.
Here is presented a brief introduction to Message-Passing Systems in Operating Systems that covers the most basic are fundamental concepts.
Topics are :
1- Synchronization
2- Addressing
3- Message format
4- Queuing Discipline
5- Mutual Exclusion
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...Sehrish Asif
Message Passing, Remote Procedure Calls and
Distributed Shared Memory as Communication Paradigms for Distributed Systems & Remote Procedure Call Implementation Using Distributed Algorithms
Message passing
Features of message passing
Issues in IPC
Synchronization
Buffering
Null buffer
Single buffer
Unbounded capacity buffer
Finite bound buffer
Multi datagram messages
Encoding and decoding
Process addressing
Failure handling
Group communication
one to many communication
many to one communication
many to many communication
This session is all about Reactive Messaging Patterns. Such messaging patterns are used to build message-driven systems. These systems are those that communicate primarily through asynchronous and non-blocking messages. Messages enable us to build systems that are both resilient, and elastic, and therefore responsive under a variety of situations.
Inter process communication by Dr.C.R.Dhivyaa, Assistant Professor,Kongu Engi...Dhivyaa C.R
Interprocess Communication: The API for the Internet Protocols – External data representation and marshalling – Client– server communication – Group communication. Distributed Objects – Communication between distributed objects – Remote procedure call.
The objectives of these slides are:
- To introduce the notion of a process - a program in execution, which forms the basis of all computation
- To describe the various features of processes, including scheduling, creation and termination, and communication
- To explore interprocess communication using shared memory and message passing
Inter-Process Communication in distributed systemsAya Mahmoud
Inter-Process Communication is at the heart of all distributed systems, so we need to know the ways that processes can exchange information.
Communication in distributed systems is based on Low-level message passing as offered by the underlying network.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024.
He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
How libraries can support authors with open access requirements for UKRI fund...
Message passing in Distributed Computing Systems
1.
2. • A process is a program in execution
• Resource manager process to monitor the
current status of usage of its local resources
• All resource managers communicate each
other from time to time to dynamically balance
the system load
• Therefore a DOS needs to provide interprocess
communication (IPC) mechanism for
communication activities
• IPC basically requires information sharing
among two or more processes
• Two basic methods for information sharing
Original sharing, or shared-data approach
Copy sharing, or message-passing approach
3. • The shared-data paradigm gives the conceptual communication
pattern
P1 P2
Shared
Common
memory Area
P1 P2
• In message-passing approach, the information to be shared is
physically copied from the sender process address space to
the address spaces of all receiver processes
• This done by transmitting the data in the form of messages
• A message is a block of information
• Communication processes interact directly with each other
4. • Distributed system communicate by exchanging
messages
• Message passing is the basic IPC mechanism in
distributed system
• Message-passing system is a subsystem of a DOS that
provides a set of message-based IPC protocols
• It enables processes to communicate by simple
communication primitives send and receive
Desirable Features of a Good Message-Passing system
1. Simplicity
MPS should be simple and easy to use
Construction of new applications and to communicate
with existing ones by using the primitives provided by
the MPS
Different modules of a distributed application use simple
primitives without bothering the system or network
Use of clean and simple semantics of IPC protocols
5. 2. Uniform Semantics
Uses two type of communication
Local communication – the communicating process are on the same
node
Remote communication – the communicating processes are on
different nodes
The semantics of remotes communication should be close as
possible to those of local communications
3. Efficiency
If the MPS is not efficient , IPC may become so expensive
Application users try to avoid its use in their applications
An IPC protocol of a MPS can be made efficient by reducing
the number of message exchanges during communication
Some optimizations are
Avoiding cost of establishing and terminating connections between
the same pair of processes of every exchange
Minimizing the cost of maintaining connections
Piggybacking of acknowledgement
6. 4. Relaiability
A reliable IPC protocol can cope up with failure problems
and guarantees the delivery of a message
Failure due to node crash or communication link failure
Handling of lost messages usually involves
acknowledgements and retransmissions on the basis of
timeouts
Another issues related to reliability is duplicate messages
Duplicate messages because of event of failures or timeouts
A reliable IPC protocol is also capable of detecting and
handling duplicates
Use sequence number to avoid duplicate messages
5. Correctness
IPC system has group communication
One sender to multiple receiver, multiple sender to one
receiver
Correctness related to IPC protocols group communication
7. Issues related to correctness is
Atomicity
Ensures that every message sent to a group of receivers will be delivered to
either all of them or none of them
Ordered delivery
Ensures that messages arrive at all receivers in an order acceptable to the
application
Survivability
Guarantees that messages will be delivered despite of partial failure of
processes, machines, or communication links
6. Flexibility
Not all applications require the same degree of reliability
and correctness of the IPC protocols
Many applications do not require atomicity or ordered
delivery of messages
The IPC primitives should be such that users have the
flexibility to choose and specify the types and levels of
reliability and correctness requirements of applications
Flexibility permit control flow as synchronous and
asynchronous send/receive
8. 7. Security
A MPS be capable of providing a secure end-to-end
communication
A message in transit on the network should not be
accessible to any user other than those to whom it is
addressed and the sender
Steps necessary for secure communication is
Authentication of the receiver(s) of a message by the sender
Authentication of the sender of a message by its receiver(s)
Encryption of a message before sending it over the network
8. Portability
Two different aspects of portability
It should be easily construct new IPC facility on another
system by reusing the basic design of existing MPS
Applications are also portable - heterogeneity must be
considered while designing MPS
9. Issues in IPC by message passing
• A message is a block of information formatted by a
sending process in such a manner that it is
meaningful to the receiving process
• It consists of fixed-length header and a variable-size
collection of typed data objects
Actual data
or pointer
to the data
Structural information
Number of
bytes/elements
Type
Sequence
number
or message ID
Addresses
Receiving
process
address
Sending
process
address
Variable
size collection
of typed data
Fixed-length header
10. • In a message-oriented IPC protocol, the sending process
determines the actual contents of a message
• The receiving process to convert the contents
• Special primitives are explicitly used for sending and receiving
the messages
• Following issues to be discussed in the design of an IPC
protocol
Who is the sender?
Who is the receiver?
Is there one receiver or many receivers?
Is the message guaranteed to have been accepted by its
receiver(s)?
Does the sender need to wait for a reply?
What should be done in case of failure (crash or communication)?
What should be done if the receiver is not accept the message?
Will the message be discarded or stored in a buffer
In case of buffering, what should be done if the buffer is full?
If there are several outstanding messages for a receiver, can it
choose the order in which to service the messages?
11. Synchronization
• Major issue of communicating process is synchronization
• The semantics classified as blocking and nonblocking types
• Nonblocking semantics if it invocation does not block the
execution of its invoker
• Otherwise a primitive is blocking (execution of invoker is
blocked)
• Two types of semantics used for the send and receive
primitives
• In case of blocking send, after the execution of send , the
sending process is blocked until acknowledgement is
received
• Blocking receive, after execution of receive statement , the
receiving process is blocked until it receives message
• Nonblocking send, after sending process sending process is
allowed to execute
• Nonblocking receive, the receiving process proceeds with its
execution after execution the receive statement
12. • An important issue in a nonblocking receive
primitive is how receiving process know that the
message has arrived in the message buffer
• The following two methods used for this
Polling
A test primitive is allowed to the receiver to check the buffer
status
Receiver periodically poll the kernel to check the buffer
Interrupt
When the message is filled in the buffer, software interrupt is
used to notify the receiving process
This method permits the receiving process to continue
without having unsucessful test requests
Its highly efficient and allows maximum parallelism
Drawback is user-level interrupts make programming
difficult
13. • A variant of Nonblocking receive primitive is the conditional receive
primitive
• It returns control immediately, either with a message or an indicator
that no message
• Blocking send primitive uses the timeout values
• The value set by user or default value
• Timeout value used for blocking receive primitive to prevent the
receiving process blocked indefinitely
• Both the send and receive primitives of a communication between
two process use blocking semantics is said to be synchronous
• If its uses nonblocking primitives then communication is
asynchronous
• Synchronous communication is simple and easy to implement
• Provide high reliability
• Drawbacks are
Limits the concurrency and is subject to communication deadlocks
Less flexible because sending process always has to wait for an
acknowledgement, even it is nor required
15. Buffering
• Messages copying from the address space of
the sending process to the address space of the
receiving process
• If the receiving process is not ready to receive
messages, then it should be save for later usage
• The message buffering is related to
synchronization strategy
• The following are the buffering strategies
1. Null buffer or no buffer
2. Buffer with unbounded capacity
3. Single-message buffer
4. Finite-bound or multiple-message buffer
16. 1. Null buffer (or no buffering)
There is no place to temporarily store the message
One of the following implementation strategies
used
The message remains in sender address space and
execution of send is delayed until the receiver executes
receive
The message is simply discarded and the timeout
mechanism is used to resend the message after a
timeout period
message
Sending process Receiving process
17. 2. Single-Message buffer
A buffer capacity to store single message is used on the
receiver’s node
An application module may have at most one message
outstanding at a time
Single-message buffer strategy is to keep the message
ready for use at the location of the receiver
The request message is buffered on the receiver’s node
if the receiver is not ready to receive the message
The message buffer may either be located in the
kernel's address space or in the receiver process’s
address space
message
Sending
process
Receiving
process
Node boundary
Single-message
buffer
18. 3. Unbounded-capacity buffer
A sender does not wait for the receiver to be ready
An unbounded-capacity message buffer that can store
all unreceived messages
It assure that all the messages sent to the receiver will
be delivered
4. Finite-bound (or multiple-message) buffer
Asynchronous ode of communication use finite-bound
buffers
Need mechanism to handle the problem of buffer
overflow
Two ways to handle buffer overflow
Unsuccessful communication
Message transfers simply fail whenever there is no mode buffer
space
The send normally returns an error message to the sending process
This method is less reliable
19. Flow-controlled communication
The sender is blocked until the receiver accepts some messages
This method introduces a synchronization between sender and receiver
It result in unexpected deadlocks
the amount of buffer space to be allocated depends on
implementation
A create-buffer system call is provided to the users
The receiver mail box is located in the kernel address space
or in the receiver process address space
This buffering provides better concurrency and flexibility
message
Message 1
Message 1
Message 1
Message 1
Sending process Receiving process
Multiple-message buffer/mailbox/port
20. Multidatagram Messages
• All networks has upper bound of the size of data
transmitted at a time
• This size is known as Maximum Transfer Unit(MTU) of a
network
• Message size greater than MTU has fragmented in to
multiples of the MTU
• Each fragment sent separately
• Each fragment is sent in a packet with control
information and data
• Each packet is known as datagram
• Messages smaller than the MTU of the network can be
sent in a single packet known as single-datagram
messages
• Messages larger than the MTU of the network have to be
fragmented and sent in multiple packets known as
multidatagram messages
21. Encoding and Decoding of Message Data
• The structure of program objects should be preserved ,
while transmitting from the address of the sending process
to receiving process
• Since both processes are on computers of different
architectures it is difficult
• Because two reasons
1. An absolute pointer value loses its meaning when transferred
from one address space to another
2. Different program objects occupy varying amount of storage
space, ex. Long int, short int, var size character strings
• Due to this problem the program objects first converted to a
stream form for transmission and placed into message
buffer
• This conversion process on the sender side is known as
encoding of a message data
• When received stream form converted to original program
objects
• Known as decoding.
22. • Two representations used for the encoding
and decoding
1. Tagged representation
The type of each program object along with its
value is encoded in the message
The receiving process to check the type of each
program object in the message
Program object is the self-describing nature of the
coded data format
2. Untagged representation
The message data only contains program objects
No information is included in the message data to
specify the type of each program object
Receiver process must have prior knowledge of
how to decode
23. Process Addressing
• MPS supports two types of process addressing
1. Explicit Addressing
The process with which communication is desired is
explicitly named as a parameter
Send(process_id, message) – send a message to the process
identified by process_id
Receive(process_id, message) – receive a message from the
process identified by process_id
2. Implicit Addressing
A process willing to communicate does not explicitly name
a process
Send_any(service_id, message)
Receive_any(process_id, message)
This type of primitive is useful in client-server
communications when the client request from set of server
provide services
This type of addressing is known as functional addressing
24. • The receiver is willing to accept a message from any
sender
• Two types of process addressing used in
communication primitives
1. Combination of machine_id and local_id such as
machine_id@local_id
The local_id part is a process identifier or a port identifier of a
receiving process
The machine_id part is used by the sending machines machines
kernel to send the message to the receiving process machine
2. Another method process identified by a combination of
three fields:machine_id, local_id, and machine_id
1st field identifies the node on which the process is created
2nd field is a local identifier generated by the node on which the
process is created
3rd field identifies the last known location (node) of the process
This method is known as link-based addressing
25. • Another method to achieve location
transparency is name server
• A processer wants to send a message to
another process specifies the high-level name
of the process
• This name is mapped with name server to get
its low-level names
• Using low-level name kernel sends the message
to the proper name
• The sending kernel also caches the high-level
name to low-level name receiving process
• For future use sending process need not
contact name server again
26. Failure Handling
• DS may suffer by partial failure like a node
crash or a communication link failure
• During interprocess communication following
failure problems will arise
Loss of request message
Due to the failure of communication link or receiver node
is down at the time the request reaches there
Sender Receiver
Send request
Lost
27. Loss of response message
Due to the communication link failure or the senders
node down
Sender Receiver
Send request
Successful request
execution
Send response
Lost
Unsuccessfull execution of the request
Due to the receivers node crashing while the request is
being processed
Sender Receiver
Send request
Unsuccessful request
execution
Restarted
Request message
Request message
Response message
28. • The kernel of the sending machine is
responsible for retransmitting the message
after waiting for a timeout period
• If the no acknowledgement is received
• The kernel of the sending machine frees the
sending process only when
acknowledgement is received
• The timeout value is slightly more than the
approximate round-trip time plus the
average time required for executing request
29. • Four-message IPC protocol for client server
communication between two processes
Client Server
Request
Acknowledgement
Acknowledgement
Reply
30. • In communication result of the processed
request is sufficient acknowledgement
• Using this three-message IPC protocol defined
Client Server
Request
Reply
Acknowledgement
31. • In the above protocol a problem occurs if a request
processing takes long time
• In this case the sender kernel timeouts and retransmit
the message
• To avoid unnecessary retransmission use separate
acknowledgement if processing takes long time
• Acknowledgement is not necessary because unnecessary
retransmission of the messages and request processing
• Use two-message IPC protocol
Client Server
Request
Reply
32. • Based on 2-msg IPC failure handling in
communication
Client Server
Send request
Send request
Send request
Send request
Request message
Retransmit
Request message
Crash
Unsuccessful
Request execution
Restarted
Successful request execution
Successful request execution
Send response
These two successful executions
of the same request
may produce different
results
Response message
Response message
Retransmit
Request message
Retransmit
Request message
Timeout
Timeout
Timeout
Lost
Lost
33. Idempotency and Handling of Duplicate Request Messages
• Idempotency means repeatability
• An idempotent operation produces the same results
without any side effects
• Example for idempotent routine GetSqrt(64) produces
the same value always 8.
• Operations which do not produce same results when
executed repeatedly with same arguments are
nonidempotent
• If the execution of the request is nonidempotent, then its
repeated execution will destroy the consistency of
information
• Such “orphan” executions must be avoided
• This orphan phenomenon use the exactly-once
semantics, which ensures only one execution is
performed by server
• It is difficult to implement
• Example of non idempotent execution
35. • Implementation of exactly-once semantics is to use a
unique identifier for every request
• The client set up a reply cache in the kernels address
space on the server machine to cache replies
• Before forwarding a request to a server for
processing
Server checks to see if a reply already exists in the reply
cache
If yes this is a duplicate request that has been already
processed
Previously computer result is extracted and new
response message sent to the client
Otherwise request is new one
After processing reply is stored along with the result of
processing
36. Client
Server
(balance = 1000)
Send
Request-1 Request-1
Debit(100)
Check reply cache for request-1
response
(success, 900)
Return(success, 900)
Lost
Send
Request-1 Retransmit request -1
Debit(100)
Return(success, 900)response
(success, 900)Receive
balance=900)
Timeout
Request
identifier
Reply to
Be sent
Request-1 (success, 900)
No match found,
so process request-1
Save reply
Check reply cache for request-1
Match found
Extract reply
37. Keeping Track of Lost and Out-of-Sequence Packets in
Multigram Messages
• Message transmission is complete only all the
packets of the message have been received
• Simple way to achieve is stop-and-wait protocol
• Separate acknowledgement leads to communication
overhead
• Improve performance, better approach is to use a
single acknowledgement packet for all the packets
using blast protocol
• When this approach used it leads to the following
problem due to node crash or link failure
One or more packets of the multidatagram message are
lost in communication
The packets are received out of sequence by the
receiver
38. • An efficient mechanism is to use a bitmap
identify the packets of a message
• Header part contains two extra fields
One of which specifies total number of packets
Bitmap filed the specifies the position of this packet
• Receiving process set the buffer size according
to the first field
• Packets stored in the corresponding buffer area
• After timeout, if all packet not received the bit
map indicating unreceived packet send to
sender
• This methods uses selective repeat protocol
39. sender Receiver
Send request message
Timeout(5, 00001)
(5, 00010)
(5, 00100)
(5, 01000)
(5, 10000)
First of 5 packets
second of 5 packets
Third of 5 packets
Fourth of 5 packets
Fifth of 5 packets
(5, 01001)
Missing packet info
(5, 00001)
First of 5 packets
(5, 01000)
Fourth of 5 packets
(5, 00000)
Acknowledgement
Send acknowledgement
Place this packet in position 4
Place this packet in position 1
Place this packet in position 5
Place this packet in position 3
Place this packet in position 2
Retransmit request for missing packets
Create buffer for 5 packets
1
2
3
4
5
Packets of
The response
message
Resend
missing
packets