Top Banner
1 O p e r a t i n g S y s t e m s Interface between the hardware and the rest: editors, compilers, database systems, application programs, your programs, etc. • Allows portability, enables easier programming, • The manager of different resources (memory, CPU, disk, printer, etc) in your system • Takes responsibility away from the users, tends to improve metrics (throughput, response time, etc) • 2 types: monolithic: all functions are inside a single kernel (central part of the OS) microkernel-based: non-basic functions float as servers (there is a small kernel for the basic functionality) D i s t r i b u t e d S y s t e m s A distributed system is: A collection of independent computers that appears to its users as a single coherent system. (also, a collection of systems that when one breaks nothing works)
20

Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

Apr 13, 2018

Download

Documents

phamthuy
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

1

Operating Systems

Interface between the hardware and the rest: editors, compilers,

database systems, application programs, your programs, etc.

• Allows portability, enables easier programming,

• The manager of different resources (memory, CPU, disk, printer, etc) in your system

• Takes responsibility away from the users, tends to improve metrics (throughput, response time, etc)

• 2 types:

– monolithic: all functions are inside a single kernel (central part of the OS)

– microkernel-based: non-basic functions float as servers (there is a small kernel for the basic functionality)

Distributed Systems

A distributed system is:

A collection of independent computers that appears to its users

as a single coherent system.

(also, a collection of systems that when one breaks nothing works)

Page 2: Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

2

Distributed Systems

A distributed system organized as middleware. What’s middleware?

Note that the middleware layer extends over multiple machines.

1.1

Issues in Distributed Computing

• Why distribute? What’s bad about centralized?DISTRIBUTION:– allows sharing of data, code, devices, messages, etc– is more flexible (can add more resources, scalable)– is cheaper (several small machines are cheaper than one powerful).

That is, the price/performance ratio is smaller than in centralized– is usually faster (same as above)– can be fault tolerant (if one site fails, not all computations fail)– much, MUCH MORE!!!

• More complex? YES, much more (here is the much more)• More time consuming? (messages need to go back and forth)• Slower response time? (messages, but can parallelizecomps)• What about reliability, security, cost, network, messages,

congestion, load balancing...

Page 3: Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

3

Distributed OS Services

• Global Inter-Process Communication (IPC) primitives, transparent to the users (currently support to client-server computing)

• Global protection schemes, so that a validation at a site needs to be validated at another site (Kerberos)

• Global process management: usual (destroy, create, etc....) + migration, load distribution, so that the user need not manuallylogon to a different machine. The OS takes charge, and executes the program requested by the user in a less-loaded, fastresponding machine (compute server, file server, etc).

• Global process synchronization (supporting different language paradigms for heterogeneity and openness)

• Compatibility among machines (binary, protocol, etc)• Global naming and file system

Distributed OSs

• Transparency attempts to hide the nature of the system from users.– Good, because users usually don’ t need to know details– Degree of transparency is important, too much may be too much

• Performance is usually an issue that needs to be studied for a specific system architecture, application, users, etc.

• Scalability is important in the long run and general use—some applications, systems, users, etc do not need scalability

• Distributed algorithms are also needed, which have the following characteristics:– State information should be distributed to all nodes (how? overhead?)– Decisions are made based on local information (why?)– Fault tolerance (what for?)– No global/synchronized clocks (why?)

Page 4: Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

4

Transparency in a Distributed System

��� ��������� ������ ��������� ����� ��������� ��������� ��� �! ! ��! � �"���� ���#$� � %&����� #'(����) %�� �� �*+���������� ���,� �-� ���-���-�.� ���.�/������� �10� ��� �"� �2%(������

��� ����%3���) �� ! ��� �# ����� ��1� 4��� �#� )� �� ����.��� ���5" �� ! �������� ����%3�� "%6 �� ������������,�7 �������"� �� ������������4��� �! �����#8��%9� %3� 4�� �������: ��� �����(����� ������ ����%3�� "%6 �� ������������,�7 �������"� �� ������������4��� �! �����#8��%9� %3� 4�� �������;.��8�! � �� �%3� ������ ����%3�� "%6 �� ������������,�7 �������7�4 ����%��� �� � %3����<! ���� �%3� ����$��� ! �� ������;.��! ���� %&� ������ ����%3�� "%6 �� ������������,�7 ����7� 4�7%(�, �� �%9� ���6! ���1 "%9� �.�=�� �.� "%9� �.���� ���#$� ��� �# #� ��������� ���,� �$! ���1 "%(��>����� "%9� ������ �����.� ) )���� ��� ������� �#�� �%( �����8�� �������"%( "%9� ���# ���?� ��@ �� ����.��� �1�,� � ������������AB���������

C+DFE�G.HJI K�L1I M6NO�H3P/NFE�KFP/H9DBN.G Q

Degree of Transparency

Observation: Aiming at full distribution transparency may be too much:

• Users may be located in different continents; distribution is apparent and not something you want to hide

• Completely hiding failures of networks and nodes is (theoretically and practically) impossible– You cannot distinguish a slow computer from a failing one– You can never be sure that a server actually performed an operation

before a crash

• Full transparency will cost performance, exposing distribution of the system– Keeping Web caches exactly up-to-date with the master copy– Immediately flushing write operations to disk for fault tolerance

Page 5: Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

5

Scalability

• Three dimensions:– Size: Number of users and/or processes– Geographical: Maximum distance between nodes– Administrative: Number of administrative domains

• Limitations:

RTS/U VFWYX3S/Z.[�U VFWY\F]F^ _F`aS/VcbS/dfe/g _.[3_hU V.i&S/X2dj].[JU S/Vk _BVF[2X3]Bg U l _F`a]Bg WBS/X2U [2m/dj^n@^�U VFW6g _fS/VBo2g U Vp_q[3_Bg _Be/mFS/Vp_h\FS/S/rk _BVF[2X3]Bg U l _F`a`B].[3]n@^�U VFW6g _f^ _BX(s._BXTi3S/Xt]Bg gpZF^ _BX3^k _BVF[2X3]Bg U l _F`a^ _BX�sBU b_F^

uBvTw+xzy+{ |}�~T��� |+y<�

Techniques for Scaling

• Distribution: Partition data and computations across multiple machines:– Move computations to clients (e.g., Java applets)

– Decentralized naming services (e.g., DNS)

– Decentralized information systems (e.g., WWW)

• Replication: Make copies of data available at different machines (e.g., replicated file servers, databases, mirrored websites, etc)

• Caching: Allow client processes to access local copies– Web caches (e.g., browser/web proxy)

– File caches (e.g., server or client)

Page 6: Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

6

Scalability

Applying scaling techniques is easy, except for: • Having multiple copies (cached or replicated), leads to

inconsistencies: modifying one copy makes that copy different from the rest.

• Always keeping copies consistent and in a general way requires global synchronization on each modification. Global synchronization precludes large-scale solutions.

Observation1: If we can tolerate inconsistencies, wemay reduce the need for global synchronization.Observation2: Tolerating inconsistencies is applicationdependent.

Scaling Techniques (Example 1)

The difference between letting:

a) a server or

b) a client check forms as they are being filled

Page 7: Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

7

Scaling Techniques (Example 2)

An example of dividing the DNS name space into zones.

Hardware Concepts

Different basic organizations and memories in distributed computer systems

Page 8: Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

8

Multiprocessors (1)

A bus-based multiprocessor.

Multiprocessors (2)

A crossbar switch An omega switching network

Page 9: Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

9

Homogeneous Multicomputer Systems

Grid Hypercube

Software ConceptsDistributed systems can be achieved in 3 ways:• DOS (Distributed Operating Systems)• NOS (Network Operating Systems)• Middleware

��� � ��� ���#�F� �2�3�(� ���"�9� ����3� ����1����� ��� ����B����� �9� ��������� �"����/���(����� ���/�+��� ����� ���7���"�9� � �,����� ��� ��� ������&� ����������� ��� �1����� ����� � ����� �

�<� �����6� ���"��������� ��� ������(��� ���-��(����� � ������������������ �����1������� ��������� �"�9� ����2��2�(���������  ���(��� ������������$����� �9� ���.�#���"�(�����$¡3�����f�����#¢,���/£�/�+�

¤6� ���������������� ���  ��� ������ �,� ��������� ����¥�� �   �9� �����1������� ��,�.� ��� �"�9� � ���2��2�(���z�����6����� �9� ���� ������������ �¦��� �   ���7��������������#��� �9� ���.�����"�(�����§/�+�

¨�©/ª «?¬T­p©/®¯+°F±�².³Jª ´�µ1ª ­�«¶F· ±"µ�°/¸

Page 10: Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

10

Uniprocessor Operating Systems

Separating applications from operating system code through a microkernel.

Multiprocessor Operating Systems

• Mutual exclusion and synchronization:– Semaphores?– Test-n-set and Swap instructions?– Spin locks?– Monitors?– A combination thereof?

• Implementation issues:– Shared memory?– Message passing?– A combination thereof?

Page 11: Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

11

Multicomputer Operating Systems (1)

• OS on each computer knows about the other computers• OS on each computer is the same• Services are generally (transparently) distributed across

computers

Multicomputer Operating Systems (2)

• No shared memory ¹ message passing• Typically no broadcasting, thus need software• Hard(er) to do synchronization• No centralized decision making• In practice, then, only very few truly distributed multicomputer

OSs exist (Amoeba? Authors? º )

Page 12: Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

12

Multicomputer Operating Systems (3)

Relation between blocking, buffering, and reliable communications.

»B¼�½�¼¾�¾�¿�À Á»/ÂÃ�Ä Â�½�Å�¾�¼�ÆÇ�¼�À6È�Æ"É9Ê ÄË7¼¾�¾1¿ Ì�¼�Ç�¼�Ä Ê Í¼�À ¼�Ç»B¼�½�¼¾�¾�¿�À Á»/ÂÃ�Ä Â�½�Å�¾�¼�ÆÇ�¼�À6È�Æ"É9Ê ÄË7¼¾�¾1¿ Ì�¼,À ¼½1¼�Ê Í ¼�Ç»BÂÉ<Ƽ½�¼¾�¾�¿�À Á»/ÂÃ�Ä Â�½�Å�¾�¼�ÆÇ�¼�À6È�Æ"É9Ê ÄË7¼¾�¾1¿ Ì�¼#¾�¼�Æ É»BÂÉ<Ƽ½�¼¾�¾�¿�À ÁÎ.¼�¾Ã�Ä Â�½�Å�¾�¼�ÆÇ�¼�À6È�Æ"É9Ê Ä�Ï�È�Ð Ð�¼�À6Æ ÂÉ/Ð&È�Ä Ä

Ñ6ÒBÓ Ô Õ/ÖBÓ Ò,×Ø<ÙqÙfÚÛ6Ü Õ/Ý3Õ/Þ.ß�ÒFÒ.à�áâ ÒBÞ.àcÖ Ü.ã3ã Ò/Ýâpä ÞF×�å�Ý3Ø�ÞBÔ æÕ.ß1Ô Ø6ÞèçFØ�Ô Þ�ß

Distributed Shared Memory Systems (1)

a) Pages of address space distributed among four machines

b) Situation after CPU 1 references page 10

c) Situation if page 10 is read only and replication is used

Page 13: Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

13

Distributed Shared Memory Systems (2)

False sharing of a page between two independent processes.

Network Operating System (1)• Each computer has its own operating system with

networking facilities• Computers work independently (i.e., they may even have

different operating systems)• Services are tied to individual nodes (ftp, telnet, WWW)• Highly file oriented (basically, processors share only files)

Page 14: Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

14

Network Operating System (2)

Two clients and a server in a network operating system.

Network Operating System (3)

Different clients may mount the servers in different places.

Page 15: Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

15

Middleware

• OS on each computer need not know about the other computers

• OS on different computers need not generally be the same• Services are generally (transparently) distributed across

computers

Middleware

• Motivation: Too many networked applications were hard or difficult to integrate:– Departments are running different NOSs– Integration and interoperability only at level of primitive NOS

services– Need for federated information systems:

• Combining different databases, but providing a single view to applications

• Setting up enterprise-wide Internet services, making use of existing information systems

• Allow transactions across different databases• Allow extensibility for future services (e.g., mobility, teleworking,

collaborative applications)

– Constraint: use the existing operating systems, and treat them as the underlying environment (they provided the basic functionality anyway)

Page 16: Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

16

Middleware Services

• Communication Services: replace primitive sockets with– Remote Procedure Calls (or Remote Method Invocations)– Message passing– Communicating streams

• Information Services: data management– Large-scale, system-wide naming– Advanced directory services– Location services– Persistent storage– Data caching and replication

• Security Services: secure communication and processing– Authentication and authorization– Encryption

Middleware and Openness

In an open middleware-based distributed system, the protocols used by each middleware layer should be the same, as well as the interfaces they offer to applications.

Give applications control of when, where and how to access data (e.g., code migration and distributed transaction processing)

Page 17: Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

17

Comparison between Systems

A comparison between multiprocessor operating systems, multicomputer operating systems, network operating systems, and middleware based distributed systems.

é�êpëBìé�êFëBìí+î ïBð ëFñí+î ïpð ëFñé�êpëBìBìFëFð ðò+óBô9õ ëFðö ëFð÷ ïpñBë ô3ó.ø ëBî ùú ïûpü ó î óBý/õ î õ ø ù

þ ë ô ìFïpñ/ëþ ë ô ìpïpñBëÿ-î ï ýFó î �ñ õ ð ø2ô2õ ý��.ø ëFñÿ-î ï ýFó î �üëBì ø2ô3ó î� ëFð ï �/ô üë�� ó ì ó�� ë��jëBì ø÷ ïpñBëBîFð�êFëFü õ 9õ ü.õ î ëFð÷ ëFð ð ó�� ë.ðû�� óBô ëFñ

�jë��jï ô ù�Bó ð õ ð ï ôüï�� � � ì õ ü ó.ø2õ ï/ìúúú�ú�� � ý ë ô ï ü�ï/ê õ ëFð,ï é7ûú ïú ïö ëFðö ëFðû ó �jëcé7ûhï/ì ó î îBìFïpñ/ëFð�¦õ � �� ï���¦õ � �ò ë ô ù �¦õ � �� ë ��ô ëFëfï Tø2ô3ó ìFð�ê óBô ëBìFü�ù

����� ��� �����! �"����� �#�$ �%&�'��"��� (�(�� )+*-,.%&)./0 ,213)2(5476

89):�;*-��%=<476

>?� 1@��%=� 0 �'�A)2(5476B#�=).�

Clients and Servers

• Servers typically manage shared resource, more intensive use

• Clients are thinner, less resource intensive, provide interface,manage smaller (digital?) components (e.g., barcode readers)

• Clients and servers may be in different machines

• Request/reply model (blocking or not?)

Page 18: Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

18

Application Layering

• Traditional three layers:– User interface (only interface)

– Processing layer (no data)

– Data layer (only data)

• Typical application: database technology

• Many others

Layering

The general organization of an Internet search engine into three different layers

Page 19: Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

19

Alternative client-server organizations

Example Architecture

An example of a server acting as a client.

Page 20: Operating Systems - University of Pittsburghpeople.cs.pitt.edu/~mosse/cs2510/class-notes/intro.pdf2 Distributed Systems A distributed system organized as middleware. What’s middleware?

20

Modern Architectures

An example of horizontal distribution of a Web service.

Alternative C/S Architectures

• Cooperating servers: Service is physically distributed across a collection of servers. E.g.,– Replicated file systems– Network news systems– Naming systems (DNS, X.500, …)– Workflow systems

• Cooperating clients: distributed application exists by virtue of client collaboration:– Teleconferencing where each client owns a (multimedia)

workstation– Publish/subscribe (push/pull) architectures in which role of

client and server is blurred