 what we were doing last time was input and output queued switches and I actually have given the example and why we were doing input output queued switches because we were looking at a cross bar and how to implement a packet switching system using a cross bar that was basically is the idea. And what I had actually mentioned that there will be inputs and there will be correspondingly the outputs I am showing it on left and right cross bar we always show from left and bottom that does not matter actually. I am just for the sake of showing I am showing it and what we had was that all the packets will be coming in synchronized slots. So, at the beginning of the slot you will set the cross bar depending on whatever cross connection you require the packet will move through then the next slot will come again you will do the same thing and so on. We will keep on doing it every time the packets will be switched out to the appropriate outgoing ports. Sometimes it will be possible that two packets will be there which want to go to the same output that is a contention output contention. One of the packet has to be dropped if it is only a cross bar because technically the speed at which the packet is or bits are going on this line packets going inside the cross bar and packets which are and bits which are going on the outgoing lines they are all three same. So, speed of factor is one in that case. So, one of the packet has to be either dropped or it has to be buffered if you can keep memory here. If you do not keep the memory here the packet will be simply dropped only one of the many contending packets will be going to the outgoing port. And of course, then I told we can probably improve this situation try to minimize on this loss I can provide some kind of buffers or the queues at the input port. So, the first idea is that I keep the buffers here these are these are known as technically input queued switches only important thing here is still my switch is operating at the same rate at which the line input lines and output lines work. That is I think I have mentioned earlier if there is a contention I actually allow one of the contending packets to go to the outgoing port remaining packets are kept in the buffer. So, it is possible the same some packet which has been retained in the buffer cannot go even next time. So, what will happen the packet which is coming in the in that particular slot will be queued up in the back of this particular queue which is held up this could have been transmitted but cannot be because somebody is there ahead of it which cannot pass through. And then of course, I gave an idea that instead of one queue I can maintain multiple of them for separate outgoing ports. And I will try to resolve as far as possible or the backlog this stuff, but cannot happen I will use whatever are the other free outgoing ports for which whatever packets are there I will schedule them. So, I said that instead of one queue you will be maintaining multiple of them like this for each outgoing port and will picking up from there. So, this can take care of ahead of the line blocking actually, but fee for display inside this queue together is not going to be maintained that is only thing but this will work very effectively. Another option was that I can if somehow I can actually have a speed of factor inside the switch. The speed of factor cannot be there if it is a plain cross bar. If I use only a cross bar like this and there are cross points which are connecting here which are triggered for every slot depending on whatever combination is required. Sorry these lines are going to work at the same rate at which you are receiving and the bit is going out there is no speed of factor it is one. If I actually modify this switch I have not mentioned it explicitly, but that was an assumption that packets do come at the incoming port in the switch they are buffered there is some limited buffer. So, maybe one packet is buffered for every input input queues can still be there I am not bothered about them, but what happens I actually have some mechanism now it is not a cross bar it is like with cross bar also I can do space switching, but I can also do time switching also I can read into memory and write kind of thing also can be done. So, I can I am not looking at a cross point cross point is a circuit switching scenario I am looking at transferring a byte or a slot time switching was possible because I was looking for a octet being transferred from one point to another point in time or in space both ways it can be done. So, here if I can actually run a processor I can actually connect a bus for example, and this bus I can read from this bus using a processor and if this bus speed is such that I can read all these packets in one single time slot that is possible. So, this processor can read this packet in one if they are n packets coming in per slot 1 by nth of the slot this packet can be read by the processor it can be analyzed and then it can be pushed on to an outgoing bus if it is a dual bus system and can be pushed on to the outgoing line. So, there can be output buffers also, but this is not a cross bar, but technically it is still a switch n by n switch packet switch or alternatively it can also be a cross bar, but then cross bar has to operate within one single slot period technically there will be n some small minor slots. So, you will be putting the packets here at some line rate, but when you will read out the packet that will be done at n times faster rate. So, each packet will be scheduled in different sub slots correspondingly then also I can use a cross bar and I will get all packets here at higher speed n times higher speed I can put them in the buffer outgoing line rate will be same as incoming line rate that also can be done. So, there are various ways of doing it. So, this bus now can address and can actually push the packets into various outgoing things if this is working at n times faster rate it is a n times speed up factor a speed up factor will be n times they are always kept as same they are always kept as same. I think that is what we have done more or less in the last time now we have to go to the analysis part of it. So, one of the important thing is that what will be the utilization and what will be the average queue length which will be there in for input queued system and output queued system. So, let us look at first of all the output queued system. So, there is a speed up factor of n which has been assumed. So, even if all packets are there they want to go to the same port it is possible that I can read out all these packets at n times faster speed n right into the outgoing buffer that is technically possible. Now, look at the outgoing buffer what happens there you have a higher clock rate is like you what is this buffer buffer is technically RAM. So, what you do is you actually have dual system here in the input side or here you actually first of all read into this particular RAM there is a next dot you are writing into this RAM if the packet is coming only you do not require any actually memory if it you have output buffering on the input side only you will do this and this packet will be read at very fast rate. So, this has to be now addressed by the processor and read out at faster rate n times faster rate. So, I can read out the whole packet in 1 by nth of the fraction 1 by n of the packet duration a slot duration I should be able to read it. So, I can read all the packets I can address 1 by 1 each 1 of them read it out analyze and then transfer to the outgoing buffers if all of them want to go to here it is fine the first I will read here next I will read here I will do addressing as I am doing it at n times faster rate I should be able to read all the memories all the RAMs while in the input side the packet which is coming is being written to second memory and what will happen is I will simply do a once this has been read out next slot you will be writing here and the read out will be happening from this all address everything remains the same. So, just do a very fast flip flop actual implementation will be something similar you cannot read and write simultaneously that is very important you have to first of all write the whole packet then only you can do the reading reading is done at a faster rate. So, packet is compressed in time technically the multiple memories which will be there in each one of these inputs. So, processor can do that. So, I am taking this particular scenario that depends on the line rate you do it at faster rate then you have to increase the speed here also. So, to ensure that all packets are read out and written even if there is a contention all n packets can be written into one slot because you are doing it n times faster rate you do not require a cross bar you can read all packets and then write them at appropriate locations cross bar is required when speed of factor is 1. So, even you can build up a hybrid you can do a cross bar and a speed of factor of k. So, cross bar size required will be actually smaller. So, some that kind of a scheme also can be built, but I am not actually looking into that as of now I am worried about the output queued system first. So, how this will be modeled. So, in this queue how the packets are actually coming that is first question. So, in every time slot every time slot it is not that one packet can come in this queue I may get no packet I may get 1 I may get 2 and I may also get n packets in the queue. So, there is a whole batch which arrives every slot and this batch size itself is variable now. So, if you want to estimate a probability that I packets will be arriving in a time slot this probability will be what p is the probability that a packet will be there in a slot. So, on an average n into p these many packets are coming per slot into the switch. Now, each packet is independent which is arriving. So, with equal probability I can assume it will be going to any one of the outputs. So, with 1 by n probability it will be directed to any one of the output. So, from here this guy will get a packet with probability p divided by n from here again p divided by n and so on. So, from any output port will get from any input with probability p by n some total of all possible scenarios has to be equal to 1 that probability that actually will be ascertained here. This is a previously we talked about n minus 1 port p by n minus 1 individual probably outside previously packets. Now, I am not bothered this is a transit switch kind of thing, but you are right I should not be sending a packet back to myself that is usually is true that was I think some other case where we considered this. I will I am actually keeping it n also does not matter because n I will ultimately will be taking n tending to infinity. So, for that kind of hypothetical switch you will try to compare the throughput performance. n cross n that is speed of factor is same as n. Speed of factor has to be n if the output queuing has to be implemented otherwise output queuing cannot be implemented. Why? It will become a hybrid system speed of factor is k. There is a probability finite probability that all packets which are coming are directed to one port and this all packets cannot be pushed to one port unless I am reading at n times faster speed. So, in one single slot I am going to read n packets that is why n times more speed is required inside the switch then only output queuing can be implemented if you are ensuring there is a mechanism or discipline or whatever it is by which you say they will never be more than k number of packets being directed to one single outgoing port where k is less than n. If this can be ensured somehow all your traffic has that thing then only k times speed of factor is good enough to implement the output queues, but then of course you require a cross bar because you are doing parallel transmission here only one packet is being read and one is being transmitted out in one sub slot and there n sub slots. So, all packets are read out and transmitted to all outgoing ports, but there you will be requiring cross bar because they are k. There may be actually n packets coming only k can be read in that sub slots k sub slots are there. What happens to the remaining packet? There has to be some kind of a cross bar mechanism which is required parallel paths. This probability will be this is n c i committorial n factorial divided by i factorial divided by n minus i factorial. This actually comes from basic elementary probability theory. p by n is a packet arrival. So, there are i packets which are arriving. I am saying this i packets. This has to be i. The packets are not directed to me that probability is this n minus i and I call it a i. From here I can find out a probability generating function a z. I will be directly using certain results without proving them because those you can then you have to refer to the probability theory for the proofs. I think each one of you understand what is the probability generating function for a discrete probability. This is a discrete probability. i can only take the discrete values 0 1 2 3 2 n. The probability generating function is usually defined as z raise to power i probability of i. i goes from whatever is the valid values that will be your p of z. That is a p g f. It is like z transform honestly speaking. It is like z transform. But this is a property because once I know z transform and when two variables said, I can actually do the find out the z transform of the combined stuff. I will use those things directly. So, a z in this case will be given by you can actually plot put whatever is this a i. This is what will be a z. So, you can actually solve for this. So, this will be z p by I just include z inside and this is a complete binomial going from i is equal to 0 to n because there are no other possibilities. So, I can write this. This is what will be the z transform. Of course, if n goes to infinity in that case a i will be what? A Poisson statistics. This I think is also a standard result. This is what it will converge to. I remember this probability n c i p raise power you must have done in terms of p and q. So, when you do this your n into p convergence goes to lambda kind of thing must have done that way and this then converge on to lambda raise power i e raise power lambda divided by i factorial. So, Poisson statistics I am actually technically use same thing since it was p by n. So, capital N into p by n in limit will always become equal to p. So, for the Poisson where n goes to infinity your a of z will be e raise power minus p 1 minus z. This also you can get from here. Take this a z this itself can be converted to 1 minus. So, this whole thing will become nothing but e in limit. This is what I have written. This whole thing will be e. So, this will be the second expression. Now, here actually one important thing which is there since it is a batch arrival I am not actually proving I am just stating all the results straight forward. So, q m will be the number of packets which are queued up for the q corresponding to output i. This should be equal to maximum of 0 or whatever was the earlier batch plus whatever were the arrivals in the current time slot for output i which comes from the probability distribution which I had written earlier minus 1 which will be successfully transmitted. So, if sometimes it is possible that you have only this sum is 1 1 minus 1 becomes 0. So, this value can never be smaller than 0. That is why that maximum operator has been put maximum of the 2. So, this is the batch arrival thing. Number of packets arriving for output i in m slot. So, that probability distribution is given by whatever is there. This is going to have this particular z transform A z is nothing but probability generating function for this variable A m i. q m is the q number of packets in the q and this is the time slot. i we are taking as the number of packets. Now, this i is summation after once you do it is all gone. It is a dummy variable. Now, this i is taken out different. This i is for the output. i is very commonly used i and j are used for dummy variables for summation. So, I think you should be able to by context should be able to figure out. So, q m is number of packets in output q i in m th time slot after m th time slot actually after m th time. Because m th time slot you will be getting the packets. This is at the end of m minus first. q m minus 1 in the summation term. Here I am assuming that whatever packets are buffered in up to m minus 1 slot that can also come in the current m slot. So, what is happening is you have a q at m minus 1 slot there was some size. This size was this size q of m minus 1 i in the m th slot what will happen? New batch will be coming. So, that batch will now fill it up. So, this size will be a i m. In this time slot one packet will also go out in m th time slot. So, I just remove this is minus 1. So, this is a size which will be there left at the end of the m th time slot that is what it means. And of course, you can build up a Markov chain and if you try you can solve build up a balance equation, but I am leaving it I am not doing that actually. The Markov chain for this particular q will look like something for example, you are in 0 state. If there is no packet comes you come back to the same state probability that packet arrived is 0. Probability that one packet comes it will also go out in that same time slot. So, at the end of it again you will be this is 0. So, a 0 plus a 1 the same probability is a i which I have done from there. This is no role for us, but anyway I am still describing. I will come here if I have a 2 one of them will go out other one will be queued up. So, that will be the q state I can have 2 I can have 3 and so on. From 0 I can come here if I have a 3 a 4 and so on. If I have a n I can go to n minus first state from here. From 1 I can come back if no packet is there one packet will go out. If there is one packet I need 2 packets to come in because one will be going out. One packet is going out 2 packets comes in a 2 then only I will come to state 2. Sorry one packet sorry it is just to be a 1 here not a 2. Just a minute it has to be a 2 only. This packet will be going out 2 will be coming in. So, you will be in a state 2. You will remain here with a 1 a 1 will go back to state 0 a 0 will stay in 1 only. One packet is this state means how many packets are queued up if there is no packet arriving which is a 0 what will happen this queued up packet will go out. What is your next state? There is no packet now 0. So, 1 to 0 you are coming with a 0. If there is only one packet in the buffer no packet arrives what will happen this packet will go out will be transmitted out. Next state of your buffer will be 0. So, it will be coming back here. So, this is unending like this a 2 a 3 this is standard Markov chain given in all query books. So, for this kind of system which this is batch arrival process I can actually build up. So, this kind of queue I can now build up what we call I basically require what is the probability that you are in this state, what is the probability you are in this state under steady state conditions. So, you can start with building a balance equations and sum of all probabilities has to be equal to 1 with that kind of thing you can even solve this. So, people have done that and in order to represent all probabilities I am representing them by a probability generating function I can generate all probabilities with this all state probabilities. So, q z for this I am just taking the result I am not proving it this will be 1 minus p 1 minus z whatever was the p g f probability generating function for a i that I will process you have to take that minus z. And once you have a probability probability generating function I can find out the mean value. So, from here you can find out what is the mean queue length or average queue length of the output buffer system from here you can find that thing out. So, how you will do it no not later theorem this is a p g f and what is your this is your i bar or a bar you can call it actually this is a mean there is nothing but mean queue length and for this I know this already this expression for here if I can you can take the derivative of p of z this will be i z i minus 1 p of i i goes from 0 to n 0 to infinity and if you put z is equal to 1 what you will get. So, for finding the mean you simply take the derivative of probability generating function and put z is equal to 1. The expectation of i is expectation expectation of i summation of all probabilities will be always yes 1. So, that is why if you put p z. So, p is p 1 is always will be equal to 1 probability generating function at z is equal to 1 will be always 1 because then that is nothing but sum of all probabilities. Take the derivative you can find out first movement second movement third movement and so on and henceforth you can find out any movement around any kind of value that is possible. So, variance also can be estimated with this so, all complete statistics is available here for a discrete system. Now, similar thing does exist even for continuous time variable continuous variable probability density functions. So, we also have something equivalent there also, but I am not bothered I am bothered about only discrete this is a very commonly used technique. So, once I have this I can from here estimate what is q bar. So, I am not solving it I am directly writing a results you can try it out. It comes from standard result of Q and Q. Yes. So, you have to look into either clean rock or any other book clean rock is one of the famous ones Q volumes I think. Clean rock. Clean or clean rock. There are many books available in the library you can search, but this is a standard result for batch arrival process. So, since I am going to use only the result to analyze. So, I am not bothered about the results derivation. So, Q bar will be coming out to be from here n minus 1 by n 2 into 1 minus p again this is a standard result. This result interestingly is nothing, but n minus 1 by n this particular part of the result what you get for a special kind of q's known as m d 1 q's m d 1 infinity q's. This actually means there is a q where arrival is Markovian the departure is deterministic m d 1 q and there is only one server and buffer length possible is infinite here. For that the average value turns out to be always p square divided by 2 divided by 1 by d. So, this value. So, it is nothing, but n minus 1 into what I call the Q thing for m d 1. So, this is the only variation multiplying factor which comes because of batch arrival. What did you mean by m d is deterministic? Deterministic service time is basically constant service time. Deterministic means constant service time. This is not a service time for every packet. One is the Q. One is one Q. Now, what is the infinity? Infinity is infinite buffer length. If there is a finite buffer length you cannot restore you have to drop the packets. So, packet loss probability comes into picture wave. So, what is Q bar? Q bar is average Q length. So, it is this d bar that will determine how many packets will go to the output of the Q. This is d bar factor. d bar is what? The service time. That is a constant slot period. One slot period is deterministic. So, every packet is serviced in one slot period. It takes only one slot for a packet to be transmitted out. For that this is the thing where p is the probability that in the slot a packet will be there. So, this is what you will get. So, n only comes here. The batch effect is here and when n goes to infinity what will happen? n is so large this one can be neglected n by n will be cancelled as f s as good as is m d 1 Q. So, batch effect does not matter. So, that is I think one important thing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . in the output queue, that is what will be the delay faced by every packet and that also can be done estimating. So, technically there will be two delays which will be there participating, you do certain packet you just sit on that packet you tag it and then see what is suffered by this packet statistically, whatever it is suffering it also suffered by other packets. You are picking up any packet randomly and tagging it actually and then seeing what is happening to this. So, to look at all possibilities and from there you can estimate the average waiting time. So, average waiting time w will be two parts w 1 and w 2. So, w 1 corresponds to this will correspond to something even if you arrive there is already buffer has lot of packets, you are arriving in nth slot, but whatever are there in the buffer already they are occupied till this point you will always be coming only in this place in the nth slot these many packets have come. So, w 1 is nothing, but this delay this much you have to suffer you have no other option. Now, the packet which you have tagged in this AMI this packet can be the first packet it can be second one it can be this it can be this. So, I have to find out statistically what is a value remember this delay w 1 and this delay which is going to be suffered here which is w 2 are independent of each other. So, I can simply add them to find out the average. So, w 1 will be nothing, but 2 m minus 1 i those many slots you have to wait. So, that will be your w 1 and if I want to find out an average value I have to just take the bar of it. Once I take the bar of it m minus 1 m m minus 2 does not matter statistically this will be nothing, but 2 m bar which will come from there. So, what is the w 1 z p g f of this will be nothing, but q of z whatever we have solved earlier same p g f will be used here a w 2 is slightly tricky part. So, w 1 is nothing, but 1 minus p 1 minus z a z minus z. So, coming to the next one this slightly tricky because we have to now find out w 2. So, w 2 will have. So, first thing whatever is your packet is coming in a batch of i again i is a separate index here this is not that number output port number now i is again I am using as a new variable. So, the tagged packet is coming in batch of i what is this probability. So, the tagged packet must be coming from one of the ports and this port cannot send another packet. So, remaining n minus 1 packets must have sent what we call i minus remaining i minus 1 packets to this particular device. So, this actually means you will have n minus 1 c i minus 1 p by n is the possibility i minus 1 this is a probability with which your packet will be in the batch of i packet. Where i is the batch size. So, your tagged packet is going to come in batch size of i that probability is this. So, you can solve for this this pretty simple n minus 1 factorial i minus 1 factorial n minus i factorial this I can write as n by p I have just minus 1 I have taken here I can now multiply by i and divide by i. So, I can write i divide by p n c i e by n and this is nothing but i into a i by p. So, what I want is I want to find out that w 2 is equal to k what is the probability. So, for this what I will do is if w 2 has to be k I need to have at least batch size which is greater than k it has to be k plus 1 minimum. So, if for any batch size if it is greater than k plus 1 it should be placed in any one of these always in this slot. If batch size is k plus 1 for example, the probability it will be at this location is 1 by whatever is the was the number in the batch 1 over i. If it was k by 2 the batch size is this much, but I have to place it here this can this packet could have been anywhere, but to be here it is again 1 by i. If I take this much large batch size again this packet is going to come here is probability is 1 by i your tagged packet can be placed with equal probability anywhere, but at k place k plus first place it is going to be place that probability is 1 by i and i has to be from k plus 1 onward to till whatever can be the maximum batch size which is n. So, this actually means this probability has to be nothing, but i is equal to k plus 1 to n 1 over i and probability that the batch size of i will be there this is what will be the probability and this is the interestingly nothing, but so I think we will close here now. So, tomorrow morning what we will do is I will start from here I will build up a probability generating function of this I already have a probability generating function of w 1 I use w 1 and w 2 probability generating functions to find out probability generating function of w when w 1 plus w 2 is equal to w probability generating function of w 1 w 1 z multiplied by w 2 z has to be equal to w z. So, once I know w z I can find out what is the mean waiting time in the queue and I know how this whole thing is going to perform this how I think we model this particular switch. Then we will look into the input queuing part to figure out what is the best strategy for operating input queue. So, what is the maximum throughput which you can achieve in the input queued switch there is a limit you cannot get to one that is not possible because of the contention which happen. See 1 by i is the probability that you will be placed at k plus first position and this can only happen when the batch size is k plus 1 minimum. So, even if you take n batch size what is the probability you will place here is again 1 by i your packet can be equally likely anywhere. So, I am put 1 by i is that probability that you are at a position k plus 1 in the coming batch and this is a probability that you will get a batch of i a batch of i some of all possible things get the average value that is a probability that you will be having w 2 is equal to k.