Title: MultiprotocolMultiservice Servers
1Lecture 7
- Multiprotocol/Multiservice Servers
2Overview
- Multiprotocol Servers
- Multiprotocol Server Design
- Concept of Shared Code
- Concurrent Multiprotocol Servers
- Consolidating Servers
- Connectionless, Multiservice Server Design
- Connection-Oriented, Multiservice Server Design
- Conncurrent, Connection-Oriented, Multiservice
Server - Invoking Separate Programs From a Multiservice
Server
3Reducing the Number of Servers
- Typically a given server handles requests for one
particular service through one particular
protocol - Example
- DAYTIME service runs two servers one for UDP
request another for TCP requests - Main disadvantage of using one server per
protocol is replication - Both TCP/UDP servers use the same basic algorithm
- Debugging and software management issues
- Resource depletion
4Multiprotocol Server Design
- A multiprotocol server consists of a single
process that uses asynchronous I/O to handle
UDP/TCP - Server opens two sockets (UDP/TCP)
- Uses asynchronous I/O to wait for one of the
sockets to become ready - TCP socket ready client requested a TCP
connection - UDP socket ready client requested a UDP
connection
5Process Structure
Server application process
server
Operating system
socket for UDP requests
socket for TCP conn requests
socket for a TCP connection
6Concept of Shared Code
A multiprotocol server design permits the
designer to create a single procedure that
responds to requests for a given service and to
call that procedure regardless of whether
requests arrive via UDP or TCP
7Concurrent Multiprotocol Servers
- DAYTIME server shown earlier is an iterative
server - Works because the server performs minimal
computation and I/O per request - Iterative servers may not suffice for other
services that require more computation per
request - Example
- Create a separate server to handle each TCP
request - Create a separate server to handle each UDP
request
8Consolidating Servers
- Typically a computer runs one server per service
(DAYTIME, ECHO, ) - Same advantages that apply to consolidating
multiprotocol servers apply to consolidating
multiserver servers - Consolidating many services into a single server
can drastically reduce the number of running
processes - Many of the small services require a trivial
amount of computation
9Connectionless Multiserver Server Design
Server application process
server
Operating System
master sockets (one for each service)
10Connection-Oriented Multiserver Server Design
Server application process
master
master sockets (one for each service)
Operating System
Socket for one individual connection
11Concurrent Connection-Oriented Multiservice Server
Server application process
master
slave1
slave2
master sockets (one for each service)
Operating System
Sockets for individual slave connections
12Separate Programs from a Multiservice Server
fork used
Server application process
master
slave1
slave2
prog1
prog2
execve used
master sockets (one for each service)
Operating System
Sockets for individual slave connections