CHAPTER 4: INTERPROCESS COMMUNICATION AND COORDINATION

Similar documents
CHAPTER 4: INTERPROCESS COMMUNICATION AND COORDINATION

Distributed Systems Exam 1 Review. Paul Krzyzanowski. Rutgers University. Fall 2016

Synchronization Part 2. REK s adaptation of Claypool s adaptation oftanenbaum s Distributed Systems Chapter 5 and Silberschatz Chapter 17

MODELS OF DISTRIBUTED SYSTEMS

Failure Tolerance. Distributed Systems Santa Clara University

CHAPTER - 4 REMOTE COMMUNICATION

Interprocess Communication Tanenbaum, van Steen: Ch2 (Ch3) CoDoKi: Ch2, Ch3, Ch5

Connections. Topics. Focus. Presentation Session. Application. Data Link. Transport. Physical. Network

Transport Layer (TCP/UDP)

Networked Systems and Services, Fall 2018 Chapter 4. Jussi Kangasharju Markku Kojo Lea Kutvonen

CSE 461 Connections. David Wetherall

Today CSCI Communication. Communication in Distributed Systems. Communication in Distributed Systems. Remote Procedure Calls (RPC)

Communication. Distributed Systems Santa Clara University 2016

Fault Tolerance. Distributed Systems. September 2002

CprE Fault Tolerance. Dr. Yong Guan. Department of Electrical and Computer Engineering & Information Assurance Center Iowa State University

MODELS OF DISTRIBUTED SYSTEMS

Chapter 8 Fault Tolerance

Distributed Systems Fault Tolerance

EEC-682/782 Computer Networks I

DISTRIBUTED COMPUTER SYSTEMS

Last Class: RPCs and RMI. Today: Communication Issues

Distributed Systems Multicast & Group Communication Services

Distributed Systems. coordination Johan Montelius ID2201. Distributed Systems ID2201

Synchronization Part II. CS403/534 Distributed Systems Erkay Savas Sabanci University

CSEP 561 Connections. David Wetherall

Fault Tolerance Part II. CS403/534 Distributed Systems Erkay Savas Sabanci University

CSEP 561 Connections. David Wetherall

Coordination 1. To do. Mutual exclusion Election algorithms Next time: Global state. q q q

Chapter 8 Fault Tolerance

CSE 461 The Transport Layer

Distributed Systems Inter-Process Communication (IPC) in distributed systems

Communication. Distributed Systems IT332

MYE017 Distributed Systems. Kostas Magoutis

Synchronization. Chapter 5

Last Class: Clock Synchronization. Today: More Canonical Problems

Distributed Systems Exam 1 Review Paul Krzyzanowski. Rutgers University. Fall 2016

Page 1. CS 194: Distributed Systems Distributed Coordination-based Systems. Coordination Systems. Taxonomy of Coordination Models

Distributed Synchronization. EECS 591 Farnam Jahanian University of Michigan

Distributed Systems Principles and Paradigms. Chapter 08: Fault Tolerance

Communication. Overview

Message Passing Models and Multicomputer distributed system LECTURE 7

Announcements. me your survey: See the Announcements page. Today. Reading. Take a break around 10:15am. Ack: Some figures are from Coulouris

Remote Invocation. Today. Next time. l Overlay networks and P2P. l Request-reply, RPC, RMI

Interprocess Communication Mechanisms

shared storage These mechanisms have already been covered. examples: shared virtual memory message based signals

COMMUNICATION IN DISTRIBUTED SYSTEMS

Fault Tolerance. Fall 2008 Jussi Kangasharju

MYE017 Distributed Systems. Kostas Magoutis

Communication in Distributed Systems

EEC-484/584 Computer Networks. Lecture 16. Wenbing Zhao

Overview. SSL Cryptography Overview CHAPTER 1

CSE/EE 461 Lecture 14. Connections. Last Time. This Time. We began on the Transport layer. Focus How do we send information reliably?

Interprocess Communication

Remote Invocation. 1. Introduction 2. Remote Method Invocation (RMI) 3. RMI Invocation Semantics

Chapter 2: Interprocess Communication

ECE 650 Systems Programming & Engineering. Spring 2018

Distributed Systems Question Bank UNIT 1 Chapter 1 1. Define distributed systems. What are the significant issues of the distributed systems?

DISTRIBUTED COMPUTER SYSTEMS

Clock Synchronization. Synchronization. Clock Synchronization Algorithms. Physical Clock Synchronization. Tanenbaum Chapter 6 plus additional papers

Other Interprocess communication (Chapter 2.3.8, Tanenbaum)

Distributed Systems. Characteristics of Distributed Systems. Lecture Notes 1 Basic Concepts. Operating Systems. Anand Tripathi

Distributed Systems. Characteristics of Distributed Systems. Characteristics of Distributed Systems. Goals in Distributed System Designs

Communication Paradigms

Distributed systems. Lecture 6: distributed transactions, elections, consensus and replication. Malte Schwarzkopf

Information Security CS 526

CHAPTER 3 - PROCESS CONCEPT

THE TRANSPORT LAYER UNIT IV

The Client Server Model and Software Design

Computer Networks SYLLABUS CHAPTER - 2 : NETWORK LAYER CHAPTER - 3 : INTERNETWORKING

OUTLINE. Introduction Clock synchronization Logical clocks Global state Mutual exclusion Election algorithms Deadlocks in distributed systems

MOM MESSAGE ORIENTED MIDDLEWARE OVERVIEW OF MESSAGE ORIENTED MIDDLEWARE TECHNOLOGIES AND CONCEPTS. MOM Message Oriented Middleware

CSCE 715: Network Systems Security

Fault Tolerance Part I. CS403/534 Distributed Systems Erkay Savas Sabanci University

CSE 461 Module 11. Connections

Distributed Systems Principles and Paradigms

Introduction. Interprocess communication. Terminology. Shared Memory versus Message Passing

QUIZ: Longest Matching Prefix

Distributed Systems. Pre-Exam 1 Review. Paul Krzyzanowski. Rutgers University. Fall 2015

Fault Tolerance. Goals: transparent: mask (i.e., completely recover from) all failures, or predictable: exhibit a well defined failure behavior

TRANSMISSION CONTROL PROTOCOL. ETI 2506 TELECOMMUNICATION SYSTEMS Monday, 7 November 2016

Transport Layer Security

05 Transmission Control Protocol (TCP)

Chapter 09 Network Protocols

Advanced Topics in Distributed Systems. Dr. Ayman A. Abdel-Hamid. Computer Science Department Virginia Tech

CSE 5306 Distributed Systems

Memory-Mapped Files. generic interface: vaddr mmap(file descriptor,fileoffset,length) munmap(vaddr,length)

CSE 5306 Distributed Systems. Fault Tolerance

Interprocess Communication Mechanisms

Interprocess Communication Mechanisms

Parallelism. Master 1 International. Andrea G. B. Tettamanzi. Université de Nice Sophia Antipolis Département Informatique

Synchronization. Clock Synchronization

Operating Systems Design Exam 3 Review: Spring 2011

Advanced Distributed Systems

Distributed Information Processing

MatrixDTLS Developer s Guide

EEC-682/782 Computer Networks I

Chapter 3: Processes. Operating System Concepts 8 th Edition,

Cristina Nita-Rotaru. CS355: Cryptography. Lecture 17: X509. PGP. Authentication protocols. Key establishment.

Different Layers Lecture 20

Distributed Operating Systems. Distributed Synchronization

Transcription:

CHAPTER 4: INTERPROCESS COMMUNICATION AND COORDINATION Chapter outline Discuss three levels of communication: basic message passing, request/reply and transaction communication based on message passing Discuss name services for communication Show examples of process coordination using message passing Basic message passing communication Communication primitives: send(destination, message) receive(source, message) channel naming = process name, link, mailbox, port direct communication: symmetric/asymmetric process naming, link indirect communication: many-to-many mailbox, many-to-one port

Message buffering and synchronization sender source network destination receiver kernel message kernel 4 request 8 7 ack 6 5 reply. Nonblocking send, +8 : Sender process is released after message has been composed and copied into sender s kernel (local system call).. Blocking send, ++7+8 : Sender process is released after message has been transmitted to the network (NIC interrupt OS).. Reliable blocking send, +++6+7+8 : Sender process is released after message has been received by the receiver s kernel (kernel receives network ACK). 4. Explicit blocking send, +++4+5+6+7+8 : Sender process is released after message has been received by the receiver process (kernel receives kernel delivery ACK). 5. Request and reply, -4, service, 5-8 : Sender process is released after message has been processed by the receiver and response returned to the sender.

Message passing API Pipe: A FIFO byte-stream unidirectional link for related processes (set up at process invocation) Message queue: A structured variable length message queue Named Pipe: A special FIFO file pipe using path name for unrelated processes under the same domain (explicitly created and accessed) Socket: A logical communication endpoint for communication between autonomous domains (bound to physical communication endpoint)

Connectionless socket communication peer processes socket logical communication endpoint (socket, LCE) bind physical communication endpoint (PCE) peer process socket logical communication endpoint (socket, LCE) bind physical communication endpoint (PCE) sendto / recvfrom peer process: application level processes - application protocol LCE: Logical Communication Endpoint - established with socket call PCE: Physical Communication Endpoint - (Transport TSAP/L4SAP, Network NSAP/LSAP) bound to LCE with bind call Network: Accessed by sendto/recvfrom primitives 4

Connection-oriented socket communication Server socket Client socket bind listen accept read write rendezvous request reply connect write read 5

Asymmetric - Client and Server Server starts first: Server process: application level process - server protocol LCE: Logical Communication Endpoint - established with socket call PCE: Physical Communication Endpoint - (Transport TSAP/L4SAP, Network NSAP/LSAP) bound to LCE with bind call Listen: Server waits for incoming connection request Accept: Server accepts connection request, initializes connection Read: Server reads incoming segment(s) of request Write: Server writes reply segment(s) Close: Server terminates connection when reply is received Client starts after Server: Client process: application level process - runs server protocol LCE: Logical Communication Endpoint - established with socket call PCE: Physical Communication Endpoint - (Transport TSAP/L4SAP, Network NSAP/LSAP) bound to LCE with connect call, which also initialized connection to server PCE Write: Client writes request segment(s) Read: Client reads incoming segment(s) of reply Close: Client terminates connection when reply is received and acknowledged 6

Secure Socket Layer protocol Privacy: use symmetric private-key cryptography Integrity: use message integrity check Authenticity: use asymmetric public-key cryptography CLIENT SERVER ClientHello randomc, CipherSuites randoms, CipherSuite, session id server public key ServerHello ServerKeyExchange ClientKeyExchange encrypted pre-mastersecret ChangeCipherSpec Finished Socket Message hashed message and secret encrypted and signed ChangeCipherSpec Finished Socket Message Server accepts connection, selects a cipher suite both can use (if any), provides its public key in a signed certificate Client verifies server public key certificate Client and Server exchange public information to establish shared secret Client and Server initialize hash key, session encryption key Either Client or Server may terminate secure connection 7

Group communication and multicast Reliability of message delivery Best effort Duplicate detection Omission detection/recovery per receiver All or none (atomic) to all receivers Orderly delivery FIFO (per sender) Causal order Total order 8

s G s G (a) s (b) G s G s G (c) s G s s G G (d) s s G G (a) Single sender/single group - reliable, ordered delivery (FIFO) (b) Multiple senders/single group - order between senders messages? (c-l) Single sender/overlapping groups - order between messages sent to different groups for nodes in intersection - consistent? (c-r) Multiple, single group senders/overlapping groups - order between messages for nodes in intersection - consistent? (d-l) Multiple, multi-group senders/independent groups - issues of (b), plus consistency of order in Group and in Group (d-r) Multiple, multi-group senders/overlapping groups - issues of (d- L), plus consistency of order for nodes in intersection of Group and Group 9

Causal order Accept message m if T i = S i + and T k S k for all k i. Delay message m if T i > S i + or there exists a k i such that T k > S k. Reject the message if T i S i. Initial Vector Clock P 000 M_ R_ R_ M_ R_ R_4 Process P 000 R_ R_ M_ R_ R_4 R_5 P 000 M_ M_ R_ M_ R_ R_ time Message Tx Timestamp Rx Event Action(s) VLC after Rx M_ R_ M_ R_ M_ R_ M_ R_4 M_ R_ M_ R_ R_ R_4 R_5 R_ R_ R_ 0

Total order,6 s 5 (msg m ) 8,9 7,5,5 g Multicast Message m 0 Acknowledge Commit Time Time delivered s 4,8 7,7 5,7 g m m m 6 8 0 9 8 pending (msg m ) 6,8 Buffer management in the communication handler s_ 5 6 7 0 m_,5 m_,5 c_,9 s_ 8 9 7 m_,7 m_,7 c_,8 g_ a_,6 a_,8 9 0 6 7 8 9 a_,9 a_,9 g_ a_,8 8 9 0 s_ m_, 0 time at which g_ s table is shown Total Order Multicast Example: Time Space Diagram

Request/reply communication Remote Procedure Calls (RPCs) Client Server return reply call request call request return reply Client Stub message to parameters to parameters message Server Stub message to parameters to parameters message Transport Transport receive send receive send Parameter passing and data conversion Binding Compilation Exception and failure handling Security

RPC Binding server machine address or handle to server directory server (binder or trader) register service client create port # port mapper register program, version, and port client machine 4 client handle server server machine

RPC compilation server procedures compilation server program RPC server stub interface specification generator header file RPC run-time library client stub client main program compilation client program 4

RPC exception and failure Exception: in-band or out-band signaling Link failure: retransmission, sequence number and idempotent requests, use of transaction id xid Server crash: at least once: server raises an exception and client retries at most once: server raises an exception and client gives up maybe: server raises no exception and client retries Client crash: orphan killed by client orphan killed by server orphan killed by expiration 5

Secure RPC C s and S s are 8-bit random numbers. C p = α Cs mod M, and S p = α Ss mod constants. M, where α and M are known SK cs = Sp Cs SK sc = Cp Ss = (α Ss ) Cs = α Ss Cs = (α Cs ) Ss = α Cs Ss NIS server user id and password login process key server Cs Sp records of. user network name. public and encrypted secret key Cp Ss key server client process {CK} session key -> {RPC message} CK server process Client machine Server machine 6

Transaction Communication ACID properties Atomicity Consistency Isolation Durability Two-phase commit protocol COORDINATOR PARTICIPANT Phase Phase - precommit the transaction - send request to all participants request - received request message - if ready then precommit and send YES - collect all replies - if all votes are unanimous YES reply else abort transaction and send NO then commit and send COMMIT else abort and send ABORT decision - receive decision - if COMMIT then commit - if ABORT then abort - received response result - send response 7

Failure and recovery of the PC protocol Coordinator failure recovery actions abort abort or continue pre- send collect commit send receive commit request reply commit response resend commit message begin end begin receive request pre- send receive send commit reply commit commit resp. update end abort find out commit or abort continue Participant failure recovery actions 8

Name and Directory Services Object attributes and name structures Service /object Attributes < attributes > < name, attributes, address > < name, type, attributes, address > Name Structures flat structure hierarchical structure name-based resolution (e.g., white pages) structure-free attribute-based resolution (e.g., yellow pages) Attribute Partitioning physical organizational functional Name space and information base DSA DSA A Root B Country C D E Organization User DSA Five naming contexts of Directory Info Tree in three Directory Service Agents 9

Name resolution DUA DSA DSA DUA DSA DSA 4 Recursive chaining Transitive chaining DSA DSA DUA DUA 4 4 DSA DSA Referral Multicast 0

Distributed Mutual Exclusion Contention-based: Timestamp prioritized Voting Control (Token)-based: Ring structure Tree structure Broadcast structure Tree-structure token passing 4 4 4 4 4 7 5 6

Broadcast structure token passing 4 4 * Process 5 0 9 5 0 0 8 4 Process 4 0 8 * Process 5 9 5 0 8 4 * Process 4 5 0 9 5 0 9 Sequence vectors Si Token vector T Token queue Q

Leader Election Complete topology The Bully algorithm Are-U-Up to higher numbered nodes If highest alive, Enter-Election to lower nodes When ACK or TRO for all lower nodes, send Result Enter-Election received: transient state until Result Logic ring topology The initiator node sets partcipating = true and send (id) to its successor node; For each process node, receive (value); case value > id : participating := true, send (value); value < id and participating == false : participating := true, value == id : announce leader; end case send (id); Tree topology Distributed MST formation, timestamp protocol