Introduction to Distributed systems 2.2 Communication Concepts CDS Wt Chapter 2 1 Wt Chapter 2 2.2 Communication Concepts CDS 2.1 What are distributed systems? 2 – What are systems? – Different kind of systems – How to distribute systems? 2.2 Communication concepts – – – – Client-Server Approach Producer-consumer approach Message oriented Stream oriented CDS Wt Need of communication Exchange of information between computers or processes • communication takes time 2.2 Communication Concepts – limits due to application, number of bytes – synchronization • communication needs „protocols“ – What kind of information will be exchanged – How information will be exchanged • communication may cause errors – data integrity – error-free data 3 CDS Wt Communication models • Multiprocessors or Processes: – exchange using shared memory – Synchronization using semaphores and monitors 2.2 Communication Concepts • Multicomputer: 4 – exchange using message passing – Synchronization with blocking in message passing – or clock based solutions Focus: communication models for multicomputer systems CDS Wt Client-Server (1) Client Server 2.2 Communication Concepts request indication response confirmation Confirmed service 5 Wt Client-Server (2) CDS service request 2.2 Communication Concepts Client requests 6 service confirmation service indication communication system service response Server realise service client server CDS Wt Example: World Wide Web 2.2 Communication Concepts Browser Web Server 2. Indication fetch document OS OS 4. confirmation 1. Request: Get Document 7 2.2 Communication Concepts CDS Wt Multitired Architectures (1) 8 3. Response, gives document 2.2 Communication Concepts CDS Wt Multitired Architectures (2) 9 2.2 Communication Concepts CDS Wt Client and Server Stubs 10 • Remote Procedure Calls (RPC) • Principle of RPC between a client and server program. • The interconnection between client and server in a traditional RPC • The interaction using asynchronous RPC 2.2 Communication Concepts CDS Wt Asynchronous RPC (1) 11 • A client and server interacting through two asynchronous RPCs 2.2 Communication Concepts CDS Wt Asynchronous RPC (2) Deferred synchronous RPC 12 2.2 Communication Concepts CDS Wt Remember! • Client / Server or producer/consumer are a logical models and can be realized with every communication system • Client / Server models can be used at different interfaces, even for internal software-interfaces • The WWW is the most popular client-server system 13 CDS Wt Producer/Consumer producer push-model consumer(s) service.request 2.2 Communication Concepts Service indication 14 Unconfirmed service publisher subscriber CDS Wt Producer/Consumer consumer producer pull-model request(s) 2.2 Communication Concepts indication response confirmation 15 CDS Wt Principles of communication • Address based – Source- and destination address – Broadcast addressing – Addresses must be available 2.2 Communication Concepts – Like sending a letter • Information based – Based on identifier, tagging the message – destination of message is unknown – Communication controller decides whether to take the message or not. – Like Advertising 16 2.2 Communication Concepts CDS Wt When takes Communication place 17 • Event driven Communication takes only place in case of an event – – – – – aim: minimize communication delay time (Event-communication) undefined workload (statistic) flexible system ensure that system is working • Cyclic there is a periodic exchange of information between subsystems – – – – cycle time (defined by the process) defined workload Timeout condition can be checked less flexibility CDS Wt Communication types • persistent communication – stored in the system, even if sending or receiving application are not running • transient communication 2.2 Communication Concepts – stored in system only, as long as sending and receiving application are running 18 • asynchronous communication – sender continues immediately after message submission • synchronous communication – sender is blocked until message is stored at local host at the receiver – worst: until message is processed at the receiver • Persistent communication of letters back in the days of the Pony Express. 2.2 Communication Concepts CDS Wt Persistence Communication (1) 19 CDS Wt Persistence Communication (2) • General organization of a communication system in which hosts are connected through a network 2.2 Communication Concepts 2-20 20 CDS Wt Persistence and Synchronicity in Communication (1) a) persistent asynchronous communication b) persistent synchronous communication 2.2 Communication Concepts 2-22.1 21 2.2 Communication Concepts CDS Wt Persistence and Synchronicity in Communication (2) 22 c) Transient asynchronous communication d) Receipt-based transient synchronous communication e) Delivery-based transient synchronous communication at message delivery f) Response-based transient synchronous communication 2.2 Communication Concepts CDS Wt Persistence and Synchronicity in Communication (3) RPC and RMI 23 CDS Wt Message oriented communication • transient synchronous communication – RPC, RMI 2.2 Communication Concepts • transient asynchronous communication 24 • Message oriented persistent communication • Message oriented persistent communication – message queuing systems – min instead of ms – message oriented middelware ( MOM) 2.2 Communication Concepts CDS Wt Message oriented persistent 25 CDS Wt Message-Queuing Model (1) • Four combinations for loosely-coupled communications using queues. 2.2 Communication Concepts 2-26 26 Wt Message-Queuing Model (2) 2.2 Communication Concepts CDS • Basic interface to a queue in a messagequeuing system. Primitive Meaning Put Append a message to a specified queue Get Block until the specified queue is nonempty, and remove the first message Poll Check a specified queue for messages, and remove the first. Never block. Notify Install a handler to be called when a message is put into the specified queue. 27 2.2 Communication Concepts CDS Wt General Architecture of a Message-Queuing System (1) 28 • The relationship between queue-level addressing and network-level addressing. • The general organization of a messagequeuing system with routers. 2-29 2.2 Communication Concepts CDS Wt General Architecture of a Message-Queuing System (2) 29 CDS Wt Message Brokers • The general organization of a message broker in a message-queuing system. 2.2 Communication Concepts 2-30 30 Message Broker: change formats, similar to Gateway Wt Channels 2.2 Communication Concepts CDS • Some attributes associated with message channel agents. Attribute Description Transport type Determines the transport protocol to be used FIFO delivery Indicates that messages are to be delivered in the order they are sent Message length Maximum length of a single message Setup retry count Specifies maximum number of retries to start up the remote MCA Delivery retries Maximum times MCA will try to put received message into queue 31 CDS Wt Data Stream (1) • Setting up a stream directly between two devices. 2.2 Communication Concepts 2-35.2 32 • An example of multicasting a stream to several receivers. 2.2 Communication Concepts CDS Wt Data Stream (2) 33 • A flow specification. 2.2 Communication Concepts CDS Wt Specifying QoS (1) 34 Characteristics of the Input Service Required • maximum data unit size (bytes) • Token bucket rate (bytes/sec) • Token bucket size (bytes) • Maximum transmission rate (bytes/sec) • Loss sensitivity (bytes) • Loss interval (μsec) • Burst loss sensitivity (data units) • Minimum delay noticed (μsec) • Maximum delay variation (μsec) • Quality of guarantee Wt Specifying QoS (2) 2.2 Communication Concepts CDS • The principle of a token bucket algorithm. 35