Distributed Objects Binding a Client to an Objectistoica/classes/cs194/05/notes/3-ObjMsg.pdf · 1...

6
1 EECS122 - UCB 1 CS 194: Distributed Systems Remote Object Invocation, Message- Oriented Communications (Based on textbook slides) Computer Science Division Department of Electrical Engineering and Computer Sciences University of California, Berkeley Berkeley, CA 94720-1776 Outline Remote Object Invocation Message Oriented Communication Stream-Oriented Communications Distributed Objects Common organization of a remote object with client-side proxy. 2-16 like client stub like server stub Binding a Client to an Object a) An example with implicit binding using only global references b) An example with explicit binding using global and local references Parameter Passing The situation when passing an object by reference or by value Copy local object Send only reference to remote object 2-18 The DCE Distributed-Object Model a) Distributed dynamic objects in DCE. b) Distributed named objects

Transcript of Distributed Objects Binding a Client to an Objectistoica/classes/cs194/05/notes/3-ObjMsg.pdf · 1...

Page 1: Distributed Objects Binding a Client to an Objectistoica/classes/cs194/05/notes/3-ObjMsg.pdf · 1 EECS122 -UCB 1 CS 194: Distributed Systems Remote Object Invocation, Message-Oriented

1

EECS122 - UCB 1

CS 194:Distributed Systems

Remote Object Invocation, Message-Oriented Communications

(Based on textbook slides)

Computer Science DivisionDepartment of Electrical Engineering and Computer Sciences

University of California, BerkeleyBerkeley, CA 94720-1776

Outline�

Remote Object Invocation

• Message Oriented Communication

• Stream-Oriented Communications

Distributed Objects

• Common organization of a remote object with client-side proxy.

2-16

like client stublike server stub

Binding a Client to an Object

a) An example with implicit binding using only global references

b) An example with explicit binding using global and local references

��� � � � ��� � ���� ���� � ��� ��� � � � ������ ��� ����� � � � ������� ������ � ������ ��� ��� �� !� ��� � ��� ���#"%$&� � �(' �� � � ��� � ) �*� +��� ��� ��� �� � �,� �����-� � � � � �.�� ������ � ������ � ��� ��� / 01������ ������� +�� 2-3 4 � � �(' ��5�� � ��� � � ���� �6�� �7� �8 ��9 ���*����� +���

3 ��4��� � � � ��� � ������� � :� ��� � � � ������ ��� ����� � � � ������� ������ � ������ ��� ��� �� !� �; �� ��� ���� � ���� ���� � ��5�� � � � � ������ ��� ���65���� �� ���<� �*� �� ����� � ����� ��� � ��� ���#"%$&� � � ' �� � � ��� � ) �6� +��� ��� ��� �� � �*� ������� � � � � .�� ��*�� � ������� � ��5�� �("=�� ��3 �� � ��� ��� 4 � � � > ?�5�� � ��� � � ���� �6�� �6���� ��� ,�*5��� �� ���<� �6� +�*� �� ���5�� ��? ��� � ��5�� �</ 01������� ���,��� +�� �2�3 4 � � � ' 8 ��9 ���*�,��� +���6�� 6� +�*� �� ����5�� ��? �

3 �4

Parameter Passing• The situation when passing an object by reference or by value

– Copy local object

– Send only reference to remote object

2-18

The DCE Distributed-Object Modela) Distributed dynamic objects in DCE.b) Distributed named objects

Page 2: Distributed Objects Binding a Client to an Objectistoica/classes/cs194/05/notes/3-ObjMsg.pdf · 1 EECS122 -UCB 1 CS 194: Distributed Systems Remote Object Invocation, Message-Oriented

2

Outline

• Remote Object Invocation�

Message Oriented Communication

• Stream-Oriented Communications

Persistence and Synchronicity in Communication (1)

• General organization of a communication system in which hosts are connected through a network

2-20

Persistence and Synchronicity in Communication (2)

• Persistence– Message is stored in the network or at the receiving

machine as long as it takes to be delivered

– E.g., mail system

• Synchronicity– Sender blocks until the receiver gets the message

Persistence and Synchronicity in Communication (3)

• Persistent communication of letters back in the days of the PonyExpress.

Persistence and Synchronicity in Communication (4)

a) Persistent asynchronous communicationb) Persistent synchronous communication

2-22.1

Persistence and Synchronicity in Communication (5)

c) Transient asynchronous communicationd) Receipt-based transient synchronous communication

2-22.2

Page 3: Distributed Objects Binding a Client to an Objectistoica/classes/cs194/05/notes/3-ObjMsg.pdf · 1 EECS122 -UCB 1 CS 194: Distributed Systems Remote Object Invocation, Message-Oriented

3

Persistence and Synchronicity in Communication (6)

e) Delivery-based transient synchronous communication at message delivery

f) Response-based transient synchronous communication

Outline

• Remote Object Invocation�

Message-Oriented Communication�

Message-Oriented Transient Communication� Message-Oriented Persistent Communication

• Stream-Oriented Communications

Berkeley Sockets (1)

• Socket primitives for TCP/IP.

����� ���� �6� +��� �� � ����� � �� ��� �� ������ ��� 8 ��� ����������� ���8 ���<� +��� �� � ����� � �� ��� ��� 8 ���� ��6� ����������� ����8 ���<� +��� �� � ����� � �� ��� ������ � 8 ��� ����� � ����5�� � ����� � ���� � � +���� �� ����� � �� ���� � �����-� ����9&� ��� � ��� .� �� � ���� �� � ����� � �� �� ����.��� ����� � � 8 ������ � ��5��� � ��.� � ��� � � � � 2� ��� � � ���� � ��5���� �� � ����� � �� �; � � � �� � � � ���+���� ��� ���������� �� ��� ����� ����9 ������ ���� ����� ���, �� � ������.� �� � ��� � �� ,�� ��5���� �������9 ���� ����� ������ � ��� � � ��

Berkeley Sockets (2)

• Connection-oriented communication pattern using sockets.

The Message-Passing Interface (MPI)

• Some of the most intuitive message-passing primitives of MPI.

��+����9�� ��� +���� ��� �(�� �� � ����� !2 ���� � ��2�� ���.��-���6 ���� �� ���9�(:' ��� � ��� 8����� ��� 8 ���*����� � ��2���� �� ����9�� � � +��� ����� �� �� ��(:' ��� ��� 8:!�� ��� ��� ��� �� � ��� ����.�� 2���� 2 ���� � ��2�� ���� ���&��� ��.� �� � ��� �� ��� 5���� � ��� � ��(:' ��� � � �� �:!�� ��� ��� ��� �� � ��� ����.�� 2���� 2 ���� � ��2�� ���� ��� �� �� � �.��(:' ��� � �� ���� ��6������� � ��2����� ���&��� � � ��� � ��5� ��(:' �� �� �-� ��� 8��� ��6������� � ��2����� ���&��� ��.� �� � ��� �� ��� 5���� � ��� � ��(:' �� � �� ���� ��6������� � ��2����� ���&��� ��.� �� � � � ��5�� �� � �*� �� ���!���<� ������� �*�.�� � ����(:' �� �� �� 5�5�� �����.�� 2���� 2*����� � ��2��*� ���*� �� ���� �� �*�.�� � ����(:' ��� �� ��� ����� ������ � ��� � � ��

Outline

• Remote Object Invocation�

Message-Oriented Communication• Message-Oriented Transient Communication�

Message-Oriented Persistent Communication

• Stream-Oriented Communications

Page 4: Distributed Objects Binding a Client to an Objectistoica/classes/cs194/05/notes/3-ObjMsg.pdf · 1 EECS122 -UCB 1 CS 194: Distributed Systems Remote Object Invocation, Message-Oriented

4

Message-Queuing Model (1)

• Four combinations for loosely-coupled communications using queues.

2-26

Message-Queuing Model (2)

• Basic interface to a queue in a message-queuing system.

' � � ��� ��*+�� ��� ��� � �*��� ��� � ������+�� ��*�,��� � �2��6� �(5�.�� � �� �*� +��� 5����� � � ���-.��.��������� � � ���+����9&��� 5����� � � �� ��.���.�,� ���<����� � �2���� ���� �*� ������8 �6� +�*� � � � � ���-��8 ���<�� ���9��: ��� ���� ����9�.� �� � �� +���� 5��� � � � ��� ��.��.�*� � �� �����5�� ������ � � ������8 �6� +�*� � � � � ���� � ��2�������� 5�5��� ���*���� � ��2��*� ����� 5��� � � � ��� ��.��.�:�.�� ����� ������ � ��� � � ��

General Architecture of a Message-Queuing System (1)

• The relationship between queue-level addressing and network-level addressing.

General Architecture of a Message-Queuing System (2)

• The general organization of a message-queuing system with routers.

2-29

Message Brokers

• The general organization of a message broker in a message-queuing system.

2-30

Example: IBM MQSeries

• General organization of IBM's MQSeries message-queuing system.

2-31

Page 5: Distributed Objects Binding a Client to an Objectistoica/classes/cs194/05/notes/3-ObjMsg.pdf · 1 EECS122 -UCB 1 CS 194: Distributed Systems Remote Object Invocation, Message-Oriented

5

Channels

• Some attributes associated with message channel agents.

� ��?�� ��.�� � � ���� � � �*��� � ��� � ��� �*5�.���� ��� ��� 8 ���*�,��� � �2��6� �� � ��.��.������ � 8 ��� ��� ��� � � �����5���� � � ��(����?�� ��.�� �.�� ��� ����� ��� � � ����� ��� � ��� � .5*� +��� ������� � � � ������ .�5�� ��� � �

� ��.� ��

� ��?�� ��.�� � �� 2-� +�������� � !2-� �6����� � �2��� ��� � ��2��*� �� 2�� +' �-� � ��� ��� � +��������� � �2����(��� �*� �*������� � 8 ��� ���7� 6� +������ ����� � +�� ��� ��� �� ��� ' ��� ����� � 8 ��� ������ ��� ��� ����� +��6� � �� �� 5��� � 5�� ��� �� ����� �*�*.� ���-� �� � 5��� � � ��5�� ���� � � �� � ��� � � � � �� ��

Message Transfer (1)

• The general organization of an MQSeries queuing network using routing tables and aliases.

Message Transfer (2)

• Primitives available in an IBM MQSeries MQI

����������������������� � !�"��#�$ �%��!$ &('!)*�!)��+�,(�����

-�)��.�/�0���������1�32 4�� ��!45 !67�!4���89'!)��!)7�+�,:6�)��

;�$ ����9��'!)��!)��+�,(%1$ ����

<:6��!45��# 6� ����12 =�$ >�� �!�0 �� ��&('!)���)��+�,( !6��!4

?(@�A�B!C�D E�F1D G�HI.C�D JKD F1D L�@

Outline

• Remote Object Invocation

• Message-Oriented CommunicationM

Stream-Oriented Communications

Data Stream (1)

• Setting up a stream between two processes across a network.

Data Stream (2)

• Setting up a stream directly between two devices.

2-35.2

Page 6: Distributed Objects Binding a Client to an Objectistoica/classes/cs194/05/notes/3-ObjMsg.pdf · 1 EECS122 -UCB 1 CS 194: Distributed Systems Remote Object Invocation, Message-Oriented

6

Data Stream (3)

• An example of multicasting a stream to several receivers.

Specifying QoS (1)

• A flow specification.

� ��������������� � �� ��� ���� ������ ��������� � �� ������� µ �������� ����� �� �� � ����������� � �� ��� ! �� ������ ���� "#� �� $%��$&! �� ���'��� � ����!%� µ ��� ���� "(��)� $%��$&!��� ���#���� � �� � �%� µ ��� ���� *����� � ����+-,���� �� ���

� $#��) � $%� $&!��� �'� �� -��� .��%� ���� � ���� /0�1��2������13�� -� �� �������� � ��4��������� /0�1��'� ����13�� 0��� .��%� ���� ������ "(��)� $%��$5 � ����$%� ����� �%� �� ������� ����4��������

6�@ C L�D B�@'7.@�8-9�D C @:;�<�=�C =�B�F�@ C�D A7F1D B�A0G�>�F�<�@�?�H�E09�F

Specifying QoS (2)

• The principle of a token bucket algorithm.

Setting Up a Stream

• The basic organization of RSVP for resource reservation in a distributed system.

Synchronization Mechanisms (1)

• The principle of explicit synchronization on the application level data units.

Synchronization Mechanisms (2)

• The principle of synchronization as supported by high-level interfaces.

2-41