 So, we will start from where we left in the previous lecture. So, I will now give how you actually iterate. This is a particular specific scenario of how you solve Markov chain. Technically, it is actually solution of a Markov chain by doing iterative computation actually because sometimes when this number of states are extremely large, it is very difficult to get a solution. So, really the way we always teach the solution is we always say, let us build up a Markov chain where we have some state probabilities and based on that then you start building of what we call balance equations and then using a fundamental axiom that all state probabilities sum has to be equal to 1. We actually get all simultaneous equations solve them get state probabilities that is what usually we do. Here actually I am not interested in that, I am more interested in what is going to be my throughput performance, what is going to be the outflow, but that actually depends on the states. So, last time I had drawn 14 states of a 2 by 2 switch and we will take two modes once one case will be when in fact for every switch when the packets are there at the input there are two ways I can actually understand, two ways the analysis can be done one is the total period which is required in this case is what we call I just t delay actually. So, t delay is one step delay from here to here, this delay usually will consist of t select plus t pass t select is the time required to identify to which outgoing port this these packets have to go and then when actually the transfer happens that requires this much time. So, we will take actually first the case when t pass will be t select will be 0 and then t pass will be 0 that two cases actually. So, now one important thing I have given you 14 states I will assume that because now switch will actually consist of buffer delta consist of many switches in a state and there many states actually and so on. So, all state probabilities within a stage are going to be same for all switches all state probabilities for all the switches in one single stage is going to be same that is the assumption. So, I need not bother about all these switches because otherwise you see 14 states I have given and then you have how many switches. So, 14 possibilities raise power number of switches those many number of states will be there and even if it is a very small number say you are going to have 8 by 8 switch for example, 8 by 8 switch requires 12 such switches. So, 14 raise power 12 is a huge number actually and maintaining those kind of things in a Markov chain or in any finite state machine is going to be complicated you cannot handle that actually. So, analysis cannot be done in that way. So, first simplification which was done is this. This is usually true because number of ports which are coming in these are independent sets and that is true for all switches because what is true for first switch result into for the second and so on iteratively. So, this is all switches technically see the same thing. So, their state probabilities has to be actually same. Now, this is going to be true. So, I am going to take this case this is the one important thing you have to keep your state diagram handy all states actually. So, I will just still put them here I will not erase them during the lecture because I have to refer again and again back to these states. So, I think I can redraw them. So, this is one now before I go onward with the iterative method of computing the state probabilities method is going to be pretty simple. For example, if you want to find out for a Q for a single Q I think I can just explain how it will be done for that. For that actually usually I can find out a very simple solution because my balance equations can be formed. So, with this if I actually being given you a 0 transition probabilities 1 transition probabilities and so on. For example, this is a infinite Q. So, usually actually you can always run an algorithm on this. So, you can start with a Q when it is empty and now we talk about the state probability with various time instance that is very important while when we did a Q-ing analysis of a simple Q I was not using time instance for a state probabilities 20 is equal to 0. So, I will always define P 0 as the state at time t. So, this is k. So, k will be 0 in the beginning. So, your initial boundary condition can be that there is no Q that is a probability and then you will have transition rates. So, you can have to define transition probabilities. So, lambda is the rate for going into one direction and mu is not going into that mu is coming back. So, you will define this as lambda and that you are not going to go there is 1 minus lambda actually. Important thing is transition is happening at every time instant it is a differential. So, I am now making a very different kind of Q here at on a time scale at t is equal to 0 packet will come t is equal to 1 something will happen t is equal to 2 this will keep on happening it is not as such a Markovian thing. So, lambda can I can replace this thing by actually P the probability P is a discrete time system now. So, with probability P the event packet comes 1 minus P packet does not come with packet again the same thing is going to happen at every time instant. So, from here actually you can find out what is going to be your P 1. So, from here you can actually find out whatever was the value P 1 at instant 1. In fact, you can build up an equation based on this. So, for 1 I will show then I can write it for general I will use a very similar procedure there this one will be that you have to be in this state in the previous time instant then there is a transition probability which was I call it something else I think let us call it lambda lambda is not arrival at it is a probability you have to understand it. So, lambda is probability, but this is a computational procedure you cannot have a close form solution here. So, with this you will be able to come here. Second thing which you can get is P of 2 from here also you can come and this probability is defined as mu, mu is the probability that packet will go out of the packet actually out within that slot is it require same slot it is technically is not arrival at it is a probability it is a conditional probability technically. So, if you are in this state chances that will go here is this, but it also turns out to be same as rate. So, this method is not used while doing for a simple M M 1 infinity q. So, I have modified the q somehow. So, you get one equation through iteration remember my time stands are different here and to begin with my initial condition is that this is one rest everything has to be 0 because of this rest everything has to be 0 and q is also in a state 0. So, I will be able to get P 1 1 from here I can in fact solve for all these in general. So, I can get P of say M in state k as P of M minus 1 lambda k minus 1 plus P of M minus 1 plus P of M minus 1 M plus 1 actually k minus 1 into mu. So, now you actually can you have to just run a computer program start with this initial condition and as your time moves you are computing every time P 1 k P 2 k P 3 k P 4 k you are just iterating and P 0 k will also get adjusted correspondingly you have to understand P 0 k will also be changing will be a function of P 0 k minus 1 1 minus lambda. So, what I am doing is we are adjusting continuously we are reducing it by some amount and increasing all other state probabilities and after sometime in the computational procedure itself it is always bound to converge. You will find there is a steady state condition which will operate and a steady state condition is when the flow rate almost becomes constant out of a system. So, when for all of them you will find out that it happens that P of any value any M and say k this almost dot lambda lambda is actually constant here departure rate. So, the flow rates here statistically has to become constant they will not be varying or when the flow rate becomes gets balanced that also you can figure out. So, in this case condition is pretty simple here probability of 0 are we not transferring the probability from state 1 to 0. Yeah that also need to be there you are right that also has to be there you are right you are right I agree k minus 1 that also you have to make that. So, when this condition or the balance condition actually you see start seeing your computation things have converged take those state probabilities and you have got your results. So, with various values of lambda and mu actually you can find out that thing it will turn out to be almost very same what we did for the simple queue. Now, this same procedure we are going to invoke here because here we cannot get the close form solution this Markov chain was very simple could have been solved, but that one we cannot do, but just to give an example I have just simplified this thing into this particular this is a computational procedure, but we this comes in the category of still analysis it is not a simulation because we are not simulating anything we are just computing and it is a iterative computation till the computation is stabilized or converges. So, we are technically solving balance equations and balance equations are when the flow rates from in to out and out to in both are same. So, we are just finding out when the flow rate converges and everything is going to keep on it will actually balance remember it is like a first order equation it is not a second order. So, there is no question of oscillations here if you carefully observe it is a first order actually equation it is always trying to move to a stable condition. So, convergence is guaranteed actually this is fine this one was a simple queue now I am going to come to complex one. So, state transition probabilities are complicated I think one important thing is you have to understand how state transition probabilities are estimated and how the how you actually understand the whole abstraction that is the important thing. So, far the things were I think little simpler now coming to this first case which we will take is when T pass is 0. So, there are two cases when I can take T pass is equal to 0 or I can take T select is equal to 0 this is all condition now what is the meaning of this actually what is the implication of this. So, I think once you understand this then it will be much more clear in the paper it has been given later I am doing it early actually I somehow feel this should be done. So, I have to take the cascades of the switch let us take this case. So, all switches are empty there is no nothing in the buffer and they are having exactly one buffer at every input port does not matter you can actually then do the simulation even for two buffers or infinite buffers whatever you feel. So, if you have two packets coming in now you have to look at the time instants. So, this at one part of a time instant it has come then the T delay will elapse after this and then the next state will come. So, how the state transition will happen and this case I am taking as T pass is equal to 0. So, this T delay will be nothing but equal to T select this is the time required for identifying to which outgoing port the packet has to go, but packets move almost instantaneously from input to output from any buffer to any buffer. So, once they the decision will take this much time you know there is a packet at the end of this T delay what will happen one packet will be almost instantaneously just before my time period finishes just before that 0 minus T minus actually. So, if it is 0 instant then just 1 minus at that instant the packet would have moved here your situation will be something like this if both are I am assuming contending for the same port you will come in this situation another T delay will happen you will get a situation like this now. So, in this T delay they will figure out it has to go to which port this has to go to this port earlier also tried, but there was a contention. So, it was buffered this also will be identified and just before the next time slots just minus just slightly earlier the packets will be moved instantaneously. So, you will actually have this packet coming on to this position and this packet coming on to this position. So, you will have this situation. So, that is when your T passes 0 drawing with a different color when T select is 0 then what will happen. So, it actually means when this particular period from here to here that slot which is starting within 0 time I am able to figure out which packet has to be going to the outgoing port then it takes one full slot for the packet to be transferred to the outgoing buffer. So, after this situation this is what is going to be there perfect. So, this is what will be the situation another time slot delay. So, in the beginning of this particular slot they will know that this packet has to go here and this packet has to go here, but the problem is this packet cannot move because this buffer is not empty because in the beginning of the slot itself you have identified where the packet has to go, but when you start transferring this packet will take full one slot for transmission to the outgoing buffer and unless this buffer is empty this cannot move. So, this will still remain stuck there. So, you will end up with a situation here where this packet will be here and this packet will be here. So, that is the difference between the two. So, analysis when T select is equal to 0 is simpler actually. So, I will do a complicated version first when T passes 0. So, the final state will be there will be no packet in the middle stage. The one with the red ones you look at maybe I can draw it separately if you wish. So, you have to match. So, red one corresponds to red one, white one corresponds to white one. So, now for when T passes 0 you have to understand now if there are packets which are queued up like this in a string all of them packet will move in the same slot to the outgoing port. Decision will take the same time one slot period then there is instantaneous movement. So, all of them will move in a chain. Now solving this is slightly tricky. So, what happens is each time slot or each event is being now identified into three phases. So, first phase we call when the packet actually goes out when you are this is the outgoing buffer when the packet from your outgoing buffer or the input of the next stage input buffer of the next stage is pushed out that is a phase one when the phase one is happening. So, this is step one actually we do not call it phase one this is step one here. Step two will be when the packet from here to here will come. See I have broken things into steps. So, that when this goes out I can immediately move the packet in the same slot here which is not possible when T select is 0 for T pass for simulation or iteration I need to do this. So, that is a step two and step three is that packet comes to your input buffer. So, you have to understand when step one is running here which step is running here is step three. When step two is running here no this is not a step three this is step two actually packet is going from input to output of a buffer this is a step two the same thing is happening here for this. So, while at the same time the step three is happening for this person. Sir that is for T select 0 these are for T pass T select is equal to 0 you do not require these definition this break up is not required per slot. Mala if you carefully think I think this is difficult to explain, but this is the way it happens this is the only way it can happen actually. Sir once again sir. Sir more complicated is T select is equal to 0. More complicated T pass is equal to 0. So, T pass is equal to 0 everything is moving in a chain. But then I have to split it know when I am doing iteration. See it is a problem of how you implement the computation. Their computation is simple every one step one time slot one step, but here every time slot is broken into three steps and this actually does allow all the chain to move in one go. So, when a time slot starts you will say step one here then step two then step three. So, everywhere you will do the step one step one will happen first then step two then step three for whole switch. So, usually what will happen is this is the packet at the outgoing buffer step one this packet will go out instantaneously here. When the step one happens here then you will apply step one here and at this point step two is going to happen here is a chaining which is happening. So, when one is happening here two is going to happen here and then when one is going to happen here then two will happen here and three will happen here and then of course two will happen here three will happen here last three will happen here and well full chain of event. So, one complete slot will be simulated 1, 2, 3 all three has happened. For this there is actually nothing to do in with 1 or 2, 1 has happened in the previous time slot. So, current and time slot I can implement this way, otherwise it is not feasible. So, now coming to the formal definitions which are required here. So, then t pass is equal to 0, we require minimum 3 steps, 2 steps. 3, t pass is equal to 0, 3 steps per slot. And 3 stages also. Any number of stages there can be yes thing. Minimum 3 stages. Not necessary, even with 2 also you can. So, it is like a state machine. One full slot is gets done when all 3 steps are executed. So, what happens is second step. Second step packet is coming from your input to your output. First step packet from your output has to go. Output has to go outside. From your output the packet is moving further. Going out big past from your input to output then packet has to come. Then from a packet has to come to your input. These 3 things will give a slot for a switch. So, which is my input set in this case out of 1? Any particular switch. In particular switch. In step 2 and then what is it? This is the, I am talking about this switch. When for this switch this step 1 is happening. This packet is moving out. For this switch step 2 is happening at that time. No, this is obviously for step 2 and 3. Which one? This is step 2 is for this. Here the packet is going from input to output. But then for this switch the packet is coming to the input. So, there is a step 3 for this and step 2 for this. And in the last one packet is coming to my input. So, the previous switch you are having a step 2 happening. So, it is always 1, 2, 3 and it actually propagates backward. That is what is happening. So, when full 1, 2, 3 set propagates from input output to input one slot has finished. But that is the way we assume. T delay is 1 delay. T delay is delay here remember. And every after T delay packet moves further. So, 1 T delay requires 3 instances, 3 steps. And selection time is full T delay in this case. But packet passing is instantaneous. So, we define now what we call our probabilities before we come to the states. So, notation is very simple. So, at what happens at time when slot starts you are at a state you are at step 0. Then step 1 will happen, then step 2 will happen, step 3 will happen, step 3 will be nothing but a step 0 for k plus first slot. So, step 3 for k th slot and step 0 for k plus 1 are same. So, now we will actually define at time instant T k. Now, k can go from 0, 1, 2 and so on because say iterative calculation these are stages in the switch. So, I am not worried about how many input ports are there 2 raise power n by 2 raise power n, but number of stages matter. Because I have made an assumption which is a correct assumption for almost all delta networks that in a stage all switches are equivalent. There is state probabilities are going to be same. So, far they are in the same stage. So, under that assumption and we will define now a probability we call it P 0 this is after step 0 actually in time instant in time slot k, k starts from. So, that is a slot and I think do you understand what is the meaning of this close and open intervals. So, in this case T k is included T k plus 1 is not included that is what it means it is a open on this side and close on this side. So, this particular probability is probability that your switch in j th stage this is this is in state this is not a stage this is state i this one. So, notation you have to remember do not change it it has to be consistent actually at time T k. So, this is the T k instant when the time is start this that value now this whole interval is known as tau k tau k is this interval this edge is not included this is included. So, tau k I am assuming that states 1, 2, 3 and there states are there steps are there steps 1, 2, 3 are happening I am going to write down those probabilities P 0 then P 1, P 2 and P 3 P 3 will be nothing but become P 0 for the next time step next delay time T k the switch is in state i switch is switch in j th stage at state i there many stages. So, for multiple stages we have to solve and is giving the formulation actual calculation has to be done through a computer P 1. So, this number identifies the step after which you are looking at the probability state stage time instant time slot this is pretty common in most of the switching analysis you will use lot of subscripts superscripts is all kind of notations. So, this is a probability that your switch in stage j is in state i in time interval I am not writing time instant now time interval tau k after step 1 there is no step 0 third step is step 0 for the next time which one this after 0 th step just before the first step then first step has taken second has happened third has happened third is nothing but the 0 th of the next one next time plot. So, I will change there k will be changed there in this. But numbering 0 1 2 3 steps but counting 0 1 2 I am counting 1 2 3 0 is same as 3 0 is same as 3, but time is 3 there time instant changes k will become k plus 1 see why I will steps I would not count 0 1 2 3 is the objects which are counted or ports which are counted 0 1 2. I am being consistent with the paper because ultimately I know this is difficult to communicate in the class you will anyway have to depend on the paper and if my notations are not same there is going to be a problem in that case in understanding. So, I have to be exactly same what is given in the paper for certain nuances which have not been explained for example, t pass and t select difference has not been explicitly told the procedure of computation is not explicitly stated because the author assumes that is what happens in most of the papers we do not give details sometimes. We assume this is a kind of a common knowledge and person can figure out on the other side, but I know the class cannot figure out as of now unless you are a PhD student with a good amount of experience is going to be difficult to figure it out. So, I could do that that does not mean that everybody else can do it. So, I have to be explicit and at least you have an option to fall back you can always ask me if there is a problem I never had that option with this paper is pretty old I do not know where are these guys, but I think this was the first one which gave for buffer delta the analysis part and it matches with the simulation that was good thing and this has taught me a different method of solving Markov chains iterative computation which is again usually not taught at most of the places. So, switch is in switch in stage j is in state i in time interval tau k step 1 and 2 both has happened. Similarly, you will have p 3 k and this has to be equal to p 3 i j k plus 1 rest everything follow exactly except in the last you will write step 1, 2 and 3 rest everything is same. Next time interval will be tau k plus 1 yeah next will be tau k plus. So, this let me write it I think this is better because switch in stage j is in state i in time interval after step 1, 2 and 3 and we will define one more probability actually now come the trickiest part. Now, what I am defining is actually will be the probabilities which are used for computing what we call transition probabilities at every state and these will also keep on changing with time as time evolves and they will stabilize after sometime in the Markov chain. So, first probability is p j tilde. So, I am going to use 3 of them I think one has to be careful I will be using this I will be using this these 3 have all different meanings. So, first I will define the top most one this is the probability that a packet at switch output link stage j this j actually identifies this is passed in time interval tau k. So, this actually is indeed a function of k I am not explicitly mentioning it, but all these p j tilde p j bar and p j will be function of k I will not be writing them paper also has not written it. So, I am keeping it as it is ideally I should have actually put a k subscript k superscript there for doing this. So, this actually means this will be in terms of now the states whatever those 14 states are there and I have already defined how the probability will be defined after every step and we know what this probability is actually mean what happens in step 1 what happens in step 2 and what happens in step 3. So, from here if there are two stages if this is the j th stage what is a probability that a packet will go out I am trying to estimate that now usually what will be the function this will depend on at the start of the time slot what was the state of this switch and then the step 1 will be happening for this and step 1 for this and step 2 will be happening for this and there is a switch previous to this that also you have to take into account because there index j actually will change when I am going to estimate for p j I will be using in this case j plus 1 actually and that decision will happen is what happens after step 1 here because step 2 outcome will be decide by what has happened in this step 1 here. So, that is why the expression actually will contain all j plus 1st terms, but what is going to happen after step 1. So, let us see what is going to happen time interval talk is passed in second line. Second line the probability that a packet at switch output link in state j packet is here is passed in time interval talk a pass to the output port they will never be passed anywhere else it can only move forward. So, it is being moved in time interval talk that is what. Step 1 to 3 we have to identify currently I am only looking at if there is a packet setting in here what are the chances it will move is a condition probability remember is a conditional probability that packet is sitting here what are the chances it will move here you have to identify basically the states for this what is earlier state and after step 1 what is happening here that will decide the probability of transition for this see whatever happens here will have a impact here if packet moves here then only state will change here packet does not move state does not change here. So, these are transition these actually will be used for computing transition probability here this is outgoing packet probability, but that will be function of what happens in step 1 here after step 1 if the packet goes out or does not go out packet does not move out from here then nothing will happen this packet cannot move. So, essentially what I have to do is I have to now list this thing can be written as. So, this will be nothing, but probability of this such that s t I have to essentially identify states when this is possible and remember this is a conditional probability. So, I have to identify all the states when the packet is there at the input of j plus first stage and this will become more clear when I will give the example now build up all that will give the examples how this actually works out and of course, for this the boundary condition before that is this at every stage you will identify q of j by this these two are why these two in the last stage if the switch is there is one buffer here packets are instantaneously removed there is no packet queued up here there is no buffer required at the output if these two packets are there in the last stage and they both have to go to any port even if they have go to the same port in the there is only time required is t delay which is for selection. Selection is done when both of them will be instantaneously put here and they will be instantaneously taken out. So, probability that this particular packet will be which is there in this is n minus first stage remember this is n minus 2. So, probability that the packet at the output of n minus 2 will be take passed out has to be always equal to 1 if the packet exist condition on that. So, that is the initial condition. So, this is known as boundary condition of the solution you have to start with certain boundary condition always. Initial condition will be when all switches will be in this state 1 no packet in the system when you start your iteration boundary condition t tilde n minus 2 0 to 1.0 there is no output condition at t n minus 1. Not possible because packet is taken out instantaneously t select is equal to 0 when t select is equal to something is equal to 0 then this will be problem will be there you cannot take then it has to t n minus 1 tilde is equal to 1 it is not t n minus. t passes equal to 0 t select is equal to t tilde. So, in full slot both of them will be selecting the one output does not matter because time t is 0 for reading out the packet. So, both of them can be read out instantaneously and they can be read out from the output port. Sir here since. Very closely. 0. Is 0. Even in case. Since I am only considering here packets at the input that is why I am taking only step 1. Packets at the input I am bothered about the j plus first stage what is happening here. See if what I am in some state I have some packet queued up what happens to my outgoing packet that will decide what will be my next state whether packet can move or not move I am looking into transition probabilities now whatever is my current state here this can only get modified if my packet moves and that depends on what is the state probability after step 1 here. So, that is why this has been done this way. Only at the last port only at the last stage not here see what happens for example, if you put packets here if these two packet does not go out both of these wants to come here. So, you have consumed the full period and finding out they have to come here, but this buffer is not free buffer is not free they will remain there remember the patterned model of the switch there is a backward flow of the signal which is there packet can only move if the buffer is empty in the next at the input of the next switch. Here you do not consider packet dropping. There is no packets are not dropped they are all buffered it is a come full loading condition remember the initially assumption initial assumption is there there is a maximal loading condition I am only estimating what is the maximum achievable throughput, but I am actually using a trick I can actually modify the input probabilities, but input probability initial conditions or boundary conditions I am taking such that is a maximal loading condition. I will write actually more this is not the only expression I have to write p j bar also. So, now this will be I have to first of all write down all the states when the packets are there at the input see then only they can go out if the packet is not there at this port they cannot go out I am worrying about here. So, I have to look into all the states in j plus first stage where the packet is there at the input. So, first one can I put one I cannot there is no packet at the input. So, one two three cannot be used four can be used there is only one packet. So, the next stage switch is in four there is a chance I might be connected to the one where there is no input buffer is not occupied or I might be connected to the top one where the buffer is occupied both of these can be connected to my switch in j th stage with equal probability. So, I will use half of this p 1 4 j plus 1 I have to write all that time is 10 k half is because I can be equally likely connected to any one of those if the switch in the next stage in this state. So, my possibility is half 50 percent of time I will be connected to the one where input buffer is occupied 50 percent time buffer is not occupied even if I flip these input ports this I could take on top this one bottom is still the same state remember plus what is the next one you have five also similar situation, but remember in five if you the next stage in that state the packet will not move packet cannot go because the next buffer is not empty after step one this is after step one actually step one is already taken place in j plus first outgoing packet has not moved out. So, my packet also cannot move in. So, four will be sitting in the numerator, but five will not be sitting in the numerator it is only in the denominator for this conditional probability. So, I will write p 1 5. So, I am intentionally writing it first thing here then I will only take some of them on the above part all of them will not go p 1 same as with the sixth there is only one input port I can be connected to any one of these, but six packet will go out. So, it will go in the numerator also similarly next one will be half p 1 7 j plus 1 I think you have to take a large copy if you take a A 4 sheet print of the paper the tilde and bar are not clearly written on the paper actually. So, if there is a confusion then you ask me because there tilde will be actually is visible as a bar. So, in the paper. Sir, in the six y that half factor will come because now the two states are not. But my stage j th stage is going to connect to j plus 1 either here or here. Half factor. With 50 probability I can be connected here 50 probability I can be connected here. So, when I am connected here input buffer is not occupied. So, 8 it should not come state 8. Step 8 will be half no step 8 not will not be half it will not be half it will be full see this is the probability that packet is there at the input port. So, here only 50 percent time packet will be there at my outgoing port or the input port of the next stage there it will be sure that packet will be there at the input port. So, p 7 and then of course, yeah then after that I do not be putting half here it will be now as you have correctly identified p 8 similarly you will have p 1 9 p 1 10 will be there yes it will be there I think now almost all of them will be there 11 p 1 12 p 1 13 p 1 14. So, I think we are now going to close. So, only I will put the numerator part remaining we will do in the next lecture. So, numerator part will be you can quickly put in case of 4 yes packet is going to go out. So, I am going to write it positively here when packet can move half of p 1 6 j plus 1 packet can move in case of 6 also it is free 5 packet cannot move actually go out. So, that should not count to my probability by definition. So, half of p 1 8 p 1 9 I think both the packets can move out. So, it is 100 percent probability half of p 1 11 half of p 1 of 12. So, this gives you the probability of p j tilde to you in terms of the state probabilities after step 1 in the next stage. So, I will use this p j tilde to essentially compute the. So, we will start from one edge and then compute all the way in the forward and backward direction two ways we will do the computation actually. So, I think here I will close today and then we will move forward we will find out what is p j bar and so on in the next lecture.