Multiprotocol Service10
Multiprotocol Service10
Contents
Introduction
Multiprotocol/Multiservice Multi-protocol server
Servers Example of Multi-protocol server
Multi-service server
Example of multi-service server
Super servers
A multiprotocol server consists of a single process that The server then uses I/O multiplexing to wait
uses I/O multiplexing to handle communication over for one of the sockets to become ready :
either UDP or TCP.
If the TCP socket The server uses accept to obtain the
becomes ready, a client new connection, and then
The server initially opens two sockets has requested a TCP communicates with the client over
one that uses a connectionless transport (UDP) connection. that connection.
1
12/6/2007
2
12/6/2007
3
12/6/2007
1. The server opens a set of UDP sockets and binds each to a server Server
well-known port. application
process
2. Keep a table to map sockets to services.
3. Call select to wait for a datagram to arrive.
4. When a datagram arrives, get the descriptor.
5. Look up the mapping table, find the right procedure.
6. compute a response and send a reply.
7. Go back to step 3.
Master sockets Socket for Operating
(one for each one individual system
service offered) connection
4
12/6/2007
5
12/6/2007
6
12/6/2007
Super server example: BSD UNIX program inetd reads a configuration file that lists all
inetd the services it should handle.
supplies many of the small TCP/IP services that
network managers use for testing
inetd creates a socket for each listed
Uses a configuration file (text file) to make
addition of new services easier
service, and adds the socket to a fd_set
/etc/inetd.conf given to select()
Dynamically configurable
7
12/6/2007
xinetd Summary
A multiprotocol server
Some versions of Unix provide a service very is: a single-process server
that can handle multiple
similar to inetd called xinetd. transport protocols
Both of them do :
configuration scheme is different
basic idea (functionality) is the same…
Reduce overhead
Save system
A multiservice server resources
is: a single-process server
that can handle multiple Make maintenance easier
services