1 00:00:00,240 --> 00:00:06,330 So in this example, are these devices in the same subnet or in different subnets? 2 00:00:06,510 --> 00:00:15,000 The PC on the left has an IP address of 10.1 1.1 with a subnet mask of 255.255.0.0. 3 00:00:15,180 --> 00:00:23,490 The device on the right has an IP address of 10.1 or 2.1 with a mosque of 255.255.020. 4 00:00:23,700 --> 00:00:29,910 So the device on the left does the following when it wants to communicate with the device on the right. 5 00:00:29,940 --> 00:00:33,500 It does a logical and on the network portion of the address. 6 00:00:33,510 --> 00:00:38,910 So at first determines which portion of its address is the network portion. 7 00:00:38,910 --> 00:00:44,910 And then it compares that to the network portion of the device that it's wanting to communicate with. 8 00:00:45,060 --> 00:00:48,990 So in this example, the network portion is 10.1. 9 00:00:49,290 --> 00:00:55,380 So in other words, the first two octets of the address on network, the device checks the first two 10 00:00:55,380 --> 00:01:01,130 octets of the other device to see if it's the same as its local network portion. 11 00:01:01,140 --> 00:01:03,390 And in this example, they are the same. 12 00:01:03,390 --> 00:01:10,110 So the device on the left will send traffic to the device on the right directly, and it will not try 13 00:01:10,110 --> 00:01:12,870 and send the traffic to its default gateway. 14 00:01:13,080 --> 00:01:20,910 What it will do is send an OPP message onto the local segment requesting the MAC address associated 15 00:01:20,910 --> 00:01:23,950 with IP address 10.1 to 2.1. 16 00:01:23,970 --> 00:01:32,310 It will try and communicate with 10.1 or 2.1 on the local segment directly and not send the traffic 17 00:01:32,310 --> 00:01:33,810 to a default gateway. 18 00:01:33,810 --> 00:01:39,420 And the reason for that is that the network portion of the addresses are the same. 19 00:01:39,420 --> 00:01:46,090 So the local device knows that the other device is on the same local segment as itself. 20 00:01:46,110 --> 00:01:50,070 In this example, the network mosque has changed. 21 00:01:50,070 --> 00:01:54,600 It's 255.255.255.0. 22 00:01:54,780 --> 00:02:01,650 So the device on the left will do a logical and and check whether the network portion of the device 23 00:02:01,650 --> 00:02:06,810 that it's wanting to communicate with is the same as its network portion. 24 00:02:07,050 --> 00:02:14,460 So based on the subnet mask, the local devices network portion is 10.11. 25 00:02:14,460 --> 00:02:21,210 The device it's wanting to communicate with has a network portion of ten .1.2. 26 00:02:21,210 --> 00:02:24,300 So in this case, the network portion is different. 27 00:02:24,390 --> 00:02:31,500 So the local host knows that the device that it's wanting to communicate with is on a different subnet 28 00:02:31,500 --> 00:02:32,580 to itself. 29 00:02:32,730 --> 00:02:39,060 So because these two devices are on different subnets, the local device will send its traffic to its 30 00:02:39,060 --> 00:02:40,380 configured default. 31 00:02:40,380 --> 00:02:47,310 Gateway PCs will send traffic to their default gateways when a default gateway is configured. 32 00:02:47,340 --> 00:02:53,550 In this example, let's assume that a default gateway is configured, and that's normally what happens 33 00:02:53,550 --> 00:02:55,560 in a real world implementation. 34 00:02:55,560 --> 00:03:01,890 So the PC is trying to talk to a device in a different subnet so it'll send its traffic to its default 35 00:03:01,890 --> 00:03:02,610 gateway. 36 00:03:02,820 --> 00:03:09,810 So in summary, the subnet mask allows the local device to determine whether the device that it's trying 37 00:03:09,810 --> 00:03:16,590 to communicate with is on the same subnet as itself or if it's on a different subnet. 38 00:03:16,920 --> 00:03:23,970 Now, Cisco and most network vendors do not support just contiguous subnet masks. 39 00:03:24,030 --> 00:03:29,250 A discontinuous subnet mask would look something like the following notice. 40 00:03:29,250 --> 00:03:38,040 In the binary we have binary ones, then binary zeros, then binary ones, binary zeros, binary ones, 41 00:03:38,040 --> 00:03:40,500 binary zeros and so forth and so on. 42 00:03:40,590 --> 00:03:48,770 This type of discontinuous subnet mask is not supported, only contiguous subnet masks are supported. 43 00:03:48,780 --> 00:03:57,480 In this example, we have contiguous or continuous ones in the binary and then contiguous or continuous 44 00:03:57,480 --> 00:03:59,400 zeros in the binary. 45 00:03:59,640 --> 00:04:06,030 Converting that to decimal gives us a value of 255 to 40.00. 46 00:04:06,060 --> 00:04:14,130 In this example, notice we have contiguous ones in binary and then contiguous zeros in binary, giving 47 00:04:14,130 --> 00:04:20,820 us a result in decimal of 255.255.192.0. 48 00:04:21,240 --> 00:04:28,050 So in a subnet mask we must start with binary ones and they must be contiguous. 49 00:04:28,320 --> 00:04:36,000 So you cannot have binary ones, then binary zeros, then binary ones and so forth and so on. 50 00:04:36,000 --> 00:04:40,740 They must be contiguous ones and then contiguous zeros. 51 00:04:41,010 --> 00:04:47,910 So you can't, for argument's sake, have a subnet mask, something like 0.0.0. 240. 52 00:04:47,910 --> 00:04:49,770 That's not supported. 53 00:04:49,950 --> 00:04:55,650 Subnet masks have to be contiguous ones, followed by contiguous zeros. 54 00:04:55,800 --> 00:04:59,280 This contiguous subnet masks are not supported. 55 00:04:59,280 --> 00:04:59,820 And thank. 56 00:04:59,890 --> 00:05:06,460 Goodness for that because it makes our lives as a network engineers a lot easier to have. 57 00:05:06,460 --> 00:05:08,680 Contiguous subnet masks.