Distributed Systems Middleware Prof Nalini Venkatasubramanian Dept of
Distributed Systems Middleware Prof. Nalini Venkatasubramanian Dept. of Information & Computer Science University of California, Irvine 1
ICS 243 F - Distributed Systems Middleware Lecture 1 - Introduction to Distributed Systems Middleware Mondays, Wednesdays 3: 30 -5: 00 p. m. Prof. Nalini Venkatasubramanian nalini@ics. uci. edu Intro to Distributed Systems Middleware 2
Course logistics and details z Course Web page yhttp: //www. ics. uci. edu/~ics 243 f z Lectures - MW 3: 30 -4: 50 p. m, z ICS 280 Reading List x. Technical papers and reports x. Reference Books Intro to Distributed Systems Middleware 3
Course logistics and details z Homeworks y. Paper summaries y. Survey paper z Course Presentation z Course Project y. Maybe done individually, in groups of 2 or 3(max) y. Potential projects on webpage Intro to Distributed Systems Middleware 4
ICS 243 F Grading Policy z Homeworks - 30% • 1 paper summary due every week • (3 randomly selected each worth 10% of the final grade). - z Project Survey Paper - 10% z Class Presentation - 10% z Class Project - 50% of the final grade z Final assignment of grades will be based on a curve. Intro to Distributed Systems Middleware 5
Lecture Schedule y. Weeks 1 and 2: x. Middleware and Distributed Computing Fundamentals x. Fundamentals of Concurrency x. General Purpose Middleware - Technical challenges x. Adaptive Computing y. Weeks 3 and 4: Distributed Systems Management x. Distributed Operating Systems x. Messaging and Communication in Distributed Systems x. Naming and Directory Services x. Distributed I/O and Storage Subsystems x. Distributed Resource Management y. Week 5 and 6: Distributed Object Models x. Concurrent Objects – Actors, Infospheres x. Common Object Services x. Synchronization with Distributed Objects x. Composing Distributed Objects Intro to Distributed Systems Middleware 6
Course Schedule y. Weeks 7 and 8: Middleware Frameworks - Case Studies x. DCE x. CORBA, RT-CORBA x. Jini x. Espeak, XML based middleware y. Weeks 9 and 10: Middleware for Distributed Application Environments x. Qo. S-enabled middleware x. Fault tolerant applications x. Secure applications x. Transaction Based applications x. Ubiquitous and Mobile Environments Intro to Distributed Systems Middleware 7
Introduction z Distributed Systems y. Multiple independent computers that appear as one y. Lamport’s Definition x“ You know you have one when the crash of a computer you have never heard of stops you from getting any work done. ” y“A number of interconnected autonomous computers that provide services to meet the information processing needs of modern enterprises. ” Intro to Distributed Systems Middleware 8
Characterizing Distributed Systems z Multiple Computers yeach consisting of CPU’s, local memory, stable storage, I/O paths connecting to the environment z Interconnections ysome I/O paths interconnect computers that talk to each other z Shared State ysystems cooperate to maintain shared state ymaintaining global invariants requires correct and coordinated operation of multiple computers. Intro to Distributed Systems Middleware 9
Examples of Distributed Systems z Banking systems z Communication - email z Distributed information systems y. WWW y. Federated Databases z Manufacturing and process control z Inventory systems z General purpose (university, office automation) Intro to Distributed Systems Middleware 10
Why Distributed Computing? z Inherent distribution y. Bridge customers, suppliers, and companies at different sites. z Speedup - improved performance z Fault tolerance z Resource Sharing y. Exploitation of special hardware z Scalability z Flexibility Intro to Distributed Systems Middleware 11
Why are Distributed Systems Hard? z Scale ynumeric, geographic, administrative z Loss of control over parts of the system z Unreliability of message passing yunreliable communication, insecure communication, costly communication z Failure y. Parts of the system are down or inaccessible y. Independent failure is desirable Intro to Distributed Systems Middleware 12
Design goals of a distributed system z Sharing y. HW, SW, services, applications z Openness(extensibility) yuse of standard interfaces, advertise services, microkernels z Concurrency ycompete vs. cooperate z Scalability yavoids centralization z Fault tolerance/availability z Transparency ylocation, migration, replication, failure, concurrency Intro to Distributed Systems Middleware 13
• Personalized Environment • Predictable Response • Location Independence • Platform Independence • Flexibility • Code Reusability • Real-Time Access • Increased • Interoperability to information Complexity • Portability • Lack of Mgmt. • Scalability • Reduced Tools • Faster Developmt. Complexity And deployment of • Changing Business Solutions Technology ORGANIZATION Intro to Distributed Systems Middleware System Administrator Application Developer END-USER [Khanna 94] 14
Classifying Distributed Systems z Based on degree of synchrony y. Synchronous y. Asynchronous z Based on communication medium y. Message Passing y. Shared Memory z Fault model y. Crash failures y. Byzantine failures Intro to Distributed Systems Middleware 15
Computation in distributed systems z Asynchronous system y no assumptions about process execution speeds and message delivery delays z Synchronous system y make assumptions about relative speeds of processes and delays associated with communication channels y constrains implementation of processes and communication z Models of concurrency y Communicating sequential processes y Functions, Logical clauses y Passive Objects y Active objects, Agents Intro to Distributed Systems Middleware 16
Concurrency issues z Consider the requirements of transaction based systems y. Atomicity - either all effects take place or none y. Consistency - correctness of data y. Isolated - as if there were one serial database y. Durable - effects are not lost z General correctness of distributed computation y. Safety y. Liveness Intro to Distributed Systems Middleware 17
Communication in Distributed Systems z Provide support for entities to communicate among themselves y. Centralized (traditional) OS’s - local communication support y. Distributed systems - communication across machine boundaries (WAN, LAN). z 2 paradigms y. Message Passing x. Processes communicate by sharing messages y. Distributed Shared Memory (DSM) x. Communication through a virtual shared memory. Intro to Distributed Systems Middleware 18
Message Passing y. Basic communication primitives x. Send message x. Receive message y. Modes of communication x. Synchronous • atomic action requiring the participation of the sender and receiver. • Blocking send: blocks until message is transmitted out of the system send queue • Blocking receive: blocks until message arrives in receive queue x. Asynchronous • Non-blocking send: sending process continues after message is sent • Blocking or non-blocking receive: Blocking receive implemented by timeout or threads. Non-blocking receive proceeds while waiting for message. Message is Intro to Distributed queued(BUFFERED) upon. Systems arrival. Middleware 19
Reliability issues z Unreliable communication y. Best effort, No ACK’s or retransmissions y. Application programmer designs own reliability mechanism z Reliable communication y. Different degrees of reliability y. Processes have some guarantee that messages will be delivered. y. Reliability mechanisms - ACKs, NACKs. Intro to Distributed Systems Middleware 20
Reliability issues z Unreliable communication y. Best effort, No ACK’s or retransmissions y. Application programmer designs own reliability mechanism z Reliable communication y. Different degrees of reliability y. Processes have some guarantee that messages will be delivered. y. Reliability mechanisms - ACKs, NACKs. Intro to Distributed Systems Middleware 21
Distributed Shared Memory z Abstraction used for processes on machines that do not share memory y. Motivated by shared memory multiprocessors that do share memory z Processes read and write from virtual shared memory. y. Primitives - read and write y. OS ensures that all processes see all updates z Caching on local node for efficiency y. Issue - cache consistency Intro to Distributed Systems Middleware 22
Remote Procedure Call z Builds on message passing yextend traditional procedure call to perform transfer of control and data across network y. Easy to use - fits well with the client/server model. y. Helps programmer focus on the application instead of the communication protocol. y. Server is a collection of exported procedures on some shared resource y. Variety of RPC semantics x“maybe call” x“at least once call” to Distributed Systems x“at most once Intro call” Middleware 23
Fault Models in Distributed Systems z Crash failures y. A processor experiences a crash failure when it ceases to operate at some point without any warning. Failure may not be detectable by other processors. x. Failstop - processor fails by halting; detectable by other processors. z Byzantine failures ycompletely unconstrained failures yconservative, worst-case assumption for behavior of hardware and software ycovers the possibility of intelligent (human) intrusion. Intro to Distributed Systems Middleware 24
Other Fault Models in Distributed Systems z Dealing with message loss y. Crash + Link x. Processor fails by halting. Link fails by losing messages but does not delay, duplicate or corrupt messages. y. Receive Omission xprocessor receives only a subset of messages sent to it. y. Send Omission xprocessor fails by transmitting only a subset of the messages it actually attempts to send. y. General Omission x. Receive and/or send omission Intro to Distributed Systems Middleware 25
Other distributed system issues z Concurrency and Synchronization z Distributed Deadlocks z Time in distributed systems z Naming z Replication yimprove availability and performance z Migration yof processes and data z Security yeavesdropping, masquerading, message tampering, replaying Intro to Distributed Systems Middleware 26
Client/Server Computing z Client/server computing allocates application processing between the client and server processes. z A typical application has three basic components: y. Presentation logic y. Application logic y. Data management logic Intro to Distributed Systems Middleware 27
Client/Server Models z There at least three different models for distributing these functions: y. Presentation logic module running on the client system and the other two modules running on one or more servers. y. Presentation logic and application logic modules running on the client system and the data management logic module running on one or more servers. y. Presentation logic and a part of application logic module running on the client system and the other part(s) of the application logic module and data management module running on one or more servers Intro to Distributed Systems Middleware 28
Application Systems: support enterprise systems Distributed Computing Platform • Application Support Services (OS, DB support, Directories, RPC) • Communication Network Services (Network protocols, Physical devices) • Hardware Intro to Distributed Systems Middleware Interoperability Portability Integration Management and Support Network Management Enterprise Systems: Perform enterprise activities 29
Application Systems: User Processing Data files & Interfaces programs Databases Distributed Computing Platform • Application Support Services Dist. Data Distributed C/S Support Trans. Mgmt. OS Interoperability Portability Integration Management and Support Network Management Enterprise Systems: • Engineering systems • Manufacturing • Office systems • Business systems Common Network Services • Network protocols & interconnectivity OSI TCP/IP SNA protocols Intro to Distributed Systems Middleware 30
What is Middleware? z Middleware is the software between the application programs and the operating System and base networking z Middleware provides a comprehensive set of higher-level distributed computing capabilities and a set of interfaces to access the capabilities of the system. Intro to Distributed Systems Middleware 31
Distributed Systems Middleware y. Enables the modular interconnection of distributed software xabstract over low level mechanisms used to implement resource management services. y. Computational Model x. Support separation of concerns and reuse of services y. Customizable, Composable Middleware Frameworks x. Provide for dynamic network and system customizations, dynamic invocation/revocation/installation of services. x. Concurrent execution of multiple distributed systems policies. Intro to Distributed Systems Middleware 32
Modularity in Middleware Services Application Program API Middleware Service 1 API Middleware Service 2 Intro to Distributed Systems Middleware API Middleware Service 3 33
Useful Middleware Services y. Naming and Directory Service y. State Capture Service y. Event Service y. Transaction Service y. Fault Detection Service y. Trading Service y. Replication Service y. Migration Service Intro to Distributed Systems Middleware 34
Types of Middleware Services z Component services y. Provide a specific function to the requestor y. Generally independent of other services y. Presentation, Communication, Control, Information Services, computation services etc. z Integrated Sets z Integration frameworks Intro to Distributed Systems Middleware 35
Integrated Sets Middleware z An Integrated set of services consist of a set of services that take significant advantage of each other. z Example: DCE Intro to Distributed Systems Middleware 36
Distributed Computing Environment (DCE) z DCE is from the Open Software Foundation (OSF), and now X/Open, offers an environment that spans multiple architectures, protocols, and operating systems. y. DCE supported by major software vendors. z It provides key distributed technologies, including RPC, a distributed naming service, time synchronization service, a distributed file system, a network security service, and a threads package. Intro to Distributed Systems Middleware 37
DCE Distributed File Service DCE Security DCE Other Basic Service Distributed Directory Services Time Service Management Applications DCE Remote Procedure Calls DCE Threads Services Operating System Transport Services Intro to Distributed Systems Middleware 38
Integration Frameworks Middleware z Integration frameworks are integration environments that are tailored to the needs of a specific application domain. z Examples y. Workgroup framework - for workgroup computing. y. Transaction Processing monitor frameworks y. Network management frameworks Intro to Distributed Systems Middleware 39
Distributed Object Computing z Combining distributed computing with an object model. y. Allows software reusability y. More abstract level of programming y. The use of a broker like entity that keeps track of processes, provides messaging between processes and other higher level services y. Examples x. CORBA x. JINI x. E-SPEAK Distributed Systems x. Note: DCE uses. Intro a to procedure-oriented distributed Middleware systems model, not an object model. 40
Issues with Distributed Objects y. Abstraction y. Performance y. Latency y. Partial failure y. Synchronization y. Complexity Intro to Distributed Systems Middleware 41
Techniques for object distribution y. Message Passing x. Object knows about network; Network data is minimum y. Argument/Return Passing x. Like RPC. Network data = args + return result + names y. Serializing and Sending Object x. Actual object code is sent. Might require synchronization. Network data = object code + object state + sync info y. Shared Memory xbased on DSM implementation to Distributed Systems x. Network Data Intro = Data touched + synchronization info Middleware 42
CORBA z CORBA is a standard specification for developing object-oriented applications. z CORBA was defined by OMG in 1990. z OMG is dedicated to popularizing Object. Oriented standards for integrating applications based on existing standards. Intro to Distributed Systems Middleware 43
The Object Management Architecture (OMA) Common facilities Application Objects Object Request Broker Object Services Intro to Distributed Systems Middleware 44
OMA z ORB: the communication hub for all objects in the system z Object Services: object events, persistent objects, etc. z Common facilities: accessing databases, printing files, etc. z Application objects: document handling objects. Intro to Distributed Systems Middleware 45
Clock Synchronization in Distributed Systems z Clocks in a distributed system drift: y. Relative to each other x. Logical Clocks are clocks which are synchronized relative to each other. y. Relative to a real world clock x. Determination of this real world clock may be an issue x. Physical clocks are logical clocks that must not deviate from the real-time by more than a certain amount. Intro to Distributed Systems Middleware 46
Synchronizing Logical Clocks z Need to understand the ordering of events z Notion of time is critical z “Happens Before” notion. y. E. g. Concurrency control using timestamps z “Happens Before” notion is not straightforward in distributed systems y. No guarantees of synchronized clocks y. Communication latency Intro to Distributed Systems Middleware 47
Event Ordering z Lamport defined the “happens before” (=>) relation y. If a and b are events in the same process, and a occurs before b, then a => b. y. If a is the event of a message being sent by one process and b is the event of the message being received by another process, then a => b. y. If X =>Y and Y=>Z then X => Z. If a => b then time (a) => time (b) Intro to Distributed Systems Middleware 48
Causal Ordering z “Happened Before” also called causal ordering z Possible to draw a causality relation between 2 events if y. They happen in the same process y. There is a chain of messages between them Intro to Distributed Systems Middleware 49
Logical Clocks z Monotonically increasing counter z No relation with real clock z Each process keeps its own logical clock Cp used to timestamp events Intro to Distributed Systems Middleware 50
Causal Ordering and Logical Clocks z Cp is incremented before each event. y. Cp = Cp + 1 z When p sends a message m, it piggybacks a logical timestamp t = Cp. z When q receives (m, t) it computes: y. Cq = max(Cq, t) before timestamping the message receipt event. z Results in a partial ordering of events. Intro to Distributed Systems Middleware 51
Intro to Distributed Systems Middleware 52
Total Ordering z Extending partial order to total order time Proc_id z Global timestamps: y(Ta, Pa) where Ta is the local timestamp and Pa is the process id. y(Ta, Pa) < (Tb, Pb) iff x(Ta < Tb) or ( (Ta = Tb) and (Pa < Pb)) y. Total order is consistent with partial order. Intro to Distributed Systems Middleware 53
Physical Clocks z How do we measure real time? y 17 th century - Mechanical clocks based on astronomical measurements x. Solar Day - Transit of the sun x. Solar Seconds - Solar Day/(3600*24) y. Problem (1940) - Rotation of the earth varies (gets slower) y. Mean solar second - average over many days Intro to Distributed Systems Middleware 54
Atomic Clocks z 1948 ycounting transitions of a crystal (Cesium 133) used as atomic clock y. TAI - International Atomic Time x 9192631779 transitions = 1 mean solar second in 1948 y. UTC (Universal Coordinated Time) x. From time to time, we skip a solar second to stay in phase with the sun (30+ times since 1958) x. UTC is broadcast by several sources (satellites…) Intro to Distributed Systems Middleware 55
Accuracy of Computer Clocks z Modern timer chips have a relative error of 1/100, 000 - 0. 86 seconds a day z To maintain synchronized clocks y. Can use UTC source (time server) to obtain current notion of time y. Use solutions without UTC. Intro to Distributed Systems Middleware 56
Berkeley UNIX algorithm z One daemon without UTC z Periodically, this daemon polls and asks all the machines for their time z The machines respond. z The daemon computes an average time and then broadcasts this average time. Intro to Distributed Systems Middleware 57
Decentralized Averaging Algorithm z Each machine has a daemon without UTC z Periodically, at fixed agreed-upon times, each machine broadcasts its local time. z Each of them calculates the average time by averaging all the received local times. Intro to Distributed Systems Middleware 58
Clock Synchronization in DCE z DCE’s time model is actually in an interval y. I. e. time in DCE is actually an interval y. Comparing 2 times may yield 3 answers xt 1 < t 2 xt 2 < t 1 xnot determined y. Each machine is either a time server or a clerk y. Periodically a clerk contacts all the time servers on its LAN y. Based on their answers, it computes a new time and gradually converges to it. Intro to Distributed Systems Middleware 59
The Network Time Protocol z Enables clients across the Internet to be synchronized accurately to the UTC y. Overcomes large and variable message delays y. Statistical techniques for filtering can be applied xbased on past behavior of server y. Can survive lengthy losses of connectivity y. Enables frequent synchronization y. Provides protection against interference y. Uses a hierarchy of servers located across the Internet (Primary servers connected to a UTC time source). Intro to Distributed Systems Middleware 60
Intro to Distributed Systems Middleware 61
Time Manager Operations z Logical Clocks y. C. adjust(L, T) xadjust the local time displayed by clock C to T (can be gradually, immediate, per clock sync period) y. C. read xreturns the current value of clock C z Timers y. TP. set(T) - reset the timer to timeout in T units z Messages yreceive(m, l); broadcast(m); forward(m, l) Intro to Distributed Systems Middleware 62
- Slides: 62