Run all the time (i.e. infinite) Provide service to any client Usually specialize in providing certain type of service, e.g. Mail Listen to a well-known port and passively open connection.
Run when needed, then terminate (i.e. finite) Actively open TCP or UDP connection with Server’s socket
Client needs to know existence & address of server
However, the server does not need to know the existence or address of the client prior to the connection
Once a connection is established, both sides can send and receive information
A ‘state’ is information kept in memory of a host, server or router to reflect past events: such as routing tables, data structures or database entries
HTTP server maintains no information about past client requests
Protocols that maintain “state” are complex!
history (state) is maintained
if server/client crashes, views of “state” may be inconsistent, must be reconciled
Server leaves connection open after sending response Subsequent HTTP messages between same client/server sent over open connection Client issues new request only when previous response has been received One RTT for each referenced object
Server leaves connection open after sending response Subsequent HTTP messages between same client/server sent over open connection Client sends requests as soon as it encounters a referenced object 1 RTT for all referenced objects
Total Response Time (\(n =\) no of objects)
\(n (2 \ \text{RTT} + \text{Transmit Time})\) - one RTT to initiate TCP connection - one RTT for HTTP request & first few bytes of HTTP response to return - file transmission time
\(n (1 \ \text{RTT} + \text{Transmit Time})\)
\(1 \ \text{RTT} + n(\text{Transmit Time})\)
Disadvantages
- requires 2 RTTs per object - OS overhead for each TCP connection - browsers often open parallel TCP connections to fetch referenced object