哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter4

Chapter 4: Server Software Design Chapter goal: algorithm and issues 工 terative servers Concurrent connection-oriented servers Singly-threaded,concurrent servers Multiprotocol servers Multiservice servers Uniform efficient management of server concurrency 哈工大计算机学院李全龙 Network Application Development Server Software Desi
哈工大计算机学院 李全龙 Network Application Development Server Software Design 1 Chapter 4: Server Software Design Chapter goal: Algorithm and issues Iterative servers Concurrent, connection-oriented servers Singly-threaded, concurrent servers Multiprotocol servers Multiservice servers Uniform, efficient management of server concurrency

Chapter 4: Server Software Design Chapter goal: Algorithm and issues Iterative servers Concurrent connection-oriented servers Singly-threaded, concurrent servers Multiprotocol servers Multiservice servers Uniform, efficient management of server concurrency 哈工大计算机学院李全龙 Network Application Development Server Software Desi 2
哈工大计算机学院 李全龙 Network Application Development Server Software Design 2 Chapter 4: Server Software Design Chapter goal: Algorithm and issues Iterative servers Concurrent, connection-oriented servers Singly-threaded, concurrent servers Multiprotocol servers Multiservice servers Uniform, efficient management of server concurrency

The conceptual server algorithm Each server follows a simple algorithm Creates a socket Binds port Enters infinite loo Accepts request Processes request Responses But only suffices for only the most trivial services 哈工大计算机学院李全龙 Network Application Development Server Software Desi
哈工大计算机学院 李全龙 Network Application Development Server Software Design 3 The conceptual server algorithm Each server follows a simple algorithm: Creates a socket Binds port Enters infinite loop Accepts request Processes request Responses But only suffices for only the most trivial services

Concurrent vs. Iterative Servers 工 terative server Process one request at a time Unnecessary delays Easier to build Poor perfformance a Concurrent server Handles multiple requests at one time More difficult to design and build Better performance 哈工大计算机学院李全龙 Network Application Development Server Software Desi
哈工大计算机学院 李全龙 Network Application Development Server Software Design 4 Concurrent vs. Iterative Servers Iterative server Process one request at a time Unnecessary delays Easier to build Poor performance Concurrent server Handles multiple requests at one time More difficult to design and build Better performance

Connection-oriented vs Connectionless Servers Depend on the application protocol Connection-oriented servers ■ Advantages Ease of programming TCP provides reliability Disadvantages: Require a separate socket for each connection Overhead of 3-way handshaking tcp does not send any po ackets over an idle connection- run out of resources 哈工大计算机学院李全龙 Network Application Development Server Software Desi
哈工大计算机学院 李全龙 Network Application Development Server Software Design 5 Connection-oriented vs. Connectionless Servers Depend on the application protocol Connection-oriented servers Advantages: Ease of programming TCP provides reliability Disadvantages: Require a separate socket for each connection Overhead of 3-way handshaking TCP does not send any packets over an idle connection- run out of resources

Connection-oriented vs Connectionless Servers Connectionless servers Advantages: Do not suffer from the problem of resource depletion Can supply broadcast or multicast communication Disadvantages: Can not depend on underlying transport for reliable delivery Application protocols respond for reliability 哈工大计算机学院李全龙 Network Application Development Server Software Desi
哈工大计算机学院 李全龙 Network Application Development Server Software Design 6 Connection-oriented vs. Connectionless Servers Connectionless servers Advantages: Do not suffer from the problem of resource depletion Can supply broadcast or multicast communication Disadvantages: Can not depend on underlying transport for reliable delivery Application protocols respond for reliability

Optimizing stateless servers Consider a connectionless server for file reading Wefⅰnd Overhead of opening and closing file Clients may read only a dozen bytes in each equest Clients tend to read files sequentially To optimize the performance Maintain a small table of file information State information 哈工大计算机学院李全龙 Network Application Development Server Software Desi
哈工大计算机学院 李全龙 Network Application Development Server Software Design 7 Optimizing stateless servers Consider a connectionless server for file reading We find: Overhead of opening and closing file Clients may read only a dozen bytes in each request Clients tend to read files sequentially To optimize the performance Maintain a small table of file information State information

Optimizing stateless servers Table of information about files clients are using hash(IP addr, port) Filename: X Offset: 512 Buffer pointer: Buffer for file x starting at byte 512 Filename: y Offset: 1024 Buffer pointer Buffer for file y starting at byte 1024 哈工大计算机学院李全龙 Network Application Development Server Software Desi
哈工大计算机学院 李全龙 Network Application Development Server Software Design 8 Optimizing stateless servers Filename:X Offset:512 Buffer pointer: Filename:Y Offset:1024 Buffer pointer: Table of information about files clients are using hash(IP addr,port) Buffer for file X starting at byte 512 Buffer for file Y starting at byte 1024

Optimizing stateless servers Improve performance without any penalty? Even a small amount of information can cause a server to perform badly when machines, client programs, or networks fail Frequent crashes can cause one client to dominate the table by filling it with entries that will never be use A programmer must be extremely careful when optimizing a stateless server 哈工大计算机学院李全龙 Network Application Development Server Software Desi 9
哈工大计算机学院 李全龙 Network Application Development Server Software Design 9 Optimizing stateless servers Improve performance without any penalty? Even a small amount of information can cause a server to perform badly when machines, client programs, or networks fail Frequent crashes can cause one client to dominate the table by filling it with entries that will never be used A programmer must be extremely careful when optimizing a stateless server

Four basic types of servers Iterative connectionless Iterative connection-oriented Concurrent connectionless Concurrent connection-oriented Iterative servers suffice only for the trivial application protocols Iterative servers work best with simple services accessed by a connectionless access protocol 哈工大计算机学院李全龙 Network Application Development Server Software Design 10
哈工大计算机学院 李全龙 Network Application Development Server Software Design 10 Four basic types of servers Iterative connectionless Iterative connection-oriented Concurrent connectionless Concurrent connection-oriented Iterative servers suffice only for the trivial application protocols Iterative servers work best with simple services accessed by a connectionless access protocol
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter4-6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter3.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter3-6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter2.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter2-6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter1new.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter1new-6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter1.pdf
- 陕西国防学院:《电子商务概论》第十章 电子商务系统的建设.pps
- 陕西国防学院:《电子商务概论》第六章 网络营销.pps
- 陕西国防学院:《电子商务概论》第九章 电子商务安全.pps
- 陕西国防学院:《电子商务概论》第八章 电子商务的法律规范.pps
- 陕西国防学院:《电子商务概论》第四章 电子商务支付系统.pps
- 陕西国防学院:《电子商务概论》第七章 电子商务在其他领域的应用.pps
- 陕西国防学院:《电子商务概论》第一章 电子商务概述.pps
- 陕西国防学院:《电子商务概论》第三章 电子商务的应用框架与交易模式.pps
- 陕西国防学院:《电子商务概论》第五章 物流管理.pps
- 陕西国防学院:《电子商务概论》第二章 网络技术基础.pps
- 陕西国防学院:《电子商务概论》序言.pps
- 《计算机软件技术基础》ppt电子课件.ppt
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter5-6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter5.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter6-6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter7-6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter7.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 网络开发与应用实验指导书.pdf
- 台北科技大学:《计算机网络》(英文版) NP04 0 Network Programming.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 1 CONTENTS.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 11 Introduction.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 12 CONTENTS.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 15 Client Server model.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 Socket API.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 Client Software Design.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 multi proto.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 multi services.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 server.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 server ex.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 server ex con.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 18.ppt