1
|
|
2
|
- Sistemas Distribuídos
- Santos,F., H., Ismael; Notas de
Aula, 2005
- Sistemas Operacionais e Programação Concorrente
- Toscani e outros, Editora
sagra-luzzatto
- Fundamentos de Sistemas Operacionais
- Silberschatz, Abraham, Galvin,
Peter, Gagne, G., LTC
- Sistemas Distribuídos
- Andrew S. Tanenbaun; Prentice
Hall
- Operating System Concepts: Internals and Design Principles
- Williiam Stallings, Prentice
Hall
|
3
|
- Distributed Systems
- Hardware for Distibuted Systems
- Client Server Paradigm
- Networking
- Client Server Communication
|
4
|
|
5
|
- Distributed system is collection of loosely coupled processors
interconnected by a communications network
- Processors called nodes, computers, machines, hosts
- Site is location of the processor
- Reasons for distributed systems
- Resource sharing
- sharing and printing files at remote sites
- processing information in a distributed database
- using remote specialized hardware devices
- Computation speedup – load sharing
- Reliability – detect and recover from site failure, function transfer,
reintegrate failed site
- Communication – message passing
|
6
|
|
7
|
|
8
|
|
9
|
- Alternative client-server organizations (a) – (e).
|
10
|
- An example of a server acting as a client.
|
11
|
|
12
|
|
13
|
|
14
|
- Network Operating Systems
- Distributed Operating Systems
|
15
|
- Users are aware of multiplicity of machines. Access to resources of various
machines is done explicitly by:
- Remote logging into the appropriate remote machine (telnet, ssh)
- Transferring data from remote machines to local machines, via the File
Transfer Protocol (FTP) mechanism
|
16
|
- Users not aware of multiplicity of machines
- Access to remote resources
similar to access to local resources
- Data Migration – transfer data by transferring entire file, or
transferring only those portions of the file necessary for the immediate
task
- Computation Migration – transfer the computation, rather than the data,
across the system
|
17
|
- Process Migration – execute an entire process, or parts of it, at
different sites
- Load balancing – distribute processes across network to even the
workload
- Computation speedup – subprocesses can run concurrently on different
sites
- Hardware preference – process execution may require specialized
processor
- Software preference – required software may be available at only a
particular site
- Data access – run process remotely, rather than transfer all data
locally
|
18
|
- Local-Area Network (LAN) – designed to cover small geographical area.
- Multiaccess bus, ring, or star network
- Speed » 10 megabits/second,
or higher
- Broadcast is fast and cheap
- Nodes:
- usually workstations and/or personal computers
- a few (usually one or two) mainframes
|
19
|
|
20
|
- Wide-Area Network (WAN) – links geographically separated sites
- Point-to-point connections over long-haul lines (often leased from a
phone company)
- Speed » 100 kilobits/second
- Broadcast usually requires multiple messages
- Nodes:
- usually a high percentage of mainframes
|
21
|
|
22
|
|
23
|
|
24
|
|
25
|
- DOS (Distributed Operating
Systems)
- NOS (Network Operating Systems)
- Middleware
|
26
|
- Separating applications from operating system code through
- a microkernel.
|
27
|
- General structure of a distributed system as middleware.
|
28
|
- Alternatives for blocking and buffering in message passing.
|
29
|
- Relation between blocking, buffering, and reliable communications.
|
30
|
- Pages of address space distributed among four machines
- Situation after CPU 1 references page 10
- Situation if page 10 is read only and replication is used
|
31
|
- False sharing of a page between two independent processes.
|
32
|
- General structure of a network operating system.
|
33
|
- Two clients and a server in a network operating system.
|
34
|
- Different clients may mount the servers in different places.
|
35
|
- In an open middleware-based
distributed system, the protocols used by each middleware layer should
be the same, as well as the interfaces they offer to applications.
|
36
|
- In an open middleware-based distributed system, the protocols used by
each middleware layer should be the same, as well as the interfaces they
offer to applications.
|
37
|
- An example of horizontal distribution of a Web service.
|
38
|
- A comparison between multiprocessor operating systems, multicomputer
operating systems, network operating systems, and middleware based
distributed systems.
|
39
|
|
40
|
|
41
|
|
42
|
|
43
|
|
44
|
|
45
|
|
46
|
|
47
|
|
48
|
|
49
|
|
50
|
|
51
|
|
52
|
- Sockets
- Remote Procedure Calls
- Remote Method Invocation (Java)
- CORBA
- Object Registration
|
53
|
|
54
|
- A socket is defined as an endpoint for communication
- Concatenation of IP address and port
- The socket 161.25.19.8:1625 refers to port 1625 on host 161.25.19.8
- Communication consists between a pair of sockets
- All Ports < 1024 are Considered “well-known”
- - TELNET uses port 23
- - FTP uses port 21
- - HTTP server uses port 80
|
55
|
|
56
|
|
57
|
- Java Provides:
- - Connection-Oriented (TCP) Sockets
- - Connection-less (UDP) Sockets
- - Multicast Connection-less Socket
|
58
|
- Server uses ServerSocket to Create the Socket on Port 5155
- ServerSocket s = new
ServerSocket(5155);
- To Accept Connections From Clients:
- Socket client = s.accept();
- Connections are Often Serviced in Separate Threads
- The Client Connects to the Server Using Socket class with the IP Address
of the Server.
- Socket s = new Socket(“127.0.0.1”,5155);
|
59
|
|
60
|
|
61
|
|
62
|
|
63
|
- The header.h file used by the client and server.
|
64
|
|
65
|
- A client using the server to copy a file.
|
66
|
|
67
|
|
68
|
|
69
|
|
70
|
|
71
|
|
72
|
|
73
|
|
74
|
|
75
|
|
76
|
|
77
|
|
78
|
- Sockets are Considered Low-level.
- RPCs Offer a higher-level Form of Communication
- Client Makes Procedure Call to “Remote” Server Using Ordinary Procedure
Call Mechanisms.
- Remote procedure call (RPC) abstracts procedure calls between processes
on networked systems.
|
79
|
- Remote procedure call, RPC
- Stubs – client-side proxy for the actual procedure on the server.
- The client-side stub locates the server and marshalls the parameters.
- The server-side stub receives this message, unpacks the marshalled
parameters, and peforms the procedure on the server.
|
80
|
- “Stub” is a Proxy for the Remote Object – Resides on Client.
- The Stub “Marshalls” the Parameters and Sends Them to the Server.
- “Skeleton” is on Server Side.
- Skeleton “Unmarshalls” the Parameters and Delivers Them to the Server.
|
81
|
- Remote Method Invocation (RMI) is a Java mechanism similar to RPCs.
- RMI allows a Java program on one machine to invoke a method on a remote
object.
|
82
|
- A Thread May Invoke a Method on a Remote Object
- An Object is Considered “remote” if it Resides in a Separate Java
Virtual Machine.
|
83
|
|
84
|
|
85
|
|
86
|
|
87
|
- RPC’s Support Procedural Programming Style
- RMI Supports Object-Oriented Programming Style
- Parameters to RPCs are Ordinary Data Structures
- Parameters to RMI are Objects
|
88
|
|
89
|
- Local (Non-Remote) Objects are Passed by Copy using Object Serialization
- Remote Objects are Passed by Reference
|
90
|
- Remote Objects are Declared by Specifying an interface that extends java.rmi.Remote
- Every Method Must Throw java.rmi.RemoteException
|
91
|
- import java.rmi.*;
- public interface MessageQueue extends Remote
- {
- public void send(Object item)
throws
- RemoteException;
- public Object receive() throws RemoteException;
- }
|
92
|
- import java.rmi.*;
- public class MessageQueueIMPL
- extends server.UnicastRemoteObject
- implements MessageQueue
- {
- public void send(Object item) throws
- RemoteException
- { /* implementation */
- }
- public Object receive() throws RemoteException
- { /* implementation */
- }
- }
|
93
|
- The Client Must
- (1) Install a Security Manager:
- System.setSecurityManager(
- new RMISecurityManager());
- (2) Get a Reference to the Remote Object
- MessageQueue mb;
- mb = (MessageQueue)Naming.lookup(
-
“rmi://127.0.0.1/MessageServer”’);
|
94
|
- Compile All Source Files and Generate Stubs
- javac *.java; rmic
MessageQueueImpl
- Start the Registry Service
- rmiregistry
- Create the Remote Object
- java –Djava.security.policy=java.policy MessageQueueImpl
- Start the Client
- java –Djava.security.policy=java.policy Factory
|
95
|
- New with Java 2
- grant {
- permission
java.net.SocketPermission
"*:1024-65535","connect,accept";
- };
|
96
|
|
97
|
|
98
|
|
99
|
|
100
|
|
101
|
- RMI is Java-to-Java Technology
- CORBA is Middleware that Allows Heterogeneous Client and Server
Applications to Communicate
- Interface Definition Language (IDL)
is a Generic Way to Describe an Interface to a Service a Remote
Object Provides
- Object Request Broker (ORB) Allows Client and Server to Communicate
through IDL.
- Internet InterORB Protocol (IIOP) is a Protocol Specifying how the ORBs
can Communicate.
|
102
|
|
103
|
|
104
|
- Registration Service Allows Remote Objects to “register” their services.
- RMI, CORBA Require Registration Services
|
105
|
|
106
|
|
107
|
|
108
|
|
109
|
|
110
|
|
111
|
|
112
|
|