WEBVTT 0:00:02.900000 --> 0:00:09.280000 Hello and welcome to this video titled, Why Do We Need IPv4 Addresses? 0:00:09.280000 --> 0:00:13.540000 In this video I'm going to talk about an introduction to IPv4 addressing, 0:00:13.540000 --> 0:00:17.560000 so you'll learn the structure of an address and what it is. 0:00:17.560000 --> 0:00:20.640000 We'll break it down into network and host bits and understand why it's 0:00:20.640000 --> 0:00:23.640000 important to know the difference between those two. 0:00:23.640000 --> 0:00:27.200000 And we'll understand packet routing decisions based on the ability to 0:00:27.200000 --> 0:00:31.060000 look at the network and host bits of an IP address. 0:00:31.060000 --> 0:00:37.280000 Alright, so let's start by talking about IPv4 addressing. 0:00:37.280000 --> 0:00:42.320000 So if you've studied IPv4 and you know anything about the IPv4 header 0:00:42.320000 --> 0:00:46.060000 that's placed in front of your data, you'll know that probably one of 0:00:46.060000 --> 0:00:51.800000 the most critical components of that IPv4 header is the source and destination 0:00:51.800000 --> 0:00:56.520000 address. After all, that's the main reason why we use IP in the first 0:00:56.520000 --> 0:01:01.900000 place is to get packets between remote networks from a source to a destination. 0:01:01.900000 --> 0:01:06.460000 So let's focus in now on just those addressing fields leaving behind all 0:01:06.460000 --> 0:01:09.240000 the other fields of the IPv4 header. 0:01:09.240000 --> 0:01:13.560000 So the IPv4 address is 32 bits wide. 0:01:13.560000 --> 0:01:15.380000 So that's how many bits it is end to end. 0:01:15.380000 --> 0:01:17.640000 So the source address is 32 bits. 0:01:17.640000 --> 0:01:19.880000 Destination address is 32 bits. 0:01:19.880000 --> 0:01:24.320000 So right here, this is an example of how your laptop, PC or smartphone 0:01:24.320000 --> 0:01:26.440000 sees its IP address. 0:01:26.440000 --> 0:01:29.180000 Of course, it sees it as a binary number. 0:01:29.180000 --> 0:01:33.220000 We don't talk about it as binary numbers, but this is how computing devices 0:01:33.220000 --> 0:01:36.100000 view their IP address. 0:01:36.100000 --> 0:01:40.440000 And that is right there, 32 bits if you count them end to end. 0:01:40.440000 --> 0:01:44.440000 Now an IP address is a logical address. 0:01:44.440000 --> 0:01:45.940000 What does that mean? 0:01:45.940000 --> 0:01:51.400000 That means that something about this address indicates geographically 0:01:51.400000 --> 0:01:55.280000 where your system is right now. 0:01:55.280000 --> 0:01:59.800000 Now geographical might mean it indicates somewhere in that address the 0:01:59.800000 --> 0:02:04.120000 department you're a part of, the floor that you're on, the room that you're 0:02:04.120000 --> 0:02:08.660000 in, maybe the section of the campus that you're working from right now. 0:02:08.660000 --> 0:02:13.540000 And so because of that, if you move your device around like a laptop or 0:02:13.540000 --> 0:02:17.180000 a tablet so frequently does, if you move from room to room or department 0:02:17.180000 --> 0:02:21.860000 to department or from building to building, your IP address will change. 0:02:21.860000 --> 0:02:26.580000 Because an overall large computer network is subdivided into different 0:02:26.580000 --> 0:02:31.660000 sections and each section has a different IP network. 0:02:31.660000 --> 0:02:36.680000 So part of this address is going to be the network portion of the address. 0:02:36.680000 --> 0:02:41.960000 Your laptop, your PC, when it sees this 32-bit number has to be able to 0:02:41.960000 --> 0:02:47.420000 identify which of those bits represent the network that it's on right 0:02:47.420000 --> 0:02:51.420000 now. And if it moves to a different network, for example, if you disconnect 0:02:51.420000 --> 0:02:55.320000 from the WiFi access point that you're on right now and you move your 0:02:55.320000 --> 0:02:58.600000 laptop over and you connect to a new WiFi access point in a different 0:02:58.600000 --> 0:03:02.840000 department, your networking bits will change. 0:03:02.840000 --> 0:03:07.280000 Well actually your entire 32-bit address will change, but the part that's 0:03:07.280000 --> 0:03:12.320000 most critical to your laptop will be representing this on a new network. 0:03:12.320000 --> 0:03:17.540000 So this 32-bit address is subdividable into two different components. 0:03:17.540000 --> 0:03:21.980000 Left to right, some of the bits from left to right will be the network 0:03:21.980000 --> 0:03:25.600000 portion, for example, maybe this right here. 0:03:25.600000 --> 0:03:30.520000 Maybe these bits right here are your networking bits and these bits right 0:03:30.520000 --> 0:03:33.140000 here are your host bits. 0:03:33.140000 --> 0:03:39.160000 And it's very critical for any device running IP, whether it be a smartphone, 0:03:39.160000 --> 0:03:43.020000 laptop, tablet, whatever, to be able to find where that dividing line 0:03:43.020000 --> 0:03:48.080000 is between the network bits and the host bits. 0:03:48.080000 --> 0:03:52.980000 So this pattern, so theoretically, this is just theoretical right now, 0:03:52.980000 --> 0:04:00.160000 if this was where my network bits right here, that would mean that if 0:04:00.160000 --> 0:04:05.640000 I'm constructing an IP packet and the destination IP address of that packet 0:04:05.640000 --> 0:04:10.320000 had this exact same pattern, that would mean that destination resides 0:04:10.320000 --> 0:04:13.920000 in the same part of the network where I am. 0:04:13.920000 --> 0:04:19.080000 Whereas if the destination bits is some different pattern, that would 0:04:19.080000 --> 0:04:22.960000 mean, logically speaking, that the destination I'm trying to reach is 0:04:22.960000 --> 0:04:27.220000 not in my section of the network, but a different section of the network, 0:04:27.220000 --> 0:04:30.080000 which would mean my packet would have to go through a router. 0:04:30.080000 --> 0:04:35.080000 The only network my laptop knows about is a network he's sitting on right 0:04:35.080000 --> 0:04:38.440000 now, which is this as an example. 0:04:38.440000 --> 0:04:44.720000 Any other bit pattern is like telling my laptop, hey, go to Jupiter, go 0:04:44.720000 --> 0:04:47.120000 to Mars, go to the Nebula Galaxy. 0:04:47.120000 --> 0:04:50.600000 My laptop has no idea where the heck those things are, but what it does 0:04:50.600000 --> 0:04:55.180000 know is that in my network, in this network, there's a device with an 0:04:55.180000 --> 0:04:59.400000 IP address that starts out with the same pattern who is a router, who 0:04:59.400000 --> 0:05:03.520000 is a gateway, and if I send my packet to him, he knows how to get it to 0:05:03.520000 --> 0:05:07.440000 those remote destinations. 0:05:07.440000 --> 0:05:12.540000 Now, we as human beings can't deal with IP addresses, they're in binary 0:05:12.540000 --> 0:05:17.260000 like that. No problem for a computing device, but we can't work with that. 0:05:17.260000 --> 0:05:22.480000 So we sort of reformat this address, we look at it in a different way 0:05:22.480000 --> 0:05:24.900000 so it's something that's human readable that we can handle. 0:05:24.900000 --> 0:05:26.460000 So here's what we do. 0:05:26.460000 --> 0:05:30.480000 Step number one is we take that 32 -bit pattern there and we divide it 0:05:30.480000 --> 0:05:32.380000 up into four octets. 0:05:32.380000 --> 0:05:35.440000 Okay, remember an octet is a grouping of eight bits. 0:05:35.440000 --> 0:05:39.720000 So here I've just divided it into four equal pieces, each one is called 0:05:39.720000 --> 0:05:45.440000 an octet or a byte, and then we say, okay, we convert each one of those 0:05:45.440000 --> 0:05:52.780000 bytes from a binary number into a decimal number, and then we put a dot 0:05:52.780000 --> 0:05:55.980000 between those decimal numbers to represent that each one of those decimal 0:05:55.980000 --> 0:05:59.680000 numbers represents eight bits of binary. 0:05:59.680000 --> 0:06:03.520000 So you can see here the 192, that's my first eight bits. 0:06:03.520000 --> 0:06:05.620000 If you know anything about binary, you could add that up. 0:06:05.620000 --> 0:06:10.220000 You know the 128 and the 64 bits are turned on, giving us 192. 0:06:10.220000 --> 0:06:13.900000 The next grouping of eight bits translates to the number one in decimal. 0:06:13.900000 --> 0:06:18.100000 The next group is the number one in decimal and then the final octet in 0:06:18.100000 --> 0:06:21.460000 binary translates to three in decimal. 0:06:21.460000 --> 0:06:25.640000 So this is called dotted decimal notation, and this is how you will see 0:06:25.640000 --> 0:06:29.820000 and manipulate IP addresses is using dotted decimal notation. 0:06:29.820000 --> 0:06:32.840000 But just be aware that whenever you go into any system, whether it be 0:06:32.840000 --> 0:06:37.900000 your laptop, your PC, a router, a switch, and you type in an IP address, 0:06:37.900000 --> 0:06:42.340000 even though you're typing it as dotted decimal in the background, that 0:06:42.340000 --> 0:06:47.180000 computing device is translating it into one big long string of 32 bits 0:06:47.180000 --> 0:06:54.920000 in binary. Okay, so as I mentioned, devices that have IP before addresses, 0:06:54.920000 --> 0:06:59.500000 whatever they are, whether it be your wireless thermostat or your refrigerator, 0:06:59.500000 --> 0:07:03.640000 has to be able to know what network it's on. 0:07:03.640000 --> 0:07:09.200000 It has to be able to differentiate the networking bits from the host bits. 0:07:09.200000 --> 0:07:13.080000 Once it's able to do that, that will help it determine, okay, now that 0:07:13.080000 --> 0:07:16.560000 I've created an IP packet and I'm going to do, I'm going to compare the 0:07:16.560000 --> 0:07:19.520000 destination with the source, with myself. 0:07:19.520000 --> 0:07:24.440000 So anytime a laptop PC smartphone creates an IP packet, and it might be 0:07:24.440000 --> 0:07:30.140000 creating thousands of IP packets every second, every time it creates one, 0:07:30.140000 --> 0:07:35.780000 it compares the destination IP address with its own source IP address. 0:07:35.780000 --> 0:07:39.760000 And that device says, okay, well, of this 32-bit number, which represents 0:07:39.760000 --> 0:07:44.260000 me, I know these first few bits are my networking bits. 0:07:44.260000 --> 0:07:47.380000 That's the group or the part of the network I'm in. 0:07:47.380000 --> 0:07:49.220000 Let me look at the destination. 0:07:49.220000 --> 0:07:54.040000 Are the same bits in the destination matching my group? 0:07:54.040000 --> 0:07:58.040000 In other words, are the networking bits I have the same as the networking 0:07:58.040000 --> 0:08:00.500000 bits in this destination? 0:08:00.500000 --> 0:08:06.220000 If the answer is no, then it says, okay, this destination is off network. 0:08:06.220000 --> 0:08:08.660000 It's not on my network, it's on some other network. 0:08:08.660000 --> 0:08:12.040000 I need to forward this packet to my router, a default gateway who is in 0:08:12.040000 --> 0:08:14.480000 my network who can get it out there. 0:08:14.480000 --> 0:08:20.460000 If the answer is yes, that means, oh, okay, I can speak to that guy directly. 0:08:20.460000 --> 0:08:22.380000 I don't need to get the router involved. 0:08:22.380000 --> 0:08:26.620000 An analogy I sometimes make is think of it like this. 0:08:26.620000 --> 0:08:37.340000 Imagine that you are standing in the middle of your street, okay? 0:08:37.340000 --> 0:08:46.240000 And I tell you, hey, I want you to, let's say your street is first street, 0:08:46.240000 --> 0:08:50.280000 and I say, hey, I want you to talk to Bob on first street. 0:08:50.280000 --> 0:08:54.940000 Well, first street is your network, and you say, oh, Bob on first street. 0:08:54.940000 --> 0:08:56.360000 Well, I live on first street. 0:08:56.360000 --> 0:08:57.460000 He lives on first street. 0:08:57.460000 --> 0:09:01.440000 Therefore, I can just shout, hey, Bob, are you out there? 0:09:01.440000 --> 0:09:04.160000 And if Bob's on first street like me, he should be able to hear me shouting 0:09:04.160000 --> 0:09:07.460000 to him, and he and I should be able to talk directly. 0:09:07.460000 --> 0:09:12.860000 But if I say, hey, I need you to talk to Sally on 17th street. 0:09:12.860000 --> 0:09:17.960000 Well, now you say, oh, okay, well, someone called Sally, great, but she's 0:09:17.960000 --> 0:09:20.340000 on 17th street. That's not my street. 0:09:20.340000 --> 0:09:23.960000 You can shout as long as you want until the cows come home, and Sally's 0:09:23.960000 --> 0:09:26.240000 not going to hear you because she's not on your street. 0:09:26.240000 --> 0:09:28.740000 She could be in a different country for all you know. 0:09:28.740000 --> 0:09:30.640000 So in that case, where would you go? 0:09:30.640000 --> 0:09:33.100000 You would turn to the postal service. 0:09:33.100000 --> 0:09:35.900000 That's analogous to your router. 0:09:35.900000 --> 0:09:37.700000 And you'd say, hey, postal service. 0:09:37.700000 --> 0:09:41.740000 If I give you my message for Sally on 17th street, can you get it there? 0:09:41.740000 --> 0:09:44.080000 And if the postal service knows what they're doing, they'll say, of course 0:09:44.080000 --> 0:09:46.720000 we can. So you give your message to them. 0:09:46.720000 --> 0:09:49.040000 That's like giving your data to your router. 0:09:49.040000 --> 0:09:52.560000 And then they somehow behind the scenes, you don't know how they do it. 0:09:52.560000 --> 0:09:54.360000 You don't care how they do it. 0:09:54.360000 --> 0:09:58.580000 They get that information to Sally on 17th street. 0:09:58.580000 --> 0:10:02.180000 That's sort of like how routing happens with these packets. 0:10:02.180000 --> 0:10:06.920000 So here's an example, a more realistic or practical example here. 0:10:06.920000 --> 0:10:13.400000 So notice that we have Bob and Sally, and they have been able to identify 0:10:13.400000 --> 0:10:18.760000 of their own unique 32-bit addresses that the red bits are their networking 0:10:18.760000 --> 0:10:22.840000 bits. Now in this video, we're not going to go into how do they figure 0:10:22.840000 --> 0:10:26.420000 that out? Of this 32-bit number, how do I figure out which bits are my 0:10:26.420000 --> 0:10:27.240000 networking bits? 0:10:27.240000 --> 0:10:30.220000 We have another video coming up that will cover that topic. 0:10:30.220000 --> 0:10:33.540000 But let's assume that logic has already been done. 0:10:33.540000 --> 0:10:40.760000 And so Bob and Sally recognize that these bits here in red are their networking 0:10:40.760000 --> 0:10:45.560000 bits. So everybody on their network has that same pattern. 0:10:45.560000 --> 0:10:51.520000 Now Bob and Sally happen to be in the library. 0:10:51.520000 --> 0:10:56.740000 So everybody in the library, when they get an IP address, the first few 0:10:56.740000 --> 0:10:59.240000 bits is going to match this common pattern. 0:10:59.240000 --> 0:11:01.100000 That's their networking bits. 0:11:01.100000 --> 0:11:04.280000 Now down below though, that's not the library. 0:11:04.280000 --> 0:11:06.860000 Down below, that's the biology department. 0:11:06.860000 --> 0:11:10.700000 So because that's a completely different network, their networking bits 0:11:10.700000 --> 0:11:13.140000 have to take a different pattern. 0:11:13.140000 --> 0:11:19.080000 Now if Bob wants to send a packet to Sally, he's going to create that 0:11:19.080000 --> 0:11:22.180000 packet and he's very quickly going to recognize by doing a comparison 0:11:22.180000 --> 0:11:26.560000 of his source address against the destination that Sally's address is 0:11:26.560000 --> 0:11:29.080000 in the exact same network as himself. 0:11:29.080000 --> 0:11:32.120000 So he can just use this switch right here to talk to her. 0:11:32.120000 --> 0:11:35.360000 They can just talk directly back and forth with that switch. 0:11:35.360000 --> 0:11:39.480000 Similarly, if Sam wants to talk to Sue, they're in the same network. 0:11:39.480000 --> 0:11:41.500000 They can just use this switch. 0:11:41.500000 --> 0:11:48.140000 But if Sam wants to talk to Sally or Sam wants to talk to Bob, very quickly 0:11:48.140000 --> 0:11:52.680000 going to recognize that okay, Sam says this is my networking bits. 0:11:52.680000 --> 0:11:54.540000 The bits I'm trying to get to is this. 0:11:54.540000 --> 0:11:58.400000 Hmm, not the same pattern, different pattern. 0:11:58.400000 --> 0:12:03.740000 So now Sam is going to have to redirect his information to a router. 0:12:03.740000 --> 0:12:09.560000 And the router is going to have to somehow learn that this pattern right 0:12:09.560000 --> 0:12:13.420000 here is reachable via interface number one. 0:12:13.420000 --> 0:12:19.520000 And that this pattern right here is reachable via interface number two. 0:12:19.520000 --> 0:12:23.760000 Once the router knows that information, it can route packets back and 0:12:23.760000 --> 0:12:27.760000 forth. Between these two networks. 0:12:27.760000 --> 0:12:31.100000 So that concludes this video. 0:12:31.100000 --> 0:12:32.880000 Thank you for watching.