0% found this document useful (0 votes)
3 views26 pages

Distributed Systems Ch7

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views26 pages

Distributed Systems Ch7

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 26

CHAPTER 7

OPERATING SYSTEM SUPPORT

From Coulouris, Dollimore and Kindberg


Distributed Systems: Concepts and Design
Edition 5, © Pearson Education 2005

Dr. Aref Hassan Kurdali

CS 462 - Distributed Systems 1


Introduction

 This chapter discusses how operating


systems (OS) provide essential support for
middleware in distributed systems, focusing
on resource management, communication,
and process handling.

2
Introduction to Operating Systems in Distributed
Systems

• Definition: An operating system (OS) is software


that manages computer hardware and software
resources and provides common services for
computer programs.
• Role in Distributed Systems: In a distributed
system, the OS facilitates resource sharing,
communication, and coordination among multiple
nodes (computers) connected over a network.
• Key Focus: The chapter examines how OS
mechanisms impact middleware's ability to
deliver distributed resource sharing effectively.
3
OS Layer Overview

• Structure of OS: The OS layer consists of the


kernel, device drivers, and user-level services
that abstract hardware resources.
• Functions:
• Process Management: Handles the creation,
scheduling, and termination of processes.
• Memory Management: Manages the allocation and
deallocation of memory space as needed by
processes.
• I/O Management: Controls input and output
devices, ensuring efficient data transfer between
hardware and software.
4
OS Layer Overview

The figure shows the core OS functionality that we shall be concerned with: process
and thread management, memory management and communication between
processes on the same computer (horizontal divisions in the figure denote
dependencies). 5
Middleware and OS Interaction

• Definition of Middleware: Middleware is software


that acts as a bridge between different
applications or services, enabling communication
and data management in distributed systems.
• Interaction with OS: Middleware relies on the OS
for:
• Resource Access: Efficiently accessing hardware resources like
CPU, memory, and storage.
• Communication: Facilitating data exchange between
distributed components.
• Importance: The effectiveness of middleware is
heavily dependent on the underlying OS
capabilities.
6
Middleware and OS Interaction

The figure shows how the operating system layer at each of two nodes supports a
common middleware layer in providing a distributed infrastructure for applications
and services.
7
Key Components of OS

• Kernel: The core component of the OS


that manages system resources and
facilitates communication between
hardware and software.
• Responsibilities: Memory
management, process scheduling, and
device management.

8
Encapsulation in OS

• Definition: Encapsulation is the principle of


hiding the internal state and behavior of an
object and exposing only what is necessary.
• Service Interface: The OS provides a set of APIs
(Application Programming Interfaces) that allow
applications to interact with hardware resources
without needing to understand the underlying
complexities.
• Benefits: Simplifies application development
and enhances security by preventing direct
access to hardware.
9
Protection Mechanisms

• Importance of Protection: Protecting resources from


unauthorized access is crucial in a distributed
environment to maintain data integrity and security.
• Mechanisms:
• Access Control Lists (ACLs): Define which users or system
processes have access to specific resources.
• User Authentication: Ensures that only authorized users can
access certain resources, often through passwords or tokens.
• Sandboxing: Isolates applications to prevent them from
interfering with each other or accessing sensitive data. For
instance, if a user visits a malicious website, the sandbox
restricts the website's ability to access the user’s files or monitor
activities outside the browser.
10
Processes and Threads

• Definition:
• Process: A program in execution, which includes the
program code, current activity, and allocated resources
(memory, file handles).
• Thread: A smaller unit of a process that can run
independently, sharing the same memory space with other
threads in the same process.
• Features:
• Concurrency: Multiple threads can execute simultaneously,
improving application responsiveness and performance.
• Resource Sharing: Threads within the same process share
resources, making inter-thread communication faster and
more efficient.

11
Processes and Threads

• Usage:
• Web Servers: Use threads to handle multiple
client requests simultaneously (e.g., Apache
HTTP Server).
• Multimedia Applications: Use threads for audio
and video processing to maintain smooth
playback (e.g., VLC Media Player).
• Examples:
• Microsoft Word: Uses multiple threads to handle
user input while performing background tasks
like spell checking.
12
Communication and invocation

1. What communication primitives does OS supply?


2. Which protocols does OS support and how open is
the communication implementation?
3. What steps Operation systems take to make
communication as efficient as possible?
4. What support is provided for high-latency and
disconnected operation?

13
Communication and invocation

1. What communication primitives does OS supply?


•OS designed for DS provide specific communication
primitives tailored to the types of invocations required.
•For example, Windows provides a variety of primitives and
frameworks like Winsock, RPC (Remote Procedure Call),
Named Pipes, MSMQ (Microsoft Message Queuing), and WCF
(Windows Communication Foundation) to support distributed
systems.
•These tools help developers create robust and scalable
distributed applications, offering both synchronous and
asynchronous communication models, security features, and
the ability to work across different network topologies and
platforms
14
Communication and invocation

2. Which protocols does OS support and how open is the


communication implementation?
•communication implementation
• Some OS have built-in support for standard
protocols.
• Some OS rely on middleware to implement
protocols.
•The openness
•Some systems allow for extensibility and integration
with new protocols. while others may be more rigid.

15
Communication and invocation

3. What steps Operation systems take to make


communication as efficient as possible?
•To enhance communication efficiency, OS implement several
strategies:
•High-Level Primitives: By providing high-level communication
primitives directly in the kernel instead of relies on system calls, which
are requests made by user-level applications to the operating system kernel.
•Group Communication: which can further reduce overhead when
multiple clients need to communicate with a server simultaneously .
•Optimized Protocols: The choice of communication protocols and
their implementation can also significantly impact efficiency, with
some systems optimizing for specific use cases or network conditions

16
Communication and invocation

4. What support is provided for high-latency and


disconnected operation?
•Caching Mechanisms: that allow clients to work with
locally stored data while waiting for updates from
remote servers.
•Asynchronous Communication: by allowing processes
to continue executing without waiting for immediate
responses.
•Disconnected Operation Support: enabling users to
continue working even when they lose connectivity. This
may involve queuing requests to be sent once the
connection is re-established.
17
Scheduling in Operating Systems

• Scheduling is the method by which work is assigned to resources that


complete the work.
• Types of Scheduling:
• Preemptive Scheduling: The OS can interrupt a currently running
process to allocate CPU time to another process, ensuring
responsiveness.
• Non-Preemptive Scheduling: A running process cannot be
interrupted; it runs until it voluntarily yields control, which can
lead to inefficiencies.
• Importance: Effective scheduling ensures fair resource allocation,
maximizes CPU utilization, and improves overall system performance.

18
OS Architectures

• Two primary architectures of kernels are


discussed: monolithic
kernels and microkernels. Each has
its advantages and disadvantages,
particularly in the context of distributed
systems.

19
OS Architectures

Monolithic Kernels
includes a wide range of services and functionalities within a single large
block of code.
So, device drivers, file system management, and network protocols, run in
kernel space.
Advantages:
• High Performance: because it allows for direct communication between
services without the overhead of context switching between user and kernel
modes.
• Simplicity: For certain applications, having all services in one place can
simplify the design and implementation.
Disadvantages:
• Stability: a failure in one part of the kernel can crash the entire system.
• Limited Flexibility: Adding new features or modifying existing ones can
require recompiling the entire kernel, which can be cumbersome.
20
OS Architectures

Microkernels
Microkernels, on the other hand, aim to
minimize the amount of functionality included in
the kernel itself. They provide only the most
essential services, such as low-level address
space management, thread management, and
interprocess communication (IPC). Other
services, like device drivers and file systems,
run in user space as separate processes.

21
OS Architectures

Microkernels
Advantages:
• Modularity: The separation of services allows for
easier updates and maintenance. New services can
be added without modifying the kernel.
• Stability and Security: Since most services run in
user space, a failure in one service does not
necessarily compromise the entire system. This
isolation can enhance security.
• Flexibility: Microkernels can be more easily adapted
to different environments, making them suitable for
various applications, including distributed systems.
22
OS Architectures

Microkernels
Disadvantages:
•Performance Overhead: The need for IPC between
user-space services can introduce performance
overhead, as communication between processes is
generally slower than within a monolithic kernel.
•Complexity in Design: Designing a microkernel
system can be more complex due to the need for
efficient IPC mechanisms and the management of
multiple user-space services.

23
OS Architectures

Suitability for Distributed Systems


Microkernels are often considered more suitable
due to their modularity, flexibility, and enhanced
stability. The ability to run various services in user
space allows for easier adaptation to different network
protocols and communication methods, which are
crucial in distributed environments.
Microkernels also facilitate the implementation of
distributed system features, such as remote procedure
calls (RPC) and other communication mechanisms, by
allowing these functionalities to be developed and
maintained independently of the kernel itself.
24
Virtualization at the operating system level

 Virtualization is allowing to create multiple operating systems or


instances of an operating system to run concurrently on a single
physical machine, effectively sharing the underlying hardware
 Virtualization provides a layer of separation between the
hardware and the software, enabling better resource
management, isolation, and flexibility.
 The key benefits of virtualization include:
• Resource Utilization: It allows for more efficient use of physical
resources by enabling multiple workloads to run on the same hardware.
• Isolation: Each virtual instance operates independently, which enhances
security and stability. If one virtual machine (VM) crashes, it does not
affect others.
• Flexibility: Virtual machines can be easily created, modified, and
migrated across physical hosts, facilitating load balancing and disaster
recovery 337, 336.
25
Virtualization at the operating system level

OS virtualization is important in distributed systems for several key reasons:


 Resource Efficiency: It maximizes hardware utilization, reducing costs.
 Isolation and Security: by preventing failures in one VM from affecting
others.
 Flexibility and Scalability: by allowing systems to easily scale up or
down based on workload demands.
 Simplified Management: by easy creation, cloning, and migration of
VMs for load balancing and disaster recovery.
 Support for Diverse Environments: It allows multiple operating systems
to coexist on the same hardware, accommodating various applications
without compatibility issues.
 Enhanced Development and Testing: Virtualization provides controlled
environments for development and testing, accelerating the
development cycle and improving software quality.

26

You might also like