But the window doesn't stay constant, right. The, the window changes in size depending upon the congestion conditions that the end host is infering. so the CWND should grow for instance if there's no congestion we should be able to increase it and that helps us to more efficiently utilize the network, right. So if there is Not, congestion right now, and everything's working very well, then why not send more if we can. And TCP advocates a linear increase in the congestion window specifically increments by one each time. So the idea is that if you send out three packets as the sender, it goes through the receiver, the receiver gets all three, right. time two over here, we're saying the receiver's getting all three and sending the acknowledgements back, then at time three. We receive all three of these acknowledgements in order, this would be for this packet corresponds to this one, this packet would correspond to this one, this packet would correspond to this one. Within reason there's reordering and things that have to go on but that's the main idea and then we can increase the congestion window by one right because we got all the packets back. so let's increase it and send a little more. Let's try to stretch the, how much we can send each time. So, we increase it by one if all the outstanding packets are received or equivalently understand that we can increase it by one over the current window size for each packet that comes back and that would have the same effect. So, we do CWND and then we add one over CWND and then there's CWND packets, so it's really just adding one. This is just CWND, plus1 . So for instance, if we have three outstanding packets, Right? so we sent 3 right here. then, For every one that comes back, we would take 3, and we would add 1 3rd and then 1 3rd for the second one. And then 1 3rd for the third one then this all becomes one so then that just becomes 4 and then, if it was 5. For instance, we take 5 plus 1 5th plus 1 5th plus 1 5th plus 1 5th plus1 5th, then that becomes one, and that goes up to five. So that's how you can implement it packet by packet and of course you wouldn't see the effect of it until you got, sorry this is 6 not 5, 5 plus 1 is 6. [LAUGH] So, but you wouldn't see the effect of this of course until you got all the packets back, right, because you can't send just a fraction of a packet. You can't send 1 5th of a packet because they all have header and control information as well. And note that this is happening in addition to sliding. right, so. We're sliding the window, right, and we are doing this addition, right. So if we have three packets currently out right now, then we would once we receive one acknowledgement back we slide the window and we can already send another packet. Then when we receive another acknowledgement back we can send the next packet. We receive another acknowledgement we can send the next packet. Then the window goes up and that's at the point that we send the fourth packet once the window goes up. So then we have four outstanding packets but it's, it's happening all at the same time. So the window is sliding as we've said before. The window slides each time we receive an acknowledgement. And then you send more packets out, and then the window size also will increase, if all the acknowledgements come back. So, we can also visualize this in a space-time diagram which is an interesting concept here. This is that space is across between these two lines. which denotes the network, space denotes the network. And time is coming down, so this is what's happening over time. Right, so initially supposed CWND is one. So we send the data and we get an acknowledgement back. That acknowledgement increases the window size to two when we receive that acknowledgement we send two packets out instead right away because now the windows has this too. Now this packet comes back, right, and it gets increased by 1 2, okay, then a, as soon as this packet comes back we can already send the next packet out. Then once this packet comes back we can send the next one out because it is increased by a, another, but it is also increased by another half which means that we can now send one more packet out. Right, and then all these three similarly, once this first packet gets back, that's 1 3rd, so that would cause one more packet to come out, when this packet gets back that's another 1 3rd which would cause one more to come out as well. Because the window slides, but then once the third packet comes back The window slides, but then also increments by one so we, then we have four packets out once cwnd is four. so that's the idea. Now if there's, there is congestion, right, so if we detect that there is congestion, we have to reduce the window size right. So we can't just Keep increasing it like this or else we're going to come, go into something like an arms race where we're all just trying to send as much as we can, at one time. TCP advocates a multiplicative decrease of the window size. Okay, so we want to decrease it for instance by half, right, so we want to half the window size. kind of like this weighed binary exponential back off worked, with when we talked about the CSMA. So the cautious growth aspects of this window size is that we want to additively increase it and multiplicatively decrease it, right. And it's this is obviously cautious if it was the other way around, it would be much more aggressive, or we would have multiplicative increase an additive decrease which wouldn't work well at all. This is generally accepted as the better way to go, the more cautious size. And we can draw another analogy to DVD rentals here, not Netflix specifically. It come be some rental company does this, but so they increases your allowance slowly as they return and they build more of a trust in you. Or kind of like your credit card allowance, how much you're allowed over time if you keep paying your bills they'll increase the amount that you're allowed to spend on each credit card. And then if you don't pay your bill on time they might reduce the amount or charge you more money but, your DVD rentals as we talked about DVD before. If you're currently, currently you're allowed five videos out and let's say you return all of them and let's say now you can take six out, right. So, then if you were to turn all of those six eventually they would say okay well now you can turn seven out. But along the way every time you return a movie you can still take another one out but it's not until when you return what the current window size is of amount of movies that you can take only one out. So, once you return the second, then you get a second one out. If the window size is currently three then once you return the third one, you can take a third one out and you can take a fourth one out. Now, suppose, for instance, that you didn't return all of them, right? So now, suppose you currently had a window size of four, right? So you had, four movies out and then you only returned two of them and you never returned the other two. Well, then they might say, okay, well, we're going to cut your allowance down to two now as a penalty, 'cuz you never gave us those two back. And then you can only have two out of negative at a time So you return these two the window slides, right,and you can have now two packets out only.