Client-Server Flashcards

1
Q

How does a client-server communication work?

A

Server is a group of processes/threads providing services to clients.

Client sends a request to a server.
Server accepts the requests, processes it and sends back a result to the client then waits for the next request. This makes the server a cyclic thread.

The communication between client and server is via dedicated communication objects (such as channels or ports). We usually have an input channel where server takes requests and response channel where client receives the result. The parameters for a request are packed into a message that has to be interpreted accordingly (protocol).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How does the server provide multiple clients the result messages in a unique way?

A

We usually have one input channel for clients to submit their requests to the server which is fine.
However when using one output or return channel, we can not assign responses to clients uniquely.
Therefore the client specifies in their request at which channel it is expecting the result message.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the difference between a multioperation server (secretary) and a server as a team of threads?

A

In a multioperaiton server, server receives request with specific service/operation to execute and depending on the type of operation it executes that operation in its own thread then returns response to the client.

In a server as a team of threads, we provide for each operation that can be requested its own individual thread. Each operation thread owns its individual entry channel (port) and the client selects the operation by selecting the entry channel port.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to achieve parallelism between client and server with one request?

A

Using drift of communication operations where the send operation in the client program has to drift backward while the receive operation in the client program has to drift forward. This achieves an overlap between client and server activity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to achieve parallelism between client and servers with multiple requests, each sent to a server

A

When a client sends multiple requests to different servers one after another. Then forking the send requests and joining the receive requests achieves parallelization. i.e. send requests are all sent first then receive messages from the server are joined together.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to solve parallelism in case the service is not used only once by the client but it is used periodically, i.e. in a loop?

A

Use buffering between client and server. Client p send requests are buffered into the input channel of the server (p:1 channel) then as soon as a response is provided to the client, its slot in the buffering input channel is freed up allowing for the client to send another request message to the server until no more send requests from client arrive and all arrived requests have been answered. The choice of the buffering capacity depends on service times and other factors. This is used in input/out or sliding window in networking.

In 2-fold buffering, we use two buffers, when a buffer is full, the 2nd buffer starts receiving requests and the server responds to all requests in first buffer and vice-versa.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the benefits of parallelism within a server? What are the three types of this parallelism?

A

By overlapping client and server activity, processing time of requests can be reduced which may allow to increase the throughput (request per unit of time).

The three mechanisms are:
- Reproduction (cloning)
- Pipelining (staged server)
- Multiplexing

The three mechanisms are independent and can be combined.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Describe reproduction for parallelism within a server

A

Server thread is available as n identical copies of the same program where all clone threads take requests from a shared input port and this reproduction is invisible to the client. This allows for up to n requests being processed simultaneously

Newer requests can overtake older requests.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Describe pipeline (staged server) for parallelism within a server

A

Cut the server thread into pieces and make those pieces into their own individual threads where each thread processes the request at its level then sends its result to an intermediate buffer to be then taken by the next thread in the pipeline server to be processed etc.. until the final result is ready to be sent back to the server.

No overtaking of requests in pipeline. Adds higher transportation overhead (intermediate internal channels). With multiple requests, we can have varying service times depending on the service times of the individual pipeline threads.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe multiplexing (interleaving, event-programming) for parallelism within a server

A

With complex servers that submit subrequests we may have several waiting points. The thread is stuck at a receive operation waiting for a response, although it can continue at another place.

In multiplexing, we combine all channels for the subrequest communications into one single superchannel. In short, if a a request cannot be further processed because it has to wait for something, we simply switch to another request. This allows the server to operate as processor at the hardware level.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly