EECE.4810/EECE.5730 Operating Systems

Slides:



Advertisements
Similar presentations
Remote Procedure Call (RPC)
Advertisements

Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
Remote Procedure Calls. 2 Client/Server Paradigm Common model for structuring distributed computations A server is a program (or collection of programs)
Process-to-Process Delivery:
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 12 Communicating over.
1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.
Communication Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
Advanced Computer Networks Topic 2: Characterization of Distributed Systems.
Politecnico di Milano © 2001 William Fornaciari Operating Systems R P C Remote Procedure Call Lecturer: William Fornaciari Politecnico di Milano
1 Lecture 5 (part2) : “Interprocess communication” n reasons for process cooperation n types of message passing n direct and indirect message passing n.
3.1 Silberschatz, Galvin and Gagne ©2009Operating System Concepts with Java – 8 th Edition Chapter 3: Processes.
 Remote Procedure Call (RPC) is a high-level model for client-sever communication.  It provides the programmers with a familiar mechanism for building.
CSE 451: Operating Systems Winter 2015 Module 22 Remote Procedure Call (RPC) Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
Remote Procedure Call Andy Wang Operating Systems COP 4610 / CGS 5765.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
CPS110: More Networks Landon Cox March 25, Virtual/physical interfaces Hardware OS Applications.
1 Chapter 2. Communication. STEMPusan National University STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered.
Topic 3: Remote Invocation Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
Remote Procedure Calls
Last Class: Introduction
Client-Server Communication
CPS110: More Networks Landon Cox March 30, 2009.
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
Prof. Leonardo Mostarda University of Camerino
IPC and RPC.
Distributed Systems CS
CMSC621: Advanced Operating Systems Advanced Operating Systems
CSE 451: Operating Systems Winter 2006 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
EECE.4810/EECE.5730 Operating Systems
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Sarah Diesburg Operating Systems COP 4610
Process-to-Process Delivery:
CSE 451: Operating Systems Autumn 2003 Lecture 16 RPC
CSE 451: Operating Systems Winter 2007 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CGS 3763 Operating Systems Concepts Spring 2013
Remote Procedure Call (RPC) Neil Tang 11/26/2008
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Advanced Computer Networks
CSE 451: Operating Systems Winter 2004 Module 19 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Spring 2012 Module 22 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Autumn 2009 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Prof. Leonardo Mostarda University of Camerino
Remote Procedure Call Hank Levy 1.
Distributed Systems CS
Remote Procedure Call Hank Levy 1.
EECE.4810/EECE.5730 Operating Systems
CSE 451: Operating Systems Autumn 2010 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
EECE.4810/EECE.5730 Operating Systems
Lecture 6: RPC (exercises/questions)
Lecture 7: RPC (exercises/questions)
CSE 451: Operating Systems Winter 2003 Lecture 16 RPC
Process-to-Process Delivery: UDP, TCP
EECE.4810/EECE.5730 Operating Systems
EECE.4810/EECE.5730 Operating Systems
Remote Procedure Call Hank Levy 1.
EECE.4810/EECE.5730 Operating Systems
Last Class: Communication in Distributed Systems
EECE.4810/EECE.5730 Operating Systems
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
EECE.4810/EECE.5730 Operating Systems
Communication.
Distributed Systems CS
Presentation transcript:

EECE.4810/EECE.5730 Operating Systems Instructor: Dr. Michael Geiger Spring 2017 Lecture 20: OS, networks, and distributed communication (cont.)

Operating Systems: Lecture 20 Lecture outline Today’s lecture Review OS & network basics Remote procedure calls Distributed applications 2/22/2019 Operating Systems: Lecture 20

Review: OS network abstractions Multiple computers connected via network  seen as single computer Machine-to-machine communication  process-to-process communication Unreliable, unordered delivery of finite messages  reliable, ordered delivery of byte stream 2/22/2019 Operating Systems: Lecture 20

Operating Systems: Lecture 20 Review: Sockets Socket Virtual network interface card Named communication endpoint NIC has MAC address; socket has port number Supports abstraction of process-to-process communication OS multiplexes multiple sockets to single NIC 2/22/2019 Operating Systems: Lecture 20

Review: Ordered & reliable messages Application interface: messages seen in order they’re sent Per-connection sequence # in message header Order messages at receiver Detect duplicates (result of perceived drops) Dropped messages detected by sender Lack of acknowledgement from receiver prior to timeout Sender retransmits message Errors detected through redundant info (checksum) Drop corrupted messages  leads to retransmission 2/22/2019 Operating Systems: Lecture 20

Review: Client-server Common distributed application structure Server provides centralized service Client makes request, then waits for response Example: web server Server stores, returns web pages Clients run web browsers Example: producer-consumer Server manages state of coke machine Clients call client_produce() or client_consume(), which send request to server and return when done Client requests block at server until satisfied 2/22/2019 Operating Systems: Lecture 20

Review: Producer-consumer client-server server() { receive request if (produce request) create thread that calls server_produce() else create thread that calls server_consume() } server_produce() { lock while (machine is full) { wait put coke in machine send response to client unlock 2/22/2019 Operating Systems: Lecture 20

Operating Systems: Lecture 20 Remote procedure call Explicit send/receive calls expose distributed nature of system Remote procedure call hide complexity of message-based communication Procedure calls more natural for inter-process communication Goals of RPC Client sending request  function call Client receiving response  function return Server receiving request  function invocation Server sending response  returning to caller 2/22/2019 Operating Systems: Lecture 20

Operating Systems: Lecture 20 RPC stubs 2/22/2019 Operating Systems: Lecture 20

Operating Systems: Lecture 20 RPC stubs Stub: piece of code to convert parameters passed between client/server in RPC Why do parameters need to be converted? Local/remote processors may use different architectures Different data representations (e.g., big- vs. little-endian) Potentially different calling conventions Client/server processes have different address spaces Pointer arguments invalid Client stub marshals parameters before sending Converts to format appropriate for transmission Packs all data into message to be sent via socket 2/22/2019 Operating Systems: Lecture 20

Operating Systems: Lecture 20 Stub outlines Client stub Construct message with function name and parameters Send request message to server Receive response from server Return response to client Server stub Receive request message Invoke correct function with specified params Construct response message with return value Send response to client stub 2/22/2019 Operating Systems: Lecture 20

Producer-consumer using RPC Client stub int produce(int n) { int status; send(sock, &n, sizeof(n)); recv(sock, &status, sizeof(status)); return status; } Server stub void produce_stub() { int n; recv(sock, &n, sizeof(n)); status = produce(n); send(sock, &status, sizeof(status)); 2/22/2019 Operating Systems: Lecture 20

Operating Systems: Lecture 20 Stub generation Stub libraries need to be installed on both client & server Stubs can be automatically generated from specification written in interface definition language (IDL) Bridge between client, server architectures 2/22/2019 Operating Systems: Lecture 20

Operating Systems: Lecture 20 Distributed systems RPC: make request/response look like function call/return Distributed shared memory: make multiple memories look like single memory Distributed file system: make disks on multiple computers look like single file system Parallelizing compilers: make multiple CPUs look like one CPU Process migration/RPC: allow users to easily use remote processes 2/22/2019 Operating Systems: Lecture 20

Distributed applications Why build distributed applications? Performance Combined performance of many computers can be faster than performance of single computer Reliability Continuous service, even if some computers fail Preserve data, even if some storage systems fail Examples Scientific computing (massively parallel datasets) MMOs Distributed info processing (banking, airline reservations) 2/22/2019 Operating Systems: Lecture 20

Concurrency and distribution Distributed applications must be multithreaded Every computer runs at least one thread Need two mechanisms for multithreaded programs Atomic primitive to synchronize threads A way to share data between threads Do these work on distributed applications? No—no shared memory Can only communicate through send/receive 2/22/2019 Operating Systems: Lecture 20

Synchronization in distributed application Can race conditions exist without shared data? Recall: race condition = output/result dependent on timing or ordering of earlier events If you don’t impose ordering on messages, race condition absolutely possible! Atomicity in network: send/receive packet If two packets A & B sent to same receiver, receiver gets A, B, or both, but not combo OS builds up from hardware Multiple interleaved packets can be separated & ordered into single message OS ensures packet contains data from single message 2/22/2019 Operating Systems: Lecture 20

Operating Systems: Lecture 20 Final notes Next time: distributed file systems Lecture Wednesday, 4/19 No class Monday, 4/17 2/22/2019 Operating Systems: Lecture 20

Operating Systems: Lecture 20 Acknowledgements These slides are adapted from the following sources: Silberschatz, Galvin, & Gagne, Operating Systems Concepts, 9th edition Anderson & Dahlin, Operating Systems: Principles and Practice, 2nd edition Chen & Madhyastha, EECS 482 lecture notes, University of Michigan, Fall 2016 2/22/2019 Operating Systems: Lecture 20