1 00:00:00,000 --> 00:00:02,430 Welcome to layer two of the OSI Model, 2 00:00:02,430 --> 00:00:04,050 the data link layer. 3 00:00:04,050 --> 00:00:05,130 In the data link layer, 4 00:00:05,130 --> 00:00:07,920 we're going to package up the bits we got from layer one 5 00:00:07,920 --> 00:00:09,330 and put those into frames, 6 00:00:09,330 --> 00:00:10,560 and then we're going to take those frames 7 00:00:10,560 --> 00:00:12,870 and transmit them throughout the network 8 00:00:12,870 --> 00:00:15,690 while performing some error detection, correction, 9 00:00:15,690 --> 00:00:18,960 identifying unique network devices using MAC addresses, 10 00:00:18,960 --> 00:00:21,150 and we're going to provide some flow control. 11 00:00:21,150 --> 00:00:24,240 Now a MAC address is a media access control address, 12 00:00:24,240 --> 00:00:27,390 which is a means for identifying a device physically 13 00:00:27,390 --> 00:00:30,240 and allowing it to operate on a logical topology. 14 00:00:30,240 --> 00:00:32,580 So when we started talking about physical topologies 15 00:00:32,580 --> 00:00:34,890 in the last lesson and the last layer, 16 00:00:34,890 --> 00:00:36,480 we dealt with things physically, 17 00:00:36,480 --> 00:00:39,690 but now we have to deal with things on a logical level. 18 00:00:39,690 --> 00:00:42,120 These MAC addresses are incredibly important 19 00:00:42,120 --> 00:00:45,180 for dealing with switches and other layer two devices. 20 00:00:45,180 --> 00:00:47,460 When it comes to identifying MAC addresses, 21 00:00:47,460 --> 00:00:49,320 every manufacturer of a network card 22 00:00:49,320 --> 00:00:52,470 assigns a unique 48-bit physical addressing system 23 00:00:52,470 --> 00:00:55,200 to every network interface card they produced. 24 00:00:55,200 --> 00:00:58,590 As you can see here, we have 12-digit hexadecimal numbers 25 00:00:58,590 --> 00:01:01,380 that are used to represent these MAC addresses. 26 00:01:01,380 --> 00:01:04,230 These MAC addresses are always written hexadecimally, 27 00:01:04,230 --> 00:01:05,940 where each of the letters or numbers 28 00:01:05,940 --> 00:01:08,070 is considered four bits. 29 00:01:08,070 --> 00:01:11,760 The first 24 bits, or the 6 letters as you can see here, 30 00:01:11,760 --> 00:01:15,240 identifies the particular vendor who made that card. 31 00:01:15,240 --> 00:01:19,470 In our example, we have D2:51:F1, 32 00:01:19,470 --> 00:01:21,240 and this is going to uniquely identify 33 00:01:21,240 --> 00:01:23,700 whichever person made this card. 34 00:01:23,700 --> 00:01:25,920 I like to think about this like a Social Security Number 35 00:01:25,920 --> 00:01:27,210 in the United States. 36 00:01:27,210 --> 00:01:29,010 If you look at the first three digits, 37 00:01:29,010 --> 00:01:31,020 it's going to identify the state and the year 38 00:01:31,020 --> 00:01:32,580 that person was born in. 39 00:01:32,580 --> 00:01:37,580 For instance, if my social security number was 123-45-6789, 40 00:01:37,890 --> 00:01:39,480 the first three digits might say 41 00:01:39,480 --> 00:01:40,980 when and where I was born. 42 00:01:40,980 --> 00:01:44,190 Maybe it was California in the year 1955. 43 00:01:44,190 --> 00:01:46,650 And that the rest of it, those other six digits, 44 00:01:46,650 --> 00:01:48,720 are going to uniquely identify me. 45 00:01:48,720 --> 00:01:50,310 Well, this is the same thing that happens 46 00:01:50,310 --> 00:01:51,390 with a MAC address. 47 00:01:51,390 --> 00:01:54,450 The first half of the MAC address, the first six digits, 48 00:01:54,450 --> 00:01:56,070 is going to tell us who made it. 49 00:01:56,070 --> 00:01:59,640 Was it made by Apple, Dell, Ralink, or whatever? 50 00:01:59,640 --> 00:02:02,550 The second half is going to represent the exact machine 51 00:02:02,550 --> 00:02:03,750 it belongs to. 52 00:02:03,750 --> 00:02:05,940 This is important for our logical topology 53 00:02:05,940 --> 00:02:07,710 because we can look at the MAC address 54 00:02:07,710 --> 00:02:10,530 and observe the flow of data going through our networks. 55 00:02:10,530 --> 00:02:11,460 And at this point, 56 00:02:11,460 --> 00:02:13,080 we don't really care how these devices 57 00:02:13,080 --> 00:02:14,550 are physically connected. 58 00:02:14,550 --> 00:02:17,430 The issue at that point is a level one issue. 59 00:02:17,430 --> 00:02:18,510 But now at level two, 60 00:02:18,510 --> 00:02:21,480 we care about whose turn it is to talk and transmit 61 00:02:21,480 --> 00:02:24,390 so other devices aren't talking over each other. 62 00:02:24,390 --> 00:02:26,280 For example, when I teach this course 63 00:02:26,280 --> 00:02:27,600 in a classroom environment, 64 00:02:27,600 --> 00:02:28,830 instead of all of the students 65 00:02:28,830 --> 00:02:30,540 shouting out their answers at once, 66 00:02:30,540 --> 00:02:32,760 we use a system of raising our hands. 67 00:02:32,760 --> 00:02:35,010 We wait for the teacher to call on one of the students, 68 00:02:35,010 --> 00:02:37,440 and then we can let them ask a question. 69 00:02:37,440 --> 00:02:39,540 This is how we control the information flow 70 00:02:39,540 --> 00:02:41,610 so that everyone can hear each other. 71 00:02:41,610 --> 00:02:44,130 In a network, we use electronic mechanisms 72 00:02:44,130 --> 00:02:45,720 to do this same thing. 73 00:02:45,720 --> 00:02:47,100 Now logical link control 74 00:02:47,100 --> 00:02:48,870 is going to provide connection services 75 00:02:48,870 --> 00:02:50,310 and allow your recipients 76 00:02:50,310 --> 00:02:52,500 to acknowledge the messages have actually gotten 77 00:02:52,500 --> 00:02:54,030 where you thought they were going. 78 00:02:54,030 --> 00:02:56,100 So for example, if I called up 79 00:02:56,100 --> 00:02:57,600 and I asked if you got my phone call, 80 00:02:57,600 --> 00:02:58,710 you could say yes 81 00:02:58,710 --> 00:03:00,450 and that would acknowledge the receipt of that 82 00:03:00,450 --> 00:03:02,790 and then we can move on to the next message. 83 00:03:02,790 --> 00:03:05,280 Logical link control does this for our networks, 84 00:03:05,280 --> 00:03:06,210 and because of this, 85 00:03:06,210 --> 00:03:09,060 it's the most basic form of flow control. 86 00:03:09,060 --> 00:03:11,490 Essentially, it's going to limit the amount of data 87 00:03:11,490 --> 00:03:13,110 that a sender can send at once 88 00:03:13,110 --> 00:03:16,050 and allow the receiver to keep from being overwhelmed. 89 00:03:16,050 --> 00:03:18,180 So if I go back to my classroom example, 90 00:03:18,180 --> 00:03:20,670 if I'm sitting there and I'm moving too quickly, 91 00:03:20,670 --> 00:03:22,267 a student might raise their hand and say, 92 00:03:22,267 --> 00:03:24,360 "Hey Jason, I don't understand this. 93 00:03:24,360 --> 00:03:26,190 Can you slow down and repeat it?" 94 00:03:26,190 --> 00:03:28,890 In the case of this video, you can just pause or go back 95 00:03:28,890 --> 00:03:30,150 and watch that part again. 96 00:03:30,150 --> 00:03:30,983 But in a classroom, 97 00:03:30,983 --> 00:03:33,570 they can't so they may ask me to repeat it. 98 00:03:33,570 --> 00:03:36,360 Logical link control, it similarly does the same thing, 99 00:03:36,360 --> 00:03:38,400 allowing a device to make this request 100 00:03:38,400 --> 00:03:40,560 for either less information at a time 101 00:03:40,560 --> 00:03:42,930 or to replay that information. 102 00:03:42,930 --> 00:03:44,760 Logical link control also gives us 103 00:03:44,760 --> 00:03:46,770 some basic error control functions, 104 00:03:46,770 --> 00:03:48,900 such as allowing the receiver to inform the sender 105 00:03:48,900 --> 00:03:51,000 if their data frame wasn't received 106 00:03:51,000 --> 00:03:52,860 or if it was received corrupted. 107 00:03:52,860 --> 00:03:55,230 And it does this by using a checksum. 108 00:03:55,230 --> 00:03:56,670 Now since everything it receives 109 00:03:56,670 --> 00:03:58,770 is just a series of ones and zeros, 110 00:03:58,770 --> 00:04:00,600 the receiver's going to add all of these up 111 00:04:00,600 --> 00:04:03,330 and the last bit will either be even or odd. 112 00:04:03,330 --> 00:04:05,880 If it matches, they add them all up and they're even, 113 00:04:05,880 --> 00:04:07,710 then it's going to assume that this was good 114 00:04:07,710 --> 00:04:10,530 if you had received a zero, meaning it was even. 115 00:04:10,530 --> 00:04:13,680 If the last bit was odd, meaning it was a one, 116 00:04:13,680 --> 00:04:14,820 and they added up all the numbers 117 00:04:14,820 --> 00:04:16,410 and they got an odd number, 118 00:04:16,410 --> 00:04:18,120 that means it was good as well. 119 00:04:18,120 --> 00:04:20,700 But if not, they can figure that something was bad 120 00:04:20,700 --> 00:04:23,850 and then ask for a retransmission of the frame. 121 00:04:23,850 --> 00:04:26,700 Now communication can be synchronized across layer two, 122 00:04:26,700 --> 00:04:29,160 according to three different schemes. 123 00:04:29,160 --> 00:04:31,410 We have something known as isochronous mode, 124 00:04:31,410 --> 00:04:32,520 which happens when the networks 125 00:04:32,520 --> 00:04:35,520 use a common reference clock, similar to synchronous, 126 00:04:35,520 --> 00:04:38,280 yet they also create time slots for transmissions, 127 00:04:38,280 --> 00:04:41,010 much like we did with time-division multiplexing. 128 00:04:41,010 --> 00:04:43,620 This has less overhead than either the other two modes 129 00:04:43,620 --> 00:04:46,080 because both devices know when they can communicate 130 00:04:46,080 --> 00:04:48,240 and for exactly how long. 131 00:04:48,240 --> 00:04:51,180 The second method we can use is known as synchronous method, 132 00:04:51,180 --> 00:04:53,670 and this is much like we use back in layer one. 133 00:04:53,670 --> 00:04:56,370 It's going to involve devices using the same clock, 134 00:04:56,370 --> 00:04:58,770 but the reason it's different from isochronous 135 00:04:58,770 --> 00:05:00,000 is that this is going to allow us 136 00:05:00,000 --> 00:05:01,680 to have beginning and ending frames 137 00:05:01,680 --> 00:05:03,990 and special control characters to tell us 138 00:05:03,990 --> 00:05:06,480 when we're going to start and when we're going to end 139 00:05:06,480 --> 00:05:08,190 based on those beats. 140 00:05:08,190 --> 00:05:10,290 For example, if I use in music, 141 00:05:10,290 --> 00:05:12,540 I have songs that have various time signatures, 142 00:05:12,540 --> 00:05:15,660 things like 3/4 or 4/4 timing. 143 00:05:15,660 --> 00:05:18,600 This tells us how many beats are in each measure. 144 00:05:18,600 --> 00:05:20,820 Our networks operate much the same way 145 00:05:20,820 --> 00:05:22,530 in that our devices can only communicate 146 00:05:22,530 --> 00:05:26,400 at frequency specified by these particular clock cycles. 147 00:05:26,400 --> 00:05:28,560 Because of this, there isn't a lot of gap time 148 00:05:28,560 --> 00:05:30,450 that isn't already properly utilized, 149 00:05:30,450 --> 00:05:33,720 and this becomes a major drawback for synchronized mode. 150 00:05:33,720 --> 00:05:36,060 And finally, of course, we have asynchronous, 151 00:05:36,060 --> 00:05:37,980 which is going to allow each of our network devices 152 00:05:37,980 --> 00:05:39,960 to reference their own clock cycles 153 00:05:39,960 --> 00:05:42,240 and use their own start and stop bits. 154 00:05:42,240 --> 00:05:44,310 In this way, there's no real control 155 00:05:44,310 --> 00:05:46,680 over when the devices are allowed to communicate though, 156 00:05:46,680 --> 00:05:49,050 and that becomes the major drawback here. 157 00:05:49,050 --> 00:05:50,760 Now when we look at layer two devices, 158 00:05:50,760 --> 00:05:53,100 we have things like network interface cards, 159 00:05:53,100 --> 00:05:54,900 bridges, and switches. 160 00:05:54,900 --> 00:05:57,450 In contrast to how a hub is a dumb machine 161 00:05:57,450 --> 00:05:59,280 that simply relies on a message coming in 162 00:05:59,280 --> 00:06:00,840 and repeating it back out, 163 00:06:00,840 --> 00:06:02,670 switches are smarter. 164 00:06:02,670 --> 00:06:04,290 They can actually use logic 165 00:06:04,290 --> 00:06:06,780 to learn which physical ports are attached 166 00:06:06,780 --> 00:06:09,420 to which devices based on their MAC addresses. 167 00:06:09,420 --> 00:06:11,220 And in this way, they can send data 168 00:06:11,220 --> 00:06:13,290 to specific devices in the network, 169 00:06:13,290 --> 00:06:15,660 allowing us to pick up and choose different lines 170 00:06:15,660 --> 00:06:18,060 of communication to go to different areas. 171 00:06:18,060 --> 00:06:20,640 Now we'll talk all about how this works 172 00:06:20,640 --> 00:06:22,290 and how these switches do this, 173 00:06:22,290 --> 00:06:25,200 including things like CAM tables using the MAC addresses 174 00:06:25,200 --> 00:06:26,460 and how they're doing the switching 175 00:06:26,460 --> 00:06:28,950 across the network in later lessons. 176 00:06:28,950 --> 00:06:30,360 And we'll go into depth in that 177 00:06:30,360 --> 00:06:32,040 because you will need to understand that 178 00:06:32,040 --> 00:06:34,140 to understand how networks really work. 179 00:06:34,140 --> 00:06:37,920 But for right now, just remember that switches, bridges, 180 00:06:37,920 --> 00:06:40,860 and MAC addresses are three great examples of things 181 00:06:40,860 --> 00:06:43,743 that operate at layer two, the data link layer.