miss maheen sadiq under the guideline of sir syed rizwan-ul-hasan assistant professor ced, ssuet

54
Advanced Principles of Operating System (CE-403) Miss Maheen Sadiq Under the guideline of Sir Syed Rizwan-ul-Hasan Assistant Professor CED, SSUET

Upload: christopher-houston

Post on 28-Dec-2015

221 views

Category:

Documents


3 download

TRANSCRIPT

Advanced Principles of Operating System (CE-403)

Advanced Principles of Operating System (CE-403)

Miss Maheen SadiqUnder the guideline ofSir Syed Rizwan-ul-HasanAssistant ProfessorCED, SSUETIntroduction (Week 1)What is Operating System?An operating system is a layer of software which takes care of technical aspects of a computer's operation.Examples: Windows, Linux, Unix and Mac OS, etc.,

Function of Operating SystemResource management-Time management (CPU and Disk Scheduling)-Space management(main and secondary storages)-Process synchronization and deadlock handling.-Accounting and status informationUser friendliness-Execution environment-Error detection and handling-Protection and security-Fault tolerance and failure recovery

Types of Advanced Operating SystemIt can be categorized on the following basis of

- Architecture DrivenA variety of high speed architectureExtremely fast parallel Offers great potential for speed upDistributed Operating SystemsMultiprocessor Operating Systems

Application DrivenRequire special operating system support as a requirement as well as for efficiency.Database Operating SystemsReal-time Operating SystemsTypes of Advanced Operating System

Distributed SystemsReal-time SystemsArchitecture DrivenApplication DrivenMultiprocessor systemsDatabase SystemsAdvanced Operating SystemsDistributed SystemsThey are for network of autonomous computers connected by a communication network.It controls and manages the h/wand s/w resources of a DS such that its users view the entire system as a power full monolithic computer system.However, design is much more complex due to the lack of both shared memory and common clock and unpredictable communication delays.Basic issues are same as traditional OS Advantages of DS Resources Sharing Computation speed up load sharing Reliability CommunicationsMultiprocessor Operating SystemConsists of a set of processors that share a set of physical memory blocksshare a common clock "share" over an interconnection network.

Control and manage resources hardware and software resourcesviewed as a uniprocessor system.

Design issues same as traditional system.

Practical issues: increased complexity of synchronization, scheduling, memory management, protection and security.

Database Operating SystemDatabase systems place increased demands on an operating system to efficiently support: concept of a transactionsmanage large volumes of dataconcurrency controlsystem failure control

Should also have buffer management schemes for data retrieval and storage from secondary storage

Concurrency control is one of the most challenging problems in the design of database operating systems

Real-time Operating SystemsSystems where jobs have completion deadlines

In soft real-time systems, jobs should be completed before its deadline to be of use

In hard real-time systems, jobs should be completed before its deadline to avert a disaster

Jobs should be scheduled in such a way that a maximum number of jobs satisfy their deadlines

Requirements can vary from application to application

Network Operating SystemA network operating system (NOS) is a computer operating system that is designed primarily to support workstation, personal computer, and, in some instances, older terminal that are connected on a local area network (LAN).A network operating system provides printer sharing, common file system and database sharing, application sharing, and the ability to manage a network name directory, security, and other housekeeping aspects of a network.

Architecture of Distributed System (Week 2)Architecture of Distributed System

A distributed system is a collection of autonomous computers which do not share memory or a clock

Computers communicate with each other by exchanging messages over a communication network

Each computer has its own memory and runs its own OS

Resources owned and controlled by a computer are said to be local to it

Resources owned and controlled by other computers are said to be remote

Architecture of Distributed SystemAccessing remote resources is more expensive because of communication delays

Motive is to convert low cost microprocessors to single powerful system

AdvantagesResource sharingHardware and software resources can be shared Printer, Compiler, Text Editors, Databases, etc.

Enhanced performanceRapid response timeHigher system throughputMany tasks can be concurrently executed at different computersDistributed system can employ load distribution techniquesTasks at heavily loaded systems are transferred to lightly loaded computersWaiting time of a task can be reduced

Improved reliability and availabilityFew components of the system can fail without affecting the availability System can be made fault tolerant through replication of data and servicesData can be files and directories and services can be the processes thatprovide functionality

Modular expandabilityNew hardware and software can be easily added without replacing the existing system

DisadvantagesComplexitySecurityManageabilityUnpredictability

Architecture of Distributed SystemCommunication NetworkCPUMemory

CPUDiskMemoryCPUDiskMemoryCPUDiskMemoryCPUMemory

Architecture typesDS can be classified into three broad categories:Minicomputer modelWorkstation modelProcessor pool model

Minicomputer ModelDS consists of several minicomputers e.g. VAX processorsEach machine supports multiple users and share resourcesRatio between no. of processors to no. of users is usually less than one

Workstation ModelConsists of several workstations ( up to several thousands)Each user has a workstation at his disposal, which consist of powerful processor, memory and displayWith the help of DFS, users can access data regardless of its locationRatio between no. of processors to no. of users is usually 1e.g. SSUET WS1 (Workstation1) and user1

19Processor Pool ModelRatio between processor to no. of users is normally greater than 1This model allocates one or more processors according to users needOnce the processors complete their jobs, they return to the pool and await a new assignmentAmoeba is a combination of the processor pool model and workstation model

Issues in Distributed Operating SystemImportant Issues in the design of a distributed operating systemGlobal knowledgeNamingScalabilityCompatibilityProcess SynchronizationResource ManagementSecurityStructuringClient-Server Computing Model

Global KnowledgeIn case of shared memory systems ,up-to date state of all processes and resources of the system is completely known

Whereas in distributed system it is much complex

Up-to date state of all processes and resources can not be known because of absence of shared memory and clock and unexpected delays

Fundamental problems in the design of DOS is to determine efficient technique to implement decentralized system wide control

Another problem is to how to order all the events that occur on different times at different computers in the absence of global clock

NamingNames are used to refer to objects

Computers, printers, services, files and users

Eg. Name service maps a logical name into a physical address, by using table lookup or by algorithm

If an algorithm is used for mapping, the algorithm would depend upon the structure of the names

Another issues in naming is the method of naming objects such that an object can be located irrespective of its logical name

ScalabilitySystems generally grow with timeDesign should be such that system should not result in system unavailability or degraded performance when growth occursE.g. broadcast based protocols work well for small systems but not for large systemsDistributed File System

CompatibilityRefers to the interoperability among the resources in a systemThere are three levels of compatibility in DSBinary Level: all processes execute the same instruction set even though the processors may differ in performance and in input-outputE.g. Emerald distributed systemProgram development is easyDS cannot include computers with different architecturesRarely supported in large distributed systems

Process SynchronizationProcess synchronization is difficult because of unavailability of shared memoryDOS has to synchronize process running at different computers when they try to concurrently access shared resourcesMutual exclusion problemRequest must be serialized to secure the integrity of the shared resourcesIn DS, process can request resources (local or remote) and release resources in any order If the sequence of the resource allocation is not controlled, deadlock may occur which can lead to decrease in system performance

Resource ManagementConcerned with making both local and remote resources available to users in an effective mannerUsers should be able to access remote resources as easily as they can access local resourcesSpecific location of resources should be hidden from users in the following ways:Data MigrationComputation Migration and Distributed scheduling

Data MigrationData can either be file or contents of physical memoryIn process of data migration, data is brought to the location of the computation that needs access to it by the DOSIf computation updates a set of data, original location may have to be updatedIn case of file DFS is involvedDFS is a component of DOS that implements a common file system available to the autonomous computers in the systemPrimary goal is to provide same functional capability to access files regardless of their locationIf the data accessed is in the physical memory of another system then a computations data request is handled by distributed shared memoryComputation MigrationIn computation migration, computation migrates to another location

It may be efficient when information is needed concerning a remote file directory

it is more efficient to send the message and receive the information back, instead of transferring the whole directory

Remote procedural call has been commonly used for computation migration

Only a part of computation of a process is normally carried out on a different machine

SecurityOS is responsible for the security of the computer systemTwo issues must be considered:Authentication: process of guaranteeing that an entity is what it claims to beAuthorization: process of deciding what privileges an entity has and making only these privileges available

Communications Network (Week 3)

Communication Networks

Computers in a DS are interconnected through a computer communication network

Computer can exchange messages with other computers and access data stored at another computer through this network

Layered protocols are commonly used for communication purpose

Wide-Area NetworksWANs consist of switches that are usually interconnected by communication links.Data is transferred b/w computers through a series of switches called point-to-point.A path may become congested due to heavy data communication through path or limited bandwidth.The data can be lost due to switch crashes, communication link failure, limited buffer capacity at switch, transmission error, etc

Packet Switching Vs. Circuit SwitchingCircuit Switching:A dedicated path is established b/w two devices wishing to communicate, and the path remains intact for the entire transmission.The telephone system uses circuit switching.The path is broken when one side terminate the connection.Packet Switching:A connection is established be/w the source device and its nearest switch.These packets are routes from one switch to another until they arrive at the switch connected to the destination device.Parallel transmission possible.The breaking of a message into packets & assembling them back at the destination carries some cost.

Layered ProtocolsISO OSI Reference Model

The OSI ModelA widely accepted structuring technique is layeringThe communications functions are partitioned into a hierarchical set of layersEach layer performs a related subset of the functions required to communicate with another systemThe resulting OSI architecture has seven layers

Physical layer:The physical layer is responsible for handling both the mechanical and electrical details of the physical transmission of a bit streamThis layer is implemented in the hardware of the network device.

Network layer:The network layer is responsible for providing connections and for routing packets in the communication networkincludes handling the address of outgoing packets, decoding the address of incoming packets, and maintaining routing information for proper response to changing load levels.

Transport layer: The transport layer is responsible for two level accesses to the network and for transfer of messages between the clientsincludes partitioning the messages into packets, maintaining packet order, controlling flow, and generating physical addresses

Session layer: Session layer is responsible for implementing sessions, or process to process communications protocolsTypically these protocols are the actual communications for remote logins and for file and mail transfers.

Presentation layer: Presentation layer performs transformations on data to provide a standardization application interface and provide common communications services;examples encryption, text compression, reformatting

Application layer:The application layer is responsible for interacting directly with the usersThis layer deals with file transfer, remote login protocol, and electronic mail.

Local-Area NetworksLAN is a communication network that interconnects a variety of data communication devices with in a small graphical area.High data transmission rate 10MB to100MB per second.The graphical scope is small & for single building.Low transmission error.

CSMA/CD ProtocolMost commonly used access control protocol for bus topology.A device wishing to transmit listen to the medium to determine whether another transmission is in progress.The advantage of this protocol is simplicity.The disadvantage is under a heavy load, contention for the bus rises and performance degrades because of frequent collision.It cannot support a large number of devices per bus.Example: Ethernet

Token Bus ProtocolDevices physically organized in a tree/bus topology form a logical ring, each device knows the identity of the devices proceeding and the following it on the ring.Access to the bus is controlled through a token.The device holding the token its allowed to transmit.A device is allowed to keep the to keep the token for a specific amount of duration.

Ring TopologyThe ring topology is much like the bus in that each workstation and file server is attached to a central cablethe workstations and file server are connected together to form a ringThe workstations and file servers take turns passing information from one to another until the information reaches its final destination

Communication Primitives

Communication primitives are the high level construct with which programs uses the underlying communication network.The designer of a communication network must address four basic issues:Naming and Name Resolution: How do two processes locate each other to communicate? Routing Strategies: How are messages sent through the network? Packet Strategies: Are packets sent individually or as a sequence?Connection Strategies: How do two processes send a sequence of messages? Contention: The network is a shared resource, so how do we resolve conflicting demands for its use?

Message Passing ModelHas two basic communication primitives, namely SEND and RECEIVE.SEND primitive has two parameters, a message and its destination.RECEIVE primitive has two parameters, the source of the message and buffer for storing the messageAn application of these primitives can be found in the client-server computational model.A client process needing some service sends a message to the server and waits for a reply message.Blocking Vs. Non Blocking PrimitiveNon Blocking Primitives:The SEND primitive returns control to the user process as soon as the message is copied from the user buffer onto the kernel buffer.The corresponding RECEIVE primitive signals its intention to receive a message and provides a buffer to copy for the arrival of a message.Program have maximum flexibility to perform computation and communication in any order they wantProgramming becomes tricky and difficult.Blocking PrimitivesThe SEND primitive does not return control to the user program until the message has been sent or until an acknowledgement has been receivedRECEIVE primitive does not return control until a message is copied to the user buffer.Behavior of the programs predictable & programming is relatively easy.The lack of flexibility in programming & the absence of concurrency b/w computation and communication.Synchronization Vs. A synchronization PrimitivesSynchronization :SEND primitives is blocked until a corresponding RECEIVE primitive is executed at the receiving computerThis strategy is also referred to as a rendezvous.

A synchronizationSEND primitive does not block even if there is no corresponding execution of a RECEIVER primitive.The corresponding RECEIVE primitive can either be a blocking or a no blocking primitive.Buffering message is more complex.

Communication: remote Procedure Calls(Week:4)Remote Procedural CallA More natural way to communicate is through Procedural call:every language supports it .semantics are well defined and understood .natural for programmers to use.Programmer Using such a model must handle the following details:Pairing of responses with request messages.Data representation.Knowing the address of remote machine on the serverTaking care of communication and system failure

RPC

Basic RPC OperationThe RPC Mechanism is based on the observation that a procedural call is well known for transfer of control and data with in a program running an a single machine.On invoking a remote procedure, the calling process is suspended.If any parameter are passed to the remote machine where the procedure will execute.On completion, the result are passed back from server to client and resuming execution as if it had called a local procedure.RPC mechanism is based on the concept of stub procedures.The server writer writes the server and links it with the server-side stubs; the client writes her program and links it with the client-side stub.The stubs are responsible for managing all details of the remote communication between client and server.

Design Issues in RPCRPC mechanism is based on the concept of stub procedures.The server writer writes the server and links it with the server-side stubs; the client writes her program and links it with the client-side stub.The stubs are responsible for managing all details of the remote communication between client and server.

Design Issues

BindingBinding is process that determines the remote procedure, and the machine on which it will be executed.It may also check the compatibility of parameters passed and procedure type called.Binding server essentially store the server machine along with the services they provide.Another approach used for binding is where the client specifies the machine and the service required and the binding server returns the port number for communication.

Parameter and Result