Communication in Distributed Systems. . The single most important difference between a distributed system and a uniprocessor system is the interprocess.

Slides:



Advertisements
Similar presentations
Remote Procedure Call (RPC)
Advertisements

Computing Systems 15, 2015 Next up Client-server model RPC Mutual exclusion.
Multiple Processor Systems
Informationsteknologi Wednesday, September 26, 2007 Computer Systems/Operating Systems - Class 91 Today’s class Mutual exclusion and synchronization 
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
CS 620 Advanced Operating Systems Lecture 4 – Distributed System Architectures Professor Timothy Arndt BU 331.
Lecture 3 Page 1 CS 239, Spring 2001 Interprocess Communications in Distributed Operating Systems CS 239 Distributed Operating Systems April 9, 2001.
1 Semaphores Special variable called a semaphore is used for signaling If a process is waiting for a signal, it is suspended until that signal is sent.
Networking Theory (Part 1). Introduction Overview of the basic concepts of networking Also discusses essential topics of networking theory.
Computer Science Lecture 2, page 1 CS677: Distributed OS Last Class: Introduction Distributed Systems – A collection of independent computers that appears.
EE 4272Spring, 2003 Protocols & Architecture A Protocol Architecture is the layered structure of hardware & software that supports the exchange of data.
Networks 1 CS502 Spring 2006 Network Input & Output CS-502 Operating Systems Spring 2006.
CS-3013 & CS-502, Summer 2006 Network Input & Output1 CS-3013 & CS-502, Summer 2006.
16: Distributed Systems1 DISTRIBUTED SYSTEM STRUCTURES NETWORK OPERATING SYSTEMS The users are aware of the physical structure of the network. Each site.
TCP: Software for Reliable Communication. Spring 2002Computer Networks Applications Internet: a Collection of Disparate Networks Different goals: Speed,
Chapter 4.1 Interprocess Communication And Coordination By Shruti Poundarik.
Gursharan Singh Tatla Transport Layer 16-May
MULTICOMPUTER 1. MULTICOMPUTER, YANG DIPELAJARI Multiprocessors vs multicomputers Interconnection topologies Switching schemes Communication with messages.
Process-to-Process Delivery:
1 Transport Layer Computer Networks. 2 Where are we?
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
Introduction to Networks CS587x Lecture 1 Department of Computer Science Iowa State University.
1 The Internet and Networked Multimedia. 2 Layering  Internet protocols are designed to work in layers, with each layer building on the facilities provided.
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
Chapter 4: Interprocess Communication‏ Pages
Chapter 8-2 : Multicomputers Multiprocessors vs multicomputers Multiprocessors vs multicomputers Interconnection topologies Interconnection topologies.
Network Protocols n ISO OSI 7-layer model n TCP/IP suite l TCP/UDP l IP l Ethernet/Token Ring l ICMP.
Lecture 4 Overview. Ethernet Data Link Layer protocol Ethernet (IEEE 802.3) is widely used Supported by a variety of physical layer implementations Multi-access.
1 Client-Server Interaction. 2 Functionality Transport layer and layers below –Basic communication –Reliability Application layer –Abstractions Files.
1 OSI and TCP/IP Models. 2 TCP/IP Encapsulation (Packet) (Frame)
Distributed (Operating) Systems -Communication in Distributed Systems- Computer Engineering Department Distributed Systems Course Assoc. Prof. Dr. Ahmet.
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Protocols and Architecture Slide 1 Use of Standard Protocols.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
4343 X2 – The Transport Layer Tanenbaum Ch.6.
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
1 Chapter 24 Internetworking Part 4 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
Chapter 9: Transport Layer
Last Class: Introduction
Lecture (2).
Instructor Materials Chapter 9: Transport Layer
Definition of Distributed System
ARP and RARP Objectives Chapter 7 Upon completion you will be able to:
Layered Architectures
TCP/IP Transmission Control Protocol / Internet Protocol
Understanding the OSI Reference Model
File Transfer and access
Switching Techniques In large networks there might be multiple paths linking sender and receiver. Information may be switched as it travels through various.
NET323 D: Network Protocols
Net 323: NETWORK Protocols
Communication in Distributed Systems
CMSC 611: Advanced Computer Architecture
Concurrency: Mutual Exclusion and Synchronization
Chapter 14 User Datagram Protocol (UDP)
Switching Techniques In large networks there might be multiple paths linking sender and receiver. Information may be switched as it travels through various.
Inter Process Communication (IPC)
NET323 D: Network Protocols
Process-to-Process Delivery:
TCP/IP Protocol Suite: Review
Multiple Processor Systems
Switching Techniques.
TCP/IP Protocol Suite: Review
Basic Mechanisms How Bits Move.
CPEG514 Advanced Computer Networkst
Ch 17 - Binding Protocol Addresses
Process-to-Process Delivery: UDP, TCP
Transport Layer 9/22/2019.
Data Link Layer. Position of the data-link layer.
Exceptions and networking
Presentation transcript:

Communication in Distributed Systems

. The single most important difference between a distributed system and a uniprocessor system is the interprocess communication.

. In a uniprocessor system, interprocess communication assumes the existence of shared memory. A typical example is the producer-consumer problem. One process writes to -  buffer -  reads from another process The most basic form of synchronization, the semaphore requires one word (the semaphore variable) to be shared.

. In a distributed system, there’s no shared memory, so the entire nature of interprocess communication must be completely rethought from scratch. All communication in distributed system is based on message passing.

. E.g. Proc. A wants to communicate with Proc. B 1.It first builds a message in its own address space 2.It executes a system call 3.The OS fetches the message and sends it through network to B.

. A and B have to agree on the meaning of the bits being sent. For example, How many volts should be used to signal a 0-bit? 1-bit? How does the receiver know which is the last bit of the message? How can it detect if a message has been damaged or lost? How long are numbers, strings, and other data items? And how are they represented?

OSI (Open System Interconnection Reference model) Presentation Session Data link Network Physical Transport Interface Process A Machine 1 Presentation Sessionn Data link Network Physical Transport Interface Process B Machine 2 Network Application protocol Presentation protocol Session protocol Transport protocol Network protocol Application Data link protocol Physical protocol

Client-Server Model Client Kernel Server Kernel Network Request Reply

Client-Server Model Layer Request/Reply Data link Physical

Advantages Simplicity: The client sends a request and gets an answer. No connection has to be established. Efficiency: just 3 layers. Getting packets from client to server and back is handled by 1 and 2 by hardware: an Ethernet or Token ring. No routing is needed and no connections are established, so layers 3 and 4 are not needed. Layer 5 defines the set of legal requests and replies to these requests. two system calls: send (dest, &mptr), receive (addr, &mptr)

Addressing 1.the server’s address was simply hardwired as a constant 2.Machine # + Process #: Machine # + local-id Disadvantage: it is not transparent to the user. If the server is changed from 243 to 170, the program has to be changed.

. 4. Assign each process a unique address that does not contain an embedded machine number. One way to achieve this is to have a centralized process address allocator that simply maintains a counter. Upon receiving a request for an address, it simply returns the current value of the counter and increment it by one. Disadvantage: centralize does not scale to large systems.

. 5. Let each process pick its own id from a large, sparse address space, such as the space of 64-bit binary integers. Problem: how does the sending kernel know what machine to send the message to?

. Solution: a.The sender can broadcast a special “locate packet” containing the address of the destination process. b. All the kernel check to see if the address is theirs. c. If so, send back “here I am” message giving their network address (machine number). Disadvantage: broadcasting puts extra load on the system.

. 6. provide an extra machine to map high- level (ASCII) service names to machine addresses. Servers can be referred to by ASCII strings in the program. Disadvantage: centralized component: the name server

. 7. Use special hardware. Let process pick random address. Instead of locating them by broadcasting, locate them by hardware.

Blocking versus Nonblocking Primitives Client running Trap to kernel, Process blocked Client running Return from kernel, process released Client blocked Message being sent Blocking send primitive

Nonblocking send primitive Client running Trap Client running Client blocked Return Message copied to kernel buffer Message being sent

Nonblocking primitives Advantage: can continue execution without waiting. Disadvantage: the sender cannot modify the message buffer until the message has been sent and it does not know when the transfer can complete. It can hardly avoid touching the buffer forever.

Solutions to the drawbacks of nonblocking primitives 1.To have the kernel copy the message to an internal kernel buffer and then allow process to continue. Problem: extra copies reduce the system performance. 2. Interrupt the sender when the message has been sent Problem: user-level interrupts make programming tricky, difficult, and subject to race conditions.

Buffered versus Unbuffered Primitives No buffer allocated. Fine if receive() is called before send(). Buffers allocated, freed, and managed to store the incoming message. Usually a mailbox created.

Reliable versus Unreliable Primitives The system has no guarantee about message being delivered. The receiving machine sent an acknowledgement back. Only when this ack is received, will the sending kernel free the user (client) process. Use reply as ack.

Implementing the client-server model ItemOption 1Option 2Option 3 AddressingMachine numberSparse process address ASCII names looked up via server BlockingBlocking primitives Nonblocking with copy to kernel Nonblocking with interrupt BufferingUnbuffered, discarding unexpected messages Unbuffered, temporarily keeping unexpected messages Mailboxes ReliabilityUnreliableRequest-Ack-Reply Ack Request-Reply-Ack

Acknowledgement Long messages can be split into multiple packets. For example, one message: 1-1, 1-2, 1-3; another message: 2-1, 2-2, 2-3, 2-4. Ack each individual packet Advantage: if a packet is lost, only that packet has to be retransmitted. Disadvantage: require more packets on the network. Ack entire message Advantage: fewer packets Disadvantage: more complicated recovery when a packet is lost. (Because retransmit the entire message).

CodePacket typeFromToDescription REQRequestClientServerThe client wants service REPReplyServerClientReply from the server to the client ACKAckEitherOtherThe previous packet arrived AYAAre you alive? ClientServerProbe to see if the server has crashed IAAI am aliveServerClientThe server has not crashed TATry againServerClientThe server has no room AUAddress unknown ServerClientNo process is using this address

Some examples of packet exchanges for client-server communication ClientServer REQ REP ClientServer REQ Client Server REQ ACK REP ACK AYA IAA REP ACK