You are on page 1of 9

NETWORK OPERATING SYSTEM AND

CONFIGURATION
ASSIGNMENT

SUBMITTED BY: RUPESH PANDEY


STUDENT ID: 40290
Question 1: Banker Algorithm
A Banker algorithm is deadlock avoidance algorithm used for resource allocation. In the
following example, there are five processes, P1, P2, P3, P4, P5 and three resource types A
(with 10 instances), B (with 5 instances) and C (with 7 instances).
The Available, Allocation and MAX matrices are given as:
a. Compute the Need matric b. After calculating the Need matric, show that the current
state is safe by showing a safe sequence of processes.

Allocation Matrix Max Matrix Need Matrix


A B C A B C A B C
P0 0 1 0 7 5 3 7 4 3
P1 2 0 0 3 2 2 1 2 2
P2 3 0 2 9 0 2 6 0 0
P3 2 1 1 2 2 2 0 1 1
P4 0 0 2 4 3 3 4 3 1

Available

A B C
3 3 2

First Iteration
For process P0

A B C
Need Matrix 7 4 3
Available Matrix 3 3 2
The Available matrix value is less than that of the need matrix value and hence it is
false.

For process P1
Here , the available matrix value is more than the need matrix value so, it is true

A B C
Need Matrix 1 2 2
Available Matrix 3 3 2
Updated Available 5 3 2
Matrix

For process P2

A B C
Need Matrix 6 0 0
Available Matrix 5 3 2
Here , the available matrix value is less than that of the need value and hence it is
false

For Process P3

A B C
Need Matrix 0 1 1
Available Matrix 5 3 2
Updated Available 7 4 3
Matrix
Here , the available matrix value is more than the need value so, it is true

For Process P4

A B C
Need Matrix 4 3 1
Available Matrix 7 4 3
Updated Available 7 4 5
Matrix
Here , the available matrix value is more than the need value so, it is true
Second Iteration
For Process P0

A B C
Need Matrix 7 4 3
Available Matrix 7 4 5
Updated Available 7 5 5
Matrix
Here , the available matrix value is more than the need value so, it is true
For Process P2

A B C
Need Matrix 6 0 0
Available Matrix 7 5 5
Updated Available 10 5 7
Matrix
Here , the available matrix value is more than the need value so, it is true
The sequence of process is P1, P3, P4, P0, P2 and it is the safe state for execution.

Question 2: Page Replacement Algorithms

a) Page replacement algorithm decide which memory pages to page out when a
page of memory needs to be allocated. And it happens when a page fault occurs,
and a free page cannot be used to satisfy the allocation. Based on this statement,
explain the different page replacement algorithms and how are they different from
each other. What are the advantages and disadvantages of using those
algorithms?

- Page replacement algorithms decides which page needs to be replaced when


new page comes in during the memory management in an operating system.
There will be thrashing problem if the page replacement algorithm is not
optimal. Therefore, the task of an optimal page replacement algorithm is to
choose the page which can limit the thrashing. There are three kinds of page
replacement Algorithms which are given below:
1. Optimal Page Replacement algorithm
This algorithm replaces the page which will not be referred for so long in
future. Although it cannot be practically implemented but it can be used as
benchmark. Other algorithms are compared to this in terms of optimality.
2. Least recent used (LRU) page replacement algorithm
This algorithm replaces the page which has not been referred for a long time.
This algorithm is just opposite to the optimal page replacement algorithm. In
this, we look at the past instead of staring at future.
3. First in First Out (FIFO)
in this algorithm, a queue is maintained. The page which is assigned the
frame first will be replaced first. In other words, the page which resides at the
rare end of the queue will be replaced on every page fault.

Furthermore, page replacement algorithms involve many various advantages


and disadvantages. They are:
1. First in First Out (FIFO):
Advantages:
 It is simple and easy to understand & implement.

Disadvantages:
 The process effectiveness is low.
 When we increase the number of frames while using FIFO, we are
giving more memory to processes. So, page fault should decrease, but here
the page faults are increasing. This problem is called as Be lady’s Anomaly.
 Every frame needs to be taken account off.

2. Least Recently Used (LRU)


Advantages:
 It is open for full analysis.
 In this, we replace the page which is least recently used.
 Easy to choose page which has faulted and has not been
used for a long time.
Disadvantages:
 It requires additional Data Structure to be implemented.
 Hardware assistance is high.

3. Optimal Page Replacement (OPR):


Advantages:
 Complexity is less and easy to implement.
 Assistance needed is low i.e. Data Structure used are easy
and light.

Disadvantages:
 OPR is perfect, but not possible in practice as the operating
system cannot know future requests.
 Error handling is tough.
4. Given a page reference string: 1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 6. If we consider
the frame size
is 4. What is number of page faults in optimal page replacement algorithm?

1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 6
1 1 1 1 1 1 1 1 1 1 1 1 7 7 7 7 1 1 1
1
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
2
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
3
4 4 4 5 6 6 6 6 6 6 6 6 6 6 6 6
6
M M M M H H M M H H H H M H H H M H H
H

Page frame: 4

Page Fault = 8

Question 3: Process Scheduling Algorithms

a) Explain different types of process scheduling algorithms. If you have a very long
process and short processes keep coming up, then names any of these
algorithms which leads to starvation.

Different type of process scheduling algorithms are as follows:


1. First-Come-First-Served (FCFS)
Also known as first-in-first-out (FIFO). When the current process ceases to execute,
the longest process in the Ready queue is selected. Performs much better for long
processes than short ones.
2. Shortest Job Next (SJN)
Non-pre-emptive, in which the process with the shortest expected processing time is
selected next. A short process will jump to the head of the queue. Possibility of
starvation for longer processes. One difficulty is the need to know, or at least
estimate, the required processing time of each process.
3. Shortest Remaining Time (SRT)
Pre-emptive version of SJN. Scheduler always chooses the process that has the
shortest expected remaining processing time. Risk of starvation of longer processes.
Should give superior turnaround time performance to SPN because a short job is
given immediate preference to a running longer job.
4. Round Robin
Pre-emptive, in which the execution in between can be stopped. Each process is
provided a fix-time to execute, it is called quantum. Once process is executed for a
given time-period, it is pre-empted, and other processes executes for a given time-
period.
5. Highest Response Ratio Next (HRNN)
Chooses next process with the greatest ratio. Attractive because it accounts for the
age of the process. While shorter jobs are favoured, aging without service increases
the ratio so that a longer process will eventually get past competing shorter jobs.

b) Using the Highest Response Ratio Next (HRRN) algorithm, you are required to
perform the following tasks:

i. Develop Gantt Chart showing execution of the processes given in the


following table.

ii. Calculate Average Waiting Time for the following processes.

Thread ARRIVAL TIME CPU BURST TIME


A 0 3
B 2 6
C 2 5
D 5 1
E 3 5

Note: In this algorithm, we need to find the response ratio of all available threads/processes
and select the one with the highest Response Ratio.
Response Ratio = (W + S)/S
SOLUTION:
GANTT CHART:

A B D C E
0 3 9 10 15
20

RRB= (3-2+6) \6 = 1.17

RRC= (3-2+5) \5=1.2


RRE= (3-3+5) \5=1

RRC = (9-2+5) \ 5 = 2.4

RRD = (9-5+1) \1 = 5

RRE = (9-3+5) \5 = 2.2

RRC = (10-2+5) \5 =2.6

RRE = (10-3+5) \5 = 2.4

THREAD ARRIVAL BURST COMPLETION TURN WAITING


TIME (A.T) TIME (B.T) TIME (C.T) AROUND TIME (W.T)
TIME
(T.A.T)
A 0 3 3 3 0
B 2 6 9 7 1
C 2 5 15 13 8
D 5 1 10 5 4
E 3 5 20 17 12

THUS, AVERAGE WAITING IS = 0+1+8+4+12


5
= 5 Units.

Question 4: Operating System Configuration and Standards


a. What is the REACT methodology. Explain the different steps of REACT
methodology.

React is the troubleshooting methodology developed by Syed Co.


The different steps of react methodology are:
1. Engage
The Engage step involves engaging other people in the troubleshooting process.
A common technique for engaging people is to ask questions regarding the
problem. Reproduce the problem in controlled environment is a key to find the
cause. Time spent on the research and engage steps may vary depending on the
problem.
2. Research
The research involves searching for possible causes of the problem based on the
problem symptoms, error messages, logs etc.
3. Adjust
The Adjust step involves trying different technical adjustments that you have
found using the research and engage steps. The outcome of the adjust step is
the problem fixed with or without knowing the cause
4. Configure
The fact that you have fixed the problem is not the end of REACT. Additional
configuration may be required to prevent problems from re-occurring. If the
problem is fixed by reinstalling / reloading previous settings, additional
configuration is often needed to return the system to the current operating state.
5. Take Note
Documenting problems and problem fixing processes are essential. As a
minimum, the following should be documented. The problem with any error
messages if existed. The cause concisely explained. Documents should be put
on searchable database for future use.

b. 802.11 refers to a family of specifications developed by the IEEE for wireless


LAN (WLAN) technology. Explain in details different specifications in the 802.11
family in terms of transmission speed and frequency.

802.11 denotes the IEEE designation for the wireless networking. IEEE 802.11 is
a set of LAN protocols and specifies the set of media access control (MAC) and
the physical layer protocols for the implementation of the wireless local area
network, Wi-Fi in various frequencies. 802.11x are the most widely used wireless
computer networking standards used in most home and office networks to access
internet services in laptops, printers, smartphones. The 802.11 standards allow
a wireless client to roam between multiple APs. The different specifications
in the 802.11 family in terms of transmission speed and frequency are
explained below:
 IEEE 802.11: There were two variations on the initial 802.11 wireless
standard. Both offered 1 or 2Mbps transmission speeds and the same RF of
2.4GHz. The difference between the two was in how data travelled through
the RF media. One used FHSS, and the other used DSSS. The original
802.11 standards are far too slow for modern networking needs and are now
no longer deployed.
 IEEE 802.11a: In terms of speed, the 802.11a standard was far ahead of the
original 802.11 standards. 802.11a specified speeds of up to 54Mbps in the
5GHz band, but most commonly, communication takes place at 6Mbps,
12Mbps, or 24Mbps. 802.11a is incompatible with the 802.11b and 802.11g
wireless standards.
 IEEE 802.11b: The 802.11b standard provides for a maximum transmission
speed of 11Mbps. However, devices are designed to be backward-compatible
with previous 802.11 standards that provided for speeds of 1, 2, and
5.5Mbps. 802.11b uses a 2.4GHz RF range and is compatible with 802.11g.
 IEEE 802.11g: 802.11g is a popular wireless standard today. 802.11g offers
wireless transmission over distances of 150 feet and speeds up to 54Mbps
compared with the 11Mbps of the 802.11b standard. Like 802.11b, 802.11g
operates in the 2.4GHz range and therefore is compatible with it.
 IEEE 802.11n: The newest of the wireless standards listed in the Network+
objectives is 802.11n. The goal of the 802.11n standard is to significantly
increase throughput in both the 2.4GHz and the 5GHz frequency range. The
baseline goal of the standard was to reach speeds of 100Mbps, but given the
right conditions, it is estimated that the 802.11n speeds might reach a
staggering 600Mbps. In practical operation, 802.11n speeds will be much
slower .ds

You might also like