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