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