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