 Hello and welcome to the next lecture in the course on Introduction to Computer and Network Performance Analysis using queuing systems. I am Professor Varsha Apte, I am a faculty member in the Department of Computer Science and Engineering IIT Bombay. So in the previous lecture we had looked at open queuing network and we have been looking at open queuing systems. So we will just look at some examples today. So this is a quick recap again, we have been seeing this slide several times, this is just for your reference, the little slaw we have seen now many examples also. This is the more recent recap, we have learnt PK formula for MG1Q and the special case of that is for the MM1Q where you take exponential service time distribution and then you can make a special case of this. Same with MD1, D is also a special case of G and you get this formula for response time. We also studied some properties of Poisson arrivals, again this is for your reference, we are not going to repeat all this today. Open queuing networks is a major topic we did last time which is this is again for your reference the parameters, the matrix all the symbols are here for your reference. The major results for the matrix were all these, we will actually do a major example where we use all of these. So please take a moment if you want to pause the video and make sure you have written this somewhere or you have your notes somewhere so that you can refer to it while we actually work on this example. So let us start with the first example. This is just an example to revise what the Poisson distribution is and its various properties. So packet arrivals to a network link are Poisson with rate 4 per millisecond. So let us denote network link again it is nothing but a queuing system. And packets are arriving here at lambda is equal to 4 per millisecond. Poisson time on this link of each packet is exactly 0.2 milliseconds so that is nothing but the service time tau is equal to 0.2. What is the probability that exactly one packet will arrive at the link during the transmission of one packet. So the question here is less about the queuing system we are not going to talk about the response time or anything here. If we just look at a timeline packets are arriving basically as packets arrive if they make queue or at some point of time there suppose this packet arrives to an idle link then its transmission will start and it takes exactly 0.2 seconds. So this is actually an MD1 queue let us assume infinite buffer that is not given but let us assume infinite buffer. So that is what this is and the question is that while the transmission is going on what is the probability that one more packet will come that exactly one packet will come. So we have to use just the fact that the packet arrival process is Poisson and what that means when you say Poisson with rate lambda is 40 is that it is 4 is that remember if it is Poisson lambda with rate lambda then it is actually Poisson distribution with parameter lambda t where t is the amount of time over which we are counting this number of packets. So just to recall arrivals are Poisson with 4 per millisecond that means what does that mean number of arrivals nt in an interval 0 to t milliseconds is Poisson with parameter 4t. This is just a short way this does not mean anything but what this really means is that number of arrivals nt in 0 to t milliseconds is Poisson with parameter 4t. So here our nt is the t that we are looking at is basically this is the 0 and this is the 0.2 and number 0t is 00.2 that is it that is what the problem is asking right. So probability that exactly one packet arrives during the transmission is probability that n 0.2 is equal to 1. So the random variable that we are looking at is n 0.2 in this definition because we are looking at arrivals in the interval 0 0.2 which is the interval which is of the transmission duration of the packet. So n 0.2 is nothing but Poisson with 4 multiplied by 0.2. So Poisson 0.8 and so some random variable which has this distribution remember for if a random variable is Poisson alpha then the problem that random variable takes the value k is nothing but alpha raise to k e to the minus alpha divided by k factorial. So that is all that we are saying here our alpha is 0.8. So it is going to be and the k that we are trying to calculate for is 1. So we have 0.8 raise to 1 is the alpha to the k e raise to minus 0.8 is this part and 1 factorial and this calculation turns out to be 0.36. Just an example to show Poisson arrivals what that means. Now another example consider a router with two incoming links link 1 and link 2. So again router here is there are two incoming links to the router and what is it saying the inter arrival time in milliseconds of packets at link 1 is exponential lambda 1 actually that means nothing but the this arrival here is going to be Poisson lambda 1 right we should just use that property. So and here the arrival is going to be Poisson lambda 2 and what is the probability that exactly 3 packets arrive at this router in a duration of 10 milliseconds. So what we are looking at here is we are looking at the merge stream right. So considering that something is coming on one link this is link 1 this is link 2 and packets are coming from link 1 at rate lambda 1 with the Poisson nature and at from link 2 with rate lambda 2 with the Poisson nature this is going to be nothing but Poisson lambda 1 plus lambda 2 right. And then that is all then the rest of the maths is just like the previous one what is it asking what is the probability that exactly 3 packets arrive at this router in a duration of 10 milliseconds. So yeah so let us just look at the thing inter arrival time at each link is exponential. So at link 1 it is Poisson lambda 1 at link 2 it is Poisson lambda 2 aggregate arrival stream and t is Poisson with lambda 1 plus lambda 2 and now the t here again is the 10 milliseconds right. So n 10 is what we are interested in. So lambda t so when it is lambda and t the parameter for the Poisson distribution is lambda t here ever lambda is lambda 1 plus lambda 2 our t is 10. So the Poisson parameter is 10 lambda 1 plus lambda 2 so probability exactly 3 packets arrive at the link again we remember e to the minus alpha alpha to the k divided by k factorial here our alpha is 10 lambda 1 plus lambda 2 that is our alpha and we are just plugging that in to get this. So these are just 2 quick examples for the Poisson properties. Now let us look at our main example for today which is of the open queuing network. So suppose this is the entire picture of the open queuing network what are we looking at here? What is this modeling? Imagine that there is a website which supports 2 types of requests request 1 and request 2 which both come to the same web server W but then they split based on what function these requests are for they split to 2 different applications that entire sort of 2 different back ends. There are 2 back ends this is one entire back end made of application server A1 and database server D1 and this is the other back end made of application server A2 and database server D2. This is a very common architecture for example in a typical call center complaints kind of website we could have a complete different system for new orders and a different system for complaints on existing product this could be a thing. So W is a web server A1 A2 are the 2 application servers and D1 D2 are the 2 database servers. What you want to do here we want to you know basically analyze the system to find system throughput utilization of each server system response time we want to know what the bottleneck server is what the bottleneck throughput is all this we want to do for given parameters and what are the parameters for open queuing network remember we need to know the most important parameter is the average number of visits a request makes to each of these servers. Remember that the request flows through the system multiple time before it exits this is the exit here in this queuing network. So it may visit servers multiple times. So the analysis of an open queuing network depends very much on knowing what these average number of visits are for a request before it completes. And of course the service times this is at one visit how much service does the request need at each of the nodes. Now suppose arrivals are poisson with rate lambda. So we have just one place where external arrivals come and that is very natural assumption that requests are all going to land at that front end web server this is the front the main web server. So external arrivals obviously come to this main web server. So this is sort of the symbolic setup what are the values we are going to do this act. So let us assume that the average number of visits to each of these nodes or the servers is given it is 10 for the web server 13.3 for the application server 1, 25 for application server 2, 9.3 for database server 1 and 20 for database server 2. And the service times are as follows 3 milliseconds for web server, 2 milliseconds for application server again 2 milliseconds for application server 2, 3 milliseconds for database server 1 and 2 milliseconds for database server 2. So these are I have kept them examples as really sort of low execution times this is very typical of good fast websites today. Now of course everything is going to depend on how many times a request has to visit each of these. So we will find out of course that even though TA1, TAOA1, TAOA2 and TAOD2 are all the same the service times are the same for application server A1, A2 and database server 2. They may not they load on each of these servers will be totally different based on how many visits each has. So it is actually straightforward compared to let us compare 13.3, 25 and 20 and clearly application server 2 is between these 3 application server 2 is going to be the one that is more loaded and same thing with the web server versus database server 1. They also have the same service time but the visits are different slightly different. So between these 2 we anticipate that the web server will actually be the more loaded. But so let us go ahead and find the bottleneck server and the bottleneck throughput first. So the remember what we need to do to find the bottleneck server is to calculate the service demands. So D1 will be V1 TAO1, D2 will be V2 TAO2 and so on. So D1 for example V1 was 10. So this is going to be 10 multiplied by TAO1, so sorry this is DW let us call this DW and VW TAOW, D A1 and V A1 TAO A1. So VW was 10 and TAOW you can check here is 3 milliseconds. So this will be 30, similarly VA1 is 13.3 and TAO A1 is 2. So here we have 13.3 multiplied by 2 that is 26.6, let us do 1 more and then that is just what is shown here. So VA2 is 25 and TAO A2 is 2. So DA2 is equal to VA2 TAO A2 this is 25 multiplied by 2 this is 50. So similarly D1 and D2 are also calculated and these are the service demands we get you know 30, 26.7 actually because this was 13.33, so 26.7, 50, 28 and 40. This is we get by using the same formula for each of these nodes and you can see that the one with the highest service demand is A2. So the bottleneck server is A2, the bottleneck service demand is 50 milliseconds. So bottleneck throughput is going to be 1000 by 50 if we want to find out in terms of requests per second and that is 20 requests per second. So the overall capacity of this system the maximum it can do in terms of completed requests is 20 requests per second. So this we found out. Now what we can do is for a given arrival rate we can try to do the rest of the analysis. So what do we want to find? System throughput, node throughput and utilization of each server for a given arrival rate. So let us take lambda is equal to 16 requests per second this is less than 20. So this implies this is a stable system. So we can actually do the analysis for all the nodes otherwise it is an unstable system and we do not bother with analyzing an unstable system. So of course the system throughput is for a stable system this is going to be just 16 requests per second. This is an infinite buffer everywhere in open queuing networks we assume infinite buffers. So that system throughput is actually here. This is where the exit is that is going to be 16 requests per second. What is interesting here is just the node throughputs and the node utilizations. So for example what is the throughput of the web server is going to be equal to the arrival rate because we are again assuming infinite buffer systems. So this is going to be VW multiplied by lambda. The number of visits a request makes to each node multiplied by the original arrival rate. So this is basically 10 multiplied by 16. So it is going to be 160 requests per second for the web server. Let us do one more just for an example. So again throughput of A1 is going to be arrival rate at A1 and that is going to be visits to A1 multiplied by lambda and visits to A1 are 13.3 multiplied by 16 that is turns out to be this basically 213.3 requests per second. We can do one more again just A2 maybe or let us do D1 what will be the throughput of D1. So number of visits to D1 is 9.3 multiplied by 16. So that is what this is around 149.3 requests per second. Now with these things we can also find out the utilizations. So what are the utilizations going to be? So let us do one or two here. So in fact it will be interesting to do the utilization for A2. So the lambda A2 is equal to 400 requests per second, tau A2 was 2 milliseconds. So rho A2 will be equal to lambda tau, lambda A2 multiplied by tau A2 divided by 1000 because we should just have the same unit. This will be equal to 400 multiplied by 2 by 1000 and this is 0.8. So this is the utilization of A2. Similarly each of the other utilizations can be calculated. You can do this yourself, the lambda 160 is here. So to get the rho w you have to simply multiply the 160 by the tau for the web server which was 3 and divide by 1000. You can tell actually that this is 1638, this is going to be 0.48. Similarly you can do all these calculations and verify that you get these as the utilizations. It is obvious expected that the utilization of the A2 server which is the bottleneck server is going to be the maximum that is 0.8 and this is more than all the other servers. Not only that actually we could have calculated, we would have known this even by looking at the fact that 16 divided by, so 16 divided by 20 is also equal to 0.8. And 20 requests per second as an overall completion rate is the bottleneck rate actually of application server A2. This is what application server, this is the rate at which application server A2 can actually complete requests, not their visits but finished requests completely and 16 requests per second is what the overall arrival rate was from external, so it all makes sense. So actually one should check, double check these things in different ways and things work out. Now that we have, what did we find out, we found out the bottleneck server, we found out the bottleneck throughput, we got the node throughputs which are also the arrival rates because this is the stable system. So remember for example, this here, the total rate here was lambda w and over here, this is also going to be lambda w, although this is throughput, this is also going to be lambda w. Similarly this here, the complete arrival rate here was lambda a1 and the throughput here was also equal to the arrival rate. This was lambda d1 and what goes out here is also lambda d1. So now let us look at the response time, that is the next thing to calculate. So what do we want to do, we want to find the response time at each node and also of course the entire system response time, we have 16 requests per second coming in here, we know we have 16 requests per second leaving also since it is a stable system. But when they come in here, what are the per visit response times, how much time does this take, how much time does this take and so on and what is the total time. So here remember we will use Jackson's result, all these times of course we have to assume to be service times have to be assumed to be exponential, this has to be arrivals have to be assumed to be Poisson, branching should be memory less, then we can apply Jackson's result and what is Jackson's result, each node behaves like an mm1, in this case 1q. So now recall you can refer to your slides and recall what the response time, average response time of an mm1q is, it is basically for any for the ith q it is going to be tau i divided by 1 minus rho i. So for example Rw is going to be tau i is 3 milliseconds, rho was 0.48, so this is 1 minus 0.48 and this just turns out to be 5.8 milliseconds. We can find out A2 since it is the bottleneck, so R A2 tau is 2, remember the utilization was 0.8, so this will be 1 minus 0.8, this is 2 divided by 0.2, so this is equal to 2 multiplied by 5 that is 10 milliseconds, so that is what is here. So similarly we can find for A1, D1, D2 you can just plug in these values and this is the set of per visit response times you get, system response time remember has to take into account the multiple visits also, so this is actually summation i Vi Ri, so we have all of these things, so actually this is basically 5.8 multiplied by 10 plus 3.5 multiplied by 13.3 plus 10 multiplied by 25 plus 5.4 multiplied by 9.3 plus 5.6 multiplied by 20. So 10, 13.3, 25, 9.3 and 20 were the visits, these were the average number of visits and we are multiplying each of them by the per visit response time and this total turns out to be 516 milliseconds, so you can verify all of this and do not just kind of follow this on video, you feel free to pause it and do the calculations yourself. So this is actually the example for open queuing network that we wanted to cover. In the next lecture we will be looking at a completely different kind of queuing system where the server and the queue and everything is the same but how we model the arrivals is different, so thank you.