SlideShare une entreprise Scribd logo
1  sur  35
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

Contenu connexe

Tendances

remote procedure calls
  remote procedure calls  remote procedure calls
remote procedure calls
Ashish Kumar
 
Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systems
sumitjain2013
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
Ashish Kumar
 

Tendances (20)

Naming in Distributed Systems
Naming in Distributed SystemsNaming in Distributed Systems
Naming in Distributed Systems
 
Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.
 
remote procedure calls
  remote procedure calls  remote procedure calls
remote procedure calls
 
Synchronization in distributed computing
Synchronization in distributed computingSynchronization in distributed computing
Synchronization in distributed computing
 
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
 
File models and file accessing models
File models and file accessing modelsFile models and file accessing models
File models and file accessing models
 
Synchronization in distributed systems
Synchronization in distributed systems Synchronization in distributed systems
Synchronization in distributed systems
 
The medium access sublayer
 The medium  access sublayer The medium  access sublayer
The medium access sublayer
 
Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systems
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
 
Chapter 6-Consistency and Replication.ppt
Chapter 6-Consistency and Replication.pptChapter 6-Consistency and Replication.ppt
Chapter 6-Consistency and Replication.ppt
 
CS6601 DISTRIBUTED SYSTEMS
CS6601 DISTRIBUTED SYSTEMSCS6601 DISTRIBUTED SYSTEMS
CS6601 DISTRIBUTED 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
 
Multiple Access Protocal
Multiple Access ProtocalMultiple Access Protocal
Multiple Access Protocal
 
CS6601 DISTRIBUTED SYSTEMS
CS6601 DISTRIBUTED SYSTEMSCS6601 DISTRIBUTED SYSTEMS
CS6601 DISTRIBUTED SYSTEMS
 
Computer networks - Channelization
Computer networks - ChannelizationComputer networks - Channelization
Computer networks - Channelization
 
Message and Stream Oriented Communication
Message and Stream Oriented CommunicationMessage and Stream Oriented Communication
Message and Stream Oriented Communication
 
Congestion control in TCP
Congestion control in TCPCongestion control in TCP
Congestion control in TCP
 
Distributed dbms architectures
Distributed dbms architecturesDistributed dbms architectures
Distributed dbms architectures
 
Design Goals of Distributed System
Design Goals of Distributed SystemDesign Goals of Distributed System
Design Goals of Distributed System
 

Similaire à Communication in Distributed Systems

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
 
Introduction to Networks_v0.2
Introduction to Networks_v0.2Introduction to Networks_v0.2
Introduction to Networks_v0.2
Sohail Gohir
 

Similaire à 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
 
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
 
Remote procedure calls
Remote procedure callsRemote procedure calls
Remote procedure calls
 

Plus de Dilum Bandara

Plus de 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
 

Dernier

Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Dernier (20)

Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 

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

Notes de l'éditeur

  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