Скачать презентацию Module 16 Distributed System Structures Adapted to COP Скачать презентацию Module 16 Distributed System Structures Adapted to COP

3dee283e896e55232bd3f8d3ffb6a6de.ppt

  • Количество слайдов: 31

Module 16: Distributed System Structures Adapted to COP 4610 by Robert van Engelen Module 16: Distributed System Structures Adapted to COP 4610 by Robert van Engelen

Distributed Systems n Distributed system is n n Operating System Concepts – 7 th Distributed Systems n Distributed system is n n Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 2 collection of loosely coupled processors interconnected by a communications network Processors variously called nodes, computers, machines, hosts Site is the location of the processor Host refers to a specific system at a site One host at one site, the client, requests a resource from another site, the server Silberschatz, Galvin and Gagne © 2005

Motivation n Reasons for distributed systems: Resource sharing 4 Sharing and printing files at Motivation n Reasons for distributed systems: Resource sharing 4 Sharing and printing files at remote sites 4 Processing information in a distributed database 4 Using remote specialized hardware devices 4 Using specialized software at remote site l Computation speedup – load sharing by moving jobs to lightly loaded sites l Reliability – detect and recover from site failure, function transfer, reintegrate failed site l Communication – message passing 4 File transfer, login, mail, and RPC l Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 3 Silberschatz, Galvin and Gagne © 2005

Types of Distributed Operating Systems n Two types of distributed operating systems: l Network Types of Distributed Operating Systems n Two types of distributed operating systems: l Network Operating Systems l Distributed Operating Systems Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 4 Silberschatz, Galvin and Gagne © 2005

Network-Operating Systems n Users are aware of multiplicity of machines, not transparent and more Network-Operating Systems n Users are aware of multiplicity of machines, not transparent and more difficult to use n Access to resources of various machines is done explicitly by: l Remote logging into the appropriate remote machine (telnet, ssh) l Remote Desktop l Transferring data from remote machines to local machines, via the File Transfer Protocol (FTP) mechanism 4 Requires explicit FTP commands: get, put, ls, cd … Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 5 Silberschatz, Galvin and Gagne © 2005

Distributed-Operating Systems n Users not aware of multiplicity of machines: access to remote resources Distributed-Operating Systems n Users not aware of multiplicity of machines: access to remote resources similar to access to local resources n Data Migration – transfer data by transferring entire file, or transferring only those portions of the file necessary for the immediate task l Old version of Andrew file system moves entire file to local site (automated FTP) l NFS only moves parts that are needed n Computation Migration – transfer the computation, rather than the data, across the system l If it takes longer to transfer the data than it is to execute the command, then migrate operation 4 Database queries Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 6 Silberschatz, Galvin and Gagne © 2005

Distributed-Operating Systems (Cont. ) n Process Migration – execute an entire process, or parts Distributed-Operating Systems (Cont. ) n Process Migration – execute an entire process, or parts of it, at different sites l Load balancing – distribute processes across network to even the workload l Computation speedup – subprocesses can run concurrently on different sites l Hardware preference – process execution may require specialized processor l Software preference – required software may be available at only a particular site l Data access – run process remotely, rather than transfer all data locally Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 7 Silberschatz, Galvin and Gagne © 2005

Network Structure n Local-Area Network (LAN) – designed to cover small geographical area l Network Structure n Local-Area Network (LAN) – designed to cover small geographical area l Nodes are terminals, workstations, PCs, printers, NFS, and/or a few (one or two) mainframes Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 8 Silberschatz, Galvin and Gagne © 2005

Network Structure (Cont. ) n Local-Area Network (LAN) l Topology: multiaccess bus, ring, or Network Structure (Cont. ) n Local-Area Network (LAN) l Topology: multiaccess bus, ring, or star network l Broadcast is fast and cheap l Speed 10 – 100 megabits/second 4 10 Base. T Ethernet (10 megabits/sec) 4 100 Base. T 4 FDDI Ethernet (100 megabits/sec) token network (100 megabits/sec) Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 9 Silberschatz, Galvin and Gagne © 2005

Network Structure (Cont. ) n Wide-Area Network (WAN) – links geographically separated sites l Network Structure (Cont. ) n Wide-Area Network (WAN) – links geographically separated sites l Point-to-point connections over long-haul lines (often leased from a phone company) l Arpanet (1968) grew to become Internet 4 Telephone lines, microwave links, satellite channels, fiber optic l Nodes: 4 Mostly mainframes and communication processors (CPs) and routers to link regional networks Broadcast usually requires multiple messages l Speed 1. 544 – 45 megabits/second, T 1 telephone system service and T 3 (28 T 1 connections) l Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 10 Silberschatz, Galvin and Gagne © 2005

Communication Processors in a Wide-Area Network Operating System Concepts – 7 th Edition, Apr Communication Processors in a Wide-Area Network Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 11 Silberschatz, Galvin and Gagne © 2005

Network Topology n Sites in the system can be physically connected in a variety Network Topology n Sites in the system can be physically connected in a variety of ways; they are compared with respect to the following criteria: Basic cost - How expensive is it to link the various sites in the system? l Communication cost - How long does it take to send a message from site A to site B? l Reliability - If a link or a site in the system fails, can the remaining sites still communicate with each other? n The various topologies are depicted as graphs whose nodes correspond to sites l An edge from node A to node B corresponds to a direct connection between the two sites l Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 12 Silberschatz, Galvin and Gagne © 2005

Network Topology Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 13 Network Topology Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 13 Silberschatz, Galvin and Gagne © 2005

Communication Structure n The design of a communication network must address four basic issues: Communication Structure n The design of a communication network must address four basic issues: 1. Naming and name resolution - How do two processes locate each other to communicate? 2. Routing strategies - How are messages sent through the network? 3. Connection strategies - How do two processes send a sequence of messages? 4. Contention - The network is a shared resource, so how do we resolve conflicting demands for its use? Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 14 Silberschatz, Galvin and Gagne © 2005

Naming and Name Resolution n Name systems in the network n Address messages with Naming and Name Resolution n Name systems in the network n Address messages with the process-id n Identify processes on remote systems by pair n Domain name service (DNS) – specifies the naming structure of the hosts, as well as resolves a name to an address (Internet) n Name server takes a domain name and returns the name server responsible for the lower-level domain part n Top-level domains. edu, . com, . org l fsu. edu 4 cs. fsu. edu – program 1. cs. fsu. edu IP address Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 15 Silberschatz, Galvin and Gagne © 2005

Routing Strategies n Fixed routing - A path from A to B is specified Routing Strategies n Fixed routing - A path from A to B is specified in advance; path changes only if a hardware failure disables it l Since the shortest path is usually chosen, communication costs are minimized l Fixed routing cannot adapt to load changes l Ensures that messages will be delivered in the order in which they were sent n Virtual circuit - A path from A to B is fixed for the duration of one session. Different sessions involving messages from A to B may have different paths l Partial remedy to adapting to load changes l Ensures that messages will be delivered in the order in which they were sent Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 16 Silberschatz, Galvin and Gagne © 2005

Routing Strategies (Cont. ) n Dynamic routing - The path used to send a Routing Strategies (Cont. ) n Dynamic routing - The path used to send a message form site A to site B is chosen only when a message is sent l Usually a site sends a message to another site on the link least used at that particular time l Adapts to load changes by avoiding routing messages on heavily used path l Messages may arrive out of order 4 This problem can be remedied by appending a sequence number to each message Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 17 Silberschatz, Galvin and Gagne © 2005

Connection Strategies n Circuit switching - A permanent physical link is established for the Connection Strategies n Circuit switching - A permanent physical link is established for the duration of the communication (i. e. , telephone system) n Message switching - A temporary link is established for the duration of one message transfer (i. e. , post-office mailing system) n Packet switching - Messages of variable length are divided into fixed-length packets which are sent to the destination l l Each packet may take a different path through the network The packets must be reassembled into messages as they arrive n Circuit switching requires setup time, but incurs less overhead for shipping each message, and may waste network bandwidth l Message and packet switching require less setup time, but incur more overhead per message Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 18 Silberschatz, Galvin and Gagne © 2005

Contention n Several sites may want to transmit information over a link simultaneously n Contention n Several sites may want to transmit information over a link simultaneously n To avoid repeated collisions: l CSMA/CD - Carrier sense with multiple access (CSMA); collision detection (CD) 4 A site determines whether another message is currently being transmitted over that link 4 If two or more sites begin transmitting at exactly the same time, then they will register a CD and will stop transmitting 4 When the system is very busy, many collisions may occur, and thus performance may be degraded l CSMA/CD is used successfully in the Ethernet system Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 19 Silberschatz, Galvin and Gagne © 2005

Contention (Cont. ) n Token passing - A token continuously circulates in the system Contention (Cont. ) n Token passing - A token continuously circulates in the system (usually a ring structure) l A site that wants to transmit information must wait until the token arrives l When the site completes its round of message passing, it retransmits the token n Message slots - A number of fixed-length message slots continuously circulate in the system (usually a ring structure) l Since a slot can contain only fixed-sized messages, a single logical message may have to be broken down into a number of smaller packets, each of which is sent in a separate slot Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 20 Silberschatz, Galvin and Gagne © 2005

Communication Protocol n The communication network is partitioned into the following multiple layers: n Communication Protocol n The communication network is partitioned into the following multiple layers: n Physical layer – handles the mechanical and electrical details of the physical transmission of a bit stream n Data-link layer – handles the frames, or fixed-length parts of packets, including any error detection and recovery that occurred in the physical layer n Network layer – provides connections and routes packets in the communication network, including handling the address of outgoing packets, decoding the address of incoming packets, and maintaining routing information for proper response to changing load levels Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 21 Silberschatz, Galvin and Gagne © 2005

Communication Protocol (Cont. ) n Transport layer – responsible for low-level network access and Communication Protocol (Cont. ) n Transport layer – responsible for low-level network access and for message transfer between clients, including partitioning messages into packets, maintaining packet order, controlling flow, and generating physical addresses n Session layer – implements sessions, or process-to- process communications protocols n Presentation layer – resolves the differences in formats among the various sites in the network, including character conversions, and half duplex/full duplex (echoing) n Application layer – interacts directly with the users’ deals with file transfer, remote-login protocols and electronic mail, as well as schemas for distributed databases Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 22 Silberschatz, Galvin and Gagne © 2005

Communication Via ISO Network Model Operating System Concepts – 7 th Edition, Apr 4, Communication Via ISO Network Model Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 23 Silberschatz, Galvin and Gagne © 2005

The ISO Protocol Layer Operating System Concepts – 7 th Edition, Apr 4, 2005 The ISO Protocol Layer Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 24 Silberschatz, Galvin and Gagne © 2005

The ISO Network Message Operating System Concepts – 7 th Edition, Apr 4, 2005 The ISO Network Message Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 25 Silberschatz, Galvin and Gagne © 2005

The TCP/IP Protocol Layers Operating System Concepts – 7 th Edition, Apr 4, 2005 The TCP/IP Protocol Layers Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 26 Silberschatz, Galvin and Gagne © 2005

Robustness: Failure Detection n Detecting hardware failure is difficult n To detect a link Robustness: Failure Detection n Detecting hardware failure is difficult n To detect a link failure, a handshaking protocol can be used n Assume site A and site B have established a link At fixed intervals, each site will exchange an I-am-up message indicating that they are up and running n If site A does not receive a message within the fixed interval, it assumes either l The other site is not up l or the message was lost n Site A can now send an Are-you-up? message to site B n If site A does not receive a reply, it can repeat the message or try an alternate route to site B l Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 27 Silberschatz, Galvin and Gagne © 2005

Failure Detection (cont) n If site A does not ultimately receive a reply from Failure Detection (cont) n If site A does not ultimately receive a reply from site B, it concludes some type of failure has occurred l Types of failures: 4 Site B is down 4 The direct link between A and B is down 4 The alternate link from A to B is down 4 The message has been lost n However, site A cannot determine exactly why the failure has occurred Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 28 Silberschatz, Galvin and Gagne © 2005

Robustness: Reconfiguration n When site A determines a failure has occurred, it must reconfigure Robustness: Reconfiguration n When site A determines a failure has occurred, it must reconfigure the system: l If the link from A to B has failed, this must be broadcast to every site in the system l If a site has failed, every other site must also be notified indicating that the services offered by the failed site are no longer available n When the link or the site becomes available again, this information must again be broadcast to all other sites Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 29 Silberschatz, Galvin and Gagne © 2005

Summary of Design Issues n Transparency – the distributed system should appear as a Summary of Design Issues n Transparency – the distributed system should appear as a conventional, centralized system to the user n Fault tolerance – the distributed system should continue to function in the face of failure n Scalability – as demands increase, the system should easily accept the addition of new resources to accommodate the increased demand n Clusters – a collection of semi-autonomous machines that acts as a single system Operating System Concepts – 7 th Edition, Apr 4, 2005 16. 30 Silberschatz, Galvin and Gagne © 2005

End of Chapter 16 End of Chapter 16