Server Algorithms

References for Lecture

Comer Text Chapter 8

Server tasks

Provide a service Conformance to specified protocols Completion of requests Deal with concurrency problems

Concurrent vs. Iterative Servers


When to use:




When to use:



Connectionless vs. Connection-Oriented Servers

The protocol specifies underlying transport layer needs to be used.

Connectionless Servers



Connection-Oriented Servers



Stateful vs. Stateless Servers

Statefulness is determined by the Protocol

State requires resources

Stateful protocols make both clients and servers more complicated

Why use state? Interactive protocols:

Why not state? If either server the server of client needs to be restarted without ill effects (NFS, Gopher, HTTP)

Caching Stateless Servers

Example: Reading a file (trivial)

The server gets a request to read a part of this file.

The server:

The file could be kept open by the server and only closes it after a certain amount of idle time.

Each request to read a block in the file will then only involve:

Other things that can be cached:

Basic Server Types

Iterative, Connectionless Server

Good enough for non-critical servers

Trivial to implement:

Iterative, Connection-Oriented Server

Never use

Concurrent, Connectionless Server

Use for heavily used services that need quick turnaround (DNS, NFS)

Concurrent, Connection-Oriented Server

Everything else...

Most standard servers fall into this category

Server Startup

inetd (automatic on-demand)

When to use:

When NOT to use:

command line (manual starting)

When to use:

When NOT to use:

rc.local (system startup)

When to use:

When NOT to use: