Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

51
Distributed Systems Distributed Systems Architecture Architecture Presentation II Presentation II Presenters Rose Kit & Turgut Rose Kit & Turgut Tezir Tezir

Transcript of Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Page 1: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Distributed Systems Architecture Distributed Systems Architecture

Presentation IIPresentation II

Presenters

Rose Kit & Turgut TezirRose Kit & Turgut Tezir

Page 2: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

OutlineOutline

General View TABLEGeneral View TABLECentralized System Architecture Centralized System Architecture Distributed System Architecture (DSA) Distributed System Architecture (DSA) Advantages of DSA Advantages of DSA Client / Server SystemClient / Server System– Client / Server ArchitectureClient / Server Architecture

Three-Tier client ArchitectureThree-Tier client Architecture– Three-Tier Client Server SystemThree-Tier Client Server System– Three-Tier Internet Banking SystemThree-Tier Internet Banking System

Distributed Object ComputingDistributed Object ComputingDistributed Object ArchitectureDistributed Object ArchitectureAdvantages of Distributed Object ArchitectureAdvantages of Distributed Object ArchitectureDistributed Object Programming TechniquesDistributed Object Programming Techniques

Page 3: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Outline, cont.Outline, cont.Distributed Network OrganizationDistributed Network OrganizationNetwork SchematicNetwork SchematicProtocol LayersProtocol LayersISO OSI Protocol LayersISO OSI Protocol LayersTCP/IP Network ModelTCP/IP Network ModelHow OSI relates to TCP/IP LayersHow OSI relates to TCP/IP LayersNetwork SchematicNetwork SchematicInternet Protocol (IP)Internet Protocol (IP)Transmission Control Protocol (TCP)Transmission Control Protocol (TCP)User Datagram Protocol (UDP)User Datagram Protocol (UDP)CommunicationCommunicationMessage passingMessage passingSocketsSocketsDifficult To Reuse CodeDifficult To Reuse CodeDistributed Object Architecture and TCPDistributed Object Architecture and TCPDistributed Object Architecture and C/S ModelDistributed Object Architecture and C/S ModelMiddlewareMiddlewareDistributed Object Architecture ModelDistributed Object Architecture ModelDisadvantages of Distributed Object ArchitectureDisadvantages of Distributed Object ArchitectureRMI ExampleRMI Example

Page 4: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

General View TABLEGeneral View TABLE

Page 5: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Centralized systems: Centralized systems: Data, Process and Data, Process and Interface components of an information Interface components of an information system are central. Users interact with the system are central. Users interact with the system via terminals or terminal system via terminals or terminal emulators.emulators.– A single computer with one ore more CPUs A single computer with one ore more CPUs

processes all incoming requestprocesses all incoming request– Problems with cost, reliabilityProblems with cost, reliability– Specification and implementation are defined Specification and implementation are defined

within a single systemwithin a single system

Centralized System Architecture Centralized System Architecture

Page 6: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Centralized System ArchitectureCentralized System Architecture

Page 7: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Centralized System ArchitectureCentralized System Architecture

Page 8: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Distributed System ArchitectureDistributed System Architecture

Distributed System: Distributed System: Data, Process, and Interface Data, Process, and Interface components of an information system are distributed to components of an information system are distributed to multiple locations in a computer network. Accordingly, multiple locations in a computer network. Accordingly, the processing workload is distributed across the the processing workload is distributed across the network.network.– Set of separate computers that are capable of autonomous Set of separate computers that are capable of autonomous

operation, link by a computer network.operation, link by a computer network.– Enable individual computers (different location) to share Enable individual computers (different location) to share

resources in the networkresources in the network– Server implementation for the same interface located in different Server implementation for the same interface located in different

servers.servers.

Page 9: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.
Page 10: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Distributed System ArchitectureDistributed System Architecture

Page 11: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Advantages of DSAAdvantages of DSA

Companies are preferring their system decentralized and Companies are preferring their system decentralized and distributed, because Distributed System allows distributed, because Distributed System allows companies to have better customer services. companies to have better customer services. – Shareability: Shareability: Allows systems to use each other’s resourcesAllows systems to use each other’s resources– Expandability: Expandability: Permits new systems to be added as members Permits new systems to be added as members

of the overall systemof the overall system– Local Autonomy: Local Autonomy: Manage local resourcesManage local resources– Improved performance: Improved performance: Resource replication. Combined Resource replication. Combined

processing power of multiple computers provides much more processing power of multiple computers provides much more processing power than a centralised system with multiple CPUsprocessing power than a centralised system with multiple CPUs

– Improved reliability and availability: Improved reliability and availability: Disruption would not stop Disruption would not stop the whole system from providing its services as resources the whole system from providing its services as resources spread across multiple computersspread across multiple computers

– Potential cost reductionsPotential cost reductions

Page 12: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Client / ServerClient / Server

Client/server is a distributed computing model in which client applications request services from server processes. Clients and servers typically run on different computers interconnected by a computer network.– Client application is a process or program that sends messages

to a server via the network. Those messages request the server to perform a specific task, such as looking up a customer record in a database or returning a portion of a file on the server’s hard disk.

– Server process or program listens for client requests that are transmitted via the network. Servers receive those requests and perform actions such as database queries and reading files.

Page 13: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Client / Server SystemClient / Server System

Page 14: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Client / Server ArchitectureClient / Server Architecture

Page 15: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Three-tier ArchitecturesThree-tier ArchitecturesAn important design consideration for large client/server systems is whether a client talks directly to the server, or whether an intermediary process is introduced in-between the client and the server. The former is a two-tier architecture, the latter is a three-tier architecture.In the three-tier architecture, process between Server and client (intermediary) process is: – separate the clients and servers.– cache frequently accessed server data to ensure better performance

and scalability.– Performance can be increased by having the intermediary process to

distribute client requests to several servers such that requests execute in parallel.

– The intermediary can also act as a translation service by converting requests and replies to and from a mainframe format, or as a security service that grants server-access only to trusted clients.

Page 16: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Three-Tier Client Server SystemThree-Tier Client Server System

Page 17: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Three-Tier Internet Banking SystemThree-Tier Internet Banking System

Page 18: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Distributed Object Computing Distributed Object Computing

Distributed object computing is Object-oriented modeling and programming that is applied to the development of client/server systems. – Objects are pieces of software that make distributed object

computing accessible through a well defined interface.– The interface consists of object operations and attributes that

are remote accessible.– Client applications may connect to a remote instance of the

interface and invoke the operations on the remote object. The remote object acts as a server.

– Client/server objects have to interact with each other even if they are written in different programming languages and to run on different hardware and operating system platforms.

Page 19: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Distributed Object ArchitectureDistributed Object Architecture

There is no distinction in a distributed object architecture between clients and serversEach distributable entity is an object that provides services to other objects and receives services from other objectsObject communication is through a middleware system called an object request broker (software bus)

Page 20: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Distributed Object ArchitectureDistributed Object Architecture

Page 21: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Advantages of Distributed Object Architecture

It allows the system designer to delay decisions on where and how services should be provided

It is a very open system architecture that allows new resources to be added to it as required

The system is flexible and scaleable

It is possible to reconfigure the system dynamically with objects migrating across the network as required

Page 22: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Distributed Network OrganizationDistributed Network Organization

Network can be organized over a WANNetwork can be organized over a WAN

WAN consists of a series of LANs WAN consists of a series of LANs connected together through routersconnected together through routers

Individual nodes (machines) in a LAN are Individual nodes (machines) in a LAN are connected to each other through a hubconnected to each other through a hub

Each machine on a network can function Each machine on a network can function as the server for a particular set of as the server for a particular set of servicesservices

Page 23: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Network SchematicNetwork Schematic

WANWAN

Router

Hub

Computer 1

Computer 2

Computer 3

Computer 4 Computer 5

Router

Hub

LAN

LAN

Page 24: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Protocol LayersProtocol Layers

Protocols are the standard rules for Protocols are the standard rules for communications between processescommunications between processes

Network communications requires Network communications requires protocols to cover high-level application protocols to cover high-level application communication all the way down to wire communication all the way down to wire communication communication

Complexity is handled by encapsulation in Complexity is handled by encapsulation in protocol layers protocol layers

Page 25: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

TCP/IP Network Model

TCP/IP layers combine layers of ISO/OSI

Page 26: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

TCP/IP Network ModelTCP/IP Network Model

Networking is implemented as a series of Networking is implemented as a series of layered protocols starting at the lowest level (the layered protocols starting at the lowest level (the electronic signals on the wire and the physical electronic signals on the wire and the physical cable) up through the higher levels.cable) up through the higher levels.

TCP/IP LayersTCP/IP Layers– Layer 1: Layer 1: LinkLink (devices and drivers) (devices and drivers)– Layer 2: Layer 2: NetworkNetwork (IP) (IP)– Layer 3: Layer 3: TransportTransport (TCP) (TCP)– Layer 4: Layer 4: Application Application (Provide network services)

Page 27: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

How OSI relates to TCP/IP LayersHow OSI relates to TCP/IP Layers

Page 28: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Network SchematicNetwork Schematic

WANWAN

Router

Hub

Computer 1

Computer 2

Computer 3

Computer 4 Computer 5

Router

Hub

Page 29: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Network SchematicNetwork Schematic

WANWAN

Router

Hub

Computer 1

Computer 2

Computer 3

Computer 4 Computer 5

Router

Hub

Page 30: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Network SchematicNetwork Schematic

WANWAN

Router

Hub

Computer 1

Computer 2

Computer 3

Computer 4 Computer 5

Router

Hub

Page 31: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Internet Protocol (IP)Internet Protocol (IP)

IP is the lowest level of network IP is the lowest level of network communication that handles packet communication that handles packet communication between machinescommunication between machinesIP is an unreliable protocol where a IP is an unreliable protocol where a message sent is not guaranteed to reach message sent is not guaranteed to reach the intended recipientthe intended recipientHigher level protocols use IP as their basic Higher level protocols use IP as their basic communication scheme adding reliability communication scheme adding reliability and other useful featuresand other useful features

Page 32: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Transmission Control Protocol Transmission Control Protocol (TCP)(TCP)

TCP is a higher level protocol built on top of IP. TCP is a higher level protocol built on top of IP. The vast majority of network traffic take place The vast majority of network traffic take place using the TCP protocol.using the TCP protocol.TCP is connection-based – a connection TCP is connection-based – a connection between two nodes is established up front and between two nodes is established up front and then messages may be sent in both directions.then messages may be sent in both directions.The TCP address is a combination of an IP The TCP address is a combination of an IP address that identifies a machine and a port on address that identifies a machine and a port on that machine. Using ports, it’s possible to that machine. Using ports, it’s possible to participate in multiple independent network participate in multiple independent network communications, even to communicate between communications, even to communicate between different processes on the same machine.different processes on the same machine.

Page 33: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

User Datagram Protocol (UDP)User Datagram Protocol (UDP)

UDP is also extends IP with the addition of ports UDP is also extends IP with the addition of ports (like TCP). (like TCP). UDP is connectionless and unreliable (like IP).UDP is connectionless and unreliable (like IP).UDP is less complex and performs better than UDP is less complex and performs better than TCP.TCP.UDP is often used in implementing client/server UDP is often used in implementing client/server applications in distributed systems built over applications in distributed systems built over local area networks where the physical local area networks where the physical connection is over a shorter distance and there connection is over a shorter distance and there is less chance of losing packets. is less chance of losing packets.

Page 34: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

CommunicationCommunication

Sharing data is easy when communicating Sharing data is easy when communicating between two processes that are in the between two processes that are in the same address space.same address space.Messages provide for communication Messages provide for communication without shared data. without shared data. Message - a piece of information that is Message - a piece of information that is passed from one process to another.passed from one process to another.One process or the other owns the data at One process or the other owns the data at any point, never both at the same time. any point, never both at the same time.

Page 35: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Message passingMessage passing

Page 36: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

SocketsSockets

Sockets is a method for communication between Sockets is a method for communication between a client program and a server program in a a client program and a server program in a networknetworkCommunicating with sockets is low-level where Communicating with sockets is low-level where both the client and server are responsible for both the client and server are responsible for ensuring that the TCP or UDP protocol is ensuring that the TCP or UDP protocol is followed correctlyfollowed correctlyBoth client and server must correctly code Both client and server must correctly code header information about the message, the header information about the message, the message size, the IP address and port number, message size, the IP address and port number, etc.etc.

Page 37: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Difficult to reuse codeDifficult to reuse code

User Interface

Business Logic

Data Management

Server

Client 1New 1…

Adapter 1

New n

Adapter n

Page 38: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Distributed Object Architecture and Distributed Object Architecture and TCPTCP

To allow for programming and distributing objects across distributed networks, TCP is used with a middleware system– At the TCP level, all the connections between

objects on networked computers appear identical because the details of routing across hubs, routers, etc. are all handled at lower levels

– Object communication is through a middleware system

Page 39: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Distributed Object Architecture and Distributed Object Architecture and C/S ModelC/S Model

Client applications are represented by Client applications are represented by objectsobjects

Server applications are represented by Server applications are represented by objectsobjects

Back-end services like database can also Back-end services like database can also be represented as objectsbe represented as objects

The role between client and server is not The role between client and server is not necessarily fixed in a networknecessarily fixed in a network

Page 40: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

MiddlewareMiddleware

A software layer that sits between applications A software layer that sits between applications and the network operating system to hide the and the network operating system to hide the different underlying platforms different underlying platforms Provides more distribution transparencyProvides more distribution transparencyInstead of communicating through operations on Instead of communicating through operations on low level sockets and using the interfaces of the low level sockets and using the interfaces of the local file system, middleware offers services for local file system, middleware offers services for different machines to pass each other messages different machines to pass each other messages at a higher abstraction level.at a higher abstraction level.Java RMI, CORBA, and DCOMJava RMI, CORBA, and DCOM

Page 41: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Distributed Object Architecture Distributed Object Architecture ModelModel

Page 42: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Distributed Object Architecture Distributed Object Architecture ModelModel

Page 43: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Distributed Object Architecture Distributed Object Architecture ModelModel

Page 44: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Distributed Object Architecture Distributed Object Architecture ModelModel

Page 45: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Distributed Object Architecture Distributed Object Architecture ModelModel

Page 46: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Disadvantages of Distributed Disadvantages of Distributed Object ArchitectureObject Architecture

Multiple protocols may be involvedMultiple protocols may be involved

Client, server, and back-end services may have Client, server, and back-end services may have to understand, interpret, and translate between to understand, interpret, and translate between multiple protocolsmultiple protocols

Data structures on the client, server, and back-Data structures on the client, server, and back-end may conflict with each other and with end may conflict with each other and with standard protocolsstandard protocols

Client, server, and back-end may each be Client, server, and back-end may each be written in a different programming languagewritten in a different programming language

Page 47: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

Distributed Object Programming Distributed Object Programming TechniquesTechniques

Java supports both RMI and CORBAJava supports both RMI and CORBA– Remote Method Invocation allows objects in a Remote Method Invocation allows objects in a

network to remotely invoke methods of other objects network to remotely invoke methods of other objects in the same networkin the same network

– Objects can be transported across the network using Objects can be transported across the network using CORBA’s standard protocol, IIOPCORBA’s standard protocol, IIOP

– All CORBA objects are filtered through an Object All CORBA objects are filtered through an Object Request Broker (ORB) which allows objects to be Request Broker (ORB) which allows objects to be translated from one language to anothertranslated from one language to another

Page 48: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

RMI ExampleRMI Example

RMI calls a method of the remote objectRMI calls a method of the remote object

x = remoteObj.MethodA(param); Remote ObjectRemote Object

StubStub

Remote Reference Layer

Transport Layer

Page 49: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

RMI ExampleRMI Example

Stub is generated which then sends Stub is generated which then sends marshalled data to receivermarshalled data to receiver

x = remoteObj.MethodA(param); Remote ObjectRemote Object

StubStub

Remote Reference Layer

Transport Layer

Receiver

Page 50: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

RMI ExampleRMI Example

Receiver unmarshals, or decodes, parameters, Receiver unmarshals, or decodes, parameters, locates object and calls the method specified by locates object and calls the method specified by the stubthe stub

x = remoteObj.MethodA(param); Remote ObjectRemote Object

StubStub

Remote Reference Layer

Transport Layer

Receiver

Page 51: Distributed Systems Architecture Presentation II Presenters Rose Kit & Turgut Tezir.

RMI ExampleRMI Example

Receiver retrieves and marshals return value and Receiver retrieves and marshals return value and sends back the encoded info to the stubsends back the encoded info to the stub

x = remoteObj.MethodA(param); Remote ObjectRemote Object

StubStub

Remote Reference Layer

Transport Layer

Receiver