Course Snapshot. The Next Few Classes

Similar documents
Course Snapshot. The Next Few Classes. Parallel versus Distributed Systems. Distributed Systems. We have covered all the fundamental OS components:

Last Class: Network Overview. Today: Distributed Systems

Distributed Computing

Distributed Systems. Distributed Object Systems 2 Java RMI. Java RMI. Example. Applet continued. Applet. slides2.pdf Sep 9,

JAVA RMI. Remote Method Invocation

Outline. EEC-681/781 Distributed Computing Systems. The OSI Network Architecture. Inter-Process Communications (IPC) Lecture 4

Object Interaction. Object Interaction. Introduction. Object Interaction vs. RPCs (2)

Distributed Systems. Why use distributed systems? What is a distributed system? Intro to Distributed Systems and Networks.

RMI (Remote Method Invocation) Over the year, there have been 3 different approaches to application development:

Remote Method Invocation

Communication Basics, RPC & RMI. CS403/534 Distributed Systems Erkay Savas Sabanci University

Module 16: Distributed System Structures

Distributed System Chapter 16 Issues in ch 17, ch 18

Chapter 17: Distributed Systems (DS)

Written by: Dave Matuszek

CHAPTER 17 - NETWORK AMD DISTRIBUTED SYSTEMS

RMI. Remote Method Invocation. 16-Dec-16

Distributed Systems. 5. Remote Method Invocation

DISTRIBUTED OBJECTS AND REMOTE INVOCATION

Module 16: Distributed System Structures. Operating System Concepts 8 th Edition,

Remote Procedure Call

COMP 6231: Distributed System Design

Introduction & RMI Basics. CS3524 Distributed Systems Lecture 01

Network Protocols and Architectures

Silberschatz and Galvin Chapter 15

Contents. Java RMI. Java RMI. Java RMI system elements. Example application processes/machines Client machine Process/Application A

Internet Routing. Review of Networking Principles. What s the Internet: nuts and bolts view. Communication links

Internet Routing. Review of Networking Principles

Data Communication. Chapter # 1: Introduction. By: William Stalling

Introduction to computer networking

Verteilte Systeme (Distributed Systems)

Module 15: Network Structures

Switching Networks (Fall 2010) EE 586 Communication and. August 27, Lecture 2. (modified by Cheung for EE586; based on K&R original) 1-1

The OSI Model. Open Systems Interconnection (OSI). Developed by the International Organization for Standardization (ISO).

Networking Applications

The UNIVERSITY of EDINBURGH. SCHOOL of INFORMATICS. CS4/MSc. Distributed Systems. Björn Franke. Room 2414

Communicating over the Network

5.4. Events and notifications

Part 1: Introduction. Goal: Review of how the Internet works Overview

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

Verteilte Systeme (Distributed Systems)

IT 4504 Section 4.0. Network Architectures. 2008, University of Colombo School of Computing 1

Distributed Systems. The main method of distributed object communication is with remote method invocation

Chapter 15: Distributed Communication. Sockets Remote Procedure Calls (RPCs) Remote Method Invocation (RMI) CORBA Object Registration

ก ก Information Technology II

Fundamental Issues. System Models and Networking Chapter 2,3. System Models. Architectural Model. Middleware. Bina Ramamurthy

Chapter 1. Computer Networks and the Internet

Chapter 16 Networking

RPC flow. 4.3 Remote procedure calls IDL. RPC components. Procedure. Program. sum (j,k) int j,k; {return j+k;} i = sum (3,7); Local procedure call

Module 2 Overview of Computer Networks

Module 2 Overview of. Computer Networks

Lecture 11: Networks & Networking

IBD Intergiciels et Bases de Données

Questions and Answers. A. RMI allows us to invoke a method of java object that executes on another machine.

Cisco Cisco Certified Network Associate (CCNA)

Introduction to Computer Networks INTRODUCTION TO COMPUTER NETWORKS

COMPONENTS OF DATA COMMUNICATION

What is a Network? A connection of two or more computers so that they can share resources.

What s a protocol? What s a protocol? A closer look at network structure: What s the Internet? Hardware view: What s the Internet?

Remote Method Invocation

Network.... communication system for connecting end- systems. End-systems a.k.a. hosts PCs, workstations dedicated computers network components

Lecture A4 Network / Internet. Computing and Art : Nature, Power, and Limits CC 3.12: Fall 2007

Internet Architecture & Performance. What s the Internet: nuts and bolts view

CS3600 SYSTEMS AND NETWORKS

Text Book. 1. Computer Networks & Internets by Douglas E Comer. 2. Data and Computer Communication by William Stalling, 5th or above edition.

5 Distributed Objects: The Java Approach

Networking and Internetworking 1

INTRODUCTION TO ICT.

Last Class: RPCs. Today:

What s a protocol? What s a protocol? A closer look at network structure: What s the Internet? What s the Internet? What s the Internet?

Chapter 4 Remote Procedure Calls and Distributed Transactions

Communication and Distributed Processing

Modulo II Introdução Sistemas Distribuídos

JAC444 - Lecture 11. Remote Method Invocation Segment 2 - Develop RMI Application. Jordan Anastasiade Java Programming Language Course

COS 140: Foundations of Computer Science

Chapter 2 Computer-System Structure

Computer Networks 1DV201

Component-Based Software Engineering

Module 15: Network Structures

DISTRIBUTED COMPUTING

CSci Introduction to Distributed Systems. Communication: RPC In Practice

CS193k, Stanford Handout #12. Threads 4 / RMI

TCP/IP THE TCP/IP ARCHITECTURE

Distributed Software Systems

Last Class: RPCs. Today:

Fundamentals of Networking Types of Topologies

System Programming. Introduction to computer networks

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 22: Remote Procedure Call (RPC)

Revision of Previous Lectures

Lecture 8: February 19

Communication Networks - 3 general areas: data communications, networking, protocols

Message Passing vs. Distributed Objects. 5/15/2009 Distributed Computing, M. L. Liu 1

03 Remote invocation. Request-reply RPC. Coulouris 5 Birrel_Nelson_84.pdf RMI

Digital Communication Networks

Defining Networks with the OSI Model. Module 2

EECS 228a Lecture 1 Overview: Networks. Jean Walrand

1: Review Of Semester Provide an overview of encapsulation.

Principles behind data link layer services

Next Steps Spring 2011 Lecture #18. Multi-hop Networks. Network Reliability. Have: digital point-to-point. Want: many interconnected points

Data Communication and Network. Introducing Networks

Transcription:

Course Snapshot We have covered all the fundamental OS components: Architecture and OS interactions Processes and threads Synchronization and deadlock Process scheduling Memory management File systems and I/O Lecture 21, page 1 The Next Few Classes Distributed Systems Networking Basics Distributed services (email, www, telnet) Distributed Operating Systems Distributed File Systems Guest lectures and special topics Linux (already done ) Lecture 21, page 2

Distributed Systems Distributed system: a set of physically separate processors connected by one or more communication links Nearly all systems today are distributed in some way. Email, file servers, network printers, remote backup, world wide web Lecture 21, page 3 Parallel versus Distributed Systems Tightly-coupled systems: parallel processing Processors share clock, memory, and run one OS Frequent communication Loosely-coupled systems: distributed computing Each processor has its own memory Each processor runs an independent OS Communication should be less frequent Lecture 21, page 4

Advantages of Distributed Systems Resource sharing: Resources need not be replicated at each processor (for example, shared files) Expensive (scarce) resources can be shared (for example, printers) Each processor can present the same environment to the user (for example, by keeping files on a file server) Computational speedup: n processors potentially gives you n times the computational power Problems must be decomposable into subproblems Coordination and communication between cooperating processes (synchronization, exchange of results) is needed. Lecture 21, page 5 Advantages of Distributed Systems Reliability: Replication of resources yields fault tolerance. For example, if one node crashes, the user can work on another. Performance will degrade, but system remains operational. However, if some component of the system is centralized, a single point of failure may result Example: If an Edlab workstation crashes, you can use another workstation. If the file server crashes, none of the workstations are useful. Communication: Users/processes on different systems can communicate. For example, mail, transaction processing systems like airlines, and banks, WWW. Lecture 21, page 6

Distributed Systems Modern work environments are distributed => operating systems need to be distributed What do we need to consider when building these systems? Communication and networks Transparency (how visible is the distribution?) Security Reliability Performance and scalability Programming models Lecture 21, page 7 Distributed System Design What gets harder when we move from a stand alone system to a distributed environment? resource sharing timing (e.g., synchronization) critical sections deadlock detection and recovery failure recovery Lecture 21, page 8

Networks Networks are usually concerned with providing efficient, correct, and robust message passing between two separate nodes. Local Area Network (LAN) usually connects nodes in a single building and needs to be fast and reliable (for example, Ethernet). Media: twisted-pair, coaxial cable, fiber optics Typical bandwidth: 10-100-1000 Mb/s (10Gb/s now available) Wide Area Network (WAN) connects nodes across the state, country, or planet. WANs are typically slower and less reliable than LAN (for example, Internet). Media: telephone lines (T1 service), microwave links, satellite channels Typical bandwidth: 1.544 Mb/s (T1), 45 Mb/s (T3) Lecture 21, page 9 Principles of Network Communication Data sent into the network is chopped into packets, the network's basic transmission unit. Packets are sent through the network. Computers at the switching points control the packet flow. Analogy: cars/road/police - packets/network/computer Shared resources can lead to contention (traffic jams). Analogy: Shared node - Mullins Center Shared link - bridge Lecture 21, page 10

Communication Protocols Protocol: a set of rules for communication that are agreed to by all parties Protocol stack : networking software is structured into layers Each layer N, provides a service to layer N+1, by using its own layer N procedures and the interface to the N-1 layer. Example: International Standards Organization/ Open Systems Interconnect (ISO/OSI) Lecture 21, page 11 ISO Network Protocol Stack Application layer: applications that use the net, e.g., mail, netscape, X- services, ftp, telnet, provide a UI Presentation layer: data format conversion, e.g., big/little endian integer format) Session layer: implements the communication strategy, such as RPC. Provided by libraries. Transport layer: reliable end-to-end communication between any set of nodes. Provided by OS. Network layer: routing and congestion control. Usually implemented in OS. Data Link Control layer: reliable point-to-point communication of packets over an unreliable channel. Sometimes implemented in hardware, sometimes in software (PPP). Physical layer: electrical/optical signaling across a wire. Deals with timing issues. Implemented in hardware. Lecture 21, page 12

TCP/IP Protocol Stack Most Internet sites use TCP/IP - Transmission Control Protocol/ Internet Protocol. It has fewer layers than ISO to increase efficiency. Consists of a suite of protocols: UDP, TCP, IP... TCP is a reliable protocol -- packets are received in the order they are sent UDP (user datagram protocol) an unreliable protocol (no guarantee of delivery). Lecture 21, page 13 Packet Each message is chopped into packets. Each packet contains all the information needed to recreate the original message. For example, packets may arrive out of order and the destination node must be able to put them back into order. Ethernet Packet Contents The data segment of the packet contains headers for higher protocol layers and actual application data Lecture 21, page 14

Point-to-Point Network Topologies Fully connected: all nodes connected to all other nodes Each message takes only a single hop, i.e., goes directly to the destination without going through any other node Failure of any one node does not affect communication between other nodes Expensive, especially with lots of nodes, not practical for WANs Lecture 21, page 15 Point-to-Point Network Topologies Partially connected: links between some, but not all nodes Less expensive, but less tolerant to failures. A single failure can partition the network. Sending a message to a node may have to go through several other nodes => need routing algorithms. WANs typically use this structure. Lecture 21, page 16

Point-to-Point Networks Topologies Tree structure: network hierarchy All messages between direct descendants are fast, but messages between cousins must go up to a common ancestor and then back down. Some corporate networks use this topology, since it matches a hierarchical world view... Not tolerant of failures. If any interior node fails, the network is partitioned. Lecture 21, page 17 Point-to-Point Networks Topologies Star: - all nodes connect to a single centralized node The central site is generally dedicated to network traffic. Each message takes only two hops. If one piece of hardware fails, that disconnects the entire network. Inexpensive, and sometimes used for LAN Lecture 21, page 18

Ring Networks Topologies One directional ring - nodes can only send in one direction. Given n nodes, message may need to go n-1 hops. Inexpensive, but one failure partitions the network. Bi-directional ring - nodes can send in either direction. With n nodes, a message needs to go at at most n/2 hops. Inexpensive, tolerates a single failure by increasing message hops. Two failures partition the network. Lecture 21, page 19 Ring Networks Topologies Doubly connected ring nodes connected to neighbors and one away neighbors A message takes at most n/4 hops. More expensive, but more tolerant of failures. Lecture 21, page 20

Bus Network Topologies Bus nodes connect to a common network Linear bus - single shared link Nodes connect directly to each other using multiaccess bus technology. Inexpensive (linear in the number of nodes) and tolerant of node failures. Ethernet LAN use this structure. Ring bus - single shared circular link Same technology and tradeoffs as a linear bus. Lecture 21, page 21 Resource Sharing There are many mechanisms for sharing (hardware, software, data) resources. Data Migration: moving the data around Computation Migration: move the computation to the data Job Migration: moving the job (computation and data) or part of the job => The fundamental tradeoff in resource sharing is to complete user instructions as fast and as cheaply as possible. (Fast and cheap are usually incompatible.) If communication is cheap: use all resources If computation is slow/expensive: local processing Reality is somewhere in between Lecture 21, page 22

Client/Server Model One of the most common models for structuring distributed computation is by using the client/server paradigm. A server is a process or collection of processes that provide a service, e.g., name service, file service, database service, etc. The server may exist on one or more nodes. A client is a program that uses the service. A client first binds to the server, i.e., locates it in the network and establishes a connection. The client then sends the server a request to perform some action. The server sends back a response. RPC is one common way this structure is implemented. Lecture 21, page 23 Remote Procedure Call Basic idea: Servers export procedures for some set of clients to call. To use the server, the client does a procedure call. OS manages the communication. Lecture 21, page 24

Remote Procedure Call: Implementation Issues For each procedure on which we want to support RPC: The RPC mechanism uses the procedure signature (number and type of arguments and return value) to generate a client stub that bundles up the RPC arguments and sends it off to the server, and to generate the server stub that unpacks the message, and makes the procedure call. Lecture 21, page 25 Client Stub: build message send message wait for response unpack reply return result Remote Procedure Call: Implementation Issues Server Stub: create threads loop wait for a command unpack request parameters call procedure with thread build reply with result(s) send reply end loop Comparison between RPC and a regular procedure call Name of procedure Parameters Result Return address Lecture 21, page 26

Remote Procedure Call How does the client know the right port? The binding can be static - fixed at compile time. Or the binding can be dynamic - fixed at runtime. In most RPC systems, dynamic binding is performed using a name service. When the server starts up, it exports its interface and identifies itself to a network name server The client, before issuing any calls, asks the name service for the location of a server whose name it knows and then establishes a connection with the server. Lecture 21, page 27 Example: Remote Method Invocation (RMI) in Java Java provides the following classes/interfaces: Naming: class that provides the calls to communicate with the remote object registry public static void bind(string name, Remote obj) - Binds a server to a name. public static Remote lookup(string name) - Returns the server object that corresponds to a name. UnicastRemoteObject: supports references to non-replicated remote objects using TCP, exports the interface automatically when the server object is constructed Java provides the following tools: rmiregistry server-side name server rmic: given the server interface, generates client and server stubs that create and interpret packets Lecture 21, page 28

Example: Server in Java Server Defines an interface listing the signatures of methods the server will satisfy Implements each of the methods in the interface Main program for server: Creates one or more server objects - normal constructor call where the object being constructed is a subclass of RemoteObject Registers the objects with the remote object registry Client Looks up the server in the remote object registry Uses normal method call syntax for remote methods Should handle RemoteException Lecture 21, page 29 Example: Hello World Server Interface Declare the methods that the server provides: package examples.hello; // All servers must extend the Remote interface. public interface Hello extends java.rmi.remote { } // Any remote method might throw RemoteException. // Indicates network failure. String sayhello() throws java.rmi.remoteexception; Lecture 21, page 30

Example: Hello World Server package examples.hello; import java.rmi.*; import java.rmi.server.unicastremoteobject; public class HelloImpl extends UnicastRemoteObject implements Hello { public HelloImpl() throws RemoteException { // The superclass constructor exports the interface and gets a port super(); } public String sayhello() throws RemoteException { // This is the "service" provided. return "Hello World!"; } Lecture 21, page 31 Example: Hello World Server (contd) public static void main(string args[]) { // Create and install a security manager System.setSecurityManager(new RMISecurityManager()); // Construct the server object. HelloImpl obj = new HelloImpl(); } } // Register the server with the name server. Naming.rebind("//myhost/HelloServer", obj); Lecture 21, page 32

Example: Hello World Client package examples.hello; import java.awt.*; import java.rmi.*; public class HelloApplet extends java.applet.applet { String message = ""; // The init method begins the execution of the applet on the client // machine that is viewing the Web page containing the reference // to the applet. public void init() { try { // Looks up the server using the name server on the host that // the applet came from. Hello obj = (Hello)Naming.lookup( "//" + getcodebase().gethost() + "/HelloServer"); Lecture 21, page 33 Example: Hello World Client (contd) // Calls the sayhello method on the remote object. message = obj.sayhello(); } catch (RemoteException e) { System.out.println("HelloApplet RemoteException caught"); } } public void paint(graphics g) { // The applet will write the string returned by the remote method // call on the display. g.drawstring(message, 25, 50); } } Lecture 21, page 34

Summary Virtually all computer systems contain distributed components Networks hook them together Networks make tradeoffs between speed, reliability, and expense Lecture 21, page 35