Presentation is loading. Please wait.

Presentation is loading. Please wait.

Distributed (Operating) Systems -Virtualization- -Server Design Issues- -Process and Code Migration- Computer Engineering Department Distributed Systems.

Similar presentations


Presentation on theme: "Distributed (Operating) Systems -Virtualization- -Server Design Issues- -Process and Code Migration- Computer Engineering Department Distributed Systems."— Presentation transcript:

1 Distributed (Operating) Systems -Virtualization- -Server Design Issues- -Process and Code Migration- Computer Engineering Department Distributed Systems Course Assoc. Prof. Dr. Ahmet Sayar Kocaeli University - Fall 2015

2 -Virtualization-

3 Resource Virtualization On a single-processor computer, simultaneous execution is, of course, an illusion. As there is only a single CPU, only an instruction from a single thread or process will be executed at a time. By rapidly switching between threads and processes, the illusion of parallelism is created The separation between having a single CPU and being able to pretend there are more can be extended to other resources as well, leading to what is known as resource virtualization.

4 Virtualization Virtualization: extend or replace an existing interface to mimic the behavior of another system. – Introduced in 1970s: Run legacy software on newer mainframe hardware Handle platform diversity by running apps in VMs – Portability and flexibility

5 Virtualization Hardware - instruction sets Software - API Platform – Windows MI running on Windows 7 Much higher level: – Middleware and its applications

6 Types of Interfaces Different types of interfaces 1.Between hardware and software: Assembly instructions that can be invoked by any program. 2.Between OS and hardware: Assembly instructions by privileged programs 3.System calls: Offered by OS 4.Library functions: APIs Depending on what is replaced /mimicked, we obtain different forms of virtualization 1 3 2 4

7 Types of Virtualization 1. Process Virtual Machines Runtime system that essentially provides an abstract instruction set that is to be used for executing applications. Instructions can be interpreted but could also be emulated as is done for running Windows applications on Unix platforms. – In this case, emulator also mimic the system calls. Ex. JVM

8 Types of Virtualization 2. Virtual Machine Monitor VMM Typical examples are VMware and Xen Virtualization is implemented as a layer completely shielding hardware Offering the complete instruction sets Can be offered simultaneously to different programs at the same time It is possible to have multiple, and different operating systems run independently and concurrently on the same platform.

9 Machine Virtualization A virtual machine abstracts the computing resources of a physical machine into virtual resources End users only see the virtual resources – Can install their operating systems and run their applications on the virtual machines A Virtual Machine Monitor (or Hypervisor) is a software layer that implements the mapping from virtual resources to physical resources

10 -Server Design Issues-

11 Server Design Issues How to locate an end-point (port #)? – Well known port # 21 80 etc. - IANA a)Directory service (port mapper in Unix) b)Super server (inetd daemon in Unix)

12 A. Client to server binding using a daemon Daemon runs servers and keeps track of current end point of each service implemented by a co-located server. The daemon itself listens to a well known end point. A client will first contact the daemon, request the end point, and then contact the specific server.

13 B- Client to server binding using super server Super server is actually a daemon. Actually implementing each service by means of a separate server may be a waste of resources. Instead of having to keep track of so many passive processes, it is often more efficient to have a single superserver listening to each end point associated with a specific service. When a request comes in, the daemon forks a process to take further care of the request. The process will exit after it finishes.

14 Server Designs -more- 1.Iterative or sequential – Single process no threads in that process – Service one request at a time – No concurrency – Concurrent server: Does not handle the request itself but passes it to a separate thread or another process. And wait for another request 2.Multithreaded – Every time new request comes in handed it to new thread – Full concurrency 3.Event-based – Sits in between 1 and 2 – Single process with single thread – The way you emulate concurrency is that all calls are not blocking (non-blocking IO) – Sequential calls and single process but you still get concurrency

15 Server Designs -more- Stateful or Stateless? Stateful server – Maintain state of connected clients – Sessions in web servers Stateless server – No state for clients Soft state – Maintain state for a limited time; discarding state does not impact correctness Compare stateful vs. stateless – What if server crashes – Performance – in terms of different metrics – Session – no session in stateless servers

16 Server Clusters Collection of machines connected through a network, where each machine runs one or more servers Mostly connected with LAN having high bandwidth and low latency Logically organized into three tiers – Each tier may be optionally replicated; uses a dispatcher – Use TCP handoffs

17 TCP hand off Standard way of accessing server cluster – TCP connection Transport layer switch Switches accept incoming TCP connection requests and hand off connections to one of the servers. The server, in turn, will send an acknowledgement back to the requesting client, but inserting the switch’s IP address as the source field

18 Switches and single access point Switch can play an important role in distributing the load among the various servers - load balancer – Switch can inspect the payload of the incoming request: content- aware request distribution. – The simplest load-balancing policy that switch can follow is round robin. More advanced server selection criteria can be deployed as well. The most server clusters offer a single access point. What if that point fails? – To eliminate that several access points can be provided. DNS can return several addresses, all belonging to the same host name.

19 -Process and Code Migration-

20 Code and Process Migration Motivation – So far, communinication is limited to passing data – How about migrating code or process? – How does migration occur? Complexity – Heterogeneous - Homogeneous systems Which one is more complicated? – Code vs. process migration There are situations in which passing programs, sometimes even while they are being executed, simplifies the design of a distributed system.

21 Process migration - Strong Mobility - Key reasons: Performance and flexibility Entire process is moved from one machine to another. The overall system performance can be improved if the process is moved from the heavily loaded to lightly loaded machines. Better utilization of system-wide resources Distributed scheduling Examples: Condor –Workload management system for compute-intensive jobs –DQS – Distributed Queuing System

22 Code Migration - Weak Mobility - Basic motivation: Process data close to where those data resides Server to Client shipment: – Shipment of server code to client – filling forms (reduce communication, no need to pre-link stubs with client) Client to Server Shipment: – Ship parts of client application to server instead of data from server to client (e.g., databases) Improve parallelism – agent-based web searches Ex. Java applet, search engine – Google

23 Motivation - Code migration Flexibility – Dynamic configuration of distributed system – Clients don’t need preinstalled software – download on demand – The big area where it is becoming popular is drivers

24 Migration models Process = Code segment + Resource segment + Execution segment Weak versus strong mobility – Weak => transferred program starts from initial state Sender-initiated versus receiver-initiated Sender-initiated ( machine having the code ) – Migration initiated by machine where code resides – Client sending a query code to a database server Client should be pre-registered Receiver-initiated ( machine receiving the code ) – Migration initiated by machine that receives code – Java applets – Receiver can be anonymous

25 Who executes migrated entity? Code migration (weak mobility) 1.Execute in a separate process 2.[Applets] Execute in target process Execute in the same process that downloaded the code Process needs to be protected against malicious codes Process migration (strong mobility) 1.Migrate the same process 2.Create a clone and migrate it 1.Remote cloning (remote fork)

26 Models for Code Migration

27 What about resource segment Do Resources Migrate? So far, migration of the code and execution segment are mentioned. What about resource segment? Depends on resource-to-process binding – By identifier (strongest): adres of specific web site or ftp server – By value: Java libraries – By type (weakest): printers, local devices Depends on resource-to-machine bindings – Unattached to any node: Data files – Fastened resources (can be moved only at high cost) Local database, web sites – Fixed resources Can not be moved: Local devices, communication end points

28 Resource Migration Actions 3 x 3 = 9 different situations (from the previos slide) Actions to be taken with respect to the references to local resources when migrating code to another machine. GR: Establish global system-wide reference MV: Move the resources CP: Copy the resource RB: Rebind process to locally available resource

29 Case Studies Back up slides

30 Case study: Agents Software agents – Autonomous process capable of reacting to, and initiating changes in its environment, possibly in collaboration – More than a “process” – can act on its own Mobile agent – Capability to move between machines – Needs support for strong mobility – Example: D’Agents (aka Agent TCL) Support for heterogeneous systems, uses interpreted languages

31 Case Study: Viruses and Malware Viruses and malware are examples of mobile code – Malicious code spreads from one machine to another Sender-initiated: – proactive viruses that look for machines to infect Autonomous code Receiver-initiated – User (receiver) clicks on infected web URL or opens an infected email attachment

32 Case Study: PlanetLab Distributed cluster across universities – Used for experimental research by students and faculty in networking and distributed systems Uses a virtualized architecture – Linux Vservers – Node manager per machine – Obtain a “slice” for an experiment: slice creation service

33 Case Study: ISOS Internet scale operating system – Harness compute cycles of thousands of PCs on the Internet – PCs owned by different individuals – Donate CPU cycles/storage when not in use (pool resources) – Contact coordinator for work – Coordinator: partition large parallel app into small tasks Assign compute/storage tasks to PCs Examples: Seti@home, P2P backups

34 Case study: Condor Condor: use idle cycles on workstations in a LAN Used to run large batch jobs, long simulations Idle machines contact condor for work Condor assigns a waiting job User returns to workstation => suspend job, migrate Flexible job scheduling policies

35 backup

36 Migration in Heterogeneous Systems Systems can be heterogeneous (different architecture, OS) 1.Support only weak mobility: Recompile code, no run time information 2.Strong mobility: Recompile code segment, transfer execution segment [migration stack] (figure) 3.Virtual machines - interpret source (scripts) or intermediate code [Java]

37 Types of Virtualization Emulation – VM emulates/simulates complete hardware – Unmodified guest OS for a different PC can be run Bochs, VirtualPC for Mac, QEMU Full/native Virtualization – VM simulates “enough” hardware to allow an unmodified guest OS to be run in isolation Same hardware CPU – IBM VM family, VMWare Workstation, Parallels,…

38 Scalability Question : How can you scale the server capacity? – Buy bigger machine! – Replicate – Distribute data and/or algorithms – Ship code instead of data – Cache


Download ppt "Distributed (Operating) Systems -Virtualization- -Server Design Issues- -Process and Code Migration- Computer Engineering Department Distributed Systems."

Similar presentations


Ads by Google