Chapter 4: Server Software Design Chapter 4: Server Software Design Algorithm and issues Algorithm and issues Iterative Iterative servers a Concurrent connection-oriented Concurrent connection-oriented servers servers Singly-threaded,concurrent a Singly-threaded, concurrent servers servers a Multiprotocol servers Multiprotocol servers a Multiservice servers Multiservice servers Uniform, efficient management Uniform, efficient management of server concurrency of server concurrency Concurrent vs. Iterative The conceptual server algorithm Servers Each server follows a simple algorithm a Iterative server Process one request at a time Enters infinite lo Easier to build Accepts request Poor performance Processes request a Concurrent Handles multiple requests at one time But only suffices for only the most trivial More difficult to design and build services Better performance Connection-oriented vs Connection-oriented vs Connectionless Servers Connectionless servers Depend on the application protocol Connectionless servers n Connection-oriented servers Advantages Advantages Do not suffer from the problem of resource Ease of programming TCP provides reliability Can supply broadcast or multicast communication Disadvantages Disadvantages: Require a separate socket for each connection Can not depend on underlying transport for Overhead of 3-way handshaking TCP does not send any packets over an idle Application protocols respond for reliability connection- run out of resources1 哈工大计算机学院 李全龙 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 哈工大计算机学院 李全龙 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 哈工大计算机学院 李全龙 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 哈工大计算机学院 李全龙 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 哈工大计算机学院 李全龙 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 哈工大计算机学院 李全龙 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