-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmod1-08.html
511 lines (462 loc) · 26.5 KB
/
mod1-08.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Advanced Networking - Module 1 Chapter 8 - Subnetting IP Networks</title>
<meta name="description" content="Abilitante alle certificazioni Cisco CCENT e CCNA">
<meta name="author" content="Hacklab Cosenza">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/hlcs.css" id="theme">
<!-- Code syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<h1>Advanced Networking</h1>
<h2>Routing & Switching:</h2>
<h2>Introduction to Networks</h2>
<h3>Chapter 8: Subnetting IP Networks</h3>
<small><a href="http://hlcs.it">Hacklab Cosenza</a> / Centro di Ricerca su Tecnologia e Innovazione</small>
</section>
<section>
<h2>Why Subnetting?</h2>
<p><strong>Subnetting</strong> is the deepening of the network/host hierarcy into a network/<em>subnet(s)</em>/host one.</p>
<p><small>The terms <em>network</em> and <em>subnet</em> both identify computer networks. <em>Subnet</em> is just used to imply that we are talking about <strong>a part of some larger address space</strong>.</small></p>
<ul>
<li><strong>Optimizing address space usage</strong> by wasting less.</li>
<li>By minimizing the definition of "local", we can <strong>reduce broadcast</strong> traffic (smaller <em>broadcast domain</em>).</li>
<li>A <strong>better packet delivery</strong> can be achieved by providing more network targets to meet our routing requirements. This is called <em>network segmentation</em>.</li>
<li>Creating more targets against which to define our policies can also <strong>improve security</strong>.</li>
</ul>
</section>
<section>
<h2>Subnetting and Routing</h2>
<p>Subnetting means taking a <strong>single network address</strong> and partitioning it into <strong>multiple logical networks</strong>.</p>
<p>Subnets <strong>are</strong> networks, so as with any multiple networks <strong>you need routing</strong> to exchange traffic between subnets.</p>
<p>As in every network, for every subnet you need to configure:</p>
<ul>
<li>every host with <strong>network address, subnet mask and default gateway</strong> appropriate to the subnet they belong to.</li>
<li>the router interface that is part of the subnet with <strong>an IPv4 address that belongs to the subnet</strong> range.</li>
</ul>
</section>
<section>
<h2>Planning Subnetting</h2>
<p>What we'll learn about <strong>subnetting will apply to both public and private IPv4 address space</strong>. Subnetting public addresses is an ISP concern, we'll focus on subnetting private blocks.</p>
<p>So we start with private IP address ranges:</p>
<ul>
<li>10.0.0.0/8 (subnet mask 255.0.0.0)</li>
<li>172.16.0.0/12 (subnet mask 255.240.0.0)</li>
<li>192.168.0.0/16 (subnet mask 255.255.0.0)</li>
</ul>
<p>and then we ask ourselves these questions:</p>
<p><em>How many subnets? What belongs to each subnet? How many hosts for each? What will I need in the future?</em></p>
</section>
<section>
<h2>Subnetting = Borrowing Bits</h2>
<p>Network address = Network part + all-0s host part, distinguished thanks to the subnet mask (or prefix).</p>
<p><u>Subnets are created by <strong>taking one or more bits of the host part</strong> and making them "network bits"</u>.</p>
<p>The <strong>subnet mask is expanded to account for the bits <em>borrowed</em></strong> from the host portion (previously 0s in the mask) that are now part of the network portion (becoming 1s).</p>
<p><strong>The more bits are borrowed the more subnets are created</strong>, but with each additional subnet the available addresses decrease. Each borrowed bit <strong>doubles the subnets and halves the addresses</strong>.</p>
</section>
<section>
<section>
<h2>Subnetting 192.168.1.0/24</h2>
<h3>2 Subnets</h3>
<pre><code class="no-highlight"> 1 bit borrowed
▼
NNN.NNN.NNN. HHHHHHHH
Original Network Address 192.168. 1. 00000000 = 192.168.1.0/24
Original Subnet Mask 255.255.255. 00000000 = 255.255.255.0</code></pre>
<p>By <strong>borrowing 1 bit</strong> we can create 2 different network addresses, and thus 2 different subnets.</p>
<pre><code class="no-highlight"> NNN.NNN.NNN. NHHHHHHH
Subnet 0 Network Address 192.168. 1. 00000000 = 192.168.1.0/25
Subnet 1 Network Address 192.168. 1. 10000000 = 192.168.1.128/25
New Subnet Mask 255.255.255. 10000000 = 255.255.255.128</code></pre>
<ul>
<li>You always <strong>start borrowing from the MSB</strong> of the host portion.</li>
<li><strong>Subnet mask is the same for every generated subnet</strong>.</li>
</ul>
</section>
<section>
<h2>Subnetting 192.168.1.0/24</h2>
<h3>Available Ranges</h3>
<p>Before we assign addresses to devices in the subnet we must understand the available range:</p>
<ul>
<li><strong>Network Address</strong>: all 0s in the host part.</li>
<li><strong>First Host Address</strong>: all 0s except the last bit of the host part.</li>
<li><strong><em>n-th</em> Host Address</strong>: all other combinations.</li>
<li><strong>Last Host Address</strong>: all 1s except the last bit of the host part.</li>
<li><strong>Broadcast Address</strong>: all 1s in the host part.</li>
</ul>
</section>
<section>
<h2>Subnetting 192.168.1.0/24</h2>
<h3>192.168.1.0/25</h3>
<pre><code class="no-highlight"> NNN.NNN.NNN. N HHHHHHH
Subnet0 Network Address 192.168. 1. 0 0000000 = 192.168.1.0/25
Subnet0 1st Host Address 192.168. 1. 0 0000001 = 192.168.1.1
Subnet0 Last Host Address 192.168. 1. 0 1111110 = 192.168.1.126
Subnet0 Broadcast Address 192.168. 1. 0 1111111 = 192.168.1.127</code></pre>
<h3>192.168.1.128/25</h3>
<pre><code class="no-highlight"> NNN.NNN.NNN. N HHHHHHH
Subnet1 Network Address 192.168. 1. 1 0000000 = 192.168.1.128/25
Subnet1 1st Host Address 192.168. 1. 1 0000001 = 192.168.1.129
Subnet1 Last Host Address 192.168. 1. 1 1111110 = 192.168.1.254
Subnet1 Broadcast Address 192.168. 1. 1 1111111 = 192.168.1.255</code></pre>
</section>
</section>
<section>
<h2>Subnetting Formulas</h2>
<p>Where</p>
<ul>
<li><strong><em>n</em></strong> is the number of borrowed bits and</li>
<li><strong><em>h</em></strong> is the number of remaining bits in the host portion.</li>
</ul>
<ul>
<li><strong>To calculate the number of subnets</strong>: 2<sup>n</sup>.</li>
<li><strong>To calculate the number of hosts in a subnet</strong>: 2<sup>h</sup> - 2.</li>
</ul>
<p>For every network, <strong>the network address address and the broadcast address are not valid</strong> addresses to assign an host, so 2 addresses must be removed from the total.</p>
</section>
<section>
<section>
<h2>Subnetting 192.168.2.0/24</h2>
<h3>4 Subnets</h3>
<p><em>How many bits I need to borrow?</em> 2<sup>2</sup> = 4. So: 2 bits.</p>
<pre><code class="no-highlight"> 2 bit borrowed
▾▾
NNN.NNN.NNN. HH HHHHHH
Original Network Address 192.168. 2. 00 000000 = 192.168.2.0/24
Original Subnet Mask 255.255.255. 00 000000 = 255.255.255.0</code></pre>
<p>Each subnet will have 2<sup>6</sup> - 2 = 64 - 2 = 62 hosts.</p>
<pre><code class="no-highlight"> NNN.NNN.NNN. NN HHHHHH
Subnet0 Network Address 192.168. 2. 00 000000 = 192.168.1.0/26
Subnet1 Network Address 192.168. 2. 01 000000 = 192.168.1.64/26
Subnet2 Network Address 192.168. 2. 10 000000 = 192.168.1.128/26
Subnet3 Network Address 192.168. 2. 11 000000 = 192.168.1.192/26
New Subnet Mask 255.255.255. 11 000000 = 255.255.255.192</code></pre>
</section>
<section>
<h2>Subnetting 192.168.2.0/24</h2>
<h3>Address Ranges for 4 subnets</h3>
<pre><code class="no-highlight"> NNN.NNN.NNN. NN HHHHHH
Subnet0 Network Addr. 192.168. 2. 00 000000 = 192.168.2.0/26
Subnet0 1st Host Addr. 192.168. 2. 00 000001 = 192.168.2.1
Subnet0 Last Host Addr. 192.168. 2. 00 111110 = 192.168.2.62
Subnet0 Broadcast Addr. 192.168. 2. 00 111111 = 192.168.2.63
Subnet1 Network Addr. 192.168. 2. 01 000000 = 192.168.2.64/26
Subnet1 1st Host Addr. 192.168. 2. 01 000001 = 192.168.2.65
Subnet1 Last Host Addr. 192.168. 2. 01 111110 = 192.168.2.126
Subnet1 Broadcast Addr. 192.168. 2. 01 111111 = 192.168.2.127
Subnet2 Network Addr. 192.168. 2. 10 000000 = 192.168.2.128/26
Subnet2 1st Host Addr. 192.168. 2. 10 000001 = 192.168.2.129
Subnet2 Last Host Addr. 192.168. 2. 10 111110 = 192.168.2.190
Subnet2 Broadcast Addr. 192.168. 2. 00 111111 = 192.168.2.191
Subnet3 Network Addr. 192.168. 2. 11 000000 = 192.168.2.192/26
Subnet3 1st Host Addr. 192.168. 2. 11 000001 = 192.168.2.193
Subnet3 Last Host Addr. 192.168. 2. 11 111110 = 192.168.2.254
Subnet3 Broadcast Addr. 192.168. 2. 11 111111 = 192.168.2.255</code></pre>
</section>
</section>
<section>
<section>
<h2>Subnetting 192.168.3.0/24</h2>
<h3>5 Subnets</h3>
<img src="http://i.imgur.com/D2cTrKz.png" style="width: 450px;">
<p>If we need 5 subnets, we have to borrow 3 bits (2<sup>4</sup> = 8 > 5).</p>
<p>The remaing 5 bits in the host part allow for 2<sup>5</sup> - 2 = 30 hosts.</p>
</section>
<section>
<h2>Subnetting 192.168.3.0/24</h2>
<h3>Ranges</h3>
<pre><code class="no-highlight"> ▾▾▾
NNN.NNN.NNN. HHH HHHHH
Original Network Addr. 192.168. 3. 000 00000 = 192.168.3.0/24
Original Subnet Mask 255.255.255. 000 00000 = 255.255.255.0
NNN.NNN.NNN. NNN HHHHH
Subnet0 Network Addr. 192.168. 3. 000 00000 = 192.168.3.0/27
Subnet1 Network Addr. 192.168. 3. 001 00000 = 192.168.3.32/27
Subnet2 Network Addr. 192.168. 3. 010 00000 = 192.168.3.64/27
Subnet3 Network Addr. 192.168. 3. 011 00000 = 192.168.3.96/27
Subnet4 Network Addr. 192.168. 3. 100 00000 = 192.168.3.128/27
NNN.NNN.NNN. NNN HHHHH
Subnet0 Network Addr. 192.168. 3. 000 00000 = 192.168.3.0/27
Subnet0 1st Host Addr. 192.168. 3. 000 00001 = 192.168.3.1
Subnet0 Last Host Addr. 192.168. 3. 000 11110 = 192.168.3.30
Subnet0 Broadcast Addr. 192.168. 3. 000 11111 = 192.168.3.31
Subnet1 Network Addr. 192.168. 3. 001 00000 = 192.168.3.32/27
Subnet1 1st Host Addr. 192.168. 3. 001 00001 = 192.168.3.33
Subnet1 Last Host Addr. 192.168. 3. 001 11110 = 192.168.3.62
Subnet1 Broadcast Addr. 192.168. 3. 001 11111 = 192.168.3.63
Subnet2 Network Addr. 192.168. 3. 010 00000 = 192.168.3.64/27
Subnet2 1st Host Addr. 192.168. 3. 010 00001 = 192.168.3.65
Subnet2 Last Host Addr. 192.168. 3. 010 11110 = 192.168.3.94
Subnet2 Broadcast Addr. 192.168. 3. 010 11111 = 192.168.3.95
Subnet3 Network Addr. 192.168. 3. 011 00000 = 192.168.3.96/27
Subnet3 1st Host Addr. 192.168. 3. 011 00001 = 192.168.3.97
Subnet3 Last Host Addr. 192.168. 3. 011 11110 = 192.168.3.126
Subnet3 Broadcast Addr. 192.168. 3. 011 11111 = 192.168.3.127
Subnet4 Network Addr. 192.168. 3. 100 00000 = 192.168.3.128/27
Subnet4 1st Host Addr. 192.168. 3. 100 00001 = 192.168.3.129
Subnet4 Last Host Addr. 192.168. 3. 100 11110 = 192.168.3.158
Subnet4 Broadcast Addr. 192.168. 3. 100 11111 = 192.168.3.159</code></pre>
</section>
</section>
<section>
<section>
<h2>100 Subnets!</h2>
<p>If we need 100 subnets, we need to borrow <strong>at least 7 bits</strong> from the host part of our address block: 2<sup>7</sup> = 128 > 100.</p>
<p>If our address block is a /24 network, that would generate a /31 prefix and leave 1 bit in the host part, so 2<sup>1</sup>-2 = <u>0 hosts</u>!</p>
<p>This means we need more host bits to borrow from, and therefore <strong>a larger starting address block</strong>. For instance...</p>
</section>
<section>
<h2>100 Subnets?</h2>
<h3>172.20.0.0/16</h3>
<pre><code class="no-highlight"> ▾▾▾▾▾▾▾
NNN.NNN.HHHHHHH H.HHHHHHHH
Original Network Add. 172. 20.0000000 0.00000000 = 172.20.0.0/16
Original Subnet Mask 255.255.0000000 0.00000000 = 255.255.0.0
NNN.NNN.NNNNNNN H.HHHHHHHH
New Subnet Mask 255.255.1111111 0.00000000 = 255.255.254.0
Subnet0 Network Addr. 172. 20.0000000 0.00000000 = 172.20.0.0/23
Subnet1 Network Addr. 172. 20.0000001 0.00000000 = 172.20.2.0/23
Subnet2 Network Addr. 172. 20.0000010 0.00000000 = 172.20.4.0/23
Subnet3 Network Addr. 172. 20.0000011 0.00000000 = 172.20.6.0/23
[..............................CUT...............................]
Subnet126 Netw. Addr. 172. 20.1111110 0.00000000 = 172.20.252.0/23
Subnet127 Netw. Addr. 172. 20.1111111 0.00000000 = 172.20.254.0/23</code></pre>
<p>Subnetting is done in the 3rd octect, <strong>host bits share part of the 3rd</strong>, plus the whole 4th octect.</p>
<p>Total hosts per subnet: 2<sup>9</sup> - 2 = 512 - 2 = 510.</p>
</section>
</section>
<section>
<section>
<h2>5000+ Hosts?</h2>
<p>Let's say we need subnets capable of > 5000 hosts. We:</p>
<ul>
<li>need at least <strong>13 bits</strong> left in the host part, <strong>after</strong> the subnetting borrowings (2<sup>13</sup> - 2 = 8190 > 5000).</li>
<li>are left with <strong>just 3 bits to borrow</strong> for subnetting, in a /16 space. This amounts to just 2<sup>3</sup> = 8 subnets.</li>
</ul>
<p>This could very well not be enough for most needs. <strong>The solution is to start from a larger block</strong>, like 10.0.0.0/8.</p>
<p>In a "10/8", after reserving the last 13 bits for our 5000+ hosts, we are left with 11 bits to borrow for subnetting. That's 2<sup>11</sup> = 2048 subnets with a /19 prefix (255.255.224.0).</p>
</section>
<section>
<h2>5000+ Hosts?</h2>
<pre><code class="no-highlight"> ▾▾▾▾▾▾▾▾ ▾▾▾
NNN.HHHHHHHH.HHH HHHHH.HHHHHHHH
Original Net. Addr. 10.00000000.000 00000.00000000 = 10.0.0.0/8
Original Mask 255.00000000.000 00000.00000000 = 255.0.0.0
New Subnet Mask 255.11111111.111 00000.00000000 = 255.255.224.0
NNN.NNNNNNNN.NNN HHHHH.HHHHHHHH
Subnet0 Net. Addr. 10.00000000.000 00000.00000000 = 10.0.0.0/19
Subnet1 Net. Addr. 10.00000000.001 00000.00000000 = 10.0.32.0/19
Subnet2 Net. Addr. 10.00000000.010 00000.00000000 = 10.0.64.0/19
[..............................CUT...............................]
Subnet8 Net. Addr. 10.00000001.000 00000.00000000 = 10.1.0.0/19
[..............................CUT...............................]
Subnet2045 Net.Addr. 10.11111111.101 00000.00000000 = 10.255.160.0/19
Subnet2046 Net.Addr. 10.11111111.110 00000.00000000 = 10.255.192.0/19
Subnet2047 Net.Addr. 10.11111111.111 00000.00000000 = 10.255.224.0/19</code></pre>
</section>
</section>
<section>
<h2>Subnetting "Short Blanket"</h2>
<p>The <strong>key to basic subnetting</strong> is to balance number of subnets, and hosts for each, based on requirements.</p>
<ul>
<li>Start by determining the <strong>total number of hosts</strong> to serve. This will hint at the <strong> starting address space</strong> you need.</li>
<li>Analize how your network is organized to <strong>determine the number of subnetworks you need</strong>. Think about possibile <strong>future segmentations</strong>.</li>
<li>Determine the <strong>highest number of host you will have on a single subnet</strong>. Try to think about if and how much this number will <strong>grow in the foreseeable future</strong>.</li>
<li>Now you have <strong>the data you need to choose</strong> how many bits to borrow and how many host bits to "leave alone".</li>
</ul>
</section>
<section>
<h2>Variable Length Subnet Mask</h2>
<p><strong>With basic subnetting, every subnet has the same size</strong>. <u>When the number of hosts needed in each is very different</u>, that would lead to significant <strong>waste and unused addresses</strong>.</p>
<p>Subnets too large for the actual need will also <strong>limit growth</strong> by reducing the number of available subnets.</p>
<p>The solution to these scenarios is a <strong>subnetting method</strong> called <em>Variable Length Subnet Mask (VLSM)</em>.</p>
<p>It does what the name says: the number of bits borrowed (hence, the subnet mask) <strong>varies with each subnet</strong>.</p>
</section>
<section>
<h2>How does VLSM work?</h2>
<img src="http://i.imgur.com/8JdgAJz.png">
<ul>
<li>you still borrow bits to create subnets.</li>
<li>the subnetting formulas are still valid.</li>
</ul>
<p>The difference is <strong>it's not a single-pass process</strong> anymore:</p>
<ul>
<li>The network is subnetted, and <strong>subnets are subnetted again</strong>, creating differently-sized subnets.</li>
<li>The <strong>process is repeated</strong> as needed.</li>
</ul>
</section>
<section>
<section>
<h2>VLSM Scenario</h2>
<img src="http://i.imgur.com/QMjXJ6M.jpg" style="width: 550px;">
<p><u>Starting from a /24</u>: we need 9 subnets, so 4 bits to borrow. It means 16 subnets with a /28 mask, each capable of 14 hosts.</p>
<p>This means <u>12 wasted address on each PtP link</u>, 48 total!</p>
<p>And 14 hosts per subnet are a bit low, aren't they?</p>
</section>
<section>
<h2>VLSM Scenario</h2>
<p>Operating with <strong>traditional, basic</strong> subnetting:</p>
<pre><code class="no-highlight">Original Network Address 192.168.1.0/24
Original Subnet Mask 255.255.255.0
New Subnet Mask 255.255.255.240 = /28
Subnet 0 192.168.1.0/28
Subnet 1 192.168.1.16/28
Subnet 2 192.168.1.32/28
Subnet 3 192.168.1.48/28
[...]
Subnet 14 192.168.1.224/28
Subnet 15 192.168.1.240/28</code></pre>
<p>Wasteful. Let's take the first /28 subnet and subnet it again into <strong>4 /30 subnets</strong> of 2 hosts each: <u>0 wasted addresses</u>!:</p>
<ul>
<li>2 hosts needed meant 2 host bits (2<sup>2</sup> - 2 = 2 hosts)</li>
<li>this left us with 2 bits to borrow: 2<sup>2</sup> = 4 subnets.</li>
</ul>
</section>
<section>
<h2>VLSM Scenario</h2>
<h3>VLSM Applied</h3>
<pre><code class="no-highlight">Subnet0 - PtP #1 192.168.1.0/30 # subnetted from 192.168.1.0/28
Subnet1 - PtP #2 192.168.1.4/30 # subnetted from 192.168.1.0/28
Subnet2 - PtP #3 192.168.1.8/30 # subnetted from 192.168.1.0/28
Subnet3 - PtP #4 192.168.1.12/30 # subnetted from 192.168.1.0/28
Subnet4 192.168.1.16/28
Subnet5 192.168.1.32/28
Subnet6 192.168.1.48/28
[...]
Subnet12 192.168.1.144/28
Subnet13 192.168.1.160/27 # 30 hosts capable
Subnet14 192.168.1.192/27 # 30 hosts capable
Subnet15 192.168.1.224/27 # 30 hosts capable</code></pre>
<p>In addition to the perfect fit for the PtP links, VLSM also allows us to create <strong>more flexible subnetting</strong>.</p>
<p>In this example <u>we ditched the last 6 /28 subnets for 3 /27 subnets</u> in which we can host up to 30 devices.</p>
</section>
<section>
<h2>VLSM Charts</h2>
<img src="http://i.imgur.com/WgSJYKv.jpg" style="width: 600px;">
<p>When using VLSM:</p>
<ul>
<li>Check that address ranges <strong>do not overlap</strong>.</li>
<li>It's easier to proceed from larger subnet to smaller.</li>
</ul>
</section>
</section>
<section>
<section>
<h2>Addressing Plan</h2>
<p>We plan the addressing scheme for our network for the following purposes:</p>
<ul>
<li><strong>Preventing address duplication</strong>: by carefully documenting how the addresses are assigned we can prevent address collision.</li>
<li><strong>Access control</strong>: by knowing precisely which address is assigned to which host, we can better control the access to network resources based on our policies.</li>
<li><strong>Network monitoring</strong>: the network admin needs to be able to readily identify sources and destinations of the traffic while analyzing it for performance and security issues.</li>
</ul>
</section>
<section>
<h2>Assigning Addresses</h2>
<p>It is best to assign addresses to hosts based on a <strong>recognizable pattern</strong>, which will help the administrator and the documentation process.</p>
<ul>
<li><strong>Clients</strong> - DHCP is the common assignment method.</li>
<li><strong>Servers & peripherals</strong> - As they provide almost all network resources, they should have static addressing, with consistent numbering, making them easy to remember.</li>
<li><strong>Internet-accessible hosts</strong> - Both public and private static addressing. Public addresses are mostly associated to these hosts by performing NAT on the perimeter.</li>
</ul>
</section>
<section>
<h2>Assigning Addresses</h2>
<ul>
<li><strong>Intermediary Devices</strong> - If they are L3-capable, they should have a static, predictable address to allow management.</li>
<li><strong>Gateways</strong> - They belong to multiple networks, so they have an IP address assigned to each interface. Almost always it is the <u>highest or lowest address available on that network segment</u>.</li>
</ul>
</section>
</section>
<section>
<section>
<h2>IPv6 Subnetting</h2>
<p>IPv4 Subnetting is done to manage address scarcity.</p>
<p>Subnetting IPv6 is done for an <u>entirely different reason</u>: to support <strong>hierarchical and logical network design</strong>.</p>
<img src="http://i.imgur.com/LGVfYS4.png">
<p>An IPv6 (public) address block with a /48 (Global Routing) prefix has <strong>16 bits for subnet ID</strong> (65536 /64 subnets).</p>
<p>A dedicated Subnet ID field means there's <u>no need to borrow bits</u> from Interface ID (host portion).</p>
</section>
<section>
<h2>IPv6 Subnetting Example</h2>
<p>Subnets created by the Subnet ID are easy to identify and represent, it just works like an hexadecimal counter.</p>
<pre><code class="no-highlight">Address Block 2001:0DB8:ACAD::/48
Subnet 0 2001:0DB8:ACAD:0000::/64
Subnet 1 2001:0DB8:ACAD:0001::/64
Subnet 2 2001:0DB8:ACAD:0002::/64
Subnet 3 2001:0DB8:ACAD:0003::/64
Subnet 4 2001:0DB8:ACAD:0004::/64
Subnet 5 2001:0DB8:ACAD:0005::/64
Subnet 6 2001:0DB8:ACAD:0006::/64
Subnet 7 2001:0DB8:ACAD:0007::/64
Subnet 8 2001:0DB8:ACAD:0008::/64
Subnet 9 2001:0DB8:ACAD:0009::/64
Subnet 10 2001:0DB8:ACAD:000A::/64
[ . . . . . . . . . . . . . . . . . . . ]
Subnet 65533 2001:0DB8:ACAD:FFFD::/64
Subnet 65534 2001:0DB8:ACAD:FFFE::/64
Subnet 65535 2001:0DB8:ACAD:FFFF::/64</code></pre>
</section>
<section>
<h2>IPv6 Subnetting Considerations</h2>
<p>Subnetting IPv6 is not that much different from IPv4.</p>
<p>The leading practice is to receive at least a <strong>/48 prefix from an ISP</strong>. This leaves 2<sup>80</sup> bits to manipulate for subnetting.</p>
<p><a href="https://tools.ietf.org/html/rfc4291">RFC 4291</a> says the <strong>current smallest recommended prefix</strong> is /64. You can assign a /64 to PtP links and <em>not feel guilty</em>.</p>
<p>Using a prefix smaller than /64 is actually <u>strongly discouraged</u> because <strong>it breaks IPv6 features</strong> that rely on a 64-bit Interface ID, like SLAAC.</p>
</section>
<section>
<h2>IPv6 Subnetting Considerations</h2>
<p>Some ISPs insist to give customers a single /64 IPv6 subnet, so they can't use the Subnet ID field to do subnetting.</p>
<p>You can of course <strong>borrow bits from the Interface ID</strong> to have a deeper hierarchy. The best practice is to borrow <strong>4 bits at a time</strong> and used aligned netmasks (/68, /72, /76, etc.). Why?</p>
<p>A <strong>nibble</strong> is a 4 bit group, or <u>one hex digit</u>. By subnetting on <em>nibble boundaries</em> we create subnets <strong>just by adding 0x01</strong>.</p>
</section>
</section>
<section>
<h1>End of Lesson</h1>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// More info https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
transition: 'slide', // none/fade/slide/convex/concave/zoom
// More info https://github.com/hakimel/reveal.js#dependencies
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true },
{ src: 'plugin/notes/notes.js', async: true }
]
});
</script>
</body>
</html>