SlideShare a Scribd company logo
Communication in
Distributed Systems
CS4262 Distributed Systems
Dilum Bandara
Dilum.Bandara@uom.lk
Some slides extracted from Dr. Srinath Perera & Dr. Rajkumar Buyya’s
Presentation Deck
Outline
 Network Programming
 Remote Procedure Calls
 Remote Method Invocation
 Message Oriented Communication
2
Network Programming
 Communication is typically over IP
 HPC Clusters may use Infiniband or Myrinet
 Unicast, multicast, anycast, broadcast
 Only unicast is globally routable
 2 main approaches
 TCP – connection oriented
 UDP – connection less
 Lot more popular than you think!
3
End-to-End Communication
4Source: Communication Networks by
Alberto Leon-Garcia (Author), Indra Widjaja, 2000
TCP Socket Calls
5
Source: Communication Networks by Alberto Leon-
Garcia (Author), Indra Widjaja, 2000
UDP Socket Calls
6
• No “handshake”
• No simultaneous close
• No fork() for concurrent servers
Source: Communication
Networks by Alberto Leon-
Garcia (Author), Indra Widjaja,
2000
Messages
 Used to convey data among nodes
 Has a limited size
 Typically has a header
 Multiple messages may be send through same
connection
 Identify message boundaries based on size, unique
symbol patterns, etc.
 Messages can be clear text, binary, XML, JSON,
etc.
7
Communication in Distributed Systems
– History
 Started with RPC
 Went to distributed objects
 Come back to RPC + Message Oriented
Communication
8
Remote Procedure Calls (RPCs)
 Extend local procedure calls to work across computers
 Call a procedure on a remote machine “just” as you would on
local machine
 Send the call as a message & get response/fault as a
message
9
Source: http://pubs.opengroup.org/onlinepubs/9629399/chap6.htm
RPC in Action…
10Source: Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007
RPC – Steps
1. Client procedure calls client stub in normal way
2. Client stub builds message, calls Middleware
3. Middleware sends message to remote Middleware
4. Remote Middleware gives message to server Skeleton
5. Server stub unpacks parameters, calls local
implementation
6. Local implementation does work, returns result to
Skeleton
7. Skeleton packs it in message, calls local Middleware
8. Server's Middleware sends message to client's
Middleware
9. Client's Middleware gives message to client stub
10. Stub unpacks result, returns to client 11
RPCs
 Introduced by Birrell & Nelson in 1984
 Pre-RPC – Most applications were built directly over Internet
primitives
 Initial idea – Mask distributed computing system using a
“transparent” abstraction
 Looks like normal procedure call
 Hides all aspects of distributed interaction
 Supports an easy programming model
 Today, RPC is the core of many distributed systems,
e.g., Web Services
 But now acknowledge other aspects like failures &
asynchronous nature, communication latency more
12
RPCs (Cont.)
13
Source - wikipedia.org
Message Exchange Patterns
 With local calls, you call, & wait for response
 But with RPC, there are other possibilities
 Send/Receive
 Send Only (Fire & Forget)
 Send with Ack (Send Robust)
 There are 2 models for client API
 Polling
 Callback
14
RPC Concerns
 How to make RPC similar to a local procedure
call?
 Communications
 Location transparency
 Parameter passing
 Heterogeneity
 OS, arch., language
 Failures
 Failure transparency
 Stubs
15
Source: http://technet.microsoft.com/en-
us/library/cc738291%28v=ws.10%29.aspx
Data in Messages
 Data is “marshalled (encoded)” into a message &
“demarshalled (decoded)” from it
 Data structures
 Flattened on transmission
 Rebuilt upon reception
 Data types
 Base types – Ints, floats
 Flat types – structures, arrays
 Complex types – pointers
 With Web services we convert them to XML
 Issues
 Big-endian vs. little-endian, strings may require padding,
alignment (16/32/64-bits), Floating point representations 16
Asynchronous & Deferred
Synchronous RPC
17
Source: Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007
Directory Service
 Directory service or a UUDI registry
 UDDI - Universal Description, Discovery & Integration
18
Source: Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007
RPC – What Can Go Wrong?
 Failures
 Network failure
 Client failure
 Server failure
 Assuming only network idiosyncrasies for now…
 Ignoring possibility of process & machine crashes
 …Need to overcome
 Limited levels of message loss
 Message disorder/reorder
 Message duplication
19
Overcoming Only Communication
Failures
 Each message carry
 Unique sequence number
 Timestamp from a global clock (in most RPC protocols)
 Global clock assumed to return roughly same value throughout
network, up to clock synchronization limits
 Enables server to detect & discard
 Very old messages
 Duplicate copies
 RPCs use acknowledgements
 If timeout with no ack  resend packet
 Leads to the issue of replayed requests
20
Overcoming Lost Packets
21
Client Server
Time out
Sends request
Retransmit
Ack for request
Reply
Ack for reply
Overcoming Lost Packets (Cont.)
 Acks are expensive
 Retransmissions are costly
 For big messages, send
packets in bursts & Ack a
burst at a time
22
Machines Could Fail Too…
 What does a failed request mean?
 Network failure, machine failure or both!
 If a process fails, but machine remains
operational, OS will provide sufficient status
information to accurately determine “process
failure”
 Client that issued request would not know, if
server processed the request or not
23
RPC  RMI Evolution
 By expanding RPCs to invocation on remote
objects
 Object-oriented equivalent of RPC
 Distribution transparency is enhanced
 Separation between interfaces & objects
implementing these interfaces is crucial for
distributed systems
 State of remote objects is not distributed
 Only interfaces implemented by the object are
distributed (available on other machines)
24
RMI in Action
25
RMI in Action (Cont.)
26
Source: Introduction to Java Programming, Comprehensive Version (7th Edition) by Y. Daniel Liang
RMI in Action (Cont.)
 Client binds to a distributed object residing at a server
machine
 An implementation of object’s interface, called a proxy, is
loaded to the client’s address space
 Proxy – Analogous to a client stub in RPC
 Marshals message invocations into messages – object
serialization
 Unmarshals reply messages to return method invocation result to
client
 On server side
 Incoming invocation requests are passed to a server stub, called a
skeleton
 Unmarshals invocation request into proper method invocations
 Marshals replies & forwards reply messages to client side proxy27
Remote Objects & Remote Interfaces
 RMI is interface-oriented
 Remote interface implemented by remote object
 Only methods specified by remote interfaces can be
accessed via RMI
 A remote object may implement several sets of
remote interfaces simultaneously
28Source: Introduction to Java Programming,
Comprehensive Version (7th Edition) by Y. Daniel Liang
Remote Exceptions
 If a remote method throws an exception
 Remote side
 Catch all uncaught exceptions thrown from remote methods
 Find the caller
 Map to network request
 Client side
 Keep listening
 Any time an exception could be sent from a remote side
 Unmarshall network requests to exception objects
 Re-throw remote exception objects locally, as if exception
was thrown from current method
29
Remote Exceptions (Cont.)
 RMI software itself can also throw exceptions
 Network timeout
 Other system related
 They have accepted those failures & have decided to
expose it
30
Web Services
 RPC like Distributed Communication medium
that supports interoperability
 Not that much different from RMI, RPC, etc.,
except interoperability & lack of distributed
objects
 Use XML to communicate
 Request messages, description, & discovery all use
standard XML based formats
31
Web Services (Cont.)
 Publish, find, & use
32
UDDI – Universal Description,
Discovery & Integration
Web Services (Cont.)
 Are described using WSDL
 Web Service Description Language standard
 Published & found through a UUDI registry
 Invoked through SOAP standard
 XML based protocol for accessing Web Services
 Can transmit through any transport
 HTTP most common
 SMTP, JMS, UDP, TCP, VFS are known
33
Web Services Fundamentals
34
Summary
35

More Related Content

What's hot

Naming in Distributed System
Naming in Distributed SystemNaming in Distributed System
Naming in Distributed System
MNM Jain Engineering College
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
Sunita Sahu
 
Distributed deadlock
Distributed deadlockDistributed deadlock
Distributed deadlock
Md. Mahedi Mahfuj
 
Replication in Distributed Systems
Replication in Distributed SystemsReplication in Distributed Systems
Replication in Distributed Systems
Kavya Barnadhya Hazarika
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systems
Rupsee
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure call
Sunita Sahu
 
Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance
SHIKHA GAUTAM
 
Peer to peer system
Peer to peer systemPeer to peer system
Peer to peer system
Jahanzaib Niazi
 
Design Goals of Distributed System
Design Goals of Distributed SystemDesign Goals of Distributed System
Design Goals of Distributed System
Ashish KC
 
Naming in Distributed Systems
Naming in Distributed SystemsNaming in Distributed Systems
Naming in Distributed Systems
Nandakumar P
 
Synchronization in distributed systems
Synchronization in distributed systems Synchronization in distributed systems
Synchronization in distributed systems
SHATHAN
 
Clock Synchronization (Distributed computing)
Clock Synchronization (Distributed computing)Clock Synchronization (Distributed computing)
Clock Synchronization (Distributed computing)
Sri Prasanna
 
Distributed Coordination-Based Systems
Distributed Coordination-Based SystemsDistributed Coordination-Based Systems
Distributed Coordination-Based Systems
Ahmed Magdy Ezzeldin, MSc.
 
Distributed system Tanenbaum chapter 1,2,3,4 notes
Distributed system Tanenbaum chapter 1,2,3,4 notes Distributed system Tanenbaum chapter 1,2,3,4 notes
Distributed system Tanenbaum chapter 1,2,3,4 notes
SAhammedShakil
 
Synchronization in distributed computing
Synchronization in distributed computingSynchronization in distributed computing
Synchronization in distributed computing
SVijaylakshmi
 
distributed Computing system model
distributed Computing system modeldistributed Computing system model
distributed Computing system model
Harshad Umredkar
 
Peer to Peer services and File systems
Peer to Peer services and File systemsPeer to Peer services and File systems
Peer to Peer services and File systems
MNM Jain Engineering College
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared Memory
SHIKHA GAUTAM
 
Distributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationDistributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communication
MNM Jain Engineering College
 
Publish subscribe model overview
Publish subscribe model overviewPublish subscribe model overview
Publish subscribe model overview
Ishraq Al Fataftah
 

What's hot (20)

Naming in Distributed System
Naming in Distributed SystemNaming in Distributed System
Naming in Distributed System
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
 
Distributed deadlock
Distributed deadlockDistributed deadlock
Distributed deadlock
 
Replication in Distributed Systems
Replication in Distributed SystemsReplication in Distributed Systems
Replication in Distributed Systems
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systems
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure call
 
Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance
 
Peer to peer system
Peer to peer systemPeer to peer system
Peer to peer system
 
Design Goals of Distributed System
Design Goals of Distributed SystemDesign Goals of Distributed System
Design Goals of Distributed System
 
Naming in Distributed Systems
Naming in Distributed SystemsNaming in Distributed Systems
Naming in Distributed Systems
 
Synchronization in distributed systems
Synchronization in distributed systems Synchronization in distributed systems
Synchronization in distributed systems
 
Clock Synchronization (Distributed computing)
Clock Synchronization (Distributed computing)Clock Synchronization (Distributed computing)
Clock Synchronization (Distributed computing)
 
Distributed Coordination-Based Systems
Distributed Coordination-Based SystemsDistributed Coordination-Based Systems
Distributed Coordination-Based Systems
 
Distributed system Tanenbaum chapter 1,2,3,4 notes
Distributed system Tanenbaum chapter 1,2,3,4 notes Distributed system Tanenbaum chapter 1,2,3,4 notes
Distributed system Tanenbaum chapter 1,2,3,4 notes
 
Synchronization in distributed computing
Synchronization in distributed computingSynchronization in distributed computing
Synchronization in distributed computing
 
distributed Computing system model
distributed Computing system modeldistributed Computing system model
distributed Computing system model
 
Peer to Peer services and File systems
Peer to Peer services and File systemsPeer to Peer services and File systems
Peer to Peer services and File systems
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared Memory
 
Distributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationDistributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communication
 
Publish subscribe model overview
Publish subscribe model overviewPublish subscribe model overview
Publish subscribe model overview
 

Similar to Communication in Distributed Systems

Chapter 2B-Communication.ppt
Chapter 2B-Communication.pptChapter 2B-Communication.ppt
Chapter 2B-Communication.ppt
sirajmohammed35
 
Communication in Distributed System.ppt
Communication in Distributed System.pptCommunication in Distributed System.ppt
Communication in Distributed System.ppt
SELVAVINAYAGAMG
 
CHP-4.pptx
CHP-4.pptxCHP-4.pptx
CHP-4.pptx
FamiDan
 
Internet (i mcom)
Internet (i mcom)Internet (i mcom)
Internet (i mcom)
priya Nithya
 
20CS2021-Distributed Computing module 2
20CS2021-Distributed Computing module 220CS2021-Distributed Computing module 2
20CS2021-Distributed Computing module 2
Kathirvel Ayyaswamy
 
20CS2021 Distributed Computing
20CS2021 Distributed Computing 20CS2021 Distributed Computing
20CS2021 Distributed Computing
Kathirvel Ayyaswamy
 
Lecture9
Lecture9Lecture9
DS-Chapter DDEFR2-Communication_105220.ppt
DS-Chapter DDEFR2-Communication_105220.pptDS-Chapter DDEFR2-Communication_105220.ppt
DS-Chapter DDEFR2-Communication_105220.ppt
menoralemu03
 
18CS3040_Distributed Systems
18CS3040_Distributed Systems18CS3040_Distributed Systems
18CS3040_Distributed Systems
Kathirvel Ayyaswamy
 
18CS3040 Distributed System
18CS3040 Distributed System	18CS3040 Distributed System
18CS3040 Distributed System
Kathirvel Ayyaswamy
 
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGYDistributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
reginamutio48
 
Intrebari si raspunsuri CCNA1
Intrebari si raspunsuri CCNA1Intrebari si raspunsuri CCNA1
Intrebari si raspunsuri CCNA1
Adrian Preda
 
remote method invocation
remote method invocationremote method invocation
remote method invocation
Ravi Theja
 
Client Server Model and Distributed Computing
Client Server Model and Distributed ComputingClient Server Model and Distributed Computing
Client Server Model and Distributed Computing
Abhishek Jaisingh
 
COMMUNICATION IN DISTRIBUTED SYSTEMS
COMMUNICATION IN DISTRIBUTED SYSTEMSCOMMUNICATION IN DISTRIBUTED SYSTEMS
COMMUNICATION IN DISTRIBUTED SYSTEMS
Saji banu
 
Designing Application over mobile environment
Designing Application over mobile environmentDesigning Application over mobile environment
Designing Application over mobile environment
Maulik Patel
 
2.communcation in distributed system
2.communcation in distributed system2.communcation in distributed system
2.communcation in distributed system
Gd Goenka University
 
Introduction to Networks_v0.2
Introduction to Networks_v0.2Introduction to Networks_v0.2
Introduction to Networks_v0.2
Sohail Gohir
 
Iap final
Iap finalIap final
Iap final
GLIM Digital
 
Class-note-data communications-01
Class-note-data communications-01Class-note-data communications-01
Class-note-data communications-01
Md. Abdur Rahim Khan
 

Similar to Communication in Distributed Systems (20)

Chapter 2B-Communication.ppt
Chapter 2B-Communication.pptChapter 2B-Communication.ppt
Chapter 2B-Communication.ppt
 
Communication in Distributed System.ppt
Communication in Distributed System.pptCommunication in Distributed System.ppt
Communication in Distributed System.ppt
 
CHP-4.pptx
CHP-4.pptxCHP-4.pptx
CHP-4.pptx
 
Internet (i mcom)
Internet (i mcom)Internet (i mcom)
Internet (i mcom)
 
20CS2021-Distributed Computing module 2
20CS2021-Distributed Computing module 220CS2021-Distributed Computing module 2
20CS2021-Distributed Computing module 2
 
20CS2021 Distributed Computing
20CS2021 Distributed Computing 20CS2021 Distributed Computing
20CS2021 Distributed Computing
 
Lecture9
Lecture9Lecture9
Lecture9
 
DS-Chapter DDEFR2-Communication_105220.ppt
DS-Chapter DDEFR2-Communication_105220.pptDS-Chapter DDEFR2-Communication_105220.ppt
DS-Chapter DDEFR2-Communication_105220.ppt
 
18CS3040_Distributed Systems
18CS3040_Distributed Systems18CS3040_Distributed Systems
18CS3040_Distributed Systems
 
18CS3040 Distributed System
18CS3040 Distributed System	18CS3040 Distributed System
18CS3040 Distributed System
 
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGYDistributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
 
Intrebari si raspunsuri CCNA1
Intrebari si raspunsuri CCNA1Intrebari si raspunsuri CCNA1
Intrebari si raspunsuri CCNA1
 
remote method invocation
remote method invocationremote method invocation
remote method invocation
 
Client Server Model and Distributed Computing
Client Server Model and Distributed ComputingClient Server Model and Distributed Computing
Client Server Model and Distributed Computing
 
COMMUNICATION IN DISTRIBUTED SYSTEMS
COMMUNICATION IN DISTRIBUTED SYSTEMSCOMMUNICATION IN DISTRIBUTED SYSTEMS
COMMUNICATION IN DISTRIBUTED SYSTEMS
 
Designing Application over mobile environment
Designing Application over mobile environmentDesigning Application over mobile environment
Designing Application over mobile environment
 
2.communcation in distributed system
2.communcation in distributed system2.communcation in distributed system
2.communcation in distributed system
 
Introduction to Networks_v0.2
Introduction to Networks_v0.2Introduction to Networks_v0.2
Introduction to Networks_v0.2
 
Iap final
Iap finalIap final
Iap final
 
Class-note-data communications-01
Class-note-data communications-01Class-note-data communications-01
Class-note-data communications-01
 

More from Dilum Bandara

Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learning
Dilum Bandara
 
Time Series Analysis and Forecasting in Practice
Time Series Analysis and Forecasting in PracticeTime Series Analysis and Forecasting in Practice
Time Series Analysis and Forecasting in Practice
Dilum Bandara
 
Introduction to Dimension Reduction with PCA
Introduction to Dimension Reduction with PCAIntroduction to Dimension Reduction with PCA
Introduction to Dimension Reduction with PCA
Dilum Bandara
 
Introduction to Descriptive & Predictive Analytics
Introduction to Descriptive & Predictive AnalyticsIntroduction to Descriptive & Predictive Analytics
Introduction to Descriptive & Predictive Analytics
Dilum Bandara
 
Introduction to Concurrent Data Structures
Introduction to Concurrent Data StructuresIntroduction to Concurrent Data Structures
Introduction to Concurrent Data Structures
Dilum Bandara
 
Hard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Hard to Paralelize Problems: Matrix-Vector and Matrix-MatrixHard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Hard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Dilum Bandara
 
Introduction to Map-Reduce Programming with Hadoop
Introduction to Map-Reduce Programming with HadoopIntroduction to Map-Reduce Programming with Hadoop
Introduction to Map-Reduce Programming with Hadoop
Dilum Bandara
 
Embarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel ProblemsEmbarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel Problems
Dilum Bandara
 
Introduction to Warehouse-Scale Computers
Introduction to Warehouse-Scale ComputersIntroduction to Warehouse-Scale Computers
Introduction to Warehouse-Scale Computers
Dilum Bandara
 
Introduction to Thread Level Parallelism
Introduction to Thread Level ParallelismIntroduction to Thread Level Parallelism
Introduction to Thread Level Parallelism
Dilum Bandara
 
CPU Memory Hierarchy and Caching Techniques
CPU Memory Hierarchy and Caching TechniquesCPU Memory Hierarchy and Caching Techniques
CPU Memory Hierarchy and Caching Techniques
Dilum Bandara
 
Data-Level Parallelism in Microprocessors
Data-Level Parallelism in MicroprocessorsData-Level Parallelism in Microprocessors
Data-Level Parallelism in Microprocessors
Dilum Bandara
 
Instruction Level Parallelism – Hardware Techniques
Instruction Level Parallelism – Hardware TechniquesInstruction Level Parallelism – Hardware Techniques
Instruction Level Parallelism – Hardware Techniques
Dilum Bandara
 
Instruction Level Parallelism – Compiler Techniques
Instruction Level Parallelism – Compiler TechniquesInstruction Level Parallelism – Compiler Techniques
Instruction Level Parallelism – Compiler Techniques
Dilum Bandara
 
CPU Pipelining and Hazards - An Introduction
CPU Pipelining and Hazards - An IntroductionCPU Pipelining and Hazards - An Introduction
CPU Pipelining and Hazards - An Introduction
Dilum Bandara
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
Dilum Bandara
 
High Performance Networking with Advanced TCP
High Performance Networking with Advanced TCPHigh Performance Networking with Advanced TCP
High Performance Networking with Advanced TCP
Dilum Bandara
 
Introduction to Content Delivery Networks
Introduction to Content Delivery NetworksIntroduction to Content Delivery Networks
Introduction to Content Delivery Networks
Dilum Bandara
 
Peer-to-Peer Networking Systems and Streaming
Peer-to-Peer Networking Systems and StreamingPeer-to-Peer Networking Systems and Streaming
Peer-to-Peer Networking Systems and Streaming
Dilum Bandara
 
Mobile Services
Mobile ServicesMobile Services
Mobile Services
Dilum Bandara
 

More from Dilum Bandara (20)

Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learning
 
Time Series Analysis and Forecasting in Practice
Time Series Analysis and Forecasting in PracticeTime Series Analysis and Forecasting in Practice
Time Series Analysis and Forecasting in Practice
 
Introduction to Dimension Reduction with PCA
Introduction to Dimension Reduction with PCAIntroduction to Dimension Reduction with PCA
Introduction to Dimension Reduction with PCA
 
Introduction to Descriptive & Predictive Analytics
Introduction to Descriptive & Predictive AnalyticsIntroduction to Descriptive & Predictive Analytics
Introduction to Descriptive & Predictive Analytics
 
Introduction to Concurrent Data Structures
Introduction to Concurrent Data StructuresIntroduction to Concurrent Data Structures
Introduction to Concurrent Data Structures
 
Hard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Hard to Paralelize Problems: Matrix-Vector and Matrix-MatrixHard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Hard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
 
Introduction to Map-Reduce Programming with Hadoop
Introduction to Map-Reduce Programming with HadoopIntroduction to Map-Reduce Programming with Hadoop
Introduction to Map-Reduce Programming with Hadoop
 
Embarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel ProblemsEmbarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel Problems
 
Introduction to Warehouse-Scale Computers
Introduction to Warehouse-Scale ComputersIntroduction to Warehouse-Scale Computers
Introduction to Warehouse-Scale Computers
 
Introduction to Thread Level Parallelism
Introduction to Thread Level ParallelismIntroduction to Thread Level Parallelism
Introduction to Thread Level Parallelism
 
CPU Memory Hierarchy and Caching Techniques
CPU Memory Hierarchy and Caching TechniquesCPU Memory Hierarchy and Caching Techniques
CPU Memory Hierarchy and Caching Techniques
 
Data-Level Parallelism in Microprocessors
Data-Level Parallelism in MicroprocessorsData-Level Parallelism in Microprocessors
Data-Level Parallelism in Microprocessors
 
Instruction Level Parallelism – Hardware Techniques
Instruction Level Parallelism – Hardware TechniquesInstruction Level Parallelism – Hardware Techniques
Instruction Level Parallelism – Hardware Techniques
 
Instruction Level Parallelism – Compiler Techniques
Instruction Level Parallelism – Compiler TechniquesInstruction Level Parallelism – Compiler Techniques
Instruction Level Parallelism – Compiler Techniques
 
CPU Pipelining and Hazards - An Introduction
CPU Pipelining and Hazards - An IntroductionCPU Pipelining and Hazards - An Introduction
CPU Pipelining and Hazards - An Introduction
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
High Performance Networking with Advanced TCP
High Performance Networking with Advanced TCPHigh Performance Networking with Advanced TCP
High Performance Networking with Advanced TCP
 
Introduction to Content Delivery Networks
Introduction to Content Delivery NetworksIntroduction to Content Delivery Networks
Introduction to Content Delivery Networks
 
Peer-to-Peer Networking Systems and Streaming
Peer-to-Peer Networking Systems and StreamingPeer-to-Peer Networking Systems and Streaming
Peer-to-Peer Networking Systems and Streaming
 
Mobile Services
Mobile ServicesMobile Services
Mobile Services
 

Recently uploaded

Red Hat Enterprise Linux Administration 9.0 RH124 pdf
Red Hat Enterprise Linux Administration 9.0 RH124 pdfRed Hat Enterprise Linux Administration 9.0 RH124 pdf
Red Hat Enterprise Linux Administration 9.0 RH124 pdf
mdfkobir
 
LOCAL-BUDGET-CIRCULAR-NO-158-DATED-JULY-11-2024.pdf
LOCAL-BUDGET-CIRCULAR-NO-158-DATED-JULY-11-2024.pdfLOCAL-BUDGET-CIRCULAR-NO-158-DATED-JULY-11-2024.pdf
LOCAL-BUDGET-CIRCULAR-NO-158-DATED-JULY-11-2024.pdf
jellyjm
 
20240710 ISSIP GGG Qtrly Community Connection Slides.pptx
20240710 ISSIP GGG Qtrly Community Connection Slides.pptx20240710 ISSIP GGG Qtrly Community Connection Slides.pptx
20240710 ISSIP GGG Qtrly Community Connection Slides.pptx
VaishaliM24
 
High Profile Girls Call Delhi 9711199171 Provide Best And Top Girl Service An...
High Profile Girls Call Delhi 9711199171 Provide Best And Top Girl Service An...High Profile Girls Call Delhi 9711199171 Provide Best And Top Girl Service An...
High Profile Girls Call Delhi 9711199171 Provide Best And Top Girl Service An...
janvikumar4133
 
Chapter 1 Introduction to Software Engineering and Process Models.pdf
Chapter 1 Introduction to Software Engineering and Process Models.pdfChapter 1 Introduction to Software Engineering and Process Models.pdf
Chapter 1 Introduction to Software Engineering and Process Models.pdf
MeghaGupta952452
 
Disaster Management and Mitigation presentation
Disaster Management and Mitigation presentationDisaster Management and Mitigation presentation
Disaster Management and Mitigation presentation
RajaRamannaTarigoppu
 
Technical Seminar of Mca computer vision .ppt
Technical Seminar of Mca computer vision .pptTechnical Seminar of Mca computer vision .ppt
Technical Seminar of Mca computer vision .ppt
AnkitaVerma776806
 
The world of Technology Management MEM 814.pptx
The world of Technology Management MEM 814.pptxThe world of Technology Management MEM 814.pptx
The world of Technology Management MEM 814.pptx
engrasjadshahzad
 
AI chapter1 introduction to artificial intelligence
AI chapter1 introduction to artificial intelligenceAI chapter1 introduction to artificial intelligence
AI chapter1 introduction to artificial intelligence
GeethaAL
 
UNIT 1 - INTRODUCTION ON DISASTER MANAGEMENT.ppt
UNIT 1 - INTRODUCTION ON DISASTER MANAGEMENT.pptUNIT 1 - INTRODUCTION ON DISASTER MANAGEMENT.ppt
UNIT 1 - INTRODUCTION ON DISASTER MANAGEMENT.ppt
shanmugamram247
 
Indian Railway Signalling concepts and basics.pdf
Indian Railway Signalling concepts and basics.pdfIndian Railway Signalling concepts and basics.pdf
Indian Railway Signalling concepts and basics.pdf
princeshah76
 
OME754 – INDUSTRIAL SAFETY - unit notes.pptx
OME754 – INDUSTRIAL SAFETY - unit notes.pptxOME754 – INDUSTRIAL SAFETY - unit notes.pptx
OME754 – INDUSTRIAL SAFETY - unit notes.pptx
shanmugamram247
 
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
John Gallagher
 
Cisco Intersight Technical OverView.pptx
Cisco Intersight Technical OverView.pptxCisco Intersight Technical OverView.pptx
Cisco Intersight Technical OverView.pptx
Duy Nguyen
 
How to Formulate A Good Research Question
How to Formulate A  Good Research QuestionHow to Formulate A  Good Research Question
How to Formulate A Good Research Question
rkpv2002
 
RMC FPV.docx_fpv solar energy panels----
RMC FPV.docx_fpv solar energy panels----RMC FPV.docx_fpv solar energy panels----
RMC FPV.docx_fpv solar energy panels----
Khader Mallah
 
charting the development of the autonomous train
charting the development of the autonomous traincharting the development of the autonomous train
charting the development of the autonomous train
huseindihon
 
Girls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in City
Girls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in CityGirls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in City
Girls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in City
rawankhanlove256
 
AI INTRODUCTION Artificial intelligence.ppt
AI INTRODUCTION Artificial intelligence.pptAI INTRODUCTION Artificial intelligence.ppt
AI INTRODUCTION Artificial intelligence.ppt
GeethaAL
 
Updated Limitations of Simplified Methods for Evaluating the Potential for Li...
Updated Limitations of Simplified Methods for Evaluating the Potential for Li...Updated Limitations of Simplified Methods for Evaluating the Potential for Li...
Updated Limitations of Simplified Methods for Evaluating the Potential for Li...
Robert Pyke
 

Recently uploaded (20)

Red Hat Enterprise Linux Administration 9.0 RH124 pdf
Red Hat Enterprise Linux Administration 9.0 RH124 pdfRed Hat Enterprise Linux Administration 9.0 RH124 pdf
Red Hat Enterprise Linux Administration 9.0 RH124 pdf
 
LOCAL-BUDGET-CIRCULAR-NO-158-DATED-JULY-11-2024.pdf
LOCAL-BUDGET-CIRCULAR-NO-158-DATED-JULY-11-2024.pdfLOCAL-BUDGET-CIRCULAR-NO-158-DATED-JULY-11-2024.pdf
LOCAL-BUDGET-CIRCULAR-NO-158-DATED-JULY-11-2024.pdf
 
20240710 ISSIP GGG Qtrly Community Connection Slides.pptx
20240710 ISSIP GGG Qtrly Community Connection Slides.pptx20240710 ISSIP GGG Qtrly Community Connection Slides.pptx
20240710 ISSIP GGG Qtrly Community Connection Slides.pptx
 
High Profile Girls Call Delhi 9711199171 Provide Best And Top Girl Service An...
High Profile Girls Call Delhi 9711199171 Provide Best And Top Girl Service An...High Profile Girls Call Delhi 9711199171 Provide Best And Top Girl Service An...
High Profile Girls Call Delhi 9711199171 Provide Best And Top Girl Service An...
 
Chapter 1 Introduction to Software Engineering and Process Models.pdf
Chapter 1 Introduction to Software Engineering and Process Models.pdfChapter 1 Introduction to Software Engineering and Process Models.pdf
Chapter 1 Introduction to Software Engineering and Process Models.pdf
 
Disaster Management and Mitigation presentation
Disaster Management and Mitigation presentationDisaster Management and Mitigation presentation
Disaster Management and Mitigation presentation
 
Technical Seminar of Mca computer vision .ppt
Technical Seminar of Mca computer vision .pptTechnical Seminar of Mca computer vision .ppt
Technical Seminar of Mca computer vision .ppt
 
The world of Technology Management MEM 814.pptx
The world of Technology Management MEM 814.pptxThe world of Technology Management MEM 814.pptx
The world of Technology Management MEM 814.pptx
 
AI chapter1 introduction to artificial intelligence
AI chapter1 introduction to artificial intelligenceAI chapter1 introduction to artificial intelligence
AI chapter1 introduction to artificial intelligence
 
UNIT 1 - INTRODUCTION ON DISASTER MANAGEMENT.ppt
UNIT 1 - INTRODUCTION ON DISASTER MANAGEMENT.pptUNIT 1 - INTRODUCTION ON DISASTER MANAGEMENT.ppt
UNIT 1 - INTRODUCTION ON DISASTER MANAGEMENT.ppt
 
Indian Railway Signalling concepts and basics.pdf
Indian Railway Signalling concepts and basics.pdfIndian Railway Signalling concepts and basics.pdf
Indian Railway Signalling concepts and basics.pdf
 
OME754 – INDUSTRIAL SAFETY - unit notes.pptx
OME754 – INDUSTRIAL SAFETY - unit notes.pptxOME754 – INDUSTRIAL SAFETY - unit notes.pptx
OME754 – INDUSTRIAL SAFETY - unit notes.pptx
 
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
 
Cisco Intersight Technical OverView.pptx
Cisco Intersight Technical OverView.pptxCisco Intersight Technical OverView.pptx
Cisco Intersight Technical OverView.pptx
 
How to Formulate A Good Research Question
How to Formulate A  Good Research QuestionHow to Formulate A  Good Research Question
How to Formulate A Good Research Question
 
RMC FPV.docx_fpv solar energy panels----
RMC FPV.docx_fpv solar energy panels----RMC FPV.docx_fpv solar energy panels----
RMC FPV.docx_fpv solar energy panels----
 
charting the development of the autonomous train
charting the development of the autonomous traincharting the development of the autonomous train
charting the development of the autonomous train
 
Girls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in City
Girls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in CityGirls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in City
Girls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in City
 
AI INTRODUCTION Artificial intelligence.ppt
AI INTRODUCTION Artificial intelligence.pptAI INTRODUCTION Artificial intelligence.ppt
AI INTRODUCTION Artificial intelligence.ppt
 
Updated Limitations of Simplified Methods for Evaluating the Potential for Li...
Updated Limitations of Simplified Methods for Evaluating the Potential for Li...Updated Limitations of Simplified Methods for Evaluating the Potential for Li...
Updated Limitations of Simplified Methods for Evaluating the Potential for Li...
 

Communication in Distributed Systems

  • 1. Communication in Distributed Systems CS4262 Distributed Systems Dilum Bandara Dilum.Bandara@uom.lk Some slides extracted from Dr. Srinath Perera & Dr. Rajkumar Buyya’s Presentation Deck
  • 2. Outline  Network Programming  Remote Procedure Calls  Remote Method Invocation  Message Oriented Communication 2
  • 3. Network Programming  Communication is typically over IP  HPC Clusters may use Infiniband or Myrinet  Unicast, multicast, anycast, broadcast  Only unicast is globally routable  2 main approaches  TCP – connection oriented  UDP – connection less  Lot more popular than you think! 3
  • 4. End-to-End Communication 4Source: Communication Networks by Alberto Leon-Garcia (Author), Indra Widjaja, 2000
  • 5. TCP Socket Calls 5 Source: Communication Networks by Alberto Leon- Garcia (Author), Indra Widjaja, 2000
  • 6. UDP Socket Calls 6 • No “handshake” • No simultaneous close • No fork() for concurrent servers Source: Communication Networks by Alberto Leon- Garcia (Author), Indra Widjaja, 2000
  • 7. Messages  Used to convey data among nodes  Has a limited size  Typically has a header  Multiple messages may be send through same connection  Identify message boundaries based on size, unique symbol patterns, etc.  Messages can be clear text, binary, XML, JSON, etc. 7
  • 8. Communication in Distributed Systems – History  Started with RPC  Went to distributed objects  Come back to RPC + Message Oriented Communication 8
  • 9. Remote Procedure Calls (RPCs)  Extend local procedure calls to work across computers  Call a procedure on a remote machine “just” as you would on local machine  Send the call as a message & get response/fault as a message 9 Source: http://pubs.opengroup.org/onlinepubs/9629399/chap6.htm
  • 10. RPC in Action… 10Source: Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007
  • 11. RPC – Steps 1. Client procedure calls client stub in normal way 2. Client stub builds message, calls Middleware 3. Middleware sends message to remote Middleware 4. Remote Middleware gives message to server Skeleton 5. Server stub unpacks parameters, calls local implementation 6. Local implementation does work, returns result to Skeleton 7. Skeleton packs it in message, calls local Middleware 8. Server's Middleware sends message to client's Middleware 9. Client's Middleware gives message to client stub 10. Stub unpacks result, returns to client 11
  • 12. RPCs  Introduced by Birrell & Nelson in 1984  Pre-RPC – Most applications were built directly over Internet primitives  Initial idea – Mask distributed computing system using a “transparent” abstraction  Looks like normal procedure call  Hides all aspects of distributed interaction  Supports an easy programming model  Today, RPC is the core of many distributed systems, e.g., Web Services  But now acknowledge other aspects like failures & asynchronous nature, communication latency more 12
  • 13. RPCs (Cont.) 13 Source - wikipedia.org
  • 14. Message Exchange Patterns  With local calls, you call, & wait for response  But with RPC, there are other possibilities  Send/Receive  Send Only (Fire & Forget)  Send with Ack (Send Robust)  There are 2 models for client API  Polling  Callback 14
  • 15. RPC Concerns  How to make RPC similar to a local procedure call?  Communications  Location transparency  Parameter passing  Heterogeneity  OS, arch., language  Failures  Failure transparency  Stubs 15 Source: http://technet.microsoft.com/en- us/library/cc738291%28v=ws.10%29.aspx
  • 16. Data in Messages  Data is “marshalled (encoded)” into a message & “demarshalled (decoded)” from it  Data structures  Flattened on transmission  Rebuilt upon reception  Data types  Base types – Ints, floats  Flat types – structures, arrays  Complex types – pointers  With Web services we convert them to XML  Issues  Big-endian vs. little-endian, strings may require padding, alignment (16/32/64-bits), Floating point representations 16
  • 17. Asynchronous & Deferred Synchronous RPC 17 Source: Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007
  • 18. Directory Service  Directory service or a UUDI registry  UDDI - Universal Description, Discovery & Integration 18 Source: Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007
  • 19. RPC – What Can Go Wrong?  Failures  Network failure  Client failure  Server failure  Assuming only network idiosyncrasies for now…  Ignoring possibility of process & machine crashes  …Need to overcome  Limited levels of message loss  Message disorder/reorder  Message duplication 19
  • 20. Overcoming Only Communication Failures  Each message carry  Unique sequence number  Timestamp from a global clock (in most RPC protocols)  Global clock assumed to return roughly same value throughout network, up to clock synchronization limits  Enables server to detect & discard  Very old messages  Duplicate copies  RPCs use acknowledgements  If timeout with no ack  resend packet  Leads to the issue of replayed requests 20
  • 21. Overcoming Lost Packets 21 Client Server Time out Sends request Retransmit Ack for request Reply Ack for reply
  • 22. Overcoming Lost Packets (Cont.)  Acks are expensive  Retransmissions are costly  For big messages, send packets in bursts & Ack a burst at a time 22
  • 23. Machines Could Fail Too…  What does a failed request mean?  Network failure, machine failure or both!  If a process fails, but machine remains operational, OS will provide sufficient status information to accurately determine “process failure”  Client that issued request would not know, if server processed the request or not 23
  • 24. RPC  RMI Evolution  By expanding RPCs to invocation on remote objects  Object-oriented equivalent of RPC  Distribution transparency is enhanced  Separation between interfaces & objects implementing these interfaces is crucial for distributed systems  State of remote objects is not distributed  Only interfaces implemented by the object are distributed (available on other machines) 24
  • 26. RMI in Action (Cont.) 26 Source: Introduction to Java Programming, Comprehensive Version (7th Edition) by Y. Daniel Liang
  • 27. RMI in Action (Cont.)  Client binds to a distributed object residing at a server machine  An implementation of object’s interface, called a proxy, is loaded to the client’s address space  Proxy – Analogous to a client stub in RPC  Marshals message invocations into messages – object serialization  Unmarshals reply messages to return method invocation result to client  On server side  Incoming invocation requests are passed to a server stub, called a skeleton  Unmarshals invocation request into proper method invocations  Marshals replies & forwards reply messages to client side proxy27
  • 28. Remote Objects & Remote Interfaces  RMI is interface-oriented  Remote interface implemented by remote object  Only methods specified by remote interfaces can be accessed via RMI  A remote object may implement several sets of remote interfaces simultaneously 28Source: Introduction to Java Programming, Comprehensive Version (7th Edition) by Y. Daniel Liang
  • 29. Remote Exceptions  If a remote method throws an exception  Remote side  Catch all uncaught exceptions thrown from remote methods  Find the caller  Map to network request  Client side  Keep listening  Any time an exception could be sent from a remote side  Unmarshall network requests to exception objects  Re-throw remote exception objects locally, as if exception was thrown from current method 29
  • 30. Remote Exceptions (Cont.)  RMI software itself can also throw exceptions  Network timeout  Other system related  They have accepted those failures & have decided to expose it 30
  • 31. Web Services  RPC like Distributed Communication medium that supports interoperability  Not that much different from RMI, RPC, etc., except interoperability & lack of distributed objects  Use XML to communicate  Request messages, description, & discovery all use standard XML based formats 31
  • 32. Web Services (Cont.)  Publish, find, & use 32 UDDI – Universal Description, Discovery & Integration
  • 33. Web Services (Cont.)  Are described using WSDL  Web Service Description Language standard  Published & found through a UUDI registry  Invoked through SOAP standard  XML based protocol for accessing Web Services  Can transmit through any transport  HTTP most common  SMTP, JMS, UDP, TCP, VFS are known 33

Editor's Notes

  1. Big-endian vs. little-endian - http://h71000.www7.hp.com/doc/82final/6443/zk-6654a.gif
  2. DCE RPC is a facility for calling a procedure on a remote machine as if it were a local procedure call
  3. UDDI a platform-independent, XML-based registry by which businesses worldwide can list themselves on the Internet, and a mechanism to register and locate web service applications.
  4. JMS – Java Message Service VFS – Virtual File System