Getting the transcript
Reading the captions from YouTube. A video nobody has opened here before takes 10 to 30 seconds; this page fills in on its own.
Reading the captions from YouTube. A video nobody has opened here before takes 10 to 30 seconds; this page fills in on its own.

freeCodeCamp.org · @freecodecamp
Where viewers went back to watch this video again, from YouTube's public Most replayed graph, lined up with what was said at that moment.
Most replayed moment #1
44:192.3x the video's typical replay level
example, if I for this case if I fixed this bit as zero, then how many address it can form? It can form either 0 0 or 0 1. That's it. Just two addresses. This was the case one. As you know I
Said at 44:12
Most replayed moment #2
22:102.1x the video's typical replay level
complete graph? That each vertex is connected to another vertex. For example, if you take like this, then this vertex should be directly connected to other vertex present. So
Said at 22:03
Most replayed moment #3
59:061.9x the video's typical replay level
will be like a town in between. So what happens? The sum is 32 bits and the total IP address is 32 bits. So out of 32 bits, 8 bits will be given to NID and 24 bits will be given to HID. So there will be 256 networks and each network will have
Said at 58:59
The graph counts replays. It does not show where viewers stopped watching.
Words
21,033
Runtime
12:18:39
Speaking pace
28wpm
Reading time
88min
28 words per minute, below the 160 25th percentile of 349 measured videos. That distribution comes from the 349-video hook study.
Opening (first 30 seconds)
This course covers the fundamental concepts, protocols, and architectures of computer networking. You'll journey
14 words, the words spoken in the first 30 seconds at 28 words per minute.
Free, no signup. See how the first 30 seconds hold attention, with rewrites.
Sentence shape
| Measure | This transcript |
|---|---|
| Sentences | 2,019 |
What this transcript is
Every word below is the caption track YouTube publishes for this video, pulled from the video itself and reproduced unchanged. It is not Prepublish's writing, not a summary, and not a re-transcription: it is the video's own published captions. English captions, generated automatically by YouTube, in the video’s original language. Source: the video on YouTube. A channel that would rather this page did not exist can ask for its removal through the contact page, and it is removed.
This course covers the fundamental concepts, protocols, and architectures of computer networking. You'll journey through the entire networking stack, exploring how data travels from physical media access control up to complex application layer protocols like HTTP and DNS. You'll learn about technical mechanisms including error detection through CRC flow control strategies and advanced IPv4 addressing techniques like cider and VLSM.
By mastering topics such as TCP congestion control and routing algorithms, you'll gain the deep theoretical foundation and practical problem solving skills necessary to navigate modern internet communications. >> Okay. So, this will be an orientation class. I'll be discussing the curriculum and the methodology we which we are going to follow and what I expect from you what are the prerequisite you require to attend the course.
So I'll be discussing all these things in this orientation class and I'll also give you the basic idea what is computer network and how the course is going to proceed. what things which you are going to study in this course. I'll give you that basic idea. For the first 10 minutes, I'll be just overviewing the syllabus. Okay. So, let's move forward. This is me. You all know me from the operating system course which we uh which you all people attended last semester.
So, I'll be your sailor for the journey through the network fundamentals. I'm Shatter Sharma and we will going to discuss all the major concept included in the computer network course from physical media access to the application layer protocol and I also added a bonus module of security. So we'll explore how data travels across network. We'll examine the protocols involved, how error is handled, routing mechanisms and the security consideration that make more internet communication possible.
And one more thing before I move forward that I'll be sharing these lectures online too recorded lectures the polished and edited ones obviously and I'll be removing the message which you all share. So the people online on YouTube or Udemy or Udemy won't be able to see that. So won't be able to see that. So you can you can ask your doubts without any ask your doubts without any hesitation. hesitation. Now for whom this course is meant for first of all this is absolutely enough for GATE.
If you are a GATE aspirant then you can blindly follow this course. I have completed each and everything which is included in the GATE service in this course. So the people online on YouTube course. If you are a university university university student who have computer science major you can attend this course or if you are preparing for any job interview courses like computer networks DBMS operating system these are very very critical.
Now for people who don't know how I teach or what is my methodology then let's discuss that first I'll be discussing you theory but I don't like slides and all so I'll be teaching you raw pen and paper style and I'll also give you the reading material notes slides DBP reading material you will uh you'll be provided so firstly we will discuss the theory and then we will practice I will solve some problems in front of And then you have to solve the problem which is given in DPP.
Now you will not attend the class without solving the DPP. You have to solve the DPP first. Ask the doubt in the class itself and then we will move forward. And before moving to the next topic, we are going to revise it with the help of a short notes. So this is the method which we are going to follow theory practice DVP and revision. Okay. Now in this class I'll be teaching you the basics of computer networks and so that you will get an idea what you are going to study in that course and in the next lecture we will begin with the core computer network which is IP4 addressing architecture.
We will be learning the foundational concept the IP addressing fundamental structure what is classful addressing classless addressing what is uniccast multiccast broadcast communication how subnet marks mask work how networks are segmented we'll learn about classless interd domain routing a variable length subnet masking supernetting and efficient IP address allocation strategies this will be a big module okay the next module which is a bit shorter than the first is error detection and correction.
We'll begin with a simple concept like a simp simple parity. Then we'll move toward more advanced concept like 2D parity check some CRC and Hamming code. Okay. The third module will include flow control mechanisms. Okay. So that a synchronicity is uh maintained between sender and receiver that sender do not increase the speed that receiver cannot handle. or these kind of things which we are going to study in the flow control mechanism.
We'll study the three three important protocols stop and wait, go back end and selective repeat or selective reject. Then the biggest module of computer network transport layer protocols we are going to study TCP and UDP. Then the next module of media control protocol media access we'll be discussing three type of media access control protocols. MAC protocols, random access, controlled access and generalization. In random access we are going to study Aloha, CSMS CD, CSMS CA, controlled access, reservation, pooling, token passing and in generalization, FDMA, TDMA and CDMMA.
I'll be telling you the important concept which you have to focus more then the routing and switching fundamentals. Okay. Now regarding that prerequisite I was talking about the prerequisite is data structures and algorithm course is there anyone in the class who have not attended the DSA course from the previous semester okay so most of the people have attended the course so I'll be discussing some of the algorithms like belman Ford Dra algorithm and all these things you should know what is a Q what is stack and all these things.
Then we'll move toward the switching techniques, circuit switching, packet switching, what are virtual circuits and datagramgrams. We'll be discussing these things in this module. The next module is of application and support protocols. We'll be discussing protocols like DNS, SMTP, FTP, HTTP, ARP and DHCP and then ICMP. Okay. So this was the complete module which we are going to discuss in the computer network course.
So this was what is in your curriculum. Now the bonus module will also include the cyber security part. How security is maintained among them among the networks. We will be discussing all these things also. So first we will learn about the IP4 addressing. The next module contains error detection and correction. The third is flow control mechanism. Fourth one is transport layer protocol. Fifth one is media access protocol and the sixth one is routing and switching fundamentals circuit switching packet switching.
These are important application and support protocols and then in the end we will discuss the security part as a bonus module. Now the resources or the references I have taken for making this course is the primary textbook will be foren. This is the bible. You should have a copy of frozen with you if you want a more better understanding. For the people who have time and are planning to build a career in this, they can also read tenbomb in that in-depth theoretical foundation is there.
And for people who are like absolutely crazy and want to read all these three books, you can also read the alternative perspective book top down approach. Okay. So this was all the curriculum which we are going to follow and know if you have any doubt regarding the curriculum or you want to ask anything you can ask now. Okay. So no doubt we are going to move toward the actual learning. Here is our pen and paper setup.
So we will learn computer network basics in this lecture. This will be a lecture zero and from the next lecture we are beginning the IPv4 addressing. What is computer network? Yes. Yes. Okay. So, let me give you a bit of formal definition. We call it as a telecommunication framework. Telecommunication framework. Framework for what? Framework which allow digital devices which allow digital devices to interact. We call it as nodes also.
Digital devices or nodes to interact. And the interaction can be either wired or it could be wireless also. Now interaction for what? Why do they interact? To share resources to share resources which could be either hardware or software. So this is a formal definition of computer network that it is a telecommunication framework which allow digital devices or nodes to interact which could be in a wired medium or can be in a wireless medium to share resources which could be hardware or software.
Internet can be example of internet is a prominent example of computer network. Okay. Now in computer network we let these nodes interact and share data. So data communication is a very important part. Data communication. Now if I ask you the component of data communication what would you say? Let me give you a hint. First component can be the sender. What could be the second component? Tell me. Receiver obviously. The third can be content or we can also call it as message.
Fourth the medium, the transmission medium. Tell me the fifth one. Think we have a sender, we have a receiver, there is a transmission medium, we have a message. Think what else is required that they can communicate with each other effectively. Correct. Michael said it. Rules. We call it as protocols. Protocols for what? For synchronization. What is synchronization? I told you the definition in OS course. Yes. To do something which is already agreed upon.
So these are the five components of data communication. We need a sender, we need a receiver, there should be message that need to be communicated, medium and protocols for synchronization that governs the data communication. Now third thing effectiveness. When do we say that one network is more effective than the other? This is reliability. No reliability is not considered to be uh a metric for effectiveness. Why? For example, in transport layer in in transport layer, we are going to read about two protocols TCP and UDP.
There you will learn that UDP is not reliable but still it is uh significantly used. So reliability is not a metric for effectiveness. Think something other. Yes. Delivery. Rebecca said it right. Delivery. What do you mean by delivery? That the data must be delivered to the correct destination. Correct destination. Okay. Second thing, integrity or you can also call it as accuracy. That data should not be modified in between because integrity is a word used for intentional modification done by some uh some [snorts] person with mal intentions.
Intentional modification while accuracy is a term used to prevent errors. So data must be delivered accurately. Delivered accurately without errors. Modification is not considered [clears throat] an error. That's why we don't use the term integrity which you have mentioned there. Third, what else can be the property? Time constraint or we can call it as timeliness. Data reached after the deadline may be useless. So data must be delivered in timely manner.
Delivered in timely manner. Timely manner. Fourth point. Let me tell you the fourth point. It is jitter. What is jitter? You may have noticed that sometime there's a mismatch between audio and the video. when you are watching a movie there could be a mismatch between audio and video. So the uneven delay uneven delay is what jitter is. So uneven delay should not be there. Okay. So these are the four matrix for effectiveness.
Now let's learn about transmission modes mode. Simplex, duplex and you can write it as half duplex and full duplex. What is simplex mode? Try to guess with the name. What is simplex mode? What is half duplex and what is full duplex? Okay, someone has written simplex is unidirectional. That's right. Then what is half duplex? They are writing birectional. Then what is full duplex? Again birectional. Then what is the difference between half duplex and full duplex?
H they have written it correctly. Birection half duplex is birectional. But it is like a single lane that either you can talk like this is sender one, this is receiver or you can call it as person one or person two. They are talking over a walkie-talkie. So while you talk over a walkie-talkie, you cannot both talk simultaneously. That's why you use the word like over and out so that the other person may know that the first person is not going to speak in between.
Are you getting the point? Unidirectional transmission means you are watching a TV. You're listening to a radio. Half duplex means you are talking over a walkie-talkie. Each station both can transmit but not at the same time. So when one device is sending the other can only receive and vice versa. While what is full duplex? The telephone that we use the telephone uh during talking over a telephone both the person can speak simultaneously.
So this is what full duplex is. I hope you are getting the point. In simplex there's only one lane and only one directional movement is allowed. In half duplex there's only one lane and one direction movement is allowed at a time. While in full duplex it is like a two-lane system. Okay. So this was all about transmission mode. Now network criteria, network criteria. Here we discuss about the reliability factor. Reliability.
What is reliability? Can you can someone give me a formal definition? We all know the meaning of being reliable and all but what is reliability according to a definition lesser failures we we call it as lesser frequency of failures failures and one more point should be added. Yeah, failure thing has been already mentioned. What should be another thing which reliability have in its definition? H resolution of failures.
You have written correctly. Lesser time in resol resolving the failure. Time taken to resolve these failures should be less should be less. The second point is performance. Performance can be measured using there are different metrics you can use transit time, you can use uh response time, number of users, transmission medium, there are multiple metrics. The security okay what about security? Protecting the data from unauthorized access.
You must have name, you must have heard the name of CIA triad. What is CIA in security? In context of security, what is CIA? Can someone give me the full form? Yes, correctly. Confidentiality, integrity and this is authorization or authentication. What is it? And what is the difference between both? Is it authorization or authentication? Author authorization or authentication? Because some people are mentioning authentication, some are mentioning authorization.
What is it and what is the difference? This is your homework. So what is security? Includes protected protecting data from unauthorized access from damage and modification. Okay. Now there are different types of connections connections. It could be uh pointto-point. It could be point to multipoint. What is multipoint connection? That one computer is sending data to different other computers. Is it necessary that all all of them should be in the same network?
No, it's not necessary. One computer from one network can send to multiple computers in a different network. This is also included in multipoint. We are going to read more about it when the time will come. Okay. And what should more be taught in the basics thing? Well, you can learn about uh topology. You can learn about topology. What is topology? Have you heard of this name before? Yes. Perfect word layout. Layout or you can also write it as uh geometric representation.
Geometric representation. What are the different type of topologies? There could be pointto-point topology. There could be a bus topology in such manner. There could be a ring topology. This is ring topology. There could be star topology. There could be a tree topology you know in a hierarchal fashion. Tree topology like in this manner. This is tree topology. What is mesh? Mesh topology. This one is mesh topology. And there could be hybrid a mix of all of them.
So this is what uh topology is the physical layout or geometric representation. We can discuss more about it. Do you want me to discuss more about it or we can just move forward? Yeah. So there's a one question that has been uh asked that in an exam of a mass topology uh the number of link was asked. Okay. So let let's discuss let's discuss them one by one. So let's start with the mesh topology. What is mesh topology?
Have you heard of the term connected graphs? Connected graph each vertex is connected to another vertex directly. Directly. So connected graph is like from one vertex you can reach to another vertex. So this is what connected graph is. But this graph is also connected. We don't want connected graph. We want completely connected graph or complete graph. What is complete graph? That each vertex is connected to another vertex.
For example, if you take like this, then this vertex should be directly connected to other vertex present. So this link, this link, this link, this link. So if there are five vertex there are five vertex in this uh pentagon. So if there are five vertex each vertex can be connected to maximum of four vertice vertices. So if there are n vertex each vertex can be connected to n minus one. Okay. So if each vertex can be connected to n minus one vertices, then how many total links will be there?
How many total links will be there? n c2 or you can write it as n into n - 1 by 2. So here in this case where we have n= to 4, how many total links will be there? 4 into 3id 2 that's 12x2 equals to 6. So six links will be there. In some very bas basic exams or easy exams these questions could be asked for fun marks. So in my topology total NC2 links will be there where n is the number of vertices. Okay. Now let's discuss what is the advantage?
Why do we use different type of topology? Why can't just we remain to any arbitrary topology? Why we are using these specific ones? So because there are several advantages associated to each of them. For example, mesh topology. What is the advantage of my topology? Why are we using? Can anyone guess the advantages? Yes, correctly. So, we have one advantage mentioned traffic issues is less traffic issues not there. So, that's one advantage.
What more advantage you can think of? Yes, Rebecca mentioned fault tolerance or robustness. Robustness anymore. Okay. You can also for example for extra point you can write fault identification is also easy. Is also easy. Okay. So what is the disadvantage you are looking? What is the disadvantage you can think of for me topology? Disadvantage. Yes. Expense. Wiring bulk or expense. Same point. It's been written. Wiring bulk.
Think of some other point. Difficulty in installation. Yes, this could be a point. Difficulty in installation. Okay. So this was for mesh topology. Now this was mesh topology. Let me write mesh tree. This is star ring bus pointtooint. Let's move to next. Next star topology. In star topology we use a device named hub. So no device is connected directly to each other. For example, this device D1 want to send data to device D3.
Then it won't send it directly. It will use hub. So D1 will send to hub and then hub will forward it to D3. Okay. So advantage could be it is easy to install, reconfigure. Fault identification is easy. You know it's it's it's robust also in a way if you look at that failure of one link will not going to affect the whole setup and it is less expensive than me topology. But the biggest disadvantage which you can directly look at is if hub is gone then the whole system collapses.
Okay. Now next topology could be you you know bus topology. must include a central backbone. Central backbone. So again the direct disadvantage is if something happens to the backbone the whole system collapses. [clears throat] So so this is a long cable. This is a long cable which act which act as a backbone. And the from the point where these are connected is known as drop line or the this link is drop line. This point is step.
This is drop line. Well, this is not so so important. You I'm just uh explaining these topologies because so that you can get an idea otherwise it's not very much important. Other could be a ring topology. Here it is ring topology. What is ring topology advantage? Simpler installation reconfiguration. A single point of failure can going to affect the whole system. So this could be a disadvantage. Okay. Okay. So in ring topology what happens?
Each device each device is connected directly to the two adjacent devices forming a closed loop. And the one specific thing which [clears throat] is uh only associated with ring is data travel in one direction only. So data signal travel in one direction through each device until they reach their destination. Each device functions as repeater also. So if data reaches to this for example D1 send want to send data to D3.
So what D2 will do? D2 will look at the data. This data is not meant for me. It is going to amplify the data. It will act as a repeater going to amplify data regenerate the signal before passing it to the next. So this was about ring topology. Okay. There are several topology you can look at it. You can search you'll understand it just by Google search you will notice. Okay. Now let's move to the biggest problem is that is for example I have a system in some different architecture.
I want to communicate with a system of some different architecture. Can I communicate directly? No. This doesn't happen. You won't be able to communicate directly. So now what is the solution? We need a model. The OSI model proposed by ISO. OSI model open system interconnection proposed by ISO international standards organization that model is going to enable communication between different system irrespective of their underlying architecture.
So it will be a conceptual framework conceptual framework a conceptual framework for creating a robust and interoperable network architecture. So this is not not some kind of protocol. This is not a protocol. This is a model. It's a like a framework. Okay. And it is a it work on a layered architecture. Layered architecture. So we will have a different different layers and we are going to study each layer in detail. Okay.
So there are different layer. Each layer is going to communicate with the corresponding same layer of different system. For example, let me draw a diagram so that you can understand better. For example, this is device A. This is device A. This is device B. Both have different architecture. Okay. So, we will need uh let's say router one here, router two and they are connected like this. Now, what happens? Device A have this layered architecture.
It have different type of layers like application layer, presentation layer, presentation layer, session layer, transport layer, then network layer. You have to remember all these names in sequence too. Network layer. You can create some pneummonic to learn data link layer and then in the end physical layer physical layer. Now what's going to happen? This device B also have the same set of layers. Now what happens? The application layer of device A is going to communicate with the application layer of device B.
We call it as peer-to-peer connection or peer-to-peer protocol. peer-to-peer protocol. Same happens with the presentation layer. Same happens with the session layer. Same happens with the transport layer. And same happens with the this device and the intermediary node. For example, in router, we reach or we require the services till network layer only. We don't require the services of transport layer. So, let's make it a single router.
R1 okay or R and then here the physical layer. So network layer is going to communicate with the network layer of router and same happens like there. Okay. [clears throat] So what happens is when teacher teaches you can in the beginning can understand the OSI model you can go like this you understand the physical layer first and then network data link layer network layer and then this okay so what approach we are going to follow is we'll first understand the services provided by these layers application presentation services a session layer.
[clears throat] Okay. So what approach we are going to follow is we are going to first understand the services provided by these layers and then when we have clarity of what is flow control, what is error control, what is framing, what is segmentation. then you will better understand the functionalities of uh or the how these layer work as a whole to provide the OSI model how these layers coordinate with each other okay so we are going to first understand the functionalities of these layers and then we'll understand how they communicate with each other how they in share data with with each other and they become the OSI model as a whole is video clear and voice audible Okay then.
So the last lecture was lecture zero. Today is the lecture one. Let's revise what we have learned yesterday and then we'll continue for IPv4 addressing. So what was computer network? It was a telecommunication framework. It was a telecommunication framework which allow digital devices to interact with each other. interaction could be wired or wireless to share resources which could be hardware or software. Regarding the components of data communication, we have sender, receiver, message, medium and protocols.
Effectiveness, four metrics were there. Delivery, accuracy, timeliness and jitter. And for transmission modes, we had simplex, half duplex and full duplex. Simplex means unidirectional like TV or radio. Half duplex means birectional but only data can travel only in one directional at a time like a walkie-talkie and a full duplex means like a telephone. And for network criteria we learned about reliability, performance and security, type of connection, pointto-oint and multipoint.
And then we learned about topology which was the layout. We learned about different topologies and then in the end we discussed the OSI model introduction the conceptual framework. It was a layered architecture. We learned about different names of the we learned about the names of the different layer. And today we are going to start with the functionality of network layer which is IPv4 addressing. But before starting let me ask you do you know about binary numbers?
Yes most of the people know about binary numbers which include zero or one. Do you know about the representation 0000 means 0 and 001 means 1. Okay, I hope you all know that because the IPv4 addressing will be totally based upon the representation of binary numbers. If you do not know them, you can leave the class first understand how binary representation is done and then watch the recorded session. Okay. So 0 0 0 is 0 0 0 is 1 is 1 0 0 1 0 is 2 0 1 1 is 3 okay this is how it is representation let me also explain how it is done for this place 2^0 for this place 2^ 1 for this place 2^ 2 and for this place 2^ 3 so if I write 1 0 0 0 this mean 1 into 2^ 3 plus 0 into 2^2 2 + 0 into 2^ 1 + 0 into 2^0 this will be 8.
Okay. For example, if I write like this 0 1 1 then this means 0 into 2^ 3 + 1 into 2^2 + 2^ 1 + 2^0 this is 4 this is 2 and this is 1. 4 into 6 + 1 7. Okay. So when I had three 1's from the right side then the value is 2^ 3 - 1. Let's say if I had four ones from the right side then I have value of 4^ 2 power 4 - 1 which is 15. Is it 15? Let's check. So instead of zero here it will become 1. Now 8 will be added to 7. This will become 15.
So yeah. So let's say if I ask you what will be the value if I have continuous 8 ones what will be the value of this 2^ 8 - 1 what is 2^ 8 256 - 1 means 255 so the maximum value with 8 once I can reach is 255 so the range will become 0 to 255 I hope this point is Okay. Now I want you to remember these numbers and their binary representation. So if I write 0 0 0 0 0 what is this? 0. If I write 1 then it will become 1.
If I write 1 1 then it will become three. If I write 1 1 then it will become then it will become 15. Okay. So this point I hope it's clear. Now what about if I start the one from left hand side? This is very easy. You can just calculate like this 2^ n minus 1 where n represents number of one ones from right hand side. Okay. Now what about this? What about number of ones from the left hand side? We have seen from the right hand side the formula is 2^ n minus 1.
What about the left hand side? So you can calculate directly like this. For example, I have this number. How am I going to calculate? Let's say we are talking in the octets. Octates with 8digit binary numbers. Now what is the value of this? [clears throat] You can calculate like this. 2^0 2^ 1 2 power 2 2^ 3 2^ 4 2^ 5 2^ 6 and 2^ 7 so I have to add these numbers and ignore these numbers why because here it is zero so 2^ 7 + 2^ 6 + 2^ 5 + 2^ 4 this will be the value of this [clears throat] you can calculate this way the another way is 1 1 1 1 0 0 0 and 0.
The another way is the maximum value that this number can achieve is 255. Now I can calculate this by subtracting 25 by subtracting the value of this from 255. So what is the maximum value this can achieve? 1111. This could be 15. So the value of this will be 240. Now you can calculate from here also the value will be 240. Let me repeat the method again. For example, I have 1 1 1 and then 0 0 0 and 0. Now, what could be the [clears throat] decimal value of this? 255 minus how many ones?
It could have 1 2 3 4 5. So, what is the maximum value? 2^ 2 power 5 - 1. This is the formula which we have witnessed just here. [clears throat] So 255 minus 255 - 2^ 5 this is 32 31 so this will be this will be 224 okay you can calculate like this or you can also calculate like this 128 64 32 and you can add all of them you will get okay [clears throat] first of all I want to make sure that you know the table of is of the power of two. 2^0 is 1. 2^ 1 is 2. 2^ 2 is 4. 2^ 3 is 8. 2^ 5 is 32.
Oh, sorry. 2^ 4 is 16. 2^ 5 is 32. 2^ 6 is 64. 2^ 7 is 128. And 2^ 8 is 256. That's all you will need. Okay. 3 4 5 6 7 8. What is the weight of each position? What is the weight of each position? The weight of this is 128 64 32 16 8 4 2 and then 1. This is nothing but 2^0 2^ 1 and all like this. So if I have the value 1 1 and rest all are 0 0 0. So I will pick up this 32. I'll pick up the eight. I'll pick up the two.
This is what the decimal value of this number is 42. Okay. So I hope now you know the conversion. You know the table of the power of two. And then you know what does it signify to have the straight ones from the left hand side and the straight ones from the right hand side. Now what you have to remember is this 1 2 3 4 5 6 7 8. You have to remember this 1 one 1 5 1 and then 6 1's and then 7 1's and then 8 ones. Rest all will be zero.
You can fill up all of this with zeros. Now just a single one from the beginning the value is 128. When there are two ones, the value will be 128 + 64. This will become 192. When you'll have three ones, then the value will be 128 + 64 + 32. The value will become 224 and then 240 and then 248 and then 252 and then and then 255. If you remember this table especially in GATE exam it will be very beneficial for you. You won't have to think.
There will be lesser chance of silly mistake and you will be quick. If you do not remember this there's no problem. You can simply calculate like this. Okay. And the more number of question you will solve you will get uh you will get better with these uh values. Now if I have just one bit with me for example let's say zero or one bit position then how many number of bits I can form how many different addresses I can form 0 and one that's it for example if I have two bits how many addresses I can form you can form 0 0 you can form 0 1 you can form 1 0 and you can form 1 one that's right so with two bit I can form four addresses four addresses Okay, what about three bits?
With three bits, I can form eight addresses. How did I know? 2^ 1 = to 2. 2^2 = to 4. 2^ 3, which means 8. What are those eight addresses? 0 0 0 1 0 0 1 0 0 1 1 0 1 1 0 and 1 1. So these are the eight addresses I can form with three bits. What about n bits? with n bits I can form 2 raised to power n addresses. I hope this point is clear. Now what I'm doing is I'm fixing the first bit. I'm fixing the first bit. What do you mean?
What do I mean by fixing the bit which means that bit cannot be changed. For example, if I for this case if I fixed this bit as zero, then how many address it can form? It can form either 0 0 or 0 1. That's it. Just two addresses. This was the case one. As you know I have fixed the bit. I have not specified I have to fix it with zero or one. So case two can be formed where I fix the bit with one. So the another set of addresses with case one will be 1 0 and 1 one again two addresses.
So what I've done is when I fixed a single bit the whole set of addresses are divided into two sets two subsets two subsets of addresses. Okay, let's try here also. If I fix a single bit, the whole set of address will be again divided into two. Hey, did I missed something? Yeah, I missed 1 0 0 1 0 0. Okay, now what happens? I again fixed this bit. I fix this bit. Okay, so with fixing I mean I can either fix it to zero or fix it to one.
Again two cases are formed. With 0 I can form 0 0 0 1 0 1 0 and 0 1 1. With one I can form 1 0 0 1 0 1 1 0 and 1 1. So I fix one bit I form two subsets. What about if I fix two bits what will happen? So if I fix two bits I can form like this. Case one will be 0 0. Case 2 will be Case 2 will be 0 1. Case 3 will be 1 0. case score will be 1 one because I have fixed two bits. So the number of cases will also increase. So with 0 0 I can form 0 0 0 or 0 0 1.
These two are fixed. So with 0 1 I can form 0 1 0 or 0 1 1. With 1 0 I can form 1 0 0 or 1 0 1. With 1 1 I can form 1 0 or 1 1. Are you getting the idea? If I am fixing just one bit, the whole set of address is getting divided into two subsets. Like here, if I fixed two bits, the whole set of addresses are getting divided into four sets. Four subsets. What if I fixed three bits? If I fixed three bits, the whole set will be divided into eight part.
Which means all of them are different. Now all of them will act as a case. I hope you are getting the idea where I'm reaching. So if I fixed from n bits from n bits if I fixed the initial k bits then total number of cases will be 2^ k and each address in the subset will be of the size 2^ n minus k. Are you getting the point? For example, look here. What is n? n is three. What is k? K is 2. So with n= to 3 and k= to 2, how many number of cases are we forming? 2^ 2 equals to four cases.
And what is the size of each? This is one 2^ 1 equals to 2. The size of each each subset is to 1 2 1 2 1 2 and 1 2. So in the in the n bits if I fix the initial k bits 2^ k cases will be there and each subset have 2^ n minus k number of addresses. Okay. Now why I'm teaching you this you will understand in few minutes. Till now if anyone have any doubt you can ask. Is the concept clear? Okay. Now we are moving to IP addressing.
What is IP addressing? So IP address is like a logical address. Logical address of size 32 bits. Of size 32 bits. Okay. Now 1 2 3 4 1 2 3 4. This is an octate. of eight bits. This is an octate. So we'll have four such octates in an IP address. Octate 1, octate 2, octate 3 and octate 4. And we differentiate with them with a dot. We differentiate them with a dot. So if I have an address of 32 bits total number of IP address will be if I have address of three bits the total if I have address of three bits total eight addresses could be found with the formula of 2^ 3.
So if I have total 32 bits the total number the total number of IP address will be 2^ 32. This is a very big number. This is a very big number. It's like 4 billion. Okay. So initially it was a time of I think 1980s IP address were divided into two fixed part. The network ID the network ID and the host ID. The network ID and the host ID. Okay. Who who was deciding this? I NA internet assigned number authority. Okay. So out of 32 bits let's say I divided 32 into two parts of 8 bit and 24 bit.
So this 8 bit let's say name it as network ID and 24 bit as host ID. So 8 bit will be acting as network ID and H ID will be acting as host ID. So how many networks could be formed? 2^ 8 which means 256 networks could be formed could be formed and I have 24 bit of host ID. So in a single network how many host could be there? 2^ 24 host can be there. Are you getting the point why I explained you that concept? So you can you can use the same analogy you can consider network as a case and post as a subset.
So I have 256 cases and each case have 2^ 24 members in the subset. Okay. I have 256 network and each network have 2^ 24 hosts. I hope the point is clear. If anyone have doubt till now you can ask. Okay. So you can uh express it like this network one let's let's name it as network one it has 2^ 24 IP addresses each address is given to one host let's say IP address one is given to host one IP address 2 is given to host two so 2^ 24 host could be given distinct addresses so network one they have 2^ 24 IP address network two similar network three similar.
So there will be like 256 networks. There are 256 networks. Each network have 2^ 24 IP address. How many total IP address will be there? This is 2^ 8. So this is 2^ 32 from where we started. Okay. So with a single IP with a with 32 bits with the 32 bits we can create 2^ 32 addresses and we are dividing that address by fixing the bits by fixing the bits. For example, if I fix the bit like this 0. Now they are eight 0 0 0 1.
This means this is network one. And if I'm writing like this, okay, let me explain it again. We are talking in octates not in a single uh we are talking about the whole IP address not about a single octate. So let's say if I fixed this and I write like this 0 0 0 0 this means this is network 1. And if I write like this 0 0 0 0 0 0 and here 0 0 0 0 1 this means network one host one. I hope you got the point. How are we dividing it?
Okay. Or I can explain more from that. 0 0 0 02. This means network one host two. I hope you're getting the point. Same thing we are doing here. Fixing the bits. Network. This was network one. This could be network two. So this means network to host one. Host two. So what is this? Tell me what is this. Which tell me the network number and host number for let's say this. What is the network number and host number? Yes, if I have assigned this network one, this could be network two, this could be network three and this could be network four and the host will be host two, host number two.
So in this way we are assigning the networks and the host. Okay. So what happened? Let's say there are only 256 networks. There are only 256 networks and each network has 2^ 24 hosts. Are you getting the point? How much 2^ 24 is 2^ 20 is approximated to a million and 2^ 4 is 16. So it's still 16 million host in a single network. in a single network. Network one have 16 million hosts which means 16 million computers could be present in network one.
So if there are only 256 network and even a small organization must buy 16 million host to purchase one network. So this is a problem to us and the number of networks are very less. The number of the number of networks are very less. So we have to come up with a solution. We call the solution as classful addressing. Classful addressing. I give you an analogy of classful addressing and then we will start the technical part of classful addressing in the next lecture.
So what is classful addressing? We will understand with the help of telephone networks. Telephone networks. I'll take the case of India as I'm from India. In India, telephone network is 11digit number and this 11digit number has two parts STD and T. And each telephone number is unique. Each telephone number is unique. So what happens? We'll take the case of city, town and villages. In the case of city, in the case of city, the big cities, the number of cities are less, number of cities are less and the people living in each city is more, people are more.
And about villages, the number of villages are more and the number of people are less. So if I fixed something like this, if I fixed something like this that I NA did in 1980 that out of the four octates, let's give the first octate for NID and the rest for HID. This will be a classic failure because the number of cities and the number of people same relation is not present with the number of villages and number of people in those villages.
In city people are more but the big cities are less. So what I want is I want lesser number of bits to represent the cities. For example, say we give three bit to std. It's like an id to identify the network and eight bits for the tid to identify the phone number. For town what we do we give four bits to tid for std sorry and seven bits to tid. And for villages what we do five bits for std and six bits for T. Now what happens with the with three bits with three bits what we can do is we can represent 000000 to 9999 thousand cities thousand big cities and each city could have the number of people 1 2 3 4 9999 these number of people each city can What about town?
How many town can be present? 9999. These could be number of towns which have the number of people ranging to maximum this much. What about the village? The number of villages can be more. So 99999. This could be number of villages. And in each village the maximum population a village can have will be this or the maximum number of phone numbers and village can have will be this. Same telephoneonic concept will be applied into the area of computer networks for addressing IP addressing.
So what are we going to do? like we divided the 11digit 11digit telephonic numbers into std n based on classes like cities, cities, towns and villages. Same way we are going to do with the IP address here IP address 32-bit IP address. We are going to divide these 32 bits into NID and HID based on the classes. Class A will have less number of networks and more number of host. Class C will have more number of networks and less number of hosts.
Class will be like a town in between. So what happens? The sum is 32 bits and the total IP address is 32 bits. So out of 32 bits, 8 bits will be given to NID and 24 bits will be given to HID. So there will be 256 networks and each network will have 2^ 24 host. And this class A type networks are used for big organizations like NASA and ISRU. Class B it's like the middle one 16 bits for NID and 16 bits for HID two 16 networks and each network have to rest for 16 hosts.
It's used for MNC's like TCS and VIPRO. Class C network more number of networks less number of host 2^ 24 bits of NID which means there will be 2^ 24 networks and each network will have 2^ 8 hosts it's used for small organizations like schools and colleges but you know the problem which I discussed before that let's say if someone buy someone wants to buy let's say thousand hosts someone wants to by a network for thousand hosts.
Which class should he approach? Should he approach class A? No. Should he approach class B? Approach class B because in class C, class C, the number of networks are 2^ 8, which is 256. So he has to approach class B. Now the total number of host in a single network of class B, you know how many they are? 2^ 16 which means 2 to power which means 6 5 53 6 and after these I'm only going to use 1,000 so how many will be wasted or how many extra host I have to buy these many extra host I have to buy so the problem still remains let me give let's say you want to buy a cake you want to buy a cake for your friend okay and the friend said that I want a 3 kg cake and and the shopkeeper have pieces of cake of this 2 kg.
Friend wants 3 kg of cake. So you won't going to you are not going to pick up the 2 kg piece. 3 kg means 3 kg. So you have to pick up this 10 kg part which means 10 - 3= to 7 kg will be wasted. Now what is the solution? The solution is you go to another shop which have not made the pieces of the cake already. it it cuts the cake based on the need based on the demand. So when you say you want a 3 kg cake a 3 kg piece will be picked up and given to you a very less or no wastage.
No wastage. Here the wastage was 7 kg and here there's no wastage. So this is what classless addressing is. This is classless addressing and that was classful addressing. So which is better classful addressing or classless addressing? Obviously classless addressing is better because classful was a older concept. Okay. Class A has 8 bit of an ID and 24 bit of HID. 16 bit of NID for class B, 16 bit for HID and 24 bit ID of class C and 8 bit of HID.
So this was the theoretical concept which we came up similar to the telephonic uh concept where we divided the std and tid hid and nid and j. So this was the theory. Now how we actually implemented this now we are going to understand bit IP address. What we did? We fixed the first bit 0 0 0 till the end and then 1 1 1 1. Okay. So when first bit is fixed this 2^ 32 address space will be divided into two address space of 2^ 31 and 2^ 31.
So this address space is 2^ 31. This is 2^ 31. We call this as class A. And this is expanded here. Okay. So one was already fixed. We fixed another bit also. 0 0 0 0 0. And then here 1 1 1 1. We call it as class B. And this part is again expanded. We fix another bit here. 1 1 0 1 1 0 1 1 0 1 1 0. And here 11 one 1 11 one 11 one 11 one 11 one 11 one 11 one 11 one 11 one 11 one 11 one one one in this manner we call it as we call it as class C and then let's expand it down 1 1 1 1 0 class D and 1 1 1 1 as E we did like this.
So class A has fixed bit of Class A has fixed bit of zero. Class B has fixed bit of 1 and 0. So class B has fixed bit of 1 0. Class C has fixed bit of here 1 1 0. So class B has Class C has fixed bit of 1 1 0. Class D 1 1 0 and class E as 1 1 1 1. Is the point clear? Now how we did? We initially began with a 32-bit IP address address space. We divided into two parts. The first one is class A and the remaining part is again divided into two parts and then the first part becomes the class B and the remaining part is again divided into two parts.
The first part became the class C and the remaining part is again divided into two parts class D and class E. Is the point clear? Why we stopped here? Because we just wanted five classes. So for five classes what we did this was let's say 2^ 32 bit address space. So we divided into first two parts 2^ 31 and 2^ 31 we call it as class A. And then 2^ 31 is divided into two parts. Class B. So this has 2^ 30 and this part has 2^ 30.
Now this is again divided into two parts. This becomes class C. So the class C has 2^ 29 and the remaining part is 2^ 29. Now this remaining part is again divided into class D and class E. So remaining part have 2^ 28 and 2^ 28 IP addresses. So this is how it's actually implemented. This is how we bifurcated the cake. We divided the IP address space into classes. So the number of IP address present in class A will be 2^ 31.
In class B it will be 2^ 30. In class C it will be 2^ 29. In class D it will be 2^ 28. And in class E also 2^ 28. Okay. And the fixed bit of class this is fixed bit and this is class name. Okay. So you have to remember 0 1 0 1 1 0 1 1 0 and 1 1. So class A class A actually comprises of 20 50% of the total address space. Class B 25%. Class C 12.5%. Class D 6.25% and class E also 6.25%. Okay. Now let's understand the representation. of IP addresses.
So we have three representation. The first one is binary. The second one is decimal and the third one is hexadimal. Hexad decimal. Binary you already know 32 bits of four octates. Octate means 8 bit each. So it could be like this. So the full binary representation of IP address is like this 1 1 0 0 1 0 0 1 1 1 1 1 0 0 or you can write anything like 0 0 1 1 1 1 How many are there? 1 2 3 4 and 1 2 3 let's remove one these are okay and the last could be 1 1 1 1 0 1 1 1 okay now what will be the decimal representation I have already taught you how to convert this is 2^0 this is 2^ 1 2 power 2 2^ 3 4 5 6 and 7 you ignore the zero zero part and you take the weight of one part and add them so this will become I think 200 this will be this will be 252.
I taught you to uh remember these values 1 2 3 4 5 6. If six ones are from the left the value is 252. If 7 1's then 254 8 1's 255. If only single one 192 sorry 128 double ones 192 triple ones. Okay, let me just write just single one 128, double ones 192, triple ones 224, four ones 240, five ones 1 2 3 4 5 24 6 ones 252, 7 ones 1 2 3 4 5 6 74 and 8 ones 1 2 3 4 5 6 7 8 255. Okay. So this is 255 and then this is 1 2 3 4 5 6 ones from the right.
What was six ones from the right? 2^ 6 - 1 which is 63. And then in the end see the full will be 255 and eighth position the value of uh this the weight of this bit is 8. So 255 minus 8 is 247. So this will be 247. You can do this smartly also. You do not have to always calculate by just adding the weight of all. You can also use the trick of subtraction. 255 minus and then 8. What will be the hexa decimal? C8. I have already calculated this C8 F C 3 F and F and it is seven.
How did I did it? See what I have done is I have divided these into four four bits and I have just converted them into hexadimal format. So what is this? This is 12. So do you know how to convert from 0 to 9? It is same like binary and from 10 11 12 13 14 15 it's like a b c d e f. So this is 12. This is 12. That's why I've written C here. And 1 0 0 is 8. That's why 8 15. So 15 is F. So C and then again 12. Then C 3 F.
This is what three and then 11 1 is F. So in this way I have written hexadimal. So I hope you got the understanding of the representation of IP addresses. Okay. Now let's understand the class A in detail. Class A it has 2^ 31 IP addresses. We have already discussed this addresses. How we got 2^ 31? Class A has 8 bits of NID and 24 bits of HID. And from the 8 bit I have fixed the first bit as zero. You know we have just discussed this thing fixed bit is zero.
So I have fixed the first bit as zero. Now how many NID it has? Seven NIDs. Seven bits. So from seven bits how many networks it can generate? 7 means 2^ 7 which means 128. So it can generate 128 networks. Okay. So let's uh write here 7 bits and then remaining 24 bits. Here 0 is already fixed. 1 2 3 4 5 6 7 then 0 1 2 3 4 5 6 7 from 0 0 0 to 1 1 1 1 1. This could be the network ID of class A. Okay. Now the thing is do you have you have to remember this that these two this one and this one these two network addresses are not generally given because they have a specific purpose what specific purpose this address zero zero from network ID and all the ghost values are also zero dot 0.0 zero.
What does this mean? That all the eight bits are zero. This is not given to any of the network. This is used as the default route. Default route or DHCP client. We are going to learn it later. But for now, you have to remember this that 0.0.0.0 is not given to any host DHCP client. And what about this? This is not given and this is not given. What about this? This is 127 127.x.x.x. What does this mean? That host value can be anything.
Host value can be anything. This is also not given to any network. Why? Because this is used for loop back testing. Loop back testing or self connectivity. For self connectivity. What is this? We are going to learn in few minutes. Self-connectivity or you can also call it as inter for interprocess communication. For interprocess communication. Okay. Now there's a specific node that you have to remember. What node is?
Whenever all the whenever we have all bits either zeros or one in network ID or host ID they are not given to any of the host which means these IP address are not assigned not assigned. What does this mean? This means that for these 24 bits if these 24 bits are all zero or all one then they will be not assigned to any of the host. Okay. So let me repeat whenever we have all zeros or all ones either in network ID or in host ID of any IP address these IP address are reserved for special purpose.
So we cannot assign these IP address to any host which means the computer. Okay. Okay. So whenever you see NID or HID, you have to deduct them from the valid addresses to be assigned to some host. Okay. So we have 2 to^ 7 minus 2 which means 126 networks in class A. Why 126? The first one was for DCP client and the second one was for loop back testing. What is loop back testing and DCP? We will learn later. You just have to remember why we have deducted these two.
So 126 networks in class sorry a and how many host 2^ 24 but you know we have reduced two all zero and all one minus two. So these could be the number of host in a network of class A. Why we directed this? 0 0 0 not valid. All ones also not valid. Okay. Which means 255.255.255 not valid. Similarly here X cannot be all zero or 255. Okay. Now what is what is this loop back testing I was discussing about and what was the default route this default route part we are going to learn in later lecture but for loop back testing we will let's see here for example I have a computer A communicating with computer B here let's say there's some intermediary node in between now what happens is computer B do not receive the message sent by computer A now what could be the problem?
So when we start testing what we do, we check that whether the router has received the message or not. The message has reached the router or not. We check that is router okay or not. So the first check we do is of is router receiving the message or not. Is router forwarding the packets, forwarding the packets or not? Then we check let's let's mark them. Let's mark these problems. The first problem we checked was is router receiving the packets.
The second problem we checked was is router forwarding the packets. Is there any problem in the link or not? Okay. So these three things we have checked. The first thing is this link. The second thing is this link and the third link is is router okay or not. Now there are two different things that we have to check. The first one is is B [clears throat] receiving the message? Is B receiving the message or A is able to send message or not?
So what they are going to do to check this the loop back testing loop back testing how it's done? Suppose the IP address suppose the IP address of A is 10.31.92.57. This is the IP address. Now sender IP address and destination source IP address and destination IP address. So the source IP address will be 10.31.92.57 and the destination IP address it will not put of B. It will put 127.x.x.x whatever value. What is the point of doing this?
The point is whenever router is going to see Let's understand loop back testing. For example, we have two computers A and B and we have intermediary node in between. Let's say this is router. Okay. Now B is not receiving the message sent by A. How are we going to check where the problem is? So let's start. First thing is is the router okay? The second thing is is this link okay? Is this link okay? Now fourth or fifth thing we are going to check is is Able to send the message or B is able to receive the message or not.
So this is done using loop back testing. Loop back testing. What we do? Let's say the IP address of class uh the IP address of this uh computer A is 10.31.92.57. Okay. So source IP address will be this and the destination IP address will not be of B. It will be 127.x.x.x. What does this mean? This means that A will send the message to itself. And if it is able to receive the message, which means it's able to send the message also.
Same thing could be done by here B. if B can receive the message sent by B itself which means it can also receive the message sent by A. So this is where loop back testing is used. Now there's very important point you cannot use this address 127.x.x.x as source IP. You cannot do this. You must always be very careful that you always put this into the destination IP part. Okay. So 127.x.x.x will always be destination IP.
Okay. And cannot be assigned to any can't be assigned to any host. So these two point you have to remember. Okay. [sighs] Should we continue the class and and keep on understanding class B or we should do in the next lecture? I'll do as you say. We can understand class B, class C and we can also go forward like class D and class C and then we can end the class with a summary and then from the next lecture we will solve some of the practice problem on this.
Does this sound okay or should I should explain this class B, C and D and E into the next lecture? Okay. So, everyone is saying that we should continue in this lecture only. So, let's continue here. Class B. Okay. So, class B we have fixed in the NID 1 zero. So, this was the NI part. Two octets more for the HID. This was the NID part. So in class B we have fixed one zero bits from the first octate of NID. Now how how many are remaining?
Six from here and eight from here. So 2 to^ 14 will be the total number of networks. Total number of networks. Should should I have to subtract something from there? No. because 1 0 even if even if everything becomes zero also in that case also the NID is not completely zero not completely zero because of this 1 zero while in class A it was become completely zero because the first bit which was fixed was also zero so here you do not have to subtract anything from the total number of networks then what about HID what about HID so we have 8 bits 8 bits which means 16 bits for the HID which means 2^ about 16 addresses for the HID.
Are these two power 16 address eligible to be assigned to some computer? No. Why? Because here h I could be all zero and all one. So these two cases should be excluded. Which means 2^ 16 minus 2 these will be number of host per network and what will be the total number of network 2^ 14. Is the point clear? Do anyone have to ask some doubt or something you are not able to grasp or any question everything okay? Okay. Let let me explain it in a different way.
Suppose [clears throat] I start with 128 because the first bit is 1 Z. So 1 Z and then this part is of N ID and this part is of HID even if I put all zero here all zero all zero what is the value 128.0 0. Now what comes the HID part? HID part. So this is the network ID. First network ID. First network ID. Now what will the second network ID? 128.1. What will be the third network ID? 128.2. Second network ID. Third network ID.
So 128.255 255 the maximum it can reach with the fixed value of 128. Now what will happen? It will go towards 129 and then 129.0 and then 129.1 and then 129.2 2 till 255 and after that 130 from 0 to 255 and then from 131 0 to 255 till till what's the maximum value it can reach can it can it reach 255 no it cannot reach why why so the maximum it can reach is minus 64 4 which is 191. How did I get this? See here 1 0. So the last last network of class B will be 1 one 1.
This is 255 minus this was 64. So equals to 191. And from 191 0 to 255. So the last network will be 191.255. Let me repeat again. We started with 128.0 reached till 255 and then 129.0 reached till 255 and then 130.0 reached till 255 and then in the last the maximum value which can reach is 191.0 to 191.255. So what is this 191 dot minus 128? What is 191 minus 128? 63. But you know whenever you count for example how many numbers are there in 1 to 10?
There are 10 numbers not nine. What how did I calculate it? 10 - 1 + 1. Okay. So in the same way if someone askked how many numbers are there from A to B. I'm not asking between A to B. I'm asking from A to B which means also calculating A and B. So this will be B minus A + 1. Similarly 191 - 128 = to 63 + 1 will be 64. So from 128 also including 191 there are 64 numbers. So 64 into each going from 0 to 255 each going from 0 to 255 which means total 256.
So this is 2^ 6 sorry 2^ 8 this is 256 and this is 2^ 6. If you multiply what is this 2^ 6 into 2^ 8 which is 2^ 14. Isn't 2^ 14 is the number of networks in class B? We just seen 2^ 14 is the total number of networks in class B. I hope you are getting the point. How are we calculating? Let me repeat again. Again if you are if you have already understood [clears throat] you can just listen again. What are we doing here?
We have in class A we have fixed the first bit zero and then we have just seven bits. So 2^ 7 - 2 Y2 0 and the one part they are excluded. For class B we have 1 zero fixed 6 bits remaining and another octed also given to NID 8 bits and then two octates for HID. So total 2^ 14 will be the total number of networks and each have 2^ 16 - 2. Why minus 2? All zero and all one will be excluded. Excluded. Okay. So till now we have completed class B.
Now let's move toward class C. [clears throat] Class C. Should I write it here or class C? In class C we have 8 bits, 8 bits and 8 bits. These are all given to NID. And the last octate is assigned to HID 8 bits, 8 bits and 8 bits. So there are 2^ 24 and this is 2^ 8. So the total number of host in a single network will be 2^ 8 minus 2 it will be 62 this was uh did I made a mistake 2^ 8 is 256 256 256 - 2 is 254 so total number of hosts will be 254 okay total number of networks will be more how many will be there we fixed 1 1 0.
So how many remaining here? Five. So 8 and 5 13 and 8 21. So 2 raised to power 21 will be the number of networks networks in class C and 254 will be the number of host in a single network of class C. Okay. Is the point clear? Let's move toward class D and then we will see the uh uh an identification trick that we we are going to just see the first octate and we can identify from which class does the IP address belong.
Okay. Now let's to move toward class D. Class D have 11 1 as fixed. And you know there's a special thing about class D and class E. There is no concept of NID. There is no concept of no N I no HID 11 1 is fixed. How many are remaining? How many are remaining? 2^ 24 28 are remaining. Four are fixed, 28 are remaining. So these will be the number of IP addresses. Similarly for class E 1 one how many are remaining? 2^ 28.
So these will be the number of IP addresses. There's no concept of an ID or HID in class D and E. Okay. Class D is reserved for multiccasting and class E for research purposes or future purposes. Research and future purposes. Research and future purposes. Okay. Okay. Now let's see the identification trick. Class A the first bit was zero and the rest was ranging from 0 0 0 from 1 till 1 1 1 1 and 0. You know if it was all one then it was 127 which was used for loop back testing.
So it couldn't couldn't be all one so it has to be zero. Now if it was all zero then it was used for DCP. So it couldn't be all zero so it has to be one. So this is one and this is 126. So class A has a range of 1 to 126 in the first octate. Class B. So class A has a range of 1 to 126. Now what about class B? Class B has 1 0 already fixed. Now remaining six bits. They could range from 0 0 0 all 0 to all one 1 1 1 1. How class A was not given the privilege to become all zero and all one? because of this zero if everything became zero then it is used for DCP for 127 it was used for loop back testing but here it is 1 zero already so even if they all become zero or all become one it's okay there the whole is not becoming zero or one okay so this value is 128 and this value is 191 so class B has a range of 128 to 191 what about class C you're going to calculate in the similar fashion 110 it could be all zero and all one.
So this will become 192 to 223. How I'm going to how I'm calculating so fast? Because I have remembered this and you also have to remember this. This range is a must to remember. This range you should remember. Okay. What about class D? Class D have 224 to 239. And what about class E? Class E have 240 to 255. Okay, let me draw the table again. Class A has a range from 1 to 126. Class B has a range from 128 to 191. Class C has a range from 192 to 223.
Class D has a range from 224 to 239. And class E has a range from 240 to 255. If you have to remember this table and let let me also write the number of IP address 2^ 31 2^ 30 2^ 29 2^ 28 and also 2^ 28 okay should I also write the number of host and number of uh networks networks and hosts so class A has 126 networks and host will be 2^ 24 - 2 class B have 2^ 14 network and host will be 2^ 16 - 2. Class C have 2^ 21 networks and the number of host will be 2^ 8US 2 and class D and class E do not have a concept of N ID or HID.
No NID, no HID. Okay. Now I have a DPP for you. You can try to solve that DPP and in the next lecture if you have any doubt you can ask me. Okay. So before solving the DPP, let me tell you in few minutes what are the properties of IP address which will help you to solve the problems. So the first thing is uh there can be questions like this from which among the following option the IP addresses of class B let's say. So how are you going to identify from 32 bits of long IP addresses?
You are going to just see the first two bits. If it is 1 0 then it will be from class B. If it is zero, it will become class A in such manner. If it is 1 0, then class C. If it is not in decimal, if it is not in binary, then it may be in the decimal format. So, how are you going to identify? Using this range. Suppose it's like 163. Tell me from which class does it belong. Yes, class B. Okay. So, in this manner, you are going to identify.
Now there may be some other questions like which of the following is not a valid IP address. How how are you going to identify? You have to see that no decimal value in IP address can surpass 255. If it is something like this like 10.25600 then this is not a valid IP address. Okay. So each and every value of the socket will be from 0 to 255. Okay. This could be asked like which of the following address can be used for interprocess communication in a host or loop back or self-connectivity then 127.x.x.x X this could be the answer and you have to very very careful that this can never be source IP address it will always be destination IP address okay we have discussed this in the topic of loop back testing okay convergence questions could be there that suppose C22 F1582 this is the hexa decimal notation of an IP address now you have to convert into let's say decimal How are you going to convert?
You can do it like this. You have to first convert into binary and then you can convert into decimal. I hope you all know this. How to convert hexodimal into binary. C. What is C? Well, which means 1 1 0 0. What is 2? 0 1 0. What is two again? 0 0 1 0. So, this will become the first octate. What is this? This is 192 and this is 2. So this will be 194 dot 1 1 f is 15. So what is this? This is I think 47. So the second octate have a decimal value of 47.
So you have to do it for these two also in such manner. I hope the point is clear. Okay. You can try more questions. For example, uh 172 A84 C8. Try to convert it into decimal. You can do like this uh the method which I taught you. Just try it. Solve it. I'm giving you 30 seconds to solve this and do not make some silly mistake of computation. Keep the work neat and tidy. Solve it systematically and you won't face any problem.
Okay. So you would have solved with a method of this. First you converted into binary and then decimal. You can also do like this and convert directly from hexadimal to decimal. Exit decimal to decimal direct conversion. How do we do that? Base is 16. So 16 raised ^0 into 7 + 16 raised to power 1 into 1. What is this? Just 7. And what is this? 16. So this is 23. So the first octate will be 23. The second octate will be in the same manner.
What is a? a is 10. So 10 + 16 into 2 32. This will become 42. And then in the same manner 4 + 16 into 8 this will become 132. And then again 12 into 16 + 8 this will become 200. So the conversion value will be 23 42.132.200. Okay. So these type of questions may be asked. This was all the easy part. And now let's go to more technical ones. Suppose a question could be like this. Suppose instead of using 16 bits for network part of class B class B and ID suppose instead of 16 bits I am using 20 bits.
Now tell me the number of class B networks and host networks and host. 20 seconds again. So what we have done before before 16 bits were assigned 1 zero was fixed remaining were 14 bits. So we said 2^ 14 were the number of networks. Now what are what are we doing? Instead of 16 bits we are assigning 20 bits 1 0 is again fixed. 18 bits are remaining. 2^ 18 will be the number of networks. What about number of hosts? So out of 32 bits, 20 bits were assigned to an ID.
How many are remaining? 12 bits are remaining for HID. So how many host? 2^ 12 minus 2. Why two? Because all zeros and all ones are not allowed. So this will be the number of hosts. The simple question may be asked. You can make it something like this also that uh maybe number of networks uh 2^ m and the number of hosts 2^ n minus 2 let's say in class b then what will be the relation between m and n you can solve like this again 10 second try to solve this is a very easy Number of networks in class B will be 2^ m= to 2^ 14.
So I will say m= to 14. And number of hosts in class b will be 2^ n - 2= to 2^ 16 - 2. So I'll say n= to 16. What is the relation? A m= to 7 n. That's the relation. Okay. Anyone have any doubt? You can ask me. You can also see questions like this that how many bits are allocated for NID and HID for an IP address like this 23.192.157.234. How many bits are assigned for an ID and how many for HID? You can see this number.
This is 23. What does that mean? That this belongs to class A. And in class A, eight bits are assigned for an ID and 24 bits are assigned for HID. I hope the point is clear. So you have to remember the range. That's why I have told you. So when you say this, you can directly in a moment can tell that this IP address belongs to class A. Okay. Anyone have any doubt? You have to remember this table where it is gone. This table you should remember the number of IP addresses, the range, number of networks, number of hosts.
They will come handy if you directly remember them. Okay. Now there is some important thing I want to tell you that you have to be very careful what is asked in the question. Read the question very carefully. whether they have asked the addresses or the hosts. Whether they have asked the addresses or the host. For example, if I ask what is the possible number of networks and addresses in each network under class B in IP4 addressing, what would you say?
Suppose uh in class B in class B 16 bits are assigned for NID and 16 bits are assigned for HID. Out of 16 bits, 10 is fixed. So 2^ 14 will be the number of networks and how many addresses? 2^ 16 and I have told you that you have to subtract two. So is this the answer? No, this is wrong. This is the number of host for host you subtract two. But how many addresses are there? Addresses will be 2^ 16. So when you are asked that tell me the host then you have to subtract two.
When you are asked tell me the addresses then you have to answer directly. So the answer will be 2^ 14 and 2^ 16. Okay. Only subtract when you are asked about the host. Things questions like this may be asked. Tell me from which class does this belong 200.18.32.65. You can directly see that this number lies between 192 to 223. So this is a range for class C. So it belongs to class C. An easy question. Okay. Percentage questions could be asked that uh class D network how percentage of address occupied by class D will be how much?
We have made a diagram here 50% are occupied by class A. 50% occupied by class A. Out of the remaining 50% we divided into two part. 25% is occupied by class B. And out of the remaining 25% we divide it into two part. 12.5% is occupied by class C. And out of the remaining 12% we divided into two part D and E. So D will occupy 6.25%. Okay. These type of questions would be asked nothing more. Okay. again from loop back testing and all these could be asked and there's a there's a one thing which you should remember that for classful addressing classful addressing large part of IP address are generally wasted because the needs are not exactly matched either you have to buy a lot more or you have to suffer with a lesser uh available networks lesser number of available host okay for example if I wanted to buy a host 70,000 host I have to buy a class A network and class A network offer a lot a lot more than 70,000.
So those will be wasted. Okay. So I hope everything is clear now. Wastage is a lot. Wastage is really a big concern in classful addressing. Let me give you another example. In class A 2^ 24 IP addresses are there in one network. Class B 2^ 16 IP addresses are there in one network. In class C 2^ 8 IP addresses in one network. Suppose an organization need 2^ 20 IP addresses. So which network it should buy? Obviously class A network it should buy.
So out to 2^ 24 - 2^ 20. Now you may see that this number is not a such of big wastage. But when you are going to solve this when you are going to solve this that this is 2^ 20 2^ 4 - 1. So this will be like 2^ 20 into 15 these are 15 million. Are you getting the point? These are 15 million. 15 million addresses were wasted. This was when when we were using 1 million. And what if we are just using like 70,000 then the wastage will be a lot more.
How are you going to solve this? How are you going to solve this with the help of class less addressing? Okay. Okay. Now that is enough for this lecture. You may solve the DBP now. And whatever problem you encounter, you can ask in the next lecture. By the way, all the problems are very easy. You will be able to solve them in one go. Okay. Bye. Good morning class. How are you all? Everything good? Okay. So if anyone have any doubt from the DPP or the lecture, you can ask now.
Okay. Okay. So student has asked about the protocols. protocols from the data communication part. From the first lecture we discussed that data communication has five components sender, receiver, message, transmission medium and protocols. Okay. So you want to know more about protocols like what are they or how do they work? Okay. So protocol means rules already predefined and set among sender and receiver so that synchronization happens between them and why why we need synchronization because let's say the sender has the capacity to send 100 Mbps but the receiver can only process 1 Mbps soon the receiver will be overloaded and the data will be lost.
Another thing you know when receiver receives the data it receives in like this fashion. It doesn't know what is the meaning of each bit. What is address from where the message is started. It knows nothing. So there must be some predefined rule that let's say these few bits are the source IP address. These few bits are like the destination IP address. The remaining may be the messages. We need rules before beforehand.
Okay. So these protocols are the predefined rules set among receiver and the sender so that synchronization happens so that they can work upon which is already agreed. Okay, protocols have you can define protocol or the key elements of the protocol will be the syntax the order like this that these few first will be source IP then the destination IP and then the message. So the syntax will be a key element semantic like what is the meaning of each section of bit you have said that these bits are fixed these bit are fixed this is what syntax was now this section of bit is the sip this section of bit is the destination IP you are giving meaning to the section of bit this is called semantics and the third thing is time when the data will be sent and how fast it will be And otherwise the receiver may be overloaded and data may be lost.
Okay. So it was nice that you asked we have discussed protocol. Any other doubts someone have? Okay. Okay. For identification. Okay. Let me discuss it very formally. So another question or another doubt which was asked was how are you going to identify and uh from which computer which process has uh has requested for the data. Okay. So we call it as the identification problem. It was a very nice doubt identification problem.
Okay. Let's discuss. So firstly you have to identify the network because there are so many networks and data or the host can be sitting in any of the networks. So you have to first identify the network. Later we will study that there are subnets also. So if subnet is present then you have to identify the subnet too. But let's keep the case simple. You have to first identify the network and from the network you have to identify the host.
There are many hosts. So you have to identify the host and among the host there are many process. You so you have to identify the process. How it is done? So firstly you you have to identify the network and then the host and then the process. So you have to identify the network using logical address or IP address. You have to identify the host with the help of MAC address. Okay. How are you going to identify the IP address?
How will you know that what is the IP address? With the help of DNS. How are we going to identify the MAC address? With the help of ARP. We will study these later. How are you going to identify the process? With the help of port number. Okay. So in such manner you will identify. [sighs] See this for the logical IP address. Let's say if the network is of class A then we have N ID and HID. N IDs of 8 bits and HIDs of 24 bits.
So how are you going to identify the network? Let's let's take an example. Suppose we have like this 10.32.15.73. Okay. So this is the NID and this is the HID 10.0.0.0. If you go to the first host or the zerooth host, which means you're going to the network and you know you know this is the zerooth host. It doesn't actually exist because we start the numbering of the host from one. Are you getting the point why we have said that all zeros are not allowed or not given to any of the host?
Because all zeros are used to identify the network. This will become zerooth host or you can say the network ID and then 10.0.0.1 was the first host. So when host ID becomes zero and network ID remain as it is it gives us the network ID. So the network we have identified 10.0.0.0. Okay. So this was the network. Similar thing let's take another example 157.30 uh anything 32. Identify the network ID. I'll give you 10 seconds.
Identify the network ID. Brother, brother, brother. Wait. Think before you write. Why have you written 157.0.0? Is it class A network? Think before you write. This belongs to class B. So in class B, two of the octates are given for the NID. So the answer will be 157.30.0.0. Let's let me give you another example. 200.30.223. What is the network ID? Yes, now you have written correctly. These three will be for the NID and this will be for the HID.
So HID will be zero only. 90.0. zero. This is the network ID. Okay. Now you have got the IP address of the network. You have identified the network. How are you going to identify the host with the help of physical address which is the MAC address printed on the NIC card. But you don't know the NIC card. But you do not have access to the NIC card of some other host in a different network. How are you going to identify the host address? with the help of address resolution protocol.
We'll understand this when the time will come when the module will come. I'll give you a very basic introduction for this ARP. You have to just remember these things that for ARP the request the ARP request is broadcasting. What is broadcasting? that you send the message to each and every host present there you you have got the IP address you have already got the IP address of the host suppose I have got the IP address of this host now I will send an ARP request like this I'll leave the MAC address empty for IP address I will write the IP address of the host 10.32.15.73 and I will send this message this ERP request to each and every host.
Now what will happen? Each and every host will look is this IP my IP? This will say no this is not my IP. So it will ignore. He will see is this IP my IP? He'll he'll say yes. So I have to send the MAC address to to the person who have asked. So source IP will be present. So we'll look at the source IP and he will fill up its MAC address whatever the MAC address is 48 bit MAC address and it will send it to the source.
So in this manner the source will get an idea of what the MAC address of this person is or this host is. Okay. Let me tell you one more thing. IP address is of 32 bits. MAC address is of 48 bits. Okay. So the ARP request ARP request it was broadcasting we sent it to everyone and the reply was uniccasting which means only the person or only the host whose IP it's written only he will reply. So the reply will be uniccasting and request will be broadcasting.
So we've got the MAC address also. We have identified the network, identified the network, we have identified the host. Now what about the process? Which process is requesting the data? We will identify using port number. And port number is of 16 bits. So what is the range of the port number if it is of 16 bits 0 to 2^ 16 - 1? If all were ones I have told you if all are ones then the range is 2^ n - 1 like this is 8.
This is 7 not 8. This is 15 not 16. So the maximum value it can reach is 2^ 16 - 1 6 5535. You can remember this number. You can remember this number 655 335 it will come again and again. So out of these 0 [clears throat] to 65535 first 1024 which means from 0 to 1023 they are wellknown port number wellknown port number these are assigned and controlled by AA internet assigned number authority. Okay these are not given to the uh random processes.
These are well definfined number. Let me give you an example. And you have to remember these port numbers. You have to remember this port number. Remember SMTP the port number is 25. HTTP the port number is 80. FTP 20 and 21. DNS the port number is 53. POP port number is 110. IMAP port number is 143. Homework. What is the port number of HTTPS? Search for it. Okay. Do anyone have any more doubt? You can ask. The more doubt you ask, the more information you will gain.
Okay. Another doubt came. He was asking we have heard about uniccasting, multiccasting and broadcasting. Can you explain more and how written? Hey, please do not use short forms. I I'm not very good at the short forms. Write properly. You want to know more about castings? Let's let's learn more types of communication. Okay. Uniccast. Uniccast means one to one broadcast. Broadcasting means one to all and multiccast one to many.
Now another homework learn more about anycasting. What is anycast? Okay. Now how uniccasting is done? What is uniccasting? Again, transmitting data from one computer to another computer is called uniccast. One:1 communication. Okay. So, let's say we have two networks. This network is 10.0.0.0. This is network ID. And another network like 22.0.0.0. And we have a host with IP address of 10. 32.52.7 anything. And here another host 22 let's say 100.35.
Now data and the source IP will be 10.32.52.7 and the destination IP will be this IP address simple 22.003.5 100.35 that's it okay and when the reply will come the reply will come like this this was source IP this was destination IP and the source and destination IP will be swept for the reply okay see it is not necessary that you have to send it to some uh different network computer you can also send it to some computer which belong to the same network like 33.52.7 can also send it like here so in uniccast communication both source and destination can be present in the same network or different network it doesn't matter what about broadcasting can we broadcast in the same network and can we also broadcast in all the computers of a different network we can do both let's understand it more when we do it in the same network like this and we can do it in the different network also Okay.
So when we are sending one to all one to all that one host is sending to all the host present in the same network and one host is sending to all the host present in the different network. We name it as limited broadcasting and we name it as like direct broadcasting. Okay. So there are different methods of doing this. For example, if you're doing like limited broadcasting that transmitting data from one computer to all the computer present in the same network.
This is the same network. Then it is limited broadcasting. So what what destination IP will you fill here? For example, if you like write data here SIP and DIP, SIP is let's say 15.23.97. What are you going to fill in the destination IP? You remember I have told you that all ones are not allowed. All ones are not allowed. That's why we have reserved that for the limited broadcasting. We are here going to write 255.255.255.251.
This means that this source IP is going to send to all the host present in the same network. So whenever you see this like FF ff this is written in hexadimal format. This means that a source IP is going to send to all the network present in the all the host present in the same network. Okay. So what about direct broadcasting? Oh and one more thing and one more thing you cannot ever use this as a source IP. This is not some this is not an IP address of a particular host.
This is reserved for limited broadcasting. So you are not going to use it ever as a source IP and it will be always used as destination IP. Okay. Is the point clear? Now what about direct broadcasting? when we are transmitting from one network to all the host of other network what will be the IP let's say for the source IP and for the destination IP what will be here source source IP will be the IP of this let's put anything like 1532.9730 what will be the destination IP the network ID 150.0 0 and the host ID is and the network ID of this will be 112.0.0.0.
So what are you going to put in here? No, no, no, no. You have mentioned we put like this 0.0.0. No, it doesn't work that way. It's already fixed. Source IP, destination IP, source IP will be the same. But for destination IP, we do not put the network ID. we write and this will be all one host ids are all one that's why I've told you not to allow any host with an IP address of all ones network ID and host ID cannot be all ones now you're getting why all ones or all zeros because they are reserved So whenever you see like this 112.255.255.255 255 as as the destination IP address which means 112 is the class A IP and these are the host IPs and all the host ids are ones which means it is a case of direct broadcasting which means someone from a some different network is trying to send some message to all the people present in this network of class A.
So this is how direct broadcasting is done. Let me repeat again for limited broadcasting and for direct broadcasting for destination IP you're going to use 255.255.255.255 and for direct broadcasting you are going to use network ID and then all host ids as well. The source IP will will be the source IP of the person who is trying to send. Okay. Again the same concept applies here. These two cannot be ever used as the source IP.
They will always be used as the destination IP. Okay. So whenever we have all ones in the HID part of any IP address that IP address represent the direct broadcast address. So this is the reason we cannot assign this IP to any host or computer. Okay. Let's discuss another case 113.0.0.0 157.132.0.0 There are several computers here in this network and 113.32.5.9 and this computer want to send the network send to all of the host present in this network the different one.
What will be the source IP and destination IP? Tell me okay correct source IP is 113.32.5.9 and the destination IP will be as this is a class B address so network ID will be the two octates 157.32 this 132 this will remain as it is and the rest HID part will be all ones so the answer will be 157.132.255 255.255. This is correct. Okay. Now let me make a table so that you may not get confused. Network ID, host ID. If network the network ID is valid and the host are all zeros, which means this represent the network ID of the full network like this.
If network ID is valid and host IDs are all ones, this represent direct broadcast address. If network ID is also one and host ID is also one, then this represent limited broadcast address which was 255.255.255.255. There's another concept of network mask. Network mask. Network mask always helps you to know which portion of the address identifies as NID and which portion of the address identifies it as HID. So class A, BC network have default mask also known as natural mask like this.
For class A, the natural mask is 255.0.0.0. For class B, the natural mask is 255.255.0.0. For class C, the natural mask is 255.255.255.0. So you can also add one thing here. Then if that if network ID is all ones and host IDs are all zero, then this will become the natural mask. Okay? Or network mask. So now how are you going to identify? Let's say I have given an IP address and suppose you do not remember the table.
How are you going to identify that this IP address belongs to Okay, suppose I have an IP address let's say 200.200.200.96. I got the network mask as as this is a class C address. So the network mask will be this. So 200.200.200.96 200.96. When we are doing bitwise ending with the subnet mask or the network mask, it will become 255 255 255.0. So as you know that if some number let's say 1 one how do we do bitwise ending?
First let's understand that 11 1 bit wise ended with 11 1. The answer will be 1 1. 1 and 0 will become 0. 0 and 0 will become 0. 0 and 1 will become 0. 1 one will become one. So for 200 how are you going to represent 200? 1 1 0 0 1 0 0 0. This is 200 like this is this is 192 and this is 8. So this is 200. How are you going to represent 255? 1 1 1 1. So 1 and 0 0 1 and 0 0 1 and 0 again 0 1 and 1 1 0 0 1 1. What is this again? 192 and 8 which means 200 only.
This was also 200. So if you are doing any number any number from the range of 0 to 255 when we are doing bitwise ending with 255 then the same number will be here same number. So the result will be 200.200.200 for 200 and if you do bitwise ending of any number with zero zero will be there. So zero will be there. This is what the network ID of the IP address of this IP address 200. Okay, you can do it directly also as you know that this is a class C address and in class C the first three octates are given to network ID.
So that those octates will be same and the remaining will be zero. See this if the network ID is valid [music] then this octate and HID are all zeros then it represents the network ID of the full network. Okay, now try this. You have to identify which type of IP address is this 192.192.192.255. Is it direct broadcast address? It is limited broadcast address. Is it host IP or it is network IP? Network address. Tell me.
Okay. So, this is not limited broadcast address. You can directly tell because it is fixed 255.255.255.255. Now this is a class C network and this is the network ID part and this is the host ID part. We see that host ID part is all one and network ID part is valid. So this is a direct broadcast address. Is it clear? Okay. Now I'll give you some uh more examples to solve. 200.200 200 let's say 10.1 19200 tell me which class does it belong 7.10.230.10 or 1 whatever 128.1.1.254 127.3.6.200 255.255.255.255 100.255.255.255 255.
Now tell me this is class C network. This is type quickly man. We don't have much time. Class A network. This is class B network. This is self connectivity. This is limited broadcast address. This is direct broadcast address. I hope now the point is clear. Anyone have any doubt? Till now you can ask. Okay. So we will end the class here. I'll give you DVP you have to solve and in the next lecture we will start with a new topic name subnetting.
Okay. So we'll end the class here. Good morning class. The topic of our today's class is subnetting. What do you think subnetting is? By the name, can you guess? Yes. Smaller networks or the process of dividing a big network into many smaller subnet is called subnetting. Subnet means sub network and subnetting means dividing a big network into smaller parts. This is what subnetting is. Let's say this is network one. So network subnet one, subnet 2, subnet 3 and subnet four.
And why do we do so? Let me give you an example. Let's say your university have 2,000 computers. Okay? You want to allocate 500 to engineering department, to some 500 to some humanities department, 500 to architecture department and 500 to uh let's say math department. Okay. And they will be managed with the help of router in between. So what are the advantages? The first advantage is maintenance and administration becomes easy.
Maintenance and administration becomes easy. When you have divided subnets, then each subnet is isolated from other. So it also provides security through isolation. Security is also there. For example, let's say in a company code of a developer department must not be accessed by some let's say HR department. So for those purposes we do subnetting because maintenance and administration become easy and it also provides security to one network from the other network.
But you know there's always a trade-off. So what are the disadvantages of subnetting? Can anyone tell? Obviously the disadvantage is identification becomes a bit harder or one step increases. We you know we have discussed this while I was talking to you uh explaining the topic of identification. Someone asked that out how are you going to identify some host in a particular network. In that case, I've told you that usually there is a three-step process.
You first identify the network, then you identify the host and then you identify the port. But now that step is changed. Now in a network you identify subnet also in which subnet your host is present. So firstly you have to identify the network. Then you have to identify subnet within the network. then identify the host within the subnet and then identify the process within the host. Okay, I hope the point is clear. So in case of a single network only two IP address are wasted to represent network ID and broadcast address.
We have discussed about this that all zeros and all ones are not allowed. Why? Because all zero represent the network ID and all ones represent the direct broadcast address. We are talking about the HIDs. When HIDs are all zero which means we are representing the network ID of a network and when HIDs are all ones then we are representing the direct broadcast address. So in case of single network two IP addresses are wasted because of this.
So when you increase the network the number of IP addresses for which could be allocated to a host will be wasted more. Let me repeat in case of a single network only two IP addresses were wasted to represent network ID and direct broadcast address but in case of subnetting two more IP address will be wasted for each subnet. Are you getting the point? So the first disadvantage was steps increases for identification. Second was more IP address wastage wasted.
What could be the third disadvantage? Obviously you you see here in the network there is no router present inside the network. But here you have to allocate some router or a hub to manage these subnet. So expense will also increase. So cost of the overall overall network will increase. Subnetting requires internal routers, switches, hubs, bridges which are very costly. Okay. So you need some intermediary device to manage these subnets.
Okay. And one more thing is you require an uh what do I say an experienced network administrator to manage these subnet networks. Okay. So this also adds to overall cost as well. So expense increases in buying these intermediary things and also an experienced network manager. Okay. Now how do we create subnets? The this thing also should be studied that how do we create subnets? So subnet is created by borrowing the bits from host ID from borrowing the bit from host ID.
Are you getting the point why we are doing so? Let's say we have three bits for that n ID. I'm just taking an example. How many subnets I how many networks I can create? I can create eight networks. Now I want to create more network. What do I need? I need more bits. And from where I have to get these more bits from the host ID part. So let's say if I borrowed one more bit then I can create 16 networks 2^ 4 16 networks.
So if you create one bit if you if you borrow one bit then you can create multiplied by two double of that existing network. For example here eight networks were there and I borrowed one bit. So now there are total of 16 networks. So the process of borrowing bits from HID to generate the subnet ID or subnet bits is called subnetting. The number of bits borrowed depends on our requirement how many subnets we want to create.
Okay. Let me give an example so that you may understand better. Let's say this is our network and our network ID will be 200.200.200.0. Tell me from which class does this network belong? Class C. Yes, here it is 200. Okay. So, this network belongs to class C. This will be your NID and this will be your HID in the whole IP address. Now, I want to create four subnet. How many bits I have to borrow? Two bits I have to create four subnets.
So how many bits I have to borrow? Two bits. So two bits will be for subnets. We call it as subnet ID. So let's say this is the first subnet. This is the second. This is the third and this is the fourth. How are you going to represent this? Let's say this is 0 0. This is 0 1. This is 1 0 and this is 1 1. Are you getting the point? So network ID remains as it is. From the host ID, we are going to borrow two bits which will act as the subnet ID.
And while we are referring to this subnet, we will write it as 0 0. Network ID remains the same. 200.200.200 and then the subnet ID remains 0. And then whatever host we are referring to, we will write it like this. As you know that host ID cannot be all zero. So 1 2 3 4 5. So this will be one. So this is the first host of first subnet. What about second host? 0 0 0 1 0. What about third host? 0 0 0 1 1. What about fourth host? 0 0 0 1 0 0.
I hope you are getting the point. Now if I want to change the subnet, let's say I want third host of this subnet. This subnet subnet two. This was subet one. This was two. This was three. This was four. What about third host of second subnet? So what I will do for second subnet? It will become 0 1. What about third host? 0 0 0 1 1. This is it. This is the third host of second subnet. I hope you're getting the point. Okay.
Okay. How many host we can have in a single subnet? So this will begin from 0 0 0 0 0 1. This is the first and then what will the last? As you know that all cannot be one. So 1 1 1 1 and 0. What is this? What is the number? All can be if all are if all were one then it will be 2^ 6 minus 1 which will be 63 and the last digit is 0 which means minus one. So maximum it will be 62. So in in a single subnet in a single subnet there are 62 hosts as you know it should have been 64 but all zeros and all ones are not allowed.
So these are now 62 hosts. I hope the point is clear. Let me repeat everything again so you can understand better. Let's say this was our this was our network 200.200.200 and I want to create four subnets within the network. Okay, this time let's create just two subnets. So for just two subnets, how many bits I want to borrow from the HID? Just a single bit. So I bit I borrowed a single bit from the HID. 0 0 0 0 0 1 2 3 4 5 6 7 and 8.
Okay. Now I borrowed a single bit from the HID. So this will now act as the subnet ID. This remains the network ID and these are now the host ID. Now you have to remember two things about host ID that all zeros all zeros and all ones are not allowed. Why not allowed? because all zeros were used to express the network ID or subnet ID and all ones are used to express the DBA. That's why all zeros and all ones in the host ID are not allowed.
This point is clear. Now if I want to represent this subnet, how I'm going to represent? You can write zero. And how are you going to represent this subnet? You can write one. Now if you want to represent some host of let's say the second subnet, how are you going to represent? You will make this submit ID one and whatever host you are going you are trying to uh represent let's say you are trying to represent eth host how are you going to represent you will just make eight out of these binary numbers so I have 0 0 0 1 0 0 0 what does this represent 8th host of second subnet okay how I'm going to represent let's say the 16th host of first subnet so So for 16th host I'll make this SID as 0 because we are talking about the first subnet and for the 16th host I'll what I'll write 0 0 0 1 0 0 0.
This is the 16th host of first subnet. If I say I have to let's say there were uh n subnets. Let's say there are n subnets and I want you to represent the kth host of mth subnet. N mth subnet obviously m is less than n. How are you going to represent? So you are going to represent k in binary and you are going to represent m minus one in binary. Why m minus one? Because subnets start from zero. You know we represented this subnet from zero because subnets start from zero and host start from one you know because all zeros can't be a host.
Are you getting the point? See here when we represented the eighth host of second subnet we created one here and we created eight here. When we represented 16th host of first subnet we created zero here and 16 here. When we represented first host of first subnet we created one here and zero here. So when the subnet was one we were creating zero. When host was one we were creating one. When subnet was second we are creating one here.
When subnet was first we are creating zero here. So when subnet will be m we will create m minus one. And when the host is k we will create k only. Why so? Because subnet can start from zero while host cannot. Okay, I hope the point is clear. So if anyone have any doubt, you can ask me. Let's take another example. Let's take another example so you'll understand better. Uh this time let's increase the number of subnet.
I want to create let's say 512 subnets. Tell me how many bits I have to borrow. It's not eight, man. Think think before you type. Yes. Nine nine bits nine bits we have to borrow. When we have to create four subnets, we will borrow two bits. When we have to create two subnets, we'll borrow one bit. When we have to create let's say 1024 subnets, we will borrow 10 bits. 512 will borrow 9 bits. 256 we'll borrow 8 bits. 128 will borrow 7 bits. 64 we borrow six bits.
Okay. So to create 512 subnets we will borrow 9 bits. So let's let me erase all this and let me draw an example. Okay. So 157.153.0.0. Tell me from which class does this network belong. Class B. Okay. So in class B these two act as NID and these two elect. That's why I have told you to remember that table. If you do not know the class, how are you going to segregate the NID and HID part? And if you cannot segregate the NID and HID part, you don't know from where to borrow the subnet bits.
Okay. Now you know you have to create 512 subnets. So we are going to borrow nine bits from the HID. So 1573 dot now one whole octate covered. And from the last octed first bit, how many HID we have? 1 2 3 4 5 6 7 8 bits from here and one bit from here. Okay, what will be the first host? The first host will be 1. Second host, it will be 1 Z. So if I have to create Kth host, I'll create K here. Okay. Now how many host could it be there in a single subnet?
Let's say we have so many subnets here. In a single subnet maximum number of hosts will be tell me what will be the maximum number of hosts in a single subnet. [clears throat] Come on man it's not that hard. Try to think you have been given the HID with this how many how many maximum you can create. See still some people are typing 128 brother 128 minus 2 why 2 because this is not allowed and 1 2 3 4 5 6 7 this is also not allowed so the answer will be so there will be 512 subnets and in each subnet there will be 126 host you'll answer 128 when I ask about the addresses because these two are also addresses But they are not not given to host.
So when I ask you address, you reply 128. When I ask you host, you reply 126. Okay. Is the subnetting clear or do I need to take one more example? Is it clear? Okay. Let me repeat it again from whatever I have written. What is subnetting? Subnetting means you are dividing a full bigger network into smaller network. How are you going to divide? by borrowing the bits from the host ID part. Okay. And why do we do so? So that maintenance and administration becomes manageable and we are isolating the network to provide the security part.
For example, if attack happens at subnet 4, subnet one will remain safe. And what are the problems? The problems will be identification part become larger. In the first case we first identify the network and then host. Now in this case in the network we have to identify the subnet also. The second disadvantage is more number of IP address will be wasted. And the third will be expense will increase for buying the machinery and experienced network manager.
And how do we do how how do we do subnetting? By borrowing from the HID. If we borrow n bits we can create 2^ n subnets. So for the case if we want to create 512 subnets the n will be 9 bits. Okay. So from the host ID part we create subnets and that host ID part will act as the subnet ID. Okay. So if I want to refer to the first subnet I'll create zero. If I want to refer to the 10th subnet, I'll create nine. If I want to refer to 123rd host, I'll create 123 in the binary.
For host, we create the same. For subnet, we create one less because subnet can start from zero. Okay, I hope the point is clear. Anyone have any doubt? You can ask me now. Hm very valid concern a valid doubt came. So student is asking when we are representing the subnet with the help of subnet ID do weights change? Let me explain what does he mean by this? For example here, for example here, what is the weight of this?
What is the weight of this bit? Is this one or 128? So the answer is it will be 128. So when you are going to represent the subnet ID, how are you going to represent the subnet ID? By this let's say let's say what is the subnet ID of this network. So you will write 200.200.200 128. What is the subnet ID of this network? 200.200.200.0. So is the network ID and the subnet ID
The words are the caption track's own and nothing is reworded or re-transcribed. Paragraph breaks are placed between sentences so the text reads as prose.
Free tools for your own script. No signup, no login.
Paste your draft and see where viewers are likely to drop off, with a rewrite for each weak line.
Paste the first 30 seconds of your own draft for a hook score and rewrites.
Check your draft against YouTube's advertiser-friendly guidelines before you record it.
Read this channel's public videos and transcripts, and download a writing brief for it.
| Average words per sentence | 10.4 |
| Longest sentence | 169 words |
| Questions asked | 329 |
| Sentences containing a number | 510 |
Most used terms
Filler phrases
194 in total: like 100 · uh 53 · you know 32 · actually 4 · I mean 2 · kind of 2 · right? 1.
A literal whole-word count of the same phrase list the Prepublish browser extension uses, so a phrase inside another word is not counted and a phrase used in its ordinary sense still is. It is a count and not a judgement.