Скачать презентацию
Идет загрузка презентации. Пожалуйста, подождите
Презентация была опубликована 9 лет назад пользователемБорис Жемчужников
1 Distributed Computing
3 Distributed system, distributed computing Early computing was performed on a single processor. Uni-processor computing can be called centralized computing. A distributed system is a collection of independent computers, interconnected via a network, capable of collaborating on a task. Distributed computing is computing performed in a distributed system.
4 Distributed Systems
5 Examples of Distributed systems Network of workstations (NOW): a group of networked personal workstations connected to one or more server machines. The Internet An intranet: a network of computers and workstations within an organization, segregated from the Internet via a protective device (a firewall).
6 Example of a large-scale distributed system – eBay
7 An example small-scale distributed system
8 A small state-of-the practice DS wireless access point wireless laptops router/ firewall cable modem to/from cable headend Ethernet
9 Computers in a Distributed System Workstations: computers used by end- users to perform computing Server machines: computers which provide resources and services Personal Assistance Devices: handheld computers connected to the system via a wireless communication link.
12 Monolithic mainframe applications vs. distributed applications The monolithic mainframe application architecture : –Separate, single-function applications, such as order-entry or billing –Applications cannot share data or other resources –Developers must create multiple instances of the same functionality (service). –Proprietary (user) interfaces The distributed application architecture : –Integrated applications –Applications can share resources –A single instance of functionality (service) can be reused. –Common user interfaces
13 Centralized vs. Distributed Computing
14 Why distributed computing? Economics: distributed systems allow the pooling of resources, including CPU cycles, data storage, input/output devices, and services. Reliability: a distributed system allow replication of resources and/or services, thus reducing service outage due to failures. The Internet has become a universal platform for distributed computing.
15 The Weaknesses and Strengths of Distributed Computing In any form of computing, there is always a tradeoff in advantages and disadvantages Some of the reasons for the popularity of distributed computing : The affordability of computers and availability of network access Resource sharing Scalability Fault Tolerance
16 The Weaknesses and Strengths of Distributed Computing The disadvantages of distributed computing: Multiple Points of Failures: the failure of one or more participating computers, or one or more network links, can spell trouble. Security Concerns: In a distributed system, there are more opportunities for unauthorized attack.
17 Operating Systems Basics
18 Operating systems basics A process consists of an executing program, its current values, state information, and the resources used by the operating system to manage its execution. A program is an artifact constructed by a software developer; a process is a dynamic entity which exists only when a program is run.
19 Process State Transition Diagram
20 Java processes There are three types of Java program: applications, applets, and servlets, all are written as a class. –A Java application program has a main method, and is run as an independent (standalone) process. –An applet does not have a main method, and is run using a browser or the appletviewer. –A servlet does not have a main method, and is run in the context of a web server. A Java program is compiled into bytecode, a universal object code. When run, the bytecode is interpreted by the Java Virtual Machine (JVM).
21 Three Types of Java programs Applications a program whose byte code can be run on any system which has a Java Virtual Machine. An application may be standalone (monolithic) or distributed (if it interacts with another process). Applets A program whose byte code is downloaded from a remote machine and is run in the browsers Java Virtual Machine. Servlets A program whose byte code resides on a remote machine and is run at the request of an HTTP client (a browser).
22 Three Types of Java programs
23 A sample Java application
24 A Sample Java Applet
25 A Sample Java Servlet
26 Concurrent Processing On modern day operating systems, multiple processes appear to be executing concurrently on a machine by timesharing resources.
27 Concurrent processing within a process It is often useful for a process to have parallel threads of execution, each of which timeshare the system resources in much the same way as concurrent processes.
28 Java threads The Java Virtual Machine allows an application to have multiple threads of execution running concurrently. Java provides a Thread class: public class Thread extends ObjectObject implements RunnableRunnable When a Java Virtual Machine starts up, there is usually a single thread (which typically calls the method named main of some designated class). The Java Virtual Machine continues to execute threads until either of the following occurs: –The exit method of class Runtime has been called and the security manager has permitted the exit operation to take place. –All threads have terminated, either by returning from the call to the run method or by throwing an exception that propagates beyond the run method.
29 Two ways to create a new thread of execution Using a subclass of the Thread class Using a class that implements the Runnable interface
30 Create a class that is a subclass of the Thread class Declare a class to be a subclass of Thread. This subclass should override the run method of class Thread. An instance of the subclass can then be allocated and started:
31 Create a class that is a subclass of the Thread class
32 Java Threads-2 The other way to create a thread is to declare a class that implements the Runnable interface. That class then implements the run method. An instance of the class can then be allocated, passed as an argument when creating Thread, and started.
33 Create a class that implements the Runnable interface
34 Program samples RunThreads.java SomeThread.java RunThreads2.java SomeThread2.java
35 Thread-safe Programming When two threads independently access and update the same data object, such as a counter, as part of their code, the updating needs to be synchronized. (See next slide.) Because the threads are executed concurrently, it is possible for one of the updates to be overwritten by the other due to the sequencing of the two sets of machine instructions executed in behalf of the two threads. To protect against the possibility, a synchronized method can be used to provide mutual exclusion.
36 Race Condition
37 Synchronized method in a thread
38 Network Basics
39 Network standards and protocols On public networks such as the Internet, it is necessary for a common set of rules to be specified for the exchange of data. Such rules, called protocols, specify such matters as the formatting and semantics of data, flow control, error correction. Software can share data over the network using network software which supports a common set of protocols.
40 Protocols In the context of communications, a protocol is a set of rules that must be observed by the participants. In communications involving computers, protocols must be formally defined and precisely implemented. For each protocol, there must be rules that specify the followings: How is the data exchanged encoded? How are events (sending, receiving) synchronized so that the participants can send and receive in a coordinated order? The specification of a protocol does not dictate how the rules are to be implemented.
41 The network architecture Network hardware transfers electronic signals,which represent a bit stream, between two devices. Modern day network applications require an application programming interface (API) which masks the underlying complexities of data transmission. A layered network architecture allows the functionalities needed to mask the complexities to be provided incrementally, layer by layer. Actual implementation of the functionalities may not be clearly divided by layer.
42 The OSI seven-layer network architecture
43 Network Architecture The division of the layers is conceptual: the implementation of the functionalities need not be clearly divided as such in the hardware and software that implements the architecture. The conceptual division serves at least two useful purposes : Systematic specification of protocols it allows protocols to be specified systematically 2.Conceptual Data Flow: it allows programs to be written in terms of logical data flow.
44 The TCP/IP Protocol Suite The Transmission Control Protocol/Internet Protocol suite is a set of network protocols which supports a four-layer network architecture. It is currently the protocol suite employed on the Internet.
45 The TCP/IP Protocol Suite -2 The Internet layer implements the Internet Protocol, which provides the functionalities for allowing data to be transmitted between any two hosts on the Internet. The Transport layer delivers the transmitted data to a specific process running on an Internet host. The Application layer supports the programming interface used for building a program.
46 Network Resources Network resources are resources available to the participants of a distributed computing community. Network resources include hardware such as computers and equipment, and software such as processes, mailboxes, files, web documents. An important class of network resources is network services such as the World Wide Web and file transfer (FTP), which are provided by specific processes running on computers.
47 Identification of Network Resources One of the key challenges in distributed computing is the unique identification of resources available on the network, such as mailboxes, and web documents. –Addressing an Internet Host –Addressing a process running on a host – Addresses –Addressing web contents: URL
48 Addressing an Internet Host
49 The Internet Topology
50 The internet consists of an hierarchy of networks, interconnected via a network backbone. Each network has a unique network address. Computers, or hosts, are connected to a network. Each host has a unique ID within its network. Each process running on a host is associated with zero or more ports. A port is a logical entity for data transmission.
51 The Internet addressing scheme In IP version 4, each address is 32 bit long (IPv6 has 128-bit address). The address space accommodates 2 32 (4.3 billion) addresses in total. Addresses are divided into 5 classes (A through E)
52 The Internet addressing scheme - 2
53 Example: Suppose the dotted-decimal notation for a particular Internet address is The 32-bit binary expansion of the notation is as follows : Since the leading bit sequence is 10, the address is a Class B address. Within the class, the network portion is identified by the remaining bits in the first two bytes, that is, , and the host portion is the values in the last two bytes, or For convenience, the binary prefix for class identification is often included as part of the network portion of the address, so that we would say that this particular address is at network and then at host address on that network.
54 Another example: Given the address , one can expand it as follows: The binary prefix of 1110 signifies that this is class D, or multicast, address. Data packets sent to this address should therefore be delivered to the multicast group
55 The Internet Address Scheme - 3 For human readability, Internet addresses are written in a dotted decimal notation: nnn.nnn.nnn.nnn, where each nnn group is a decimal value in the range of 0 through 255 # Internet host table (found in /etc/hosts file) localhost falcon.csc.calpoly.edu falcon loghost falcon-srv.csc.calpoly.edu falcon-srv hornet.csc.calpoly.edu hornet hornet-srv.csc.calpoly.edu hornet-srv onion.csc.calpoly.edu onion hercules.csc.calpoly.edu hercules
56 IP version 6 Addressing Scheme Each address is 128-bit long. There are three types of addresses: –Unicast: An identifier for a single interface. –Anycast: An identifier for a set of interfaces (typically belonging to different nodes). –Multicast: An identifier for a set of interfaces (typically belonging to different nodes). A packet sent to a multicast address is delivered to all interfaces identified by that address. See Request for Comments: (link is in books reference)
57 The Domain Name System (DNS) For user friendliness, each Internet address is mapped to a symbolic name, using the DNS, in the format of:... {. } e.g.,
58 The Domain Name System. For network applications, a domain name must be mapped to its corresponding Internet address.. Processes known as domain name system servers provide the mapping service, based on a distributed database of the mapping scheme.. The mapping service is offered by thousands of DNS servers on the Internet, each responsible for a portion of the name space, called a zone. The servers that have access to the DNS information (zone file) for a zone is said to have authority for that zone.
59 Top-level Domain Names.com: For commercial entities, which anyone, anywhere in the world, can register..net : Originally designated for organizations directly involved in Internet operations. It is increasingly being used by businesses when the desired name under "com" is already registered by another organization. Today anyone can register a name in the Net domain..org: For miscellaneous organizations, including non-profits..edu: For four-year accredited institutions of higher learning..gov: For US Federal Government entities.mil: For US military Country Codes :For individual countries based on the International Standards Organization. For example, ca for Canada, and jp for Japan.
60 Domain Name Hierarchy
61 Name lookup and resolution If a domain name is used to address a host, its corresponding IP address must be obtained for the lower-layer network software. The mapping, or name resolution, must be maintained in some registry. For runtime name resolution, a network service is needed; a protocol must be defined for the naming scheme and for the service. Example: The DNS service supports the DNS; the Java RMI registry supports RMI object lookup; JNDI is a network service lookup protocol.
62 Addressing a process running on a host
63 Logical Ports
64 Well Known Ports Each Internet host has 2 16 (65,535) logical ports. Each port is identified by a number between 1 and 65535, and can be allocated to a particular process. Port numbers beween 1 and 1023 are reserved for processes which provide well- known services such as finger, FTP, HTTP, and .
65 Well-known ports
66 Choosing a port to run your program For our programming exercises: when a port is needed, choose a random number above the well known ports: 1, ,535. If you are providing a network service for the community, then arrange to have a port assigned to and reserved for your service.
67 Addressing a Web Document
68 The Uniform Resource Identifier (URI) Resources to be shared on a network need to be uniquely identifiable. On the Internet, a URI is a character string which allows a resource to be located. There are two types of URIs: –URL (Uniform Resource Locator) points to a specific resource at a specific location –URN (Uniform Resource Name) points to a specific resource at a nonspecific location.
69 URL A URL has the format of: protocol://host address[:port]/directory path/file name#section
70 More on URL The path in a URL is relative to the document root of the server. On the CSL systems, a users document root is ~/www. A URL may appear in a document in a relative form: and the actual URL referred to will be another.html preceded by the protocol, hostname, directory path of the document.
71 Software Engineering Basics
72 Procedural versus Object-oriented Programming In building network applications, there are two main classes of programming languages: procedural language and object-oriented language. – Procedural languages, with the C language being the primary example, use procedures (functions) to break down the complexity of the tasks that an application entails. – Object-oriented languages, exemplified by Java, use objects to encapsulate the details. Each object simulates an object in real life, carrying state data as well as behaviors. State data are represented as instance data. Behaviors are represented as methods.
73 UML Class Diagram Notations NOTE: The shape, the style of the line (dashed or solid), the direction of the arrow, and the shape of the arrowheads (pointed, hollow, or solid) are significant.
74 UML Class Diagram Notations
76 The Architecture of Distributed Applications
Еще похожие презентации в нашем архиве:
© 2024 MyShared Inc.
All rights reserved.