1 00:00:00,300 --> 00:00:02,969 In this lesson, I'm going to show you DHCP 2 00:00:02,969 --> 00:00:04,740 and how it works behind the scenes 3 00:00:04,740 --> 00:00:07,440 by looking at the packet as they go across our network. 4 00:00:07,440 --> 00:00:09,060 Now, when we look at DHCP here, 5 00:00:09,060 --> 00:00:11,010 I'm going to do it in a very simplistic manner, 6 00:00:11,010 --> 00:00:13,050 and I'm going to use a small office home office 7 00:00:13,050 --> 00:00:15,150 wireless router or wireless gateway. 8 00:00:15,150 --> 00:00:17,850 You can see that here on the left side of the screen. 9 00:00:17,850 --> 00:00:19,530 All right, so let's go ahead and get started here. 10 00:00:19,530 --> 00:00:21,210 We have a wireless router at the top, 11 00:00:21,210 --> 00:00:24,330 and I've got two clients, PC0 and PC1. 12 00:00:24,330 --> 00:00:26,940 Right now, PC0 is statically assigned, 13 00:00:26,940 --> 00:00:29,340 and PC1 is dynamically assigned. 14 00:00:29,340 --> 00:00:30,810 You can see that if I click on them. 15 00:00:30,810 --> 00:00:32,009 Here's PC1. 16 00:00:32,009 --> 00:00:33,810 You can see it is set up for DHCP, 17 00:00:33,810 --> 00:00:37,590 and it's pulled an address of 182.168.0.1 18 00:00:37,590 --> 00:00:39,030 as it's default gateway. 19 00:00:39,030 --> 00:00:40,920 And if I look at its actual interface card, 20 00:00:40,920 --> 00:00:44,460 you could see its IP address over here at 192.168.0.101. 21 00:00:46,380 --> 00:00:49,500 Now, if I look at PC0, you're going to see on PC0 22 00:00:49,500 --> 00:00:51,720 that I have a statically assigned default gateway, 23 00:00:51,720 --> 00:00:53,820 and that gateway doesn't match the DHCP one, 24 00:00:53,820 --> 00:00:54,660 which is why I'm having some 25 00:00:54,660 --> 00:00:56,190 communication problems with this one. 26 00:00:56,190 --> 00:00:58,770 So I decided I'm just going to make my life easy 27 00:00:58,770 --> 00:01:00,360 and set up DHCP. 28 00:01:00,360 --> 00:01:02,460 So I'm going to click on DHCP, 29 00:01:02,460 --> 00:01:05,010 and it will automatically switch me to DHCP. 30 00:01:05,010 --> 00:01:08,250 Now, once I click on DHCP, I'm going to minimize this window, 31 00:01:08,250 --> 00:01:09,960 and that way we can see it as it steps through 32 00:01:09,960 --> 00:01:11,400 the DORA process. 33 00:01:11,400 --> 00:01:12,900 So the first packet that's going to go out 34 00:01:12,900 --> 00:01:16,200 is going to be a broadcast message for the discover process. 35 00:01:16,200 --> 00:01:17,820 Notice here the destination. 36 00:01:17,820 --> 00:01:22,820 It is 255.255.255.255, and this tells us that 37 00:01:23,070 --> 00:01:25,740 that is the broadcast for layer three. 38 00:01:25,740 --> 00:01:26,670 And so we're going to send this out, 39 00:01:26,670 --> 00:01:28,440 and everybody connected over layer three 40 00:01:28,440 --> 00:01:30,030 is going to get this message. 41 00:01:30,030 --> 00:01:31,590 In this case, the only other person 42 00:01:31,590 --> 00:01:34,620 that's connected over layer three is wireless router zero. 43 00:01:34,620 --> 00:01:36,150 So when I do this 44 00:01:36,150 --> 00:01:38,700 and I hit the next button, we're going to send that packet up. 45 00:01:38,700 --> 00:01:40,500 It gets to wireless router zero. 46 00:01:40,500 --> 00:01:43,070 When it gets there, it accepts that and it processes it. 47 00:01:43,070 --> 00:01:45,720 It says, "Oh, somebody on this network 48 00:01:45,720 --> 00:01:47,370 wants to get an IP address." 49 00:01:47,370 --> 00:01:49,080 So this was the discovery phase. 50 00:01:49,080 --> 00:01:51,690 Since this wireless router has a DHCP server, 51 00:01:51,690 --> 00:01:54,390 it's going to say, "Great, I can give you an IP address, 52 00:01:54,390 --> 00:01:55,740 and I'm going to offer you one." 53 00:01:55,740 --> 00:01:57,570 So it's going to send a packet back, 54 00:01:57,570 --> 00:01:58,890 and when it sends that packet, 55 00:01:58,890 --> 00:02:00,900 we are going to send that out as a broadcast, 56 00:02:00,900 --> 00:02:03,740 so it goes to both PC0 and PC1. 57 00:02:03,740 --> 00:02:07,200 In this case, PC0 accepted it and PC1 didn't. 58 00:02:07,200 --> 00:02:08,729 Why didn't PC1 accept it? 59 00:02:08,729 --> 00:02:10,139 Because it didn't ask for it, 60 00:02:10,139 --> 00:02:11,550 it didn't do the discover process. 61 00:02:11,550 --> 00:02:13,140 So it says, "This isn't meant for me," 62 00:02:13,140 --> 00:02:14,850 and it simply drops that packet. 63 00:02:14,850 --> 00:02:15,683 Now, on the other hand, 64 00:02:15,683 --> 00:02:17,790 PC0 says, "I was looking for a message." 65 00:02:17,790 --> 00:02:19,740 And so this message came as a broadcast. 66 00:02:19,740 --> 00:02:22,470 You could see the destination there is listed as broadcast. 67 00:02:22,470 --> 00:02:24,510 Now, because this was sent as a broadcast message, 68 00:02:24,510 --> 00:02:26,850 it's coming over layer three at the broadcast. 69 00:02:26,850 --> 00:02:29,160 So again, you could see the destination IP address 70 00:02:29,160 --> 00:02:32,430 of 255.255.255.255, 71 00:02:32,430 --> 00:02:35,160 so everyone on this network got a copy of that, 72 00:02:35,160 --> 00:02:37,170 but only PC0 wanted it, 73 00:02:37,170 --> 00:02:39,390 so it's the only one that's going to process that message 74 00:02:39,390 --> 00:02:42,180 as indicated by those blue lines going over it. 75 00:02:42,180 --> 00:02:44,010 So next we're going to get that, 76 00:02:44,010 --> 00:02:46,470 and we've discovered where we asked for it, 77 00:02:46,470 --> 00:02:48,060 we received it as an offer, 78 00:02:48,060 --> 00:02:49,950 so now we need to request it 79 00:02:49,950 --> 00:02:52,110 and say, "Can I keep that address?" 80 00:02:52,110 --> 00:02:53,250 Now remember, we just sent that out to 81 00:02:53,250 --> 00:02:54,270 everybody in the network, 82 00:02:54,270 --> 00:02:55,800 so maybe there was two or three clients 83 00:02:55,800 --> 00:02:57,030 that wanted that address, 84 00:02:57,030 --> 00:02:58,410 so whichever one requests it 85 00:02:58,410 --> 00:03:00,720 is then going to get an acknowledgement from the server. 86 00:03:00,720 --> 00:03:04,680 So PC0 is going to go back and say, "I want this IP address." 87 00:03:04,680 --> 00:03:07,620 And so it sends its request as part of the DORA process. 88 00:03:07,620 --> 00:03:09,600 That goes up to wireless router zero. 89 00:03:09,600 --> 00:03:11,460 When it gets it, it's going to see it, 90 00:03:11,460 --> 00:03:13,800 and in this case, we are sending this as, 91 00:03:13,800 --> 00:03:15,300 again, a broadcast message 92 00:03:15,300 --> 00:03:17,430 because everything is being done in broadcasting 93 00:03:17,430 --> 00:03:19,080 or using DHCP. 94 00:03:19,080 --> 00:03:20,220 Now, once it gets up there 95 00:03:20,220 --> 00:03:21,810 and wireless router zero sees it, 96 00:03:21,810 --> 00:03:23,167 it's going to process that message and say, 97 00:03:23,167 --> 00:03:26,430 "Okay, I acknowledge that PC0 can have this." 98 00:03:26,430 --> 00:03:28,470 And so it sends out another message to everybody, 99 00:03:28,470 --> 00:03:30,210 and this goes to all the PCs, 100 00:03:30,210 --> 00:03:33,060 and again, just like before, this is a broadcast message, 101 00:03:33,060 --> 00:03:36,210 so if it wasn't intended for you, you're just going to drop it. 102 00:03:36,210 --> 00:03:39,030 This case, PC0 wanted it, so it accepts it, 103 00:03:39,030 --> 00:03:40,560 and we get that green check mark. 104 00:03:40,560 --> 00:03:44,520 At this point, PC0 should now have an IP address. 105 00:03:44,520 --> 00:03:46,200 So if we go into PC0, 106 00:03:46,200 --> 00:03:49,110 we should now see that there is a DHCP address assigned. 107 00:03:49,110 --> 00:03:53,400 Now notice we have a default gateway of 192.168.0.1 108 00:03:53,400 --> 00:03:57,240 that has been assigned as a dynamic DHCP gateway for us. 109 00:03:57,240 --> 00:03:59,460 Now, if we look at the wireless interface itself, 110 00:03:59,460 --> 00:04:01,050 we will see its actual IP address, 111 00:04:01,050 --> 00:04:04,710 in this case, 192.168.0.100 112 00:04:04,710 --> 00:04:08,610 with a subnet mask of 255.255.255.255.0 113 00:04:08,610 --> 00:04:10,950 which means we are now on this network, 114 00:04:10,950 --> 00:04:12,210 we have a valid IP, 115 00:04:12,210 --> 00:04:13,320 and we can start to communicate 116 00:04:13,320 --> 00:04:14,760 with other computers on this network, 117 00:04:14,760 --> 00:04:17,760 or out through that default gateway over to the internet 118 00:04:17,760 --> 00:04:19,980 if that wireless router is connected to a cable modem, 119 00:04:19,980 --> 00:04:21,660 or something else like that. 120 00:04:21,660 --> 00:04:25,260 All right, that is the quick and dirty way of how DHCP works 121 00:04:25,260 --> 00:04:26,553 through the DORA process. 122 00:04:26,553 --> 00:04:28,260 Now, the other thing we might want to look at 123 00:04:28,260 --> 00:04:30,480 is inside the wireless router itself. 124 00:04:30,480 --> 00:04:31,830 Now I'm going to go ahead and maximize this 125 00:04:31,830 --> 00:04:33,150 so you can see it a little better. 126 00:04:33,150 --> 00:04:36,210 And over here on the front page, you see the DHCP server. 127 00:04:36,210 --> 00:04:37,350 It is enabled here. 128 00:04:37,350 --> 00:04:39,720 That's why this wireless router was answering up 129 00:04:39,720 --> 00:04:41,340 and handing out IP addresses, 130 00:04:41,340 --> 00:04:43,500 because it has a DHCP server enabled. 131 00:04:43,500 --> 00:04:45,030 And you can see that the router has 132 00:04:45,030 --> 00:04:48,930 an IP address of 192.168.0.1. 133 00:04:48,930 --> 00:04:50,490 This is the default gateway, 134 00:04:50,490 --> 00:04:53,070 and this router is acting as that default gateway. 135 00:04:53,070 --> 00:04:57,570 We also see it's subnet mask, 255.255.255.255.0 136 00:04:57,570 --> 00:05:00,480 That means that we have 256 total IPs, 137 00:05:00,480 --> 00:05:02,880 one for the broadcast, one for the network name, 138 00:05:02,880 --> 00:05:05,280 and 254 that are reserved for clients. 139 00:05:05,280 --> 00:05:07,680 Now, when it comes to handing out DHCP addresses, 140 00:05:07,680 --> 00:05:09,120 where are we going to start that? 141 00:05:09,120 --> 00:05:11,430 Well, here you could see the start IP address. 142 00:05:11,430 --> 00:05:15,180 It's set at 192.168.0.100. 143 00:05:15,180 --> 00:05:18,420 Now, the maximum number of users we're going to hand out is 50. 144 00:05:18,420 --> 00:05:20,670 That means we're only going to hand out IP addresses 145 00:05:20,670 --> 00:05:24,540 that start with 192.168.0.100 146 00:05:24,540 --> 00:05:28,980 all the way up to 192.168.0.149 147 00:05:28,980 --> 00:05:31,680 giving me 50 total clients that we can use. 148 00:05:31,680 --> 00:05:33,060 Now, if you have a particular device 149 00:05:33,060 --> 00:05:35,250 that you want to always get the same IP address, 150 00:05:35,250 --> 00:05:38,310 like maybe a wireless printer, or a laptop, or a server, 151 00:05:38,310 --> 00:05:40,950 you can do that using DHCP reservations. 152 00:05:40,950 --> 00:05:43,680 In this device, you just click DHCP reservations, 153 00:05:43,680 --> 00:05:45,450 and here you'll see it's already been configured 154 00:05:45,450 --> 00:05:46,830 so that there are two devices 155 00:05:46,830 --> 00:05:48,750 that are getting IP addresses this way. 156 00:05:48,750 --> 00:05:53,040 We have one set at 192.168.0.101, 157 00:05:53,040 --> 00:05:54,090 and we know which one that was. 158 00:05:54,090 --> 00:05:55,410 That was PC1, 159 00:05:55,410 --> 00:06:00,090 and then we had 192.168.0.100, which was PC0, 160 00:06:00,090 --> 00:06:01,380 the one we just turned on 161 00:06:01,380 --> 00:06:03,300 and went through the DORA process for. 162 00:06:03,300 --> 00:06:05,310 This means that anytime I turn off that thing 163 00:06:05,310 --> 00:06:07,620 and I put it static, and I come back to doing dynamic, 164 00:06:07,620 --> 00:06:09,390 I'm always going to get the same address, 165 00:06:09,390 --> 00:06:11,190 because this is what I reserved for it. 166 00:06:11,190 --> 00:06:13,560 Now, if I didn't care what address I had for this device, 167 00:06:13,560 --> 00:06:15,360 I can go ahead and remove the mapping. 168 00:06:15,360 --> 00:06:16,470 In the instance of a laptop, 169 00:06:16,470 --> 00:06:18,570 I really don't care which IP it has, 170 00:06:18,570 --> 00:06:20,550 but if I had a printer, or a file server, 171 00:06:20,550 --> 00:06:21,840 or something like that, 172 00:06:21,840 --> 00:06:23,940 I might want to have a DHCP reservation, 173 00:06:23,940 --> 00:06:25,740 so it doesn't change each time. 174 00:06:25,740 --> 00:06:27,480 If you want to add something to this list, 175 00:06:27,480 --> 00:06:28,500 you can just give it a name, 176 00:06:28,500 --> 00:06:30,210 for instance, let's say I have a printer. 177 00:06:30,210 --> 00:06:32,580 I'm going to say that is going to be 103, 178 00:06:32,580 --> 00:06:34,890 and I'm going to save the MAC address for that printer. 179 00:06:34,890 --> 00:06:36,413 And nominally, I'm just going to say it's 180 00:06:36,413 --> 00:06:40,980 11:22:33:44:55:66, and then I'll hit add, 181 00:06:40,980 --> 00:06:43,350 and you'll see that it is now being reserved. 182 00:06:43,350 --> 00:06:44,730 Down here we have printer. 183 00:06:44,730 --> 00:06:48,570 We have the IP address of 192.168.0.103, 184 00:06:48,570 --> 00:06:50,910 and the MAC address that I just assigned. 185 00:06:50,910 --> 00:06:52,860 If I know longer want to have that reservation, 186 00:06:52,860 --> 00:06:54,960 I simply go over and click remove. 187 00:06:54,960 --> 00:06:57,000 Then because this is a graphical user interface, 188 00:06:57,000 --> 00:06:59,850 always click save settings so that your settings are saved 189 00:06:59,850 --> 00:07:01,380 and it is applied to that router. 190 00:07:01,380 --> 00:07:02,910 All right, hopefully you enjoyed 191 00:07:02,910 --> 00:07:05,190 that little demonstration with DHCP, 192 00:07:05,190 --> 00:07:06,780 and it helps you understand a little better 193 00:07:06,780 --> 00:07:10,080 how the whole DORA process works with a DHCP server, 194 00:07:10,080 --> 00:07:11,850 and when you might want to use scopes 195 00:07:11,850 --> 00:07:14,403 and reservations inside your DHCP setup.