 Hello and welcome to this first lecture on the course on Introduction to Computer and Network Performance Analysis using queuing systems. I am Professor Varsha Apte, I am faculty member in the Department of Computer Science and Engineering at IIT Bombay. So at this point I would like to remind everybody to please have a pen and paper ready. There will be times in this lecture where I will ask you to just pause the video and write some thoughts for yourself. So it will be useful to have a pen and paper. So the name of the course is Computer Systems Network Performance. So what exactly do we mean by that? I am sure everybody has seen this dreaded loading icon when you are trying to see some movie or Netflix or some even a lecture let us say. Sometimes you will see this loading icon and or if you visit a website you will see some icon which is showing you that the website is still loading. So everybody who has done anything in computers or and used networks have experienced this and this is basically a delay in loading. And when you see this you might say that today my network performance is poor or today this application is performing poorly but what exactly do we mean when we say performance. So this is an excerpt from actually a dictionary meaning of performance. So we all know that one meaning of performance is actually like an art performance of some kind either a music performance or a dance performance or a performance of a play and we might say that the performance of this actor in this play was really nice. Obviously that is not what we mean in this course. In this course the last definition on this slide is the one that is the one that we mean which is the manner in which or the efficiency with which something reacts or fulfills its intended purpose. One way to use this word in a sentence in normal life would be the mechanic evaluated the cars performance in city conditions right. So you are talking about how well something does what it does. So digging a little deeper into this meaning of the word performance. So it is basically about how a system does its function performs meaning does its function given that it is functioning. So this is important when we talk about performance let us say of a car when we talk about performance we will refer to its characteristics like how many kilometers it is giving per liter or how fast it can go from 0 to some 60 or 100 but we assume that the system is functioning. Sometimes in kind of loose language and for the purpose of this course it will be wrong language it can be the formal word for that is actually reliability or dependability. So for example in the car example if we want to talk about how often the car breaks down that would not be a performance matter that would be a reliability matter. And just so that the difference is very clear in our minds these two characteristics do not go together. For example a car could be really efficient or it could be very fast it goes to 0 to 60 in a few seconds but it could just fail all the time like every 3 months it just breaks down you have to take it to the mechanic for repair. On the other hand a car could be very reliable like it just goes off on for 5, 6 months like 5, 6 years you have not had to do anything other than just regular service it has never broken down but it is just basically let us say a petrol guzzler maybe you just needs a lot of petrol or it is basically just slow does not really take a lot big you know go to very high speed. So these are standalone characteristics they do not go together and so we will be focusing on this part you know how well a system is doing its function given that is functioning that is the focus of this course. So let us go further coming back to this dreaded loading icon right. This icon is basically a indication of a delay right something that you are waiting for you wanted to start watching the lecture or the movie right now but now you are delayed. The point though is that delays are not something that is specific to computer systems or network right we face delays in many places in life. So maybe this is a point where on your paper that you have with you you can write down places where you just have been delayed you have had to wait for something. So I will give you some examples here these people are waiting for a train this is some other country where people you know stand in queues like this or maybe sometimes I have seen this at Delhi metro also people stand in queues for the train and they are going to face a delay this person here is going to be you know have some time to go from here to here and also they are just waiting for the train to come from whichever side the train is not here yet ok. Then this is actually a photo of a pole booth and these are all voters waiting to vote and clearly this person here this person here all of these people actually are going to face some delay there will be some ID checking and so on that. So they will spend some maybe hours in the line then we have this escalator here right this is people have come out of this train and there is a crowd here and the people who are right here they got on to the escalator quickly but the people have to wait. Similarly there is this woman I mean there is nobody in front of her but she is still waiting for the elevator because the elevator is somewhere else right. Then we have this road and we all know we have seen traffic jams in our life we have spent a lot of hours in our life on the road. So clearly whoever is here is going to be delayed to wherever they were planning to go right. So just digging a little deeper into the delays why do delays happen? I mean something is common between the 5 photos that I showed right the person waiting for the elevator, the road, the escalator, the pole booth, the train station is there something that is common here due to which people end up waiting okay think about it write it down. So why do delays happen? One reason of course as we discussed during the definition of performance is breakdown right maybe this person here has gone for a lunch break or this escalator just was not working for some time you know there could be breakdown but the focus of this course as I said is not about breakdowns and because breakdowns are not always the reason why delays happen this person could be really working very efficiently really trying to do the ID checks and everything and very busy not taking any breaks but still a line can form right. Similarly this escalator could just be functioning perfectly still there will be a crowd and there will be delays. So it is not always breakdown is not the reason always okay actually more commonly the reason is contention for shared resources. So let me talk about each word what is a resource here? The resource is the thing that everybody is using and we can see here. So for example the road is a resource here, the pole worker is the resource here, the escalator is the resource here and in the previous photos it was the elevator somewhere it was the train right these are all the common resources and they are shared. Obviously the road is not only for one car so if you are living in a bungalow and there is a driveway that just comes to your bungalow then sure that road is not shared by anybody and of course there will never be any delay to get on to that road. If the elevator was like maybe you own the building and the elevator is just for you the elevator could always be parked wherever you just got off. So you are going to go there itself and there will never be any delay. But normally that is not the case resources that we see that where delays are happening those are happening because they are shared and there is contention meaning people are competing for the resource they are all vying for the same resource they all want the same resource they also want their desire to use the resource comes at the same time. If it also came very regularly at different times then also there would not be any problem but that contention meaning it is a competition and it is a desire to use the same resource at the same time that is the root cause of delays ok. So sharing results in building of what is what we in general also called queues and in computer networks also we will see queues sometimes of course they are just like crowds but in some abstract sense there is a queue there is no order but there is a queue for the shared resource and queuing is what results in delays. So what do delays depend on ok let us keep further thinking in general life ok. So here for example what is what are all the factors that will determine how much delay this person for example will face. So there are many things one can think of but the main common ones I will list obviously one thing that will come to our mind is the speed right. So how long does the poll worker take to check the ID or whatever of one person right. If it is 1 minute per person the delay from here to here for this person will be less if it is 5 minutes per person it will be more simple as that right. So how speed is of course a rate so you know can the poll worker check the IDs per hour versus only 10 IDs per hour so that is the speed ok. Then number of resources you can see here there is there seem to be 3 lines 1, 2 and 3 that means there are 3 desks where people are checking the IDs. If there was one more here you know one more here then clearly there will be less delay ok. So the number of resources matters similarly here you can think that if there was one more escalator on which people could go up there could be less delay. Then the next one is workload intensity what do I mean by workload here it is basically the amount of work it is the same meaning that we have in normal life what is the workload that is coming to this poll worker meaning you can say how many people per hour are coming to this polling station ok. Clearly if everything is the same there are 1, 2, 3 desks and the speed of the poll worker to check the IDs is the same even when all of these are the same the rate of people coming to the polling station per hour will impact the delays. So if there are say you know 200 people coming per hour versus 500 people coming per hour so 200 arrivals per hour versus 500 arrivals per hour the delay will be different because the lines will get longer right for 500 the line will be longer for 200 the line will be shorter even if rest 3 are the same. So one is that is the intensity this is some sort of a rate of work coming to the resource this it will depend on this it also depends on the nature of the workload ok. So just give your attention to this example here. Here consider two conditions one where if 10 persons arriving per minute to this escalator versus 100 persons per 10 minutes ok. So 10 persons per minute and 100 persons per 10 minutes this is actually the same rate but the nature of arrivals is different right. So if the train here is coming every 10 minutes ok the train here it is this is a realistic example maybe the train arrives every 10 minutes and when the train arrives 100 people get out of this right 100 people come out of this and then they queue for this escalator if that is the case then the crowd will form but if you can think of 10 persons per minute coming here 10 persons does not look like there will be much delay they will be able to go up this escalator pretty fast versus 100 persons every 10 minutes. So in this case the rate or the workload intensity is actually the same but the nature is different ok and this kind of second thing is called bursty means there is a sudden burst of work. So if there is a sudden even in this case for example if whole morning nobody came and 11 am suddenly you know like 1000 people landed up here right like then the line will be very long right. So the nature of workload is important as a and not only the overall rate. Lastly the resource sharing policy or what we call scheduling policy in computers and networks that can also make a big difference what do I mean by that consider these 2 examples ok. Here this is a resource it is being shared anytime there is a resource and it needs to be shared you should have a rule about sharing it right the policy means some kind of a rule. So first come first serve is one kind of a rule it is also called a scheduling policy. So here obviously it seems like it is first come first serve. Here it is there seems to be no policy right no rule people are just going whoever can push ahead is pushing ahead. So clearly there will be some difference in the delays here. Here it will be a little more predictable here it will be a bit unpredictable. So now also compare these 2 roads right. Here there seems to be a very clear sort of lanes and they are all standing behind each other. So we expect that the time for the cars to go from here to here will be different probably shorter than whatever is happening here where there seems to be the road is shared by moving cars by parked cars by people there does not seem to be a clear rule on where should people be where should park car be is where should moving cars be. So we expect maybe more delays there right. So the sharing policy is very important resource sharing policy and that will also affect delays. Now why did I talk about all of this right this course is not about roads and escalators and elevators and all that. The reason we talked about this of course is that the root cause of delays in computing systems and networks is the same. It is the fact that there are shared resources and because there are shared resources there are queues ok. So again in your notebook think of some resources here is where it is useful to recall the prerequisites for this course you know the OS networks all kinds of undergraduate prerequisites. So think of hardware computer hardware also there are many resources ok. Most simple resource that comes to mind is CPU and when you think of a of any resource think of who uses it ok. A CPU is used by whom if you remember your operating systems the entity that is actually scheduled on the CPU it is called either a process or a thread right. Or you can think of a network link right a network link what is it that actually goes on a network link in terms of computer networks I mean you can think of many things it is you know electromagnetic signals and so on. But a computer networking view of link should suggest to you that the thing that uses links are packets. So in this way we have we can think of resources and users and these are shared a CPU is never in a modern CPU is never only running one process or one thread it is running actually hundreds of processes and hundreds of threads. And there can be only one CPU and hundreds of threads and they have to wait their turn to run on the CPU. So there are delays packet lots of packets go on the link and if many thousands of packets come to one link at the same time like happens when you are downloading a file or something then there will be a queue. So here are little more detail of that example look at the first example of a packet queue for network links. This is basically a network here these are switches and there are links shown and this is here an IP camera that is connected to this switch. Let us imagine that there is one more switch here one more camera here let us say there is one more camera also sending. So this IP camera will be sending packets here this IP camera will be sending packets here and let us imagine that all of this is going to this router here. So if all of these packets are going on this shared link this is basically shared then a queue will form on this outgoing link there will be a queue. Similarly you can consider this computer and this laptop suppose they are both talking to this laptop they are both suppose this laptop is downloading a file from both these computers at the same time. So again this computer will send packets here this laptop will send packets here and both these will be queued will be wanting to be sent on this link. So a queue will form here. Similarly there are when we go to a website we send an HTTP request if you remember again remember your application layer protocols what goes to a website is HTTP requests or web requests. It is a web request going to a web server a web server is nothing but a process with multiple threads running on a server machine. So here I have shown four lines to represent four threads. So suppose these are all busy right now working on some request then the next request that comes here will have to queue and this will basically be a buffer some in the computer memory. These requests will have to be just place somewhere in the computer memory and this will result in delays. Similarly the CPU itself like I said in the previous slide the CPU itself is a shared resource and in fact these threads these threads are soft entities they have to run on a CPU right. So these threads will be the ones actually contending right contending for the CPU. So this can be thread 1, thread 2, thread 3, thread 4. So if we again think about the resource and the queues that form in front of that this is what leads to delays. When you click on your YouTube link sometime and you see the this loading icon somewhere here in fact this shows the whole journey that the packets would be queuing somewhere in some switches. First your request will queue for the thread the threads might be queuing for the CPU. Then even if the machine starts sending packets the packets might queue on so many routers all across the world until they come to your laptop or your mobile phone. So it can lead in sometimes it is fast sometimes everything is nice so there are not many queues but sometimes there will be delays and they will be very perceptible to us. So this is just putting down the pictures in the previous page as a list with some more examples we already saw the CPU and the thread as a resource we saw the web servers threads and the HTTP requests. Here in fact there is an interesting thing here that in this example the threads are a customer or a user. Customer is a word we often use to make up to describe these users and the things that queue for resources in a very general terminology if you want to use we sometimes use the term customer. But you can say the thread or the process is a user of the CPU but it also is a resource itself for which HTTP requests or web requests queue. So a resource can sometimes be a customer of another resource or user of another resource. We saw this link example with IP packets as the users. Similarly we can have a wireless medium many of you who are watching this lecture might be on a wireless medium and currently your laptop will be downloading these packets. The packets will be coming from a Wi-Fi router to your laptop and so the wireless medium is a resource it is being shared by possibly your laptop and many other laptops which are on the same Wi-Fi network. If there is nobody on the Wi-Fi network then your YouTube video is the only one using the network but if many people are using the same Wi-Fi then it is a shared resource ok. So the users are frames at the link layer packets are called frames right. So we call them frames here. Printers are often shared and then the print job is the user. This is another interesting example where we have a web server threads again become customers for a log file. Many times server processes write something to a log file like what time did the request come, how long did it take, what time what type of request it was. So when it does that all the threads have to use a common log file. So then this log file is a resource because if another thread is writing to that log file the other thread who also wants to write to that log file has to wait. So there is actually a queue of threads waiting to write to the log file ok. Another very important example is cellular network channels. So when we use our mobile phones and make a normal cellular call on our mobile phones they actually go on these things called channels which are owned by the cellular operator and the user entity there is the call itself. The channel has to be given to the entire call and sometimes if there is a lot of traffic nowadays it does not happen much but if there are not many channels and there are too many users some emergency has happened everybody is trying to make a call you will get a network busy signal right. You will get on your phone actually a message say which says network busy that means all the channels are busy ok. So these are all the resource and user pairs and it is useful to think in terms of these pairs. Clearly there is a notion of performance right that exists for all of these use resource user pairs right. There are the notion of performance is often seen as a delays we often say something is slow or something is fast that is one very common way that we describe and we talk about performance of a computer or network system. But can we formalize it a little more can we talk about a few performance metrics like the time to load a web page that is a metric. Similarly all of these just as we discussed the delays depend on number of shared resources, the speed of the resource, the workload intensity can be for each of these systems actually the ones that we listed here. Can we be more specific the earlier discussion was in the context of roads and escalator and elevator and pole workers and things like that. Can we talk in terms of computer systems and networks and identify some parameters on which these are the factors on which the performance will depend on ok. So this is what we will do in our next lecture and thank you for listening.