apos week 1 4

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: alixafar

Post on 10-Jun-2015

327 views

Category:

Education


5 download

TRANSCRIPT

  • 1. Miss Maheen SadiqUnder the guideline ofSir Syed Rizwan-ul-HasanAssistant Professor CED, SSUET

2. Introduction (Week 1) 3. What is Operating System? An operating system is a layer of software which takes care oftechnical aspects of a computers operation. Examples: Windows, Linux, Unix and Mac OS, etc., 4. Function of Operating System Resource management-Time management (CPU and Disk Scheduling)-Space management(main and secondary storages)-Process synchronization and deadlock handling.-Accounting and status information User friendliness-Execution environment-Error detection and handling-Protection and security-Fault tolerance and failure recovery 5. Types of Advanced Operating System It can be categorized on the following basis of - Architecture Driven A variety of high speed architecture Extremely fast parallel Offers great potential for speed up Distributed Operating Systems Multiprocessor Operating Systems - Application Driven Require special operating system support as a requirement as well as for efficiency. Database Operating Systems Real-time Operating Systems 6. Types of Advanced Operating SystemAdvanced Operating SystemsArchitecture Driven Application DrivenDistributedMultiprocessor Database SystemsReal-timeSystemssystemsSystems 7. Distributed Systems They 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 Communications 8. Multiprocessor Operating System Consists of a set of processors that share a set of physical memory blocks share a common clock "share" over an interconnection network. Control and manage resources hardware and software resources viewed as a uniprocessor system. Design issues same as traditional system. Practical issues: increased complexity of synchronization, scheduling, memory management, protection and security. 9. Database Operating System Database systems place increased demands on an operatingsystem to efficiently support: concept of a transactions manage large volumes of data concurrency control system failure control Should also have buffer management schemes for dataretrieval and storage from secondary storage Concurrency control is one of the most challengingproblems in the design of database operating systems 10. Real-time Operating Systems Systems where jobs have completion deadlines In soft real-time systems, jobs should be completed before itsdeadline to be of use In hard real-time systems, jobs should be completed before itsdeadline to avert a disaster Jobs should be scheduled in such a way that a maximumnumber of jobs satisfy their deadlines Requirements can vary from application to application 11. Network Operating System A network operating system (NOS) is a computer operatingsystem that is designed primarily to supportworkstation, personal computer, and, in someinstances, older terminal that are connected on a local areanetwork (LAN). A network operating system provides printersharing, common file system and databasesharing, application sharing, and the ability to manage anetwork name directory, security, and other housekeepingaspects of a network. 12. Architecture of Distributed System (Week 2) 13. Architecture of Distributed System A distributed system is a collection of autonomous computerswhich do not share memory or a clock Computers communicate with each other by exchangingmessages 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 belocal to it Resources owned and controlled by other computers are said tobe remote 14. Architecture of Distributed System Accessing remote resources is more expensive because ofcommunication delays Motive is to convert low cost microprocessors to singlepowerful system 15. Advantages Resource sharing Hardware and software resources can be shared Printer, Compiler, Text Editors, Databases, etc. Enhanced performance Rapid response time Higher system throughput Many tasks can be concurrently executed at different computers Distributed system can employ load distribution techniques Tasks at heavily loaded systems are transferred to lightly loaded computers Waiting time of a task can be reduced 16. Improved reliability and availability Few components of the system can fail without affecting the availability System can be made fault tolerant through replication of data and services Data can be files and directories and services can be the processes that provide functionality Modular expandability New hardware and software can be easily added without replacing the existing system Disadvantages Complexity Security Manageability Unpredictability 17. Architecture of Distributed SystemCPU CPUDiskMemory Memory CommunicationNetworkCPU CPUDiskDiskCPUMemory Memory Memory 18. Architecture typesDS can be classified into three broad categories: Minicomputer model Workstation model Processor pool modelMinicomputer Model DS consists of several minicomputers e.g. VAX processors Each machine supports multiple users and share resources Ratio between no. of processors to no. of users is usuallyless than one 19. Workstation Model Consists of several workstations ( up to several thousands) Each user has a workstation at his disposal, which consistof powerful processor, memory and display With the help of DFS, users can access data regardless ofits location Ratio between no. of processors to no. of users is usually 1 e.g. SSUET WS1 (Workstation1) and user1 20. Processor Pool Model Ratio between processor to no. of users is normally greaterthan 1 This model allocates one or more processors according tousers need Once the processors complete their jobs, they return to thepool and await a new assignment Amoeba is a combination of the processor pool model andworkstation model 21. Issues in Distributed Operating SystemImportant Issues in the design of a distributed operatingsystem Global knowledge Naming Scalability Compatibility Process Synchronization Resource Management Security Structuring Client-Server Computing Model 22. Global Knowledge In case of shared memory systems ,up-to date state of allprocesses 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 beknown because of absence of shared memory and clock andunexpected delays Fundamental problems in the design of DOS is to determineefficient technique to implement decentralized system widecontrol Another problem is to how to order all the events that occuron different times at different computers in the absence ofglobal clock 23. Naming Names are used to refer to objects Computers, printers, services, files and users Eg. Name service maps a logical name into a physicaladdress, by using table lookup or by algorithm If an algorithm is used for mapping, the algorithm woulddepend upon the structure of the names Another issues in naming is the method of naming objectssuch that an object can be located irrespective of its logicalname 24. Scalability Systems generally grow with time Design should be such that system should not result insystem unavailability or degraded performance whengrowth occurs E.g. broadcast based protocols work well for small systemsbut not for large systems Distributed File System 25. Compatibility Refers to the interoperability among the resources in a system There are three levels of compatibility in DS Binary Level: all processes execute the same instruction set even though the processors may differ in performance and in input-output E.g. Emerald distributed system Program development is easy DS cannot include computers with different architectures Rarely supported in large distributed systems 26. Process Synchronization Process synchronization is difficult because of unavailability ofshared memory DOS has to synchronize process running at different computerswhen they try to concurrently access shared resources Mutual exclusion problem Request must be serialized to secure the integrity of the sharedresources In DS, process can request resources (local or remote) andrelease resources in any order If the sequence of the resource allocation is notcontrolled, deadlock may occur which can lead to decrease insystem performance 27. Resource Management Concerned with making both local and remote resourcesavailable to users in an effective manner Users should be able to access remote resources as easily as theycan access local resources Specific location of resources should be hidden from users in thefollowing ways: Data Migration Computation Migration and Distributed scheduling 28. Data Migration Data can either be file or contents of physical memory In process of data migration, data is brought to the location ofthe computation that needs access to it by the DOS If computation updates a set of data, original location may haveto be updated In case of file DFS is involved DFS is a component of DOS that implements a common filesystem available to the autonomous computers in the system Primary goal is to provide same functional capability to accessfiles regardless of their location If the data accessed is in the physical memory of another systemthen a computations data request is handled by distributedshared memory 29. Computation Migration In computation migration, computation migrates to anotherlocation It may be efficient when information is needed concerning aremote file directory it is more efficient to send the message and receive theinformation back, instead of transferring the whole directory Remote procedural call has been commonly used forcomputation migration Only a part of computation of a process is normally carried outon a different machine 30. Security OS is responsible for the security of the computer system Two issues must be considered: Authentication: process of guaranteeing that an entity is whatit claims to be Authorization: process of deciding what privileges an entityhas and making only these privileges available 31. Communications Network(Week 3) 32. 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 33. Wide-Area Networks WANs consist of switches that are usually interconnected by communicationlinks. 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 throughpath or limited bandwidth. The data can be lost due to switch crashes, communication link failure,limited buffer capacity at switch, transmission error, etc 34. Packet Switching Vs. Circuit Switching Circuit Switching: A dedicated path is established b/w two devices wishing tocommunicate, and the path remains intact for the entiretransmission. 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 itsnearest switch. These packets are routes from one switch to another untilthey arrive at the switch connected to the destination device. Parallel transmission possible. The breaking of a message into packets & assembling themback at the destination carries some cost. 35. Layered ProtocolsISO OSI Reference Model 36. The OSI Model A widely accepted structuring technique is layering The communications functions are partitioned into a hierarchicalset of layers Each layer performs a related subset of the functions required tocommunicate with another system The resulting OSI architecture has seven layersPhysical layer: The physical layer is responsible for handling boththe mechanical and electrical details of the physicaltransmission of a bit stream This layer is implemented in the hardware of thenetwork device. 37. Network layer: The network layer is responsible for providing connectionsand for routing packets in the communication network includes handling the address of outgoing packets, decodingthe address of incoming packets, and maintaining routinginformation for proper response to changing load levels. Transport layer: The transport layer is responsible for two level accesses tothe network and for transfer of messages between theclients includes partitioning the messages into packets, maintainingpacket order, controlling flow, and generating physicaladdresses 38. 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 toprovide a standardization application interface and providecommon communications services; examples encryption, text compression, reformatting Application layer: The application layer is responsible for interacting directlywith the users This layer deals with file transfer, remote login protocol,and electronic mail. 39. Local-Area Networks LAN is a communication network that interconnects a variety ofdata 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. 40. CSMA/CD Protocol Most commonly used access control protocol for bus topology. A device wishing to transmit listen to the medium to determinewhether another transmission is in progress. The advantage of this protocol is simplicity. The disadvantage is under a heavy load, contention for the busrises and performance degrades because of frequent collision. It cannot support a large number of devices per bus. Example: Ethernet 41. Token Bus Protocol Devices physically organized in a tree/bus topology form a logicalring, each device knows the identity of the devices proceeding andthe 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 specificamount of duration. 42. Ring Topology The ring topology is much like the bus in that each workstationand file server is attached to a central cable the workstations and file server are connected together to form aring The workstations and file servers take turns passing informationfrom one to another until the information reaches its finaldestination 43. Communication Primitives Communication primitives are the high level construct withwhich programs uses the underlying communication network. The designer of a communication network must address fourbasic 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? 44. Message Passing Model Has two basic communication primitives, namely SEND andRECEIVE. SEND primitive has two parameters, a message and its destination. RECEIVE primitive has two parameters, the source of the messageand buffer for storing the message An application of these primitives can be found in the client-servercomputational model. A client process needing some service sends a message to the serverand waits for a reply message. 45. Blocking Vs. Non Blocking Primitive Non Blocking Primitives: The SEND primitive returns control to the user process as soon as themessage is copied from the user buffer onto the kernel buffer. The corresponding RECEIVE primitive signals its intention to receive amessage and provides a buffer to copy for the arrival of a message. Program have maximum flexibility to perform computation andcommunication in any order they want Programming becomes tricky and difficult. Blocking Primitives The SEND primitive does not return control to the user program until themessage has been sent or until an acknowledgement has been received RECEIVE primitive does not return control until a message is copied to theuser buffer. Behavior of the programs predictable & programming is relatively easy. The lack of flexibility in programming & the absence of concurrency b/wcomputation and communication. 46. Synchronization Vs. A synchronization Primitives Synchronization : SEND primitives is blocked until a corresponding RECEIVE primitive is executed at the receiving computer This strategy is also referred to as a rendezvous. A synchronization SEND 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. 47. Communication: remote Procedure Calls (Week:4) 48. Remote Procedural Call A 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 followingdetails: Pairing of responses with request messages. Data representation. Knowing the address of remote machine on the server Taking care of communication and system failure 49. RPC 50. Basic RPC Operation The RPC Mechanism is based on the observation that a procedural callis well known for transfer of control and data with in a program runningan a single machine. On invoking a remote procedure, the calling process is suspended. If any parameter are passed to the remote machine where the procedurewill execute. On completion, the result are passed back from server to client andresuming 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-sidestubs; the client writes her program and links it with the client-sidestub. The stubs are responsible for managing all details of the remotecommunication between client and server. 51. Design Issues in RPC RPC mechanism is based on the concept of stub procedures. The server writer writes the server and links it with theserver-side stubs; the client writes her program and links itwith the client-side stub. The stubs are responsible for managing all details of theremote communication between client and server. 52. Design Issues 53. Binding Binding is process that determines the remote procedure, and themachine on which it will be executed. It may also check the compatibility of parameters passed andprocedure type called. Binding server essentially store the server machine along with theservices they provide. Another approach used for binding is where the client specifies themachine and the service required and the binding server returns theport number for communication. 54. Parameter and Result