Professional Documents
Culture Documents
Distributed System
Collection of independent computers, interconnected via a network, that are capable of collaborating on a task. Computers are considered independent if they do not share the memory or program execution space. Loosely coupled configuration
Distributed Computing
It is computing performed in distributed system. Web based applications are good examples of distributed computing
Network Services.
Email, ftp, telnet etc.
Network applications
Enterprise application such electronic auction etc. as online shopping,
Distributed Computing
Performed among multiple network connected computers, each of having its own processor and resources
Parallel Computing
Another form of distributed computing which uses more than one processor simultaneously to executes a single program
Weaknesses:
Multiple points of failure Security concerns
Prerequisite
Operating System
Process, Process states Concurrent Programming Concurrent processes running on multiple computers
Programming support is needed for communication among processes
Network
Architecture, addressing, protocols etc.
Software Engineering
Procedural Vs. Object Oriented programming Modeling Language like UML
Prerequisite
Architecture of Distributed Applications
Three Layers
Presentation Application Logic Service Layer
Interprocess Communication
Backbone of the Distributed Communication Provides the ability for separate independent processes to communicate among themselves to collaborate on task Two independent processes running on different machines exchanges the data Unicast : One sender, One receiver Multicast : One sender, Multiple receiver IPC in form of API (Application Program Interface) provides abstraction of the details and intricacies of the system level facilities
Receive :
Issued by receiving process to receive the data. Allows the identification of sending process and specified the space to store the data
Disconnect:
Previously created connection is deallocated on both the sides
Example:
Communication between Web-server and
Accept connection Receive (Request) Send (Response) Disconnect
Web-browser
Make connection Send (Request) Receive (Response) Disconnect
Event Synchronization
Major difficulty is that processes runs independently HTTP needs that two sides involved in communication must issue IPC operations in specific order Event synchronization is provided by blocking, suspending the process until operation issued by process has been completed Blocking operations are also called synchronous operations Alternatively, IPC operations may be asynchronous or nonblocking Event synchronization is fundamental to distributed computing Example : Receive issued by web-browser is blocking, while send issued by web-server is non-blocking
Event Synchronization
Four different modes
Synchronous send and synchronous receive
Required when logic of both processes requires that data sent must be received before further processing can start
Process 2
Process 1
Event Synchronization
Asynchronous send and synchronous receive
Appropriate when senders logic does not depend on the receiving of the data at the other end
Process 1
Process 2
Event Synchronization
Synchronous send and asynchronous receive
Causes different scenarios for a protocol session. Depends on IPC implementation. Three scenarios: Data already arrived at the time when receive operation is issued. Immediate delivery Data requested by receive operation has not arrived; no delivery to the process. Receive process can use polling (loop) until data is received Data requested by receive operation has not arrived; When data arrives IPC facility notifies the process2.
Event Synchronization
Process 1 Process 2 Process 1 Process 2 Nonblocking receive issued and returned immediately
Process 1
Process 2 Nonblocking Receive issued And returned immediately Process is Notifed of the arrival of data
Event Synchronization
Asynchronous send and asynchronous receive
Data retained by IPC facility and receiving process is notified or Receiving process may poll for the data
Process 1 Process 2
Nonblocking receive issued and returnd immediately Process is notified of the arrival of the data and the data may now be delivered to it
Care must be taken to avoid the deadlocks, which causes the indefinite suspension
Data Representation
Different languages have different size of data types and different representation When heterogeneous systems are involved, there are three possibilities
Sending process converts to representation of receiving process before sending Receiving process converts the senders representation upon receiving Exchange the data in External Representation
Data Encoding
General purpose distributed application needs platform independent scheme of encoding the data exchanged. Three network data encoding standard exists
External Data Representation (XDR) from sun ANS.1 (Abstract Syntax Notation Number 1) from OSI Supports data tagging Each data is encoded with type,length,value and optinal tag to specify the interpretation XML (Extensible Markup Language) <message> <to>students@da-iict.org</to> <from>mts@ldce.org</from> <subject> Interprocess communication</subject> <text> IPC is backbone of distributed computing </text> </message>
Protocols
Text based protocols
Data exchanged as stream of characters FTP, HTTP, SMTP are text based
Request-Response protocols
One side issues the request and awaits for the response from other side Examples : FTP, HTTP, SMTP
Event diagrams and sequence diagrams are used to document the details of communication
IPC Paradigms
Connection oriented Vs. Connectionless Abstractions:
Level of Abstraction IPC Paradigms Example RPC/RMI Unix Socket API Winsock Serial/parallel communication
Abstraction
Idea of hiding the details or encapsulation We often use abstraction when it is not necessary to know the exact details of how something works or represented, because we can still make use of it in its simplified form. Getting involved with the detail often tends to obscure what we are trying to understand, rather than illuminate it. Abstraction plays very important role in programming because we often want to model, in software, simplified version of things that exist in the real world without having to built the real things.
An Example System
Online Auctioning System System handles only one auctioned item per session. During each auctioning session, an item is open for bids placed by the auction participants. At the end the auctioneer announces the outcome
Sender Receiver
Message queue Message System
Implementation of auction system is same as RMI except that each object must register with ORB Each participant issues requests to the auctioneer object to register for the session and to make bids Example : OMGs CORBA Through the ORB, the auctioneer invokes the methods of each participant to announce the start of the session, to update the bidding status and to announce the end of the session
read
Requestor
read
writ e
Mutual exclusion is inherent as only one participant can access at an object at a time from space JavaSpaces is an example toolkit
Host4
Service Object
Service Requestor
Example system
Auctioneer registers itself with directory service, allowing the participants to locate it and once the session starts , to make the bid Participant provides call back methods to allow auctioneer to announce the start and end of the session and to update the status of the session
message
message
Java multicast API and Java Shared Data ToolKit (JSDT) are message-based SMART board and Microsofts Netmeeting are based on white-board meeting
TradeTrade-offs
Level of abstraction Vs. Overhead
Higher the abstraction, higher the overhead
Scalability
Complexity increases as no. of participants increases High level paradigms, complexity is handled by system
Reference
Distributed Computing : Principals and Applications - M.L. Liu - Pearson Addison-Wesley