OSY

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 17

ADITYA POLYTECHNIC, BEED

Micro Project On

“FCFS (First-Come-First-Serve), SSTF (Shortest Seek


Time First), and SCAN Algorithms. ”
Submitted By
Gaikwad Vishal Shivaji
Under The Guidance Of
Prof. A. Kamble
For The Subject
Operating Systems
Department Of
Computer Science And Engineering
2024-25
CERTIFICATE

This is to certify that Gaikwad Vishal Shivaji , from Aditya


Polytechnic, Beed Institute Having Enrollment no.
2209590325 has completed Micro Project of Third year
Operating System subject having Title FCFS, STSF &
SCAN Algorithms during academic year 2024-2025 The
project completed by Student under the guidance of the
faculty Prof. Kamble.A.

Name and signature of guide


……………………................................
Annexure – I

Report on Creating a simulation of different disk scheduling


algorithms like FCFS (First-Come-First-Serve), SSTF (Shortest Seek
Time First), and SCAN.

1.0 Aims/Benefits of the micro project

The aim of the project on disk scheduling algorithms is to create a


simulation and compare the performance of different disk scheduling algorithms,
specifically FCFS, SSTF, and SCAN. The project aims to evaluate these algorithms
based on two key performance metrics: average seek time and throughput.

By conducting the simulation and analyzing the results, the project aims to
provide insights into the strengths and weaknesses of each disk scheduling
algorithm. This information can help in understanding how each algorithm performs
in terms of minimizing seek time, ensuring fairness, and maximizing disk utilization.
Ultimately, the project aims to contribute to the understanding of disk scheduling
algorithms and provide guidance in selecting the most appropriate algorithm for
specific disk usage scenarios. The results can assist system administrators,
developers, and researchers in making informed decisions when designing and
optimizing disk I/O operations.

2.0 Course outcome addressed.

The project on disk scheduling algorithms can contribute to achieving several


course outcomes, depending on the specific course or educational program. Here are
some potential course outcomes that align with this project:

1. Understanding Operating Systems: The project allows students to gain a


practical understanding of how disk scheduling algorithms operate within an
operating system. It helps them comprehend the importance of efficient disk
scheduling for improving overall system performance.
2. Applied Algorithms and Data Structures: The project involves implementing
and simulating different disk scheduling algorithms, which reinforces students’
knowledge of various algorithmic techniques. It provides hands-on experience
in analyzing and comparing the performance of different algorithms.

3. Performance Evaluation and Optimization: The project involves measuring and


evaluating the performance of disk scheduling algorithms using metrics such
as average seek time and throughput. Students learn how to analyze and
optimize system performance by selecting appropriate algorithms based on
specific requirements.

4. Problem Solving and Analytical Skills: The project requires students to identify
the strengths and weaknesses of different disk scheduling algorithms, analyze
simulation results, and draw meaningful conclusions. It enhances their
problem-solving and analytical skills in the context of storage system
optimization.

5. Research and Documentation: The project may involve conducting literature


reviews to understand the existing knowledge and research on disk scheduling
algorithms. Students learn how to compile and document their findings,
methodologies, and simulation results in a structured report format.

6. System Design and Optimization: The project provides insights into the design
and optimization of disk I/O operations. Students gain an understanding of
trade-offs between different scheduling algorithms and learn how to select
the most appropriate algorithm for specific system requirements.

By achieving these course outcomes, students can develop a solid foundation in


operating systems, algorithms, performance evaluation, and optimization
techniques. They also enhance their research, problem-solving, and documentation
skills, which are valuable in various fields related to computer systems, software
engineering, and data storage.
3.0 Proposed methodology

The methodology for the project on disk scheduling algorithms involves several key
steps. Here is a suggested methodology that can be followed:

1. Problem Definition: Clearly define the problem statement, objectives, and


scope of the project. Specify the disk scheduling algorithms to be simulated
(e.g., FCFS, SSTF, SCAN).

2. Literature Review: Conduct a thorough literature review to understand the


existing knowledge and research on disk scheduling algorithms. Explore
academic papers, textbooks, and reputable online sources to gain insights into
the theory, implementation, and performance evaluation of the algorithms.

3. Simulation Environment Setup: Set up a simulation environment that


emulates a disk drive with a fixed number of tracks. Determine the
parameters required for the simulation, such as the number of requests, track
numbers, and arrival times. Implement the necessary data structures and
algorithms to simulate the disk scheduling algorithms.

4. Data Generation: Generate a set of random I/O requests that will serve as
input for the simulation. Consider different workload patterns, such as
uniform or skewed distributions, to represent realistic scenarios.

5. Algorithm Implementation: Implement the disk scheduling algorithms (FCFS,


SSTF, SCAN) based on their respective principles and guidelines obtained from
the literature review. Ensure that the algorithms handle the incoming
requests, maintain a queue of pending requests, and perform the necessary
head movements.

6. Simulation Execution: Run the simulation multiple times to obtain statistically


significant results. Each simulation run should process the generated set of I/O
requests using a specific disk scheduling algorithm. Record the order in which
the requests are serviced, along with the corresponding timestamps.
7. Performance Metrics Calculation: Calculate the performance metrics for each
algorithm. Compute the average seek time by measuring the distance traveled
by the disk arm for each request. Determine the throughput by counting the
number of requests serviced per unit of time.

8. Data Analysis and Comparison: Analyze the simulation results to compare the
performance of the disk scheduling algorithms. Identify trends, patterns, and
differences in terms of average seek time and throughput. Visualize the data
using graphs, charts, or tables to facilitate understanding and interpretation.

Following this methodology will help ensure a systematic and comprehensive


approach to the project, enabling a meaningful evaluation and comparison of the
disk scheduling algorithms.

4.0 Action Plan

Sr.
Name of responsible team
No Detail of activity Plan start date Plan finish date
members
.

collect information on the


1
internet

2 create a micro project format

input micro project information


3
in ms word

create ms word file and show


4
file to guide

after confirmation print the


5
project report
5.0 Resources used

Sr. no. Name of resource material Specifications Quantity

1 textbook Operating Systems 1

2 internet Wikipedia / Msbte Store 1

3 PC windows 11 1
Annexure-II

Report on Creating a simulation of different disk scheduling


algorithms like FCFS (First-Come-First-Serve), SSTF (Shortest Seek
Time First), and SCAN.

1.0 Brief Description:-

Title: Disk Scheduling Algorithms: A Comparative Analysis of FCFS, SSTF, and SCAN

Abstract: Disk scheduling algorithms play a crucial role in optimizing the performance
of storage systems by efficiently accessing data on disk drives. This report presents a
simulation-based study comparing three popular disk scheduling algorithms: FCFS
(First-Come-First-Serve), SSTF (Shortest Seek Time First), and SCAN. The performance
of these algorithms is evaluated based on average seek time and throughput metrics.
The simulation results provide insights into the strengths and weaknesses of each
algorithm and help in selecting the most appropriate scheduling algorithm for
specific disk usage scenarios.

1. Introduction: Disk scheduling algorithms are responsible for determining the order
in which I/O requests are serviced on a disk drive. The selection of an appropriate
disk scheduling algorithm can significantly impact the overall performance and
efficiency of disk I/O operations. This report aims to evaluate and compare the
performance of three widely used disk scheduling algorithms: FCFS, SSTF, and SCAN.

2. Disk Scheduling Algorithms: 2.1 First-Come-First-Serve (FCFS): FCFS is a non-


preemptive disk scheduling algorithm that processes the I/O requests in the order
they arrive. It serves the requests sequentially, starting from the outermost track and
moving towards the innermost track. FCFS is simple to implement but suffers from
poor performance in terms of average seek time and fairness.

2.2 Shortest Seek Time First (SSTF): SSTF is a preemptive disk scheduling algorithm
that selects the request with the shortest seek time from the current head position.
It aims to minimize the seek time by prioritizing the closest requests. SSTF performs
well in reducing average seek time but can result in starvation for requests located
farther from the current head position.
2.3 SCAN: SCAN is a preemptive disk scheduling algorithm that works by moving the
head in one direction (e.g., from outer to inner track) until it reaches the end, and
then reverses direction. SCAN services the requests in a sweeping motion, providing
better fairness compared to FCFS. However, it may lead to increased average seek
time due to the “elevator effect.”

3. Simulation Setup: To compare the disk scheduling algorithms, a simulation


environment was created. The simulation emulates a disk drive with a fixed number
of tracks and generates a set of random I/O requests. Each request consists of a track
number and arrival time. The simulation records the order in which the requests are
serviced and calculates the average seek time and throughput for each algorithm.

4. Results and Analysis: The simulation was run multiple times, and the results were
averaged to provide a fair comparison of the disk scheduling algorithms. The
following performance metrics were analyzed:

4.1 Average Seek Time: The average seek time measures the average distance the
disk arm must travel to fulfill all the I/O requests. Lower average seek time indicates
better performance. The results showed that SSTF outperforms both FCFS and SCAN
in terms of average seek time, as it prioritizes requests based on proximity to the
current head position.

4.2 Throughput: Throughput refers to the number of I/O requests serviced per unit
of time. Higher throughput signifies better utilization of the disk drive. FCFS
demonstrated the highest throughput among the three algorithms, as it processes
requests in the order of arrival without considering seek time. SSTF and SCAN
exhibited lower throughput due to additional seek time optimization.
Here’s some additional information about disk scheduling algorithms:

1. First-Come-First-Serve (FCFS):

FCFS is one of the simplest disk scheduling algorithms. It operates on the


principle of serving I/O requests in the order they arrive. The disk arm starts from its
current position and moves sequentially towards the inner tracks, serving the
requests along the way. FCFS is easy to implement but suffers from poor
performance in terms of average seek time, as it may result in unnecessary head
movements and can lead to longer waiting times for requests located farther from
the current head position.

It stands for 'first-come-first-serve'. As the name suggests, the request which


comes first will be processed first and so on. The requests coming to the disk are
arranged in a proper sequence as they arrive. Since every request is processed in this
algorithm, there is no chance of 'starvation'.

● Advantages:

1. Implementation is easy.

2. No chance of starvation.

● Disadvantages:

1. 'Seek time' increases.

2. Not so efficient.
2. Shortest Seek Time First (SSTF):

SSTF is a preemptive disk scheduling algorithm that aims to minimize the seek time
by prioritizing requests with the shortest seek time from the current head position.
Instead of following a predetermined order, the algorithm dynamically selects the
nearest pending request and serves it first. It stands for 'Shortest seek time first'. As
the name suggests, it searches for the request having the least 'seek time' and
executes them first. This algorithm has less 'seek time' as compared to the FCFS
Algorithm.

Example: : Suppose a disk having 200 tracks (0-199). The request


sequence(82,170,43,140,24,16,190) is shown in the given figure and the head
position is at 50.

Advantages:

1. In this algorithm, disk response time is less.

2. More efficient than FCFS.

Disadvantages:

3. Less speed of algorithm execution.

4. Starvation can be seen.


3. SCAN: SCAN, also known as the elevator algorithm, is a preemptive disk scheduling
algorithm that mitigates the starvation issue present in SSTF. SCAN moves the head
in a single direction (either from outer to inner track or vice versa) until it reaches the
end of the disk. Upon reaching the end, the head reverses direction. SCAN services
the requests in a sweeping motion, serving the requests encountered along the
sweeping path.

In this algorithm, the head starts to scan all the requests in a direction and
reaches the end of the disk. After that, it reverses its direction and starts to scan
again the requests in its path and serves them. Due to this feature, this algorithm is
also known as the "Elevator Algorithm".

Example: Suppose a disk having 200 tracks (0-199). The request


sequence(82,170,43,140,24,16,190) is shown in the given figure and the head
position is at 50. The 'disk arm' will first move to the larger values.

● Advantages:

1. Implementation is easy.

2. Requests do not have to wait in a queue.

● Disadvantage:

1. The head keeps going on to the end even if there are no requests in
that direction.
4. Look and C-SCAN: Look and C-SCAN are variations of the SCAN algorithm that
further optimize the performance. Look does not move the head to the end of the
disk when there are no more pending requests in the current direction. Instead, it
reverses the head movement immediately. This reduces unnecessary head
movement and improves average seek time. C-SCAN, on the other hand, always
moves the head to the end of the disk, regardless of pending requests. Upon
reaching the end, the head jumps back to the opposite end, without servicing any
requests in the reverse direction. C-SCAN aims to provide uniform response time for
all requests, but it may result in longer waiting times for requests located at the
extreme tracks.

It stands for "Circular-Scan". This algorithm is almost the same as the Scan disk
algorithm but one thing that makes it different is that 'after reaching the one end and
reversing the head direction, it starts to come back. The disk arm moves toward the
end of the disk and serves the requests coming into its path. After reaching the end
of the disk it reverses its direction and again starts to move to the other end of the
disk but while going back it does not serve any requests.

Example: Suppose a disk having 200 tracks (0-199). The request


sequence(82,170,43,140,24,16,190) is shown in the given figure and the head
position is at 50.

5. Comparison and Selection of Algorithms: When selecting a disk scheduling


algorithm, it is essential to consider the specific requirements and characteristics of
the system. Some factors to consider include workload patterns, seek time
optimization, fairness, and throughput requirements. FCFS provides high throughput
but can result in longer average seek time. SSTF minimizes seek time but may starve
certain requests. SCAN provides fairness but can increase average seek time. Look
and C-SCAN offer variations with further optimizations.

Ultimately, the choice of a disk scheduling algorithm should be based on a thorough


analysis of the system’s requirements, workload characteristics, and trade-offs
between seek time optimization, fairness, and throughput. Additionally, hybrid
approaches or adaptive algorithms that dynamically select the most suitable
algorithm based on the workload and system conditions can be explored for further
performance improvements.

The C-Look algorithm is almost the same as the Look algorithm. The only
difference is that after reaching the end requests, it reverses the direction of the
head and starts moving to the initial position. But in moving back, it does not serve
any requests.

Example: Suppose a disk having 200 tracks (0-199). The request


sequence(82,170,43,140,24,16,190) is shown in the given figure and the head
position is at 50.
2.0 Actual Resources Used

Sr. no. Name of resource material Specifications Quantity

1 textbook Operating Systems 1

2 internet Wikipedia / Msbte Store 1

3 PC windows 11 1

3.0 Skill Developed / Learning outcomes of this Micro-Project

a) Computer skills increase.

b) Communication skills improved.


4.0 Applications of this Micro-Project

The project on disk scheduling algorithms has several applications in the field of
computer systems, particularly in the design and optimization of storage systems.
Here are some key applications of the project:

1. Operating Systems: Disk scheduling algorithms are an integral part of


operating systems, as they determine the order in which I/O requests are
serviced.

2. Storage System Design: The project provides insights into the selection and
optimization of disk scheduling algorithms in the design of storage systems.
Understanding the performance characteristics of various algorithms helps in
making.

3. Database Systems: Database management systems often handle large


volumes of data stored on disks.

4. File Systems: Disk scheduling algorithms play a crucial role in file systems, as
they determine the order in which file blocks are accessed.

5. Cloud Computing: In cloud computing environments, disk scheduling


algorithms impact the performance of virtual machines and storage systems.
The project’s findings can help cloud service providers optimize disk I/O
operations, enhance resource allocation, and improve the overall quality of
service for cloud-based applications.

By exploring these applications, the project contributes to the advancement of


storage system design, operating systems, database management, cloud computing,
and related fields. It offers practical insights into the selection, evaluation, and
optimization of disk scheduling algorithms to improve system performance and
enhance user experience.
Conclusion
In conclusion, the project on disk scheduling algorithms aimed to create a
simulation and compare the performance of three popular algorithms: First-Come-
First-Serve (FCFS), Shortest Seek Time First (SSTF), and SCAN. The project successfully
achieved its objectives and provided valuable insights into the strengths and
weaknesses of each algorithm.

The project findings highlighted the trade-offs between seek time optimization
and fairness in disk scheduling algorithms. The selection of the most appropriate
algorithm depends on specific system requirements, workload patterns, and the
desired balance between seeking time reduction and fairness. The project’s
outcomes can aid system administrators, developers, and researchers in making
informed decisions when selecting and optimizing disk scheduling algorithms for
different storage system scenarios. The results contribute to the understanding of
disk scheduling algorithms and their impact on system performance and efficiency.

Overall, the project successfully accomplished its objectives, provided insights


into disk scheduling algorithms, and laid the foundation for future research and
optimization efforts in the field of storage systems and operating systems.

Reference
1. https://msbtestore.com/
2. https://www.wikipedia.org/
3. https://www.google.com/
4. https://www.youtube.com/@Msbte_Store/

You might also like