EXERCICE Client/Server System FIFO (Distributed System Analysis)
A project on Client/server System
This project is about a client/server architecture where clients’ sends request to the server to access the resources on it based on the rules set. A client always initiates a request and a server always guarantees to eventually accept a request. Subsequently, spontaneous communication that can lead to deadlock is not allowed. A server may not be able to provide all of the service required of its client locally, In which case, the server may make a client request of another server on behalf of the original client. The clients are not meant to do any serious work in between. Client uses one different reply channel. This ensures that it receives the reply from a server (Server).
Project Basic-model
Our project sample model involves many client requests to a server and an example of it is shown in the figure 1 below.
Figure 1. Project basic model
Client definition
A net is a client if it includes transitions which are associated to services supplied by other nets (in our case a server), and the occurrence of such a transition causes a call to the service it is associated to.
A client request is controlled by a queue place (waiting place) before it is send to the server. Figure 2 shows the connections of the client request and the transitions to get access to the server with a queuing place (waiting place) in first in first out (FIFO) policy.
Figure 2. Client request with queuing place
A simple Client Request and Reply for transmission
A client generates a request at time λi (lambda) which and then controlled by a queue play which then transmits a request at time µi (mu) to the server and it also takes the server time β (beta) to reply to transmission as it is shown in the figure 3 below.
Figure 3. Simple client request and reply for transmission
Our Overall Project Model using Generalized Stochastic Petri Nets
The overall model of our project on a client/server (two clients and one server) system where a server processing a client request in First In First Out policy, with an idle period, processing time and with the server being able to process three requests at most is shown in figure 4 below.
The following below are the descriptions/definitions of the most important places and transitions of our project.
· Client1 – place for clients generating request at time λ1
· Client2 – place for clients generating request at time λ2
· Server – place for a sever with a rate of three (3) buffers of request at most
· ProcessedClient1Request – place to store processed Client1 request before reply of transmission
· ProcessedClient2Request – place to store processed Client2 request before reply of transmission
· Queue(FIFO)– place in a server for queuing requests with FIFO policy
· Server_Idle – place to indicating the idle period of a server which between the two transmission rates (µ1, µ2) and processing rate (η1, η2)
· λ1 – Timed transition for sending (firing tokens) requests generated by client1
· λ2 – Timed transition for sending (firing tokens) requests generated by client2
· µ1– Timed transition for transmitting client1 requests to the server
· µ2– Timed transition for transmitting client2 requests to the server
· ηi – Timed transition for processing client requests by a server according to FIFO policy and at most three requests
· β_Client1_reply_transmission – Timed transition for replying (reply channel) to client1 after the requests are being processed by server or transmitted to server (βi)
· β_Client2_reply_transmission – Timed transition for replying (reply channel) to a client2 after the requests are being processed by server or transmitted to server (βi)
· t0 – immediate transition to return server resources after processing client1 request
· t1 – immediate transition to return server resources after processing client2 request
Parameters:
λ1 = 4.2ms
λ2 = 3.3ms
µ1 = 0.1ms
µ2 = 0.15ms
η1 = 2.0ms
η1 = 3.0ms
βi = 3.2ms
Figure 4. Overall project model
Project Description of Token movement with Markings
At the initial state of the model only three places have tokens that’s Client1, Client2 and Server with the consideration that a server with three processors to buffer three requests at most at a processing time of ηi has marking as follows:
M={Client1(1),Client2(1),Queue(FIFO)(0),Server(1),ProcessedClient1Request(0), ProcessedClient2Request(0),Server_Idle(0)} or in short M = {1,1,0,1,0,0, 0}.
When the Clients station generates requests and transition λ1, λ2 fires, the tokens moved to the Queue(FIFO) and the marking becomes M = {0,0,1,1,0,0,0}.
When the tokens arrived at the place Queue(FIFO) and the transition µ1, µ2 fires, the tokens get to the Sever for processing and also within this period another clients can also generate a request and the marking becomes M = {1,1,0,1,0,0,0}.
When the server finishes processing, transition η1, η2 fires and the tokens moved to the place ProcessedClient1Request and ProcessedClient2Request, server becomes idle, another token may also arrived in the Queue(FIFO) and also a new request generated by the Clients and the marking becomes M = {1,1,1,0,1,1,1}.
NB: The markings can change depending on the number of clients request which we call N (maximum number of tokens) and the tokens continue to move from one place to the other through the transitions based on the FIFO policy and also only three requests can be buffered by the Server at most at a time ηi (of transitions).
The Idle time is the time between the two transmission rates (µ1, µ2) and processing rate (η1, η2)
Also the waiting time can be computed from Little’s law which is
N = λ ・ R and also R = waiting time + service time.