1
1

00:00:00,280  -->  00:00:02,550
<v ->Layer 4, the transport layer.</v>
2

2

00:00:02,550  -->  00:00:05,120
Now, the transport layer is our dividing line
3

3

00:00:05,120  -->  00:00:08,110
between what we call the upper layers of the OSI model
4

4

00:00:08,110  -->  00:00:10,630
and the lower layers of that OSI model.
5

5

00:00:10,630  -->  00:00:12,350
Now, we've already covered the lower layers
6

6

00:00:12,350  -->  00:00:13,780
when we talked about the physical,
7

7

00:00:13,780  -->  00:00:15,790
the data link, and the network layers.
8

8

00:00:15,790  -->  00:00:18,370
And so now, we're going to move into the upper layers,
9

9

00:00:18,370  -->  00:00:20,910
starting with this layer, the transport layer,
10

10

00:00:20,910  -->  00:00:23,200
the session layer, the presentation layer,
11

11

00:00:23,200  -->  00:00:24,920
and the application layer.
12

12

00:00:24,920  -->  00:00:26,500
Now, in the next couple of lessons,
13

13

00:00:26,500  -->  00:00:28,789
we're going to cover each of these as we go forward.
14

14

00:00:28,789  -->  00:00:31,210
Now, segment is our datatype here
15

15

00:00:31,210  -->  00:00:33,400
when we're dealing with the transport layer.
16

16

00:00:33,400  -->  00:00:35,490
When we deal with segments and datagrams,
17

17

00:00:35,490  -->  00:00:38,010
we're talking about the transport layer.
18

18

00:00:38,010  -->  00:00:39,560
Now, as we talk about datagrams,
19

19

00:00:39,560  -->  00:00:42,350
we're going to go into those a little bit more later in depth.
20

20

00:00:42,350  -->  00:00:44,710
But for now, let's focus on the two protocols
21

21

00:00:44,710  -->  00:00:46,750
that we have inside layer 4,
22

22

00:00:46,750  -->  00:00:49,820
which are the TCP and the UDP protocols.
23

23

00:00:49,820  -->  00:00:50,980
And we're also going to introduce
24

24

00:00:50,980  -->  00:00:53,440
a couple of extra reliability features here
25

25

00:00:53,440  -->  00:00:55,910
known as windowing and buffering.
26

26

00:00:55,910  -->  00:00:58,180
Now, what is TCP?
27

27

00:00:58,180  -->  00:01:01,160
TCP is a transmission control protocol.
28

28

00:01:01,160  -->  00:01:03,240
It is a connection-oriented protocol,
29

29

00:01:03,240  -->  00:01:06,330
which means it's a reliable way to transport segments
30

30

00:01:06,330  -->  00:01:07,980
across our network.
31

31

00:01:07,980  -->  00:01:09,490
Now, if a segment has dropped,
32

32

00:01:09,490  -->  00:01:11,670
the protocol will actually ask for acknowledgment
33

33

00:01:11,670  -->  00:01:12,930
each and every time.
34

34

00:01:12,930  -->  00:01:14,780
If it doesn't get that acknowledgement,
35

35

00:01:14,780  -->  00:01:17,430
it's going to resend that piece of information.
36

36

00:01:17,430  -->  00:01:20,320
That's why we call this connection full protocol
37

37

00:01:20,320  -->  00:01:22,830
because it has this two-way type of information
38

38

00:01:22,830  -->  00:01:24,170
where I'm sending you information
39

39

00:01:24,170  -->  00:01:26,080
and I'm verifying you actually got it
40

40

00:01:26,080  -->  00:01:29,070
by listening that you got it and you give me a response.
41

41

00:01:29,070  -->  00:01:30,710
Now, let's look at this little diagram here
42

42

00:01:30,710  -->  00:01:31,795
on the screen for a second.
43

43

00:01:31,795  -->  00:01:34,120
You're going to see that I have a client on the left
44

44

00:01:34,120  -->  00:01:35,690
and a server on the right.
45

45

00:01:35,690  -->  00:01:38,750
Now, the client is going to send what's called a SYN packet
46

46

00:01:38,750  -->  00:01:41,537
or a synchronization packet over to the server.
47

47

00:01:41,537  -->  00:01:43,120
Now, when the server gets that,
48

48

00:01:43,120  -->  00:01:45,810
it's going to send back a synchronization acknowledgment
49

49

00:01:45,810  -->  00:01:48,490
to the client known as a SYN-ACK.
50

50

00:01:48,490  -->  00:01:50,610
Now, when the client gets that acknowledgement,
51

51

00:01:50,610  -->  00:01:53,290
it's going to send back its own acknowledgement to the server.
52

52

00:01:53,290  -->  00:01:54,950
This is known as the ACK.
53

53

00:01:54,950  -->  00:01:57,830
Now, when we do this SYN, SYN-ACK, ACK,
54

54

00:01:57,830  -->  00:02:00,940
this is what we refer to as a three-way handshake.
55

55

00:02:00,940  -->  00:02:03,620
Essentially, it's the client going, hey server,
56

56

00:02:03,620  -->  00:02:05,310
are you ready to get some information?
57

57

00:02:05,310  -->  00:02:07,390
And then the server says, sure, why not?
58

58

00:02:07,390  -->  00:02:08,780
Send me some information.
59

59

00:02:08,780  -->  00:02:10,987
And the client says, okay, here it comes.
60

60

00:02:10,987  -->  00:02:13,540
And then, the transmission is going to begin
61

61

00:02:13,540  -->  00:02:15,710
because we've established that three-way handshake
62

62

00:02:15,710  -->  00:02:18,141
and we know that both sides are ready to communicate.
63

63

00:02:18,141  -->  00:02:19,900
Now, are you ready?
64

64

00:02:19,900  -->  00:02:22,422
Yes, I am, here it comes.
65

65

00:02:22,422  -->  00:02:25,460
Now, every time this data, which we call a segment,
66

66

00:02:25,460  -->  00:02:27,050
is sent across the network,
67

67

00:02:27,050  -->  00:02:29,360
there is going to be an acknowledgment that it was received
68

68

00:02:29,360  -->  00:02:31,380
and that tells us there was successful
69

69

00:02:31,380  -->  00:02:33,330
two-way communication occurring.
70

70

00:02:33,330  -->  00:02:35,760
Now, if the server is expecting to get 100 pieces
71

71

00:02:35,760  -->  00:02:38,800
of information, but it only got 98 of those,
72

72

00:02:38,800  -->  00:02:40,020
it's going to say to the client,
73

73

00:02:40,020  -->  00:02:42,448
hey, you told me you're going to send me 100 things
74

74

00:02:42,448  -->  00:02:44,570
but you only sent me 98.
75

75

00:02:44,570  -->  00:02:46,770
Send me over those two things that I'm missing.
76

76

00:02:46,770  -->  00:02:48,739
And then a retransmission occurs.
77

77

00:02:48,739  -->  00:02:51,191
This way, the communication can go forth
78

78

00:02:51,191  -->  00:02:53,000
and we can always make sure we're getting
79

79

00:02:53,000  -->  00:02:55,030
what we're supposed to because we have this resending
80

80

00:02:55,030  -->  00:02:56,881
of the packets across the network.
81

81

00:02:56,881  -->  00:02:59,500
Now, this is used for all network data
82

82

00:02:59,500  -->  00:03:03,150
that needs to be assured to get to its final destination.
83

83

00:03:03,150  -->  00:03:05,780
I like to think about this like certified mail.
84

84

00:03:05,780  -->  00:03:08,780
If I want to send a message to the IRS, for example,
85

85

00:03:08,780  -->  00:03:10,330
I want to make sure that they get it
86

86

00:03:10,330  -->  00:03:11,940
and that doesn't get lost in the mail.
87

87

00:03:11,940  -->  00:03:13,960
So, I might pay a little extra money
88

88

00:03:13,960  -->  00:03:16,530
to get a certified receipt that when it gets there,
89

89

00:03:16,530  -->  00:03:19,140
they have to sign it and that gets mailed back to me.
90

90

00:03:19,140  -->  00:03:21,080
This way, when I get that receipt back,
91

91

00:03:21,080  -->  00:03:23,381
I know that the IRS got my mail package.
92

92

00:03:23,381  -->  00:03:25,835
That's the way TCP works.
93

93

00:03:25,835  -->  00:03:28,970
Now, on the other hand, we have another protocol
94

94

00:03:28,970  -->  00:03:30,272
known as UDP.
95

95

00:03:30,272  -->  00:03:33,560
UDP is what we call a connectionless protocol,
96

96

00:03:33,560  -->  00:03:35,757
meaning, it doesn't have to wait for connections.
97

97

00:03:35,757  -->  00:03:39,150
UDP stands for User Datagram Protocol
98

98

00:03:39,150  -->  00:03:40,610
and the reason why we call it a datagram
99

99

00:03:40,610  -->  00:03:42,470
is because if you're using UDP,
100

100

00:03:42,470  -->  00:03:44,080
you're using this type of data,
101

101

00:03:44,080  -->  00:03:45,400
it's called a datagram.
102

102

00:03:45,400  -->  00:03:47,820
And so, for the exam, I want you to remember
103

103

00:03:47,820  -->  00:03:51,650
that layer 4 is for segments almost exclusively
104

104

00:03:51,650  -->  00:03:53,950
because we use it with TCP.
105

105

00:03:53,950  -->  00:03:58,040
But if you're using UDP, this is now called a datagram.
106

106

00:03:58,040  -->  00:04:00,500
So, if you have a datagram or a segment,
107

107

00:04:00,500  -->  00:04:01,681
you're in layer 4.
108

108

00:04:01,681  -->  00:04:05,940
Now, when we talk about UDP, UDP is unreliable
109

109

00:04:05,940  -->  00:04:08,420
and it transmits segments called datagrams
110

110

00:04:08,420  -->  00:04:09,430
and if they're dropped,
111

111

00:04:09,430  -->  00:04:11,950
the sender will never even know that it happened.
112

112

00:04:11,950  -->  00:04:13,760
Now, why would I want to send stuff
113

113

00:04:13,760  -->  00:04:15,220
where the sender isn't aware of it
114

114

00:04:15,220  -->  00:04:16,629
and I don't get any kind of receipt?
115

115

00:04:16,629  -->  00:04:20,800
Well, UDP is really good for audio and visual streaming
116

116

00:04:20,800  -->  00:04:22,830
because you send a lot of data
117

117

00:04:22,830  -->  00:04:25,530
and there's a lot less overhead when you use UDP
118

118

00:04:25,530  -->  00:04:27,770
because we don't have that constant three-way handshake
119

119

00:04:27,770  -->  00:04:29,420
to establish it and we don't have
120

120

00:04:29,420  -->  00:04:31,900
all the checks and balances that are associated
121

121

00:04:31,900  -->  00:04:33,431
by using TCP.
122

122

00:04:33,431  -->  00:04:37,070
So, by using UDP, you can really increase the performance
123

123

00:04:37,070  -->  00:04:39,140
of your network because you're going to have
124

124

00:04:39,140  -->  00:04:40,720
zero retransmissions,
125

125

00:04:40,720  -->  00:04:42,830
you're just going to end up dropping information.
126

126

00:04:42,830  -->  00:04:44,410
Now, isn't that a bad thing?
127

127

00:04:44,410  -->  00:04:46,470
Why would we want to drop information?
128

128

00:04:46,470  -->  00:04:49,670
Well, for certain applications, it really doesn't matter.
129

129

00:04:49,670  -->  00:04:52,240
For example, you're streaming this video right now
130

130

00:04:52,240  -->  00:04:55,050
and if I dropped out for one hundredth of a second,
131

131

00:04:55,050  -->  00:04:56,470
would you even notice?
132

132

00:04:56,470  -->  00:04:57,850
Well, you probably wouldn't.
133

133

00:04:57,850  -->  00:04:59,720
And that's why UDP is so good
134

134

00:04:59,720  -->  00:05:02,450
because we can drop one 100th of the time here
135

135

00:05:02,450  -->  00:05:04,200
and you're really never even going to notice it
136

136

00:05:04,200  -->  00:05:06,050
and there won't be a retransmission.
137

137

00:05:06,050  -->  00:05:09,240
But with TCP, it's going to lead to a lot more buffering
138

138

00:05:09,240  -->  00:05:11,590
because you have to wait and then get resent to you
139

139

00:05:11,590  -->  00:05:14,170
and then put it in the right place and then play it back.
140

140

00:05:14,170  -->  00:05:16,700
And so, because of that acknowledgement and that overhead
141

141

00:05:16,700  -->  00:05:18,810
for every single second of this video,
142

142

00:05:18,810  -->  00:05:20,840
it's going to end up making a lot larger
143

143

00:05:20,840  -->  00:05:22,700
and use a lot more bandwidth.
144

144

00:05:22,700  -->  00:05:25,180
And that's one of the big reasons why we use UDP
145

145

00:05:25,180  -->  00:05:27,590
for video streaming and audio streaming.
146

146

00:05:27,590  -->  00:05:31,680
Now, let's do a quick little summary here of TCP versus UDP
147

147

00:05:31,680  -->  00:05:34,320
because this is a really, really important concept.
148

148

00:05:34,320  -->  00:05:36,550
In fact, if you have your notes out right now,
149

149

00:05:36,550  -->  00:05:38,080
I would write down this chart
150

150

00:05:38,080  -->  00:05:39,360
that I'm going to tell you right now
151

151

00:05:39,360  -->  00:05:41,470
as we talk about TCP versus UDP
152

152

00:05:41,470  -->  00:05:43,710
because it really is that important.
153

153

00:05:43,710  -->  00:05:46,300
Now first, TCP is reliable.
154

154

00:05:46,300  -->  00:05:49,970
It has a three-way handshake where UDP is not very reliable,
155

155

00:05:49,970  -->  00:05:51,470
it's an unreliable protocol
156

156

00:05:51,470  -->  00:05:54,090
because there is no three-way handshake.
157

157

00:05:54,090  -->  00:05:56,440
TCP is what we call connection-oriented
158

158

00:05:56,440  -->  00:05:58,154
or a connectionfull protocol
159

159

00:05:58,154  -->  00:05:59,810
because we have that three-way handshake
160

160

00:05:59,810  -->  00:06:03,570
in the acknowledgements but UDP is connectionless.
161

161

00:06:03,570  -->  00:06:05,490
It's a fire and forget method.
162

162

00:06:05,490  -->  00:06:07,080
I just start sending out information
163

163

00:06:07,080  -->  00:06:09,204
and hopefully you're going to get it.
164

164

00:06:09,204  -->  00:06:13,120
TCP uses segment retransmission and flow control
165

165

00:06:13,120  -->  00:06:14,670
that's being handled through windowing,
166

166

00:06:14,670  -->  00:06:16,710
which we're going to talk about more in just a second.
167

167

00:06:16,710  -->  00:06:19,990
UDP, on the other hand, there is no retransmission
168

168

00:06:19,990  -->  00:06:21,470
and no windowing.
169

169

00:06:21,470  -->  00:06:24,380
With TCP, we have segmentation of our sequencing
170

170

00:06:24,380  -->  00:06:26,050
of all of our different segments.
171

171

00:06:26,050  -->  00:06:28,620
With UDP, there is no sequencing.
172

172

00:06:28,620  -->  00:06:30,770
Now, what this means is, as I send everything out,
173

173

00:06:30,770  -->  00:06:33,980
I'm going to send it out in the proper order from one to 100.
174

174

00:06:33,980  -->  00:06:36,068
I'll do this for both TCP and UDP.
175

175

00:06:36,068  -->  00:06:38,150
Now, if you miss some of those pieces,
176

176

00:06:38,150  -->  00:06:39,600
or they arrive in a different order
177

177

00:06:39,600  -->  00:06:41,720
because they take different paths over the network,
178

178

00:06:41,720  -->  00:06:43,740
with TCP, they're sequencing
179

179

00:06:43,740  -->  00:06:45,387
so it knows that you have one to 1,000
180

180

00:06:45,387  -->  00:06:47,640
and it puts them back in the right sequence.
181

181

00:06:47,640  -->  00:06:50,090
With UDP, whatever they come in as,
182

182

00:06:50,090  -->  00:06:51,830
that's how it's going to broadcast it.
183

183

00:06:51,830  -->  00:06:55,752
And so, it can be coming in 1, 50, 2, 500,
184

184

00:06:55,752  -->  00:06:59,050
3, 4, 5, 6, 20,
185

185

00:06:59,050  -->  00:07:00,450
in any random order like that
186

186

00:07:00,450  -->  00:07:01,820
and that's how you're going to hear it.
187

187

00:07:01,820  -->  00:07:04,260
So, if video, you may hear a little bit of jumpiness,
188

188

00:07:04,260  -->  00:07:06,010
or a little bit of high-pitch squeaks
189

189

00:07:06,010  -->  00:07:06,960
or something like that
190

190

00:07:06,960  -->  00:07:09,055
because one of those frames may have come out of order.
191

191

00:07:09,055  -->  00:07:11,930
Now, when we go back to TCP, it is going to acknowledge
192

192

00:07:11,930  -->  00:07:13,210
each of those segments.
193

193

00:07:13,210  -->  00:07:15,000
And so, we have acknowledgment.
194

194

00:07:15,000  -->  00:07:17,040
If I don't get it, I know that I didn't get it
195

195

00:07:17,040  -->  00:07:20,230
and I can get it retransmitted to me and then get it again.
196

196

00:07:20,230  -->  00:07:22,440
With UDP, there is no acknowledgement.
197

197

00:07:22,440  -->  00:07:25,410
So, again, UDP has a lot less overhead
198

198

00:07:25,410  -->  00:07:26,790
because there's no connection,
199

199

00:07:26,790  -->  00:07:30,000
no windowing, no retransmission, no sequencing,
200

200

00:07:30,000  -->  00:07:31,332
and no acknowledgement.
201

201

00:07:31,332  -->  00:07:33,850
Now, if you have to get something there
202

202

00:07:33,850  -->  00:07:36,110
and you want to make sure the person got it,
203

203

00:07:36,110  -->  00:07:39,356
you really have to use TCP as your protocol of choice.
204

204

00:07:39,356  -->  00:07:42,160
And that's why we really are going to use TCP
205

205

00:07:42,160  -->  00:07:44,760
for things like banking and websites and ecommerce
206

206

00:07:44,760  -->  00:07:45,990
and things like that.
207

207

00:07:45,990  -->  00:07:48,130
But if we have something that has a lot of data
208

208

00:07:48,130  -->  00:07:49,760
like audio or video streaming,
209

209

00:07:49,760  -->  00:07:51,780
UDP really does well with that
210

210

00:07:51,780  -->  00:07:52,760
because we don't need to get
211

211

00:07:52,760  -->  00:07:54,550
every single piece of that file.
212

212

00:07:54,550  -->  00:07:57,760
We can skip a little bit here and there and that's okay.
213

213

00:07:57,760  -->  00:07:58,910
Now, earlier in the lesson,
214

214

00:07:58,910  -->  00:08:01,070
I mentioned a concept known as windowing
215

215

00:08:01,070  -->  00:08:02,730
and I said, we'd get to it later.
216

216

00:08:02,730  -->  00:08:04,040
Well, here we are.
217

217

00:08:04,040  -->  00:08:05,670
We're going to talk about windowing.
218

218

00:08:05,670  -->  00:08:07,270
Now, what is windowing?
219

219

00:08:07,270  -->  00:08:08,770
Windowing is going to allow the clients
220

220

00:08:08,770  -->  00:08:11,270
to adjust the amount of data in each segment
221

221

00:08:11,270  -->  00:08:13,051
as it goes through the transmission.
222

222

00:08:13,051  -->  00:08:15,120
This way, we can continually adjust
223

223

00:08:15,120  -->  00:08:17,650
to either send more or fewer pieces of data
224

224

00:08:17,650  -->  00:08:19,813
for each segment that's being transmitted.
225

225

00:08:19,813  -->  00:08:21,820
So, the whole idea here with windowing
226

226

00:08:21,820  -->  00:08:23,410
is that if you're sending data
227

227

00:08:23,410  -->  00:08:25,001
and you're getting a lot of retransmissions,
228

228

00:08:25,001  -->  00:08:27,560
well, you might be sending too much information.
229

229

00:08:27,560  -->  00:08:28,930
So, you need to back that down
230

230

00:08:28,930  -->  00:08:30,630
and close the window a little bit.
231

231

00:08:30,630  -->  00:08:32,420
So, you'll send less each time.
232

232

00:08:32,420  -->  00:08:34,410
Now, if you're not getting any retransmissions,
233

233

00:08:34,410  -->  00:08:36,390
it means you're probably not going fast enough.
234

234

00:08:36,390  -->  00:08:38,230
So, instead, we can open up that window
235

235

00:08:38,230  -->  00:08:40,737
and send more data with each of those segments.
236

236

00:08:40,737  -->  00:08:41,910
And then, if we start getting
237

237

00:08:41,910  -->  00:08:44,010
a lot more of those retransmissions happening again,
238

238

00:08:44,010  -->  00:08:46,410
well, we start closing that window down.
239

239

00:08:46,410  -->  00:08:48,306
And so, always we're opening and closing the window
240

240

00:08:48,306  -->  00:08:51,900
to maximize our throughput and our bandwidth here.
241

241

00:08:51,900  -->  00:08:54,020
So, if you ever copied a file over a network
242

242

00:08:54,020  -->  00:08:55,890
on a Windows machine, you've probably seen
243

243

00:08:55,890  -->  00:08:58,530
where it starts that movie file and it starts saying,
244

244

00:08:58,530  -->  00:09:00,350
hey, you have 20 minutes remaining
245

245

00:09:00,350  -->  00:09:02,460
and then it drops down to five minutes remaining,
246

246

00:09:02,460  -->  00:09:04,230
then it jumps up to 50 minutes remaining,
247

247

00:09:04,230  -->  00:09:06,750
and then 30 minutes remaining, and then an hour,
248

248

00:09:06,750  -->  00:09:07,972
and then it goes down to three minutes.
249

249

00:09:07,972  -->  00:09:10,170
And it has a really hard time estimating
250

250

00:09:10,170  -->  00:09:12,990
how long it's going to take to move that really large file
251

251

00:09:12,990  -->  00:09:15,640
off of your shared drive and onto your Windows computer.
252

252

00:09:15,640  -->  00:09:16,900
Now, why is that?
253

253

00:09:16,900  -->  00:09:18,980
Well, that's windowing at work.
254

254

00:09:18,980  -->  00:09:21,020
What's happening here is that as there's issues
255

255

00:09:21,020  -->  00:09:23,830
on the network, and there's a lot more retransmissions,
256

256

00:09:23,830  -->  00:09:26,580
the window decreases become smaller
257

257

00:09:26,580  -->  00:09:28,960
and that means, we have to send more segments
258

258

00:09:28,960  -->  00:09:31,440
to get all that data across, which takes more time.
259

259

00:09:31,440  -->  00:09:33,660
Now, as things go better,
260

260

00:09:33,660  -->  00:09:35,390
and the network starts flowing again,
261

261

00:09:35,390  -->  00:09:37,940
that window opens up and we can send less segments
262

262

00:09:37,940  -->  00:09:40,470
with more data each time and that's going to end up
263

263

00:09:40,470  -->  00:09:42,624
decreasing the time or making it go down.
264

264

00:09:42,624  -->  00:09:46,160
So, what happens here is as you can see on the screen,
265

265

00:09:46,160  -->  00:09:48,450
let's say that little green thing is what I'm sending
266

266

00:09:48,450  -->  00:09:50,360
and I start sending the information over
267

267

00:09:50,360  -->  00:09:52,610
but that red starts creeping up
268

268

00:09:52,610  -->  00:09:55,040
to where we start to not being able to keep up with it.
269

269

00:09:55,040  -->  00:09:58,280
So, we'll come back down and then the red can creep up again
270

270

00:09:58,280  -->  00:10:00,592
and then, we'll come back down and we'll keep doing that.
271

271

00:10:00,592  -->  00:10:02,520
Hopefully, the red and the green here
272

272

00:10:02,520  -->  00:10:04,660
will eventually match at a higher level
273

273

00:10:04,660  -->  00:10:05,503
than it was starting with.
274

274

00:10:05,503  -->  00:10:08,680
As soon as we open up that window and close that window,
275

275

00:10:08,680  -->  00:10:11,190
we can start out slow and then we can go faster
276

276

00:10:11,190  -->  00:10:13,760
by opening up that window and faster and faster
277

277

00:10:13,760  -->  00:10:15,600
until we have problems and then we'll start
278

278

00:10:15,600  -->  00:10:16,800
closing it down again.
279

279

00:10:16,800  -->  00:10:19,550
And we'll keep doing that over and over and over again,
280

280

00:10:19,550  -->  00:10:21,660
until we get the best bandwidth we can
281

281

00:10:21,660  -->  00:10:24,180
as we try to push as much as we can.
282

282

00:10:24,180  -->  00:10:27,170
So, for example, if I started counting numbers to you,
283

283

00:10:27,170  -->  00:10:28,800
I'm going to start going slow.
284

284

00:10:28,800  -->  00:10:32,695
One, two, three, that's pretty slow, right?
285

285

00:10:32,695  -->  00:10:35,000
You'll say okay, okay, I got it, Jason.
286

286

00:10:35,000  -->  00:10:35,950
You can go faster.
287

287

00:10:35,950  -->  00:10:37,490
So, I start talking faster.
288

288

00:10:37,490  -->  00:10:41,220
One, two, three, four, five, okay?
289

289

00:10:41,220  -->  00:10:42,860
That's still good, let's try again.
290

290

00:10:42,860  -->  00:10:43,750
One, two, three, four, five,
291

291

00:10:43,750  -->  00:10:45,950
oh, wait, wait, wait, wait, that's too fast, Jason.
292

292

00:10:45,950  -->  00:10:47,440
Okay, let me slow down.
293

293

00:10:47,440  -->  00:10:50,230
One, two, three, four, five, you got it?
294

294

00:10:50,230  -->  00:10:51,960
Okay, and we keep doing that.
295

295

00:10:51,960  -->  00:10:53,250
That's the idea of windowing.
296

296

00:10:53,250  -->  00:10:54,750
I'll speed up and I'll slow down
297

297

00:10:54,750  -->  00:10:56,560
until you don't have any errors copying down
298

298

00:10:56,560  -->  00:10:57,560
what I'm saying.
299

299

00:10:57,560  -->  00:10:59,150
That's the whole idea here.
300

300

00:10:59,150  -->  00:11:01,360
And we want to be able to send as much information to you
301

301

00:11:01,360  -->  00:11:02,940
as quickly as possible
302

302

00:11:02,940  -->  00:11:05,000
with the least amount of retransmissions
303

303

00:11:05,000  -->  00:11:07,323
but still getting the maximum throughput.
304

304

00:11:07,323  -->  00:11:10,670
Now, the next concept we want to talk about is buffering.
305

305

00:11:10,670  -->  00:11:12,310
If you've ever watched online video,
306

306

00:11:12,310  -->  00:11:14,450
you've probably dealt with buffering before.
307

307

00:11:14,450  -->  00:11:17,980
Now, devices such as routers have a special memory in them
308

308

00:11:17,980  -->  00:11:19,980
that will store segments if the bandwidth
309

309

00:11:19,980  -->  00:11:21,540
isn't readily available.
310

310

00:11:21,540  -->  00:11:23,270
Now, this is called the buffer.
311

311

00:11:23,270  -->  00:11:24,750
So, when it becomes available,
312

312

00:11:24,750  -->  00:11:26,920
it'll go ahead and start transmitting out the contents
313

313

00:11:26,920  -->  00:11:29,240
of that buffer and clear itself out.
314

314

00:11:29,240  -->  00:11:31,500
The same thing happens when you try to load a video.
315

315

00:11:31,500  -->  00:11:32,954
If the network is congested,
316

316

00:11:32,954  -->  00:11:35,510
it will take in a lot of information at first
317

317

00:11:35,510  -->  00:11:37,130
in anticipation of the fact
318

318

00:11:37,130  -->  00:11:38,750
that you're going to watch it faster,
319

319

00:11:38,750  -->  00:11:41,390
then, you're going to be able to download the rest of the video.
320

320

00:11:41,390  -->  00:11:43,030
And so, this is the idea with our buffering
321

321

00:11:43,030  -->  00:11:44,450
our routers, as well.
322

322

00:11:44,450  -->  00:11:46,910
So, if the buffer is going to overflow, though,
323

323

00:11:46,910  -->  00:11:49,130
and on a router you only have so much space
324

324

00:11:49,130  -->  00:11:51,070
and you start putting too much information there
325

325

00:11:51,070  -->  00:11:52,410
cause you can't send it out,
326

326

00:11:52,410  -->  00:11:53,940
then what's going to end up happening?
327

327

00:11:53,940  -->  00:11:55,080
You run out of memory.
328

328

00:11:55,080  -->  00:11:57,603
And when you run out of memory, the segment's will drop.
329

329

00:11:57,603  -->  00:11:59,980
So, let's look at an example of how buffering
330

330

00:11:59,980  -->  00:12:01,290
is going to work.
331

331

00:12:01,290  -->  00:12:03,350
Let's take a look at the buffer on the router
332

332

00:12:03,350  -->  00:12:06,150
and here we have router four in our diagram.
333

333

00:12:06,150  -->  00:12:08,938
Notice how it's kind of the central point of this diagram.
334

334

00:12:08,938  -->  00:12:12,480
Now, I have stuff coming into it from router number six,
335

335

00:12:12,480  -->  00:12:15,050
and router number one and router number three.
336

336

00:12:15,050  -->  00:12:17,770
So, if I look at all of those, there's 100 megabits,
337

337

00:12:17,770  -->  00:12:20,230
100 megabits, and 10 megabits.
338

338

00:12:20,230  -->  00:12:23,720
That's a possibility of 210 megabits per second
339

339

00:12:23,720  -->  00:12:26,219
of information going into router four.
340

340

00:12:26,219  -->  00:12:28,580
Now, if it needs to send that information out
341

341

00:12:28,580  -->  00:12:32,230
to router five, and there's only a 50 megabit connection,
342

342

00:12:32,230  -->  00:12:33,510
you can see pretty quickly
343

343

00:12:33,510  -->  00:12:35,437
that there's going to be a bottleneck here.
344

344

00:12:35,437  -->  00:12:37,500
Now, what's going to end up happening for us
345

345

00:12:37,500  -->  00:12:39,530
is that router four is going to have to catch
346

346

00:12:39,530  -->  00:12:42,190
all that extra information in its buffer.
347

347

00:12:42,190  -->  00:12:43,810
And when it has more availability,
348

348

00:12:43,810  -->  00:12:46,060
it'll send that information out to router five
349

349

00:12:46,060  -->  00:12:47,294
and clear its buffer.
350

350

00:12:47,294  -->  00:12:51,410
You may ask, why would we design a network this way?
351

351

00:12:51,410  -->  00:12:53,010
Well, often what's happening here
352

352

00:12:53,010  -->  00:12:56,560
is there isn't necessarily going to be 100% utilization
353

353

00:12:56,560  -->  00:12:58,940
from router four to router five.
354

354

00:12:58,940  -->  00:13:01,110
Maybe that's our exterior one connection
355

355

00:13:01,110  -->  00:13:02,580
going out to the Internet.
356

356

00:13:02,580  -->  00:13:04,920
In fact, router one may only be sending you
357

357

00:13:04,920  -->  00:13:07,520
10 or 15 megabits per second right now.
358

358

00:13:07,520  -->  00:13:09,600
And router three might be sending you 30.
359

359

00:13:09,600  -->  00:13:11,700
And router six might be sending you one
360

360

00:13:11,700  -->  00:13:14,230
which is all added together less than 50.
361

361

00:13:14,230  -->  00:13:16,030
So, no buffering would occur.
362

362

00:13:16,030  -->  00:13:18,310
Now, there's also the possibility that router one
363

363

00:13:18,310  -->  00:13:20,910
and router three sends us more information.
364

364

00:13:20,910  -->  00:13:23,000
And that can cause buffering to occur
365

365

00:13:23,000  -->  00:13:25,610
because router four can't send enough data out
366

366

00:13:25,610  -->  00:13:28,770
to router five over that 50 megabit per second connection.
367

367

00:13:28,770  -->  00:13:31,270
So, this is the idea, we want to buffer things and hold it
368

368

00:13:31,270  -->  00:13:34,280
and then as we have room, we can send that information out,
369

369

00:13:34,280  -->  00:13:36,148
clear the buffer, and keep on moving.
370

370

00:13:36,148  -->  00:13:38,610
Because when we look at your networks,
371

371

00:13:38,610  -->  00:13:41,470
the chances are not every device is communicating
372

372

00:13:41,470  -->  00:13:44,300
to 100% of its capability all of the time.
373

373

00:13:44,300  -->  00:13:47,370
And so, by doing this, we can pay for a smaller connection
374

374

00:13:47,370  -->  00:13:50,300
to the outside world that 50 megabit connection,
375

375

00:13:50,300  -->  00:13:51,870
as opposed to paying for a large
376

376

00:13:51,870  -->  00:13:55,230
and expensive fiber connection of one gigabit per second.
377

377

00:13:55,230  -->  00:13:56,720
So, we can keep our costs down
378

378

00:13:56,720  -->  00:13:59,370
by knowing what our utilization is over our network
379

379

00:13:59,370  -->  00:14:00,850
for the long period of time.
380

380

00:14:00,850  -->  00:14:02,810
Now, that gets into some more advanced concepts
381

381

00:14:02,810  -->  00:14:04,600
that as you work as a network engineer,
382

382

00:14:04,600  -->  00:14:06,330
you'll start working on those designs
383

383

00:14:06,330  -->  00:14:08,170
and as bandwidth keeps getting cheaper,
384

384

00:14:08,170  -->  00:14:10,290
it becomes less and less important for us,
385

385

00:14:10,290  -->  00:14:12,840
at least in the small office, home office environment.
386

386

00:14:12,840  -->  00:14:15,363
But in large corporations, this is a big deal.
387

387

00:14:15,363  -->  00:14:19,180
Now, what are some examples of layer 4 devices?
388

388

00:14:19,180  -->  00:14:23,060
Well, we have TCP and UDP as our protocols for layer 4.
389

389

00:14:23,060  -->  00:14:24,840
So, if you see TCP and UDP,
390

390

00:14:24,840  -->  00:14:26,423
you know you're dealing with layer 4.
391

391

00:14:26,423  -->  00:14:29,000
We also have things like WAN accelerators,
392

392

00:14:29,000  -->  00:14:31,550
where we try to add compression to our IP packets,
393

393

00:14:31,550  -->  00:14:33,480
and then we send those segments over
394

394

00:14:33,480  -->  00:14:35,020
through those WAN accelerators
395

395

00:14:35,020  -->  00:14:37,110
to get them through our network faster.
396

396

00:14:37,110  -->  00:14:39,280
We also have load balancers and firewalls
397

397

00:14:39,280  -->  00:14:40,810
that can operate at layer 4
398

398

00:14:40,810  -->  00:14:43,440
by blocking and allowing different ports and protocols
399

399

00:14:43,440  -->  00:14:44,360
to go through them.
400

400

00:14:44,360  -->  00:14:46,520
For example, if you've ever gone in your firewall
401

401

00:14:46,520  -->  00:14:49,800
and blocked a port like Port 80 over TCP,
402

402

00:14:49,800  -->  00:14:51,770
well, that is a layer 4 block
403

403

00:14:51,770  -->  00:14:53,760
because you're blocking the port, Port 80,
404

404

00:14:53,760  -->  00:14:56,830
which is web traffic and the protocol TCP,
405

405

00:14:56,830  -->  00:14:58,853
which is our protocol at layer 4.
