You are on page 1of 62

AMERICAN INTERNATIONAL UNIVERSITY-BANGLADESH

CSC5012: ADVANCED OPERATING SYSTEM


Lecture: # 9 Week: # 5 Semester: FALL 2021-2022

Distributed OS

Instructor: Dr. Afroza Nahar, Associate Professor


Department of Computer Science, Faculty of Science & Technology.
afroza@aiub.edu
OUTLINE
 Introduction of distributed operating systems

 Overview of major issues in distributed systems

Terminology
Communication models
Remote procedure calls

 Overview of distributed operating systems

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 2
2
WHAT IS DISTRIBUTED
SYSTEM?
 A collection of autonomous computers
 linked by a network

 using software to produce an integrated computing facility

 What size is a distributed system?

 Local Area Network (10's of hosts)


 Metropolitan Area Networks (100's of hosts)
 Wide Area Networks (internet) (1000's or 1,000,000's of hosts)

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 3
3
DISTRIBUTED SYSTEM : EXAMPLE
Applications of DS
 Intranets,
 Internet,
 WWW,
 email.

Telecommunication networks: Telephone networks and


Cellular networks.

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 4
4
DISTRIBUTED SYSTEM…
 It consists of multiple computers that do not share a
memory.

 Each Computer has its own memory and runs its own
operating system.

 The computers can communicate with each other


through a communication network.

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 5
5
DISTRIBUTED SYSTEM…
 Where is the knowledge of distributed operating systems
likely to be useful?
 Custom OS's for high performance computer systems
 OS subsystems, like Network File System (NFS), Network Information
Service (NIS)
 Distributed ``middleware'' for large computations
 Distributed applications

Note: The Network Information Service (NIS) and Network File System (NFS) are services that
allow you to build distributed computing systems that are both consistent in their appearance
and transparent in the way files and data are shared. NIS provides a distributed
database system for common configuration files.

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 6
6
DISTRIBUTED SYSTEM…

 Distributed system organized as middleware.


Note that the middleware layer extends over multiple machines 

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 7
7
WHY BUILD A DISTRIBUTED
SYSTEM?
 Microprocessors are getting more and more powerful.
 A distributed system combines (and increases) the computing
power of individual computer.
 Some advantages include:
 Resource sharing (but not as easily as if on the same machine)
 Enhanced performance (but 2 machines are not as good as a single machine
that is 2 times as fast)
 Improved reliability & availability (but probability of single failure increases,
as does difficulty of recovery)
 Modular expandability

 Distributed OS's have not been economically successful!!!


11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 8
8
ADVANTAGES OF DISTRIBUTED
SYSTEM
 Reliability, high fault tolerance:
 A system crash on one server does not affect other servers.

 Scalability:
 In distributed computing systems you can add more machines
as needed.

 Flexibility:
 It makes it easy to install, implement and debug new services.

Communication and resource sharing possible

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 9
9
DISADVANTAGES
 Distribution-aware PLs, OSs and applications
 Network connectivity essential
 Security and privacy

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 10
10
TRANSPARENCY IN A DS

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 11
11
OPEN DISTRIBUTED SYSTEMS
 Offer services that are described a priori
 Syntax and semantics are known via protocols

 Services specified via interfaces


 Benefits
 Interoperability

 Portability

 Extensibility
 Open system evolve over time and should be extensible to
accommodate new functionality.

 Separate policy from mechanism

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 12
12
SYSTEM MODELS
 The minicomputer model (e.g early computer network)
 Each user has local machine
 Local processing but can fetch remote data (files, databases)

 The workstation model (e.g sprite)


 Processing can also migrate
 each user has a workstation, the system provides some
common services, such as a distributed file system.

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 13
13
SYSTEM MODELS…
 Client-server Model (e.g., V system, world wide web)
 User has local workstation
 Powerful workstations serve as servers (file, print, DB servers)

 The processor pool model (e.g., Amoeba, Plan 9)

 Terminals are Xterms or diskless terminals


 Pool of backend processors handle processing

i. e The model allocates processor to a user according to the user's


needs.

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 14
14
SYSTEM MODELS…
 Cluster computing systems / Data centers
 LAN with a cluster of servers + storage
 Linux, Mosix, ..
 Used by distributed web servers, scientific applications, enterprise
applications

 Grid computing systems


 Cluster of machines connected over a WAN
 SETI@ home
 WAN-based clusters / distributed data centers
 Google, Amazon, …

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 15
15
EMERGING MODELS
 Distributed Pervasive Systems

 “smaller” nodes with networking capabilities


 Computing is “everywhere”
 Home networks: TiVO, Windows Media Center, …
 Mobile computing: smart phones, iPODs, Car-based
PCs
 Sensor networks
 Health-care: personal area networks

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 16
16
UNIPROCESSOR OPERATING SYSTEMS
(REVIEW)
  An OS acts as a resource manager or an arbitrator
 Manages CPU, I/O devices, memory

 OS provides a virtual interface that is easier to use than


hardware

 Structure of uniprocessor operating systems


 Monolithic (e.g., MS-DOS, early UNIX)
 One large kernel that handles everything

 Layered design
 Functionality is decomposed into N layers

 Each layer uses services of layer N-1 and implements new service(s)
for layer N+1
11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 17
17
UNIPROCESSOR OPERATING SYSTEMS
(REVIEW)
 Microkernel architecture
 Small kernel
 user-level servers implement additional functionality

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 18
18
ISSUES IN DISTRIBUTED
SYSTEM
 The lack of global knowledge.
 Naming.
 Scalability.
 Compatibility.
 Process synchronization (requires global knowledge)
 Resource management (requires global knowledge)
 Security.
 Fault tolerance, error recovery.

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 19
19
LACK OF GLOBAL KNOWLEDGE
 Communication delays are at the core of the problem

 Information may become false before it can be acted upon

 These create some fundamental problems:

 no global clock -- scheduling based on fifo queue?

 no global state -- what is the state of a task? What is a


correct program?

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 20
20
NAMING
 Named objects: computers, users, files, printers, services

 Namespace must be large

 Unique (or at least unambiguous) names are needed

 Logical to physical mapping needed

 Mapping must be changeable, expandable, reliable, fast

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 21
21
SCALABILITY
 How large is the system designed for?

 How does increasing number of hosts affect overhead?

 Broadcasting primitives, directories stored at every


computer -- these design options will not work for large
systems.

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 22
22
COMPATIBILITY
 Binary level: same architecture (object code)

 Execution level: same source code can be compiled and


executed (source code).

 Protocol level: only requires all system components to


support a common set of protocols.

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 23
23
PROCESS SYNCHRONIZATION
 test-and-set instruction won't work.

 Need all new synchronization mechanisms for distributed


systems.

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 24
24
DISTRIBUTED RESOURCE
MANAGEMENT
 Data migration: data are brought to the location that
needs them.
 distributed filesystem (file migration)
 distributed shared memory (page migration)

 Computation migration: the computation migrates to


another location.
 remote procedure call: computation is done at the remote
machine.
 processes migration: processes are transferred to other
processors.
11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 25
25
SECURITY
 Authentication: guaranteeing that an entity is what it
claims to be.

 Authorization: deciding what privileges an entity has and


making only those privileges available.

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 26
26
STRUCTURING
 The monolithic kernel: one piece

 The collective kernel structure: a collection of processes

 Object oriented: the services provided by the OS are


implemented as a set of objects.

 Client-server: servers provide the services and clients use the


services.

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 27
27
COMMUNICATION NETWORKS
 WAN and LAN

 Traditional operating systems implement the TCP/IP protocol


stack: host to network layer, IP layer, transport layer,
application layer.

 Most distributed operating systems are not concerned with


the lower layer communication primitives.

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 28
28
COMMUNICATION MODELS
Message passing
Remote procedure call (RPC)

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 29
29
MESSAGE PASSING PRIMITIVES
 Send (message, destination), Receive (source, buffer)
buffered vs. unbuffered
blocking vs. nonblocking
reliable vs. unreliable
synchronous vs. asynchronous

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 30
30
RPC
 With message passing, the application programmer must worry about
many details:
 parsing messages
 pairing responses with request messages
 converting between data representations
 knowing the address of the remote machine/server
 handling communication and system failures
 RPC is introduced to help hide and automate these details.
 RPC is based on a ``virtual'' procedure call model
 client calls server, specifying operation and arguments
 server executes operation, returning results
11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 31
31
RPC ISSUES
 Stubs (See Unix rpcgen tool, for example.)
 

 are automatically generated, e.g. by compiler


 do the ``dirty work'' of communication
 Binding method
 server address may be looked up by service-name
 or port number may be looked up
 Parameter and result passing
 Error handling semantics

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 32
32
RPC DIAGRAM

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 33
33
SCALABILITY PROBLEMS
 Scalability problems in distributed systems appear as
performance problems caused by limited capacity of servers and
network.

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 34
34
SCALING TECHNIQUES
 Principles for good decentralized algorithms

 No machine has complete state


 Make decision based on local information
 A single failure does not bring down the system
 No global clock

 Techniques
 Asynchronous communication
 Distribution
 Caching and replication

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 35
35
SCALING TECHNIQUES 1
 There are now basically only three techniques for scaling:
1. Hiding communication latencies : avoid waiting for responses
to remote service request when possible

 Asynchronous communication
 Reduce overall communication
2. Distribution : split a component into parts & distribute them
across the system

3. Replication:
 Increase availability
 Helps balance the load
 May hide communication latency
11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 36
36
SCALING TECHNIQUES 1

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 37
37
SCALING TECHNIQUES 2

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 38
38
HARDWARE CONCEPT

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 39
39
MULTIPROCESSORS 1
 Single address space shared by all

 Coherency is easy but scalability a problem

 Solution – cache – now coherency is an issue

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 40
40
MULTIPROCESSORS 2 (SWITCH-
BASED)
 Competition for the bus is still an issue

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 41
41
HOMOGENEOUS MULTICOMPUTER
SYSTEMS 

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 42
42
SOFTWARE CONCEPTS
 Software Concepts OS for multicomputer/multiprocessors can be
divided in two categories
 Distributed OS – tightly-coupled systems
 Network OS – loosely-coupled systems
 From a NOW, to get a distributed system you need middleware

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 43
43
UNIPROCESSOR OPERATING
SYSTEM
  Uniprocessor Operating Systems OS for distributed systems and
uniprocessors are very much alike
 They act as resource managers for the underlying hardware
 Provide a virtual machine that hide the intricacies of the underlying
hardware
 Part of enabling resource sharing is protecting apps from each other
 Dual mode of operation – monolithic Oss
 Microkernels
 Pros and cons

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 44
44
MULTIPROCESSOR OPERATING
SYSTEM 1

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 45
45
MULTIPROCESSOR OPERATING
SYSTEM 1
 No shared memory – communication through message
passing
 You can
 Exposed message passing to application
 Hide it through distributed shared memory

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 46
46
MULTIPROCESSOR OPERATING
SYSTEM 2

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 47
47
DISTRIBUTED SHARED MEMORY
SYSTEM 1

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 48
48
DISTRIBUTED SHARED
MEMORY
 Since MP seems to be more difficult to program for
Distributed Shared Memory
 AS divided into pages
 Pages distributed among machines

 Performance improvements
 Replicate read-only pages
 Replicate all pages
 Weaker than strict consistency
 Larger pages sizes
 potential problem of false sharing

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 49
49
DISTRIBUTED SHARED MEMORY
SYSTEM 2

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 50
50
DISTRIBUTED OPERATING
SYSTEM
 Manages resources in a distributed system
 Seamlessly and transparently to the user

 Looks to the user like a centralized OS


 But operates on multiple independent CPUs

 Provides transparency
 Location, migration, concurrency, replication,…

 Presents users with a virtual uniprocessor

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 51
51
TYPES OF DISTRIBUTED OSS

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 52
52
MULTIPROCESSOR OPERATING
SYSTEMS
 Like a uniprocessor operating system

 Manages multiple CPUs transparently to the user

 Each processor has its own hardware cache


 Maintain consistency of cached data

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 53
53
MULTIPROCESSOR OPERATING
SYSTEMS
 Example: MOSIX cluster - single system image

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 54
54
NETWORK OPERATING SYSTEM
1
 Various machines interconnected; users can access
remote resources
 No assumptions of
 Homogeneous underlying hardware
 Managed as a single system

 Pros and Cons


 Harder to use
 Harder to manage
 Very easy to scale

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 55
55
NETWORK OPERATING SYSTEM
2
 Employs a client-server model
 Minimal OS kernel
 Additional functionality as user processes

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 56
56
NETWORK OPERATING SYSTEM
3

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 57
57
MIDDLEWARE-BASED SYSTEM
 Remember the definition of a distributed system
 Distributed OS – not intended to handle independent machines

 Network OS – does not provide a view of a single coherent system

 Most distributed systems are built from NOS +


middleware

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 58
58
MIDDLEWARE AND OPENNESS

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 59
59
COMPARISON BETWEEN
SYSTEMS

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 60
60
CLIENT -SERVER MODEL
 Clients and Servers as a model for distributed applications

 Layering: general organization of an Internet search


engine into 3 different layers

11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 61
61
11/08/2021
11/08/2021
Dr. Afroza Nahar
Dr. Afroza Nahar 62
62

You might also like