分布式应用的构成 3 layers of a distributed application network level (TCP/IP, network protocols higher-level services( directory services, security protocols, etc. v applicationlevel At the application level processes threads objects: processes can be made up of one or more objects which can be accessed by one or more threads within the process agents: an"independentfunctionalelement(e. g, in a banking application we may have a customer agent, a transaction agent, an information brokerage agent) Distributed Systems Frameworks
Distributed Systems Frameworks 13 分布式应用的构成 3 layers of a distributed application: network level (TCP/IP, network protocols) higher-level services (directory services, security protocols, etc.) application level At the application level: processes threads objects: processes can be made up of one or more objects which can be accessed by one or more threads within the process agents: an “independent”functional element (e.g., in a banking application we may have a customer agent, a transaction agent, an information brokerage agent)
分布式应用的一般技术需求 e Partitioning and distributing Data and functions data-driven distribution functional distribution object-based distribution o Flexible extendible communication protocols allocation of tasks to agents has a direct influence on the complexity of the communication protocol ( type of data amount of data, persistence of connections) may also be dictated by legacy systems that need to be incorporated Distributed Systems Frameworks
Distributed Systems Frameworks 14 分布式应用的一般技术需求 Partitioning and Distributing Data and Functions data-driven distribution functional distribution object-based distribution Flexible, Extendible Communication Protocols allocation of tasks to agents has a direct influence on the complexity of the communication protocol (type of data, amount of data, persistence of connections) may also be dictated by legacy systems that need to be incorporated
分布式应用的一般技术需求 e Multi-threading requirements server object may need to service multiple remote clients at once effective way to optimize resources Security requirements authentication of client identities define resource access levels data encryption Distributed Systems Frameworks
Distributed Systems Frameworks 15 分布式应用的一般技术需求 Multi-threading Requirements server object may need to service multiple remote clients at once effective way to optimize resources Security Requirements authentication of client identities define resource access levels data encryption
分布计算 口How? 口理想主义: Distributed Operating System 口现实主义: ■操作系统提供网络通信功能 (中间件) 分布应用程序 Institute of Computer Software 2021/2/5 Nanjing University
分布计算 How? 理想主义:Distributed Operating System 现实主义: ◼ 操作系统提供网络通信功能 ◼ (中间件) ◼ 分布应用程序 2021/2/5 Institute of Computer Software Nanjing University 16
分布计算 a Socket programming in Java // listen to port 5000 on the local host for socket connection requests ServerSocket s new Server Socket(5000)i while (true )( // wait for connection request from client Socket clientconn s accepto) Inputstream in clientconn. getInputstream()i Outputstream out s clientConn. getoutputstream()i // now IO streams are connected to client: do something with them Institute of Computer Software 2021/2/517 Nanjing University
分布计算 Socket programming in Java 2021/2/5 Institute of Computer Software Nanjing University 17 17 // listen to port 5000 on the local host for socket connection requests ServerSocket s = new ServerSocket(5000); while (true) { // wait for connection request from client Socket clientConn = s.accept(); InputStream in = clientConn.getInputStream(); OutputStream out = clientConn.getOutputStream(); // now IO streams are connected to client; do something with them