-: Internet Protocol version 4 addressing. 2 2
In this lesson, 3 3
we're going to talk about IPv4 4 4
or Internet Protocol version 4. 5 5
IPv4 is extremely popular 6 6
and is the most common type of IP addressing 7 7
that's used in our networks. 8 8
In fact, if you're like most people, 9 9
you've already seen an IPv4 address before. 10 10
When you look at them, 11 11
they're written as a series of four decimal numbers 12 12
separated by dots. 13 13
Some examples of this are IPv4 addresses like 10.1.2.3 14 14
or 172.21.243.67. 15 15
As you can see, 16 16
each IPv4 address is made up of four parts 17 17
to form that address. 18 18
This is known as a dotted-decimal notation. 19 19
When you're referring to each of those 20 20
four individual parts, 21 21
we call this an octet 22 22
because they each have a decimal number 23 23
that's used to represent an 8-bit number. 24 24
Because these decimal numbers represent an 8-bit 25 25
or eight binary digits, 26 26
this means that they can only represent a value 27 27
from zero to 255 in each of those four positions. 28 28
Now, when all four octets are combined, 29 29
we have four octets that contain eight bits each, 30 30
for a total of 32 bits of total addressable space 31 31
when using an IPv4 address. 32 32
Now, for example, 33 33
if I have the IPv4 address of 192.168.1.4, 34 34
this is written in dotted-decimal notation 35 35
to make it easier for us as humans to read it. 36 36
But in reality, 37 37
it's actually 11000000.10101000.00000001.00000100 38 38
if I put its into true binary form. 39 39
As you can see, 40 40
being able to use dotted-decimal notation 41 41
is a lot easier for us to read and to type. 42 42
And therefore, it's less prone to us making mistakes 43 43
because as humans entering these numbers 44 44
into our network devices using binary 45 45
would just be a big issue for us. 46 46
We just don't think that way. 47 47
Now, when we see an IP address like 192.168.1.4, 48 48
it's actually being broken down into two portions 49 49
by using a second 32-bit number known as a subnet mask. 50 50
Now, one part of the IPv4 address 51 51
is used to identify the network portion 52 52
and the other part 53 53
is going to be used to identify the host portion. 54 54
When you look at a subnet mask, 55 55
it's going to look a lot like an IPv4 address, 56 56
but if you convert it to binary, 57 57
you're going to see that it has 58 58
a continuous strings of ones or zeros 59 59
to identify the network 60 60
and host portions of that address 61 61
being used by the client or device. 62 62
So if I have a subnet mask like 255.255.255.0, 63 63
this is known as a default class C subnet mask. 64 64
Now, don't worry about classes just yet, 65 65
we are going to cover them more in just a moment. 66 66
For now, I just want you to see 67 67
what a subnet mask looks like. 68 68
Now, if I converted this into binary, 69 69
each of those octets that are 255 70 70
are going to be written as 11111111. 71 71
So I'm going to get 11111111.11111111.11111111. 72 72
and then 00000000. 73 73
This is because in binary, 74 74
eight ones is going to equal 255 75 75
when I read it in decimal. 76 76
And if I have eight zeros in binary 77 77
that is going to equal zero in decimal. 78 78
Again, don't worry too much about this conversion just yet. 79 79
We are going to do a lot of these different conversions 80 80
and math problems in a separate video lesson 81 81
when we talk about computer mathematics. 82 82
Now, when you look at this number, 83 83
if you see a one in the binary of that subnet mask, 84 84
this means it's part of the network portion 85 85
of the IP address. 86 86
If I see a zero in the binary portion of the subnet mask, 87 87
this means it's part of the host portion 88 88
of the IPv4 address. 89 89
So let's put this together by showing both an IPv4 address 90 90
and a subnet mask together. 91 91
First, we have our IPv4 address of 192.168.1.4. 92 92
Next we have our subnet mask 93 93
underneath it with 255.255.255.0. 94 94
Now, everywhere I see that 255, 95 95
this is going to represent a one in binary. 96 96
So this becomes part of the network portion 97 97
of that IPv4 address. 98 98
If I use this example, 192.168.1.4, 99 99
the 198.168.1, that is part of the network. 100 100
Now, I can do anything that starts with 192.168.1.something 101 101
and it would all be addressable by the same local network 102 102
because they all share this same network portion. 103 103
Now, when I get to the second part, 104 104
anytime I see those zeros, 105 105
this represents all zeros in binary. 106 106
So that's going to be the host portion of that IPv4 address. 107 107
In this case, that is the .4 portion of this address, 108 108
which is going to represent the host. 109 109
That host could be a server, a desktop, a laptop, a tablet, 110 110
a smartphone or any other network device. 111 111
It really doesn't matter. 112 112
But when we talk about this .4 device, 113 113
that is a single host. 114 114
When I talk about the 192.168.1, 115 115
that is the network that can contain up to 254 devices. 116 116
So if I have a device like 192.168.1.50 117 117
with a subnet of 255.255.255.0 118 118
that device is also in the same network 119 119
as our 192.168.1.4 device, 120 120
and they can communicate with each other using a switch 121 121
and they wouldn't have to use a router 122 122
because they both share the same network portion, 192.168.1. 123 123
Now, on the other hand, 124 124
let's assume I have a device like 192.168.0.100 125 125
with a subnet of 255.255.255.0, 126 126
that device is on a different network, 127 127
specifically, it's on the 192.168.0.something network. 128 128
So we cannot communicate that from our original device 129 129
at 192.168.1.4 without leaving our network 130 130
and routing our traffic over to this new network, 131 131
this 192.168.0.something network. 132 132
This is why we need to have a router. 133 133
Now, if this doesn't quite make sense yet, 134 134
don't worry too much. 135 135
We are going to dive deeper into subnetting 136 136
and you're going to actually calculate subnet mast 137 137
and things like that to learn how routing works. 138 138
Right now, we have barely just scratched the surface 139 139
in the examples we talked about. 140 140
And I just wanted to get you the idea 141 141
and introduce you to this concept. 142 142
Now, the next concept that we need to talk about 143 143
is that an IPv4 addresses 144 144
and how they're broken up into classes 145 145
or groupings or ranges 146 146
that can be used for different purposes. 147 147
Now, each class has its own default subnet mask as well. 148 148
When we talk about classes, 149 149
we identify these by a letter. 150 150
These letters are A, B, C, D, and E. 151 151
Now, to identify the class for a given IP address, 152 152
you just need to look at the first octet. 153 153
If that first octet begins with a number between 1 and 127, 154 154
it's going to be considered a class A address, 155 155
and it has a default subnet mask of 255.0.0.0. 156 156
This means the network portion of that address 157 157
is just the first octet, 158 158
and the second, third and fourth octets 159 159
are going to make up the host portion. 160 160
This means that with a class A network, 161 161
we can have 256 times 256 times 256 hosts 162 162
on a single network, 163 163
which means there are 16.7 million 164 164
possible host IP addresses 165 165
available for a single network address portion 166 166
assigned in the class A. 167 167
Now, our second class we have 168 168
occurs when we have that first octet 169 169
beginning with a number between 128 and 191. 170 170
This would be considered a class B address, 171 171
and it will have a default subnet mask of 255.255.0.0. 172 172
This means that the network portion of this address 173 173
is going to be the first and second octets, 174 174
and the third and fourth octet 175 175
are going to make up the host portion. 176 176
This means that for a class B network, 177 177
we can have up to 256 times 256 hosts on a single network. 178 178
And that means we get 65,536 possible host IP addresses 179 179
available for a single network address portion 180 180
assigned within a class B. 181 181
Now, the third class we have occurs when the first octet 182 182
begins with a number between 192 and 223. 183 183
This is considered a class C address, 184 184
and it has a default subnet mask of 255.255.255.0. 185 185
This means that the network portion of the address 186 186
is going to be the first, second and third octet. 187 187
And we save that fourth octet for the host portion. 188 188
This means that for a class C network, 189 189
you can only have 256 hosts on a single network. 190 190
And this means there are only 256 possible host IP addresses 191 191
available for a single network address portion 192 192
that's being assigned. 193 193
Now the fourth class we have occurs when the first octet 194 194
begins with a number between 224 and 239. 195 195
This is considered a class D address. 196 196
Now, a class D address 197 197
does not have any subnet mask assigned to it. 198 198
This is because class D addresses are special 199 199
and they're reserved for multicasting or multicast routing. 200 200
Now, a multicast address is a logical identifier 201 201
for a group of hosts in a computer network 202 202
that are already going to be available to process datagrams 203 203
or frames intended to be multicast 204 204
for a designated network service. 205 205
So the actual multicast address 206 206
doesn't have to align with a single host, 207 207
but instead, it aligns with a group of hosts. 208 208
When you think about a multicast address, 209 209
I want you to think about it like a group chat on Facebook. 210 210
You might have a group chat name, 211 211
in our case, a multicast address. 212 212
And when you send a message to your group chat's name, 213 213
all of the members of that group 214 214
are going to get a copy of that message. 215 215
Well, the same thing is going to happen in multicast 216 216
when we're using IPv4. 217 217
We're going to talk more about multicasting later on 218 218
when we discuss the different types of data flows 219 219
within IPv4. 220 220
But for now, 221 221
this is the idea of what you need to understand 222 222
with multicasting. 223 223
I sent it from one person 224 224
and it goes to multiple people all at the same time. 225 225
Now, the fifth class we have occurs when the first octet 226 226
begins with a number between 240 and 255. 227 227
This is called a class E address 228 228
and it also has no default subnet mask. 229 229
This is because class E addresses are also special. 230 230
In this case, 231 231
they're reserved for experimental purposes for research 232 232
and development or study only. 233 233
This experimental range contains about 268 million addresses 234 234
that are reserved for future use. 235 235
Over the years, 236 236
there've been a few proposals 237 237
to reallocate these class E addresses for general use 238 238
because public IPv4 addresses 239 239
were becoming more and more scarce 240 240
in the class A, class B, and class C ranges 241 241
as more and more devices started getting connected 242 242
to the internet. 243 243
That said, so far to date, 244 244
these class E addresses 245 245
still remain allocated for experimental use only, 246 246
and most IP implementations within our networks 247 247
will consider any IP in this range from 240.0.0.0 248 248
all the way up to 255.255.255.255 249 249
to be invalid as a source or destination within a datagram. 250 250
And therefore, 251 251
the datagram would be rejected by the destination system. 252 252
So if you try to send something to a window server 253 253
or a workstation, 254 254
it's going to refuse to communicate with that device 255 255
if you claim to be from a class E address. 256 256
All right. 257 257
So now that we've covered the five different classes 258 258
of IPv4 addresses, 259 259
let's talk a little more about subnet masks. 260 260
Let's pretend that 261 261
we have an IP address of 192.168.1.4 again, 262 262
with a subnet mask of 255.255.255.0. 263 263
This subnet mask is the default subnet mask 264 264
for a class C network. 265 265
And since our IP address begins with a 192, 266 266
it is also a class C address. 267 267
This means we have a class C address 268 268
using a class C default subnet mask. 269 269
So we consider this to be classful 270 270
We call this a classful mask. 271 271
Now, a classful subnet mask is just the default 272 272
for a given class of IP address. 273 273
This doesn't mean though, 274 274
that it's the best one for us to always use. 275 275
For example, if we're using a class A address, 276 276
you may recall that his default subnet mask is 255.0.0.0. 277 277
This means we have a possibility of having 278 278
16.7 million hosts on a single network. 279 279
Now, I don't know about you, 280 280
but I don't often come across networks that are that large 281 281
and require that many hosts. 282 282
In fact, I used to work 283 283
on one of the world's largest internets, 284 284
and we had a little over 1 million hosts 285 285
spread across six continents around the globe. 286 286
That was a really, really big network, 287 287
and we still didn't come close 288 288
to using all 16.7 million IP addresses 289 289
in a classful class A subnet. 290 290
So, often what we'll want to do 291 291
is break up these networks into smaller networks. 292 292
So we often instead want to break down these large networks 293 293
into smaller networks. 294 294
To do this, 295 295
we're going to use a process known as subnetting. 296 296
Now, we're not going to cover subnetting in detail 297 297
in this lesson. 298 298
Instead, I'm going to dedicate a few lessons later on 299 299
to fully dive into that concept 300 300
because you need to understand how to do it. 301 301
But for now, 302 302
I just want you to remember that we don't have to stick 303 303
with a classical subnet mask. 304 304
Instead, we can use a classless subnet mask if we want to. 305 305
This is a process known as classless inter-domain routing. 306 306
This will let us borrow some of those host bits, 307 307
those zeros that I showed you in the subnet mask, 308 308
and then reassign them to the network portion. 309 309
So this lets me cut down the size of my networks 310 310
into much smaller portions with less hosts 311 311
and this is more efficient. 312 312
This will give me, at the same time, 313 313
a lot more networks that I can possibly use. 314 314
Because again, if you think of it like a pie, 315 315
you can cut it many different ways, 316 316
but it's still one pie and it's a fixed amount of IPs 317 317
that we have in total. 318 318
So, I can cut the pie in half 319 319
and we'd have two halves of the pie, 320 320
or I can cut it in quarters 321 321
and we can have four pieces of pie, 322 322
but each of those pieces are smaller. 323 323
The same thing with our networks. 324 324
So, for example, 325 325
let's say I have a classful class C subnet mask, 326 326
and I would have 255.255.255.0 as that subnet mask. 327 327
This allowed me to have 256 hosts, right? 328 328
Well, in my home network, 329 329
I don't really need 256 hosts. 330 330
So maybe I want to break this down into four smaller networks. 331 331
If I take 256 and I divide it by four, 332 332
I get 64 hosts for each of those four networks. 333 333
To do this, 334 334
I would change the subnet mask from 255.255.255.0 335 335
to 255.255.255.192. 336 336
How do I do this? 337 337
Well, I borrowed two bits from the host 338 338
and I gave it to the network portion of the address. 339 339
And this is how I make four different subnetworks 340 340
or subnets out of this by using my subnet mask. 341 341
Now, later on in this section, 342 342
I'm going to teach you how to do subnetting 343 343
and understand how I got that number for that subnet mask, 344 344
including all the math involved, 345 345
just like I did here. 346 346
But for now, 347 347
I just want you to remember that subnetting allows you 348 348
to use a classless subnet mask to create smaller networks 349 349
with fewer hosts in each of those networks than you could 350 350
if you had a classful subnet mask by itself. 351 351
This process is known as 352 352
the classless inter-domain routing or CIDR, 353 353
and we are going to abbreviate our IP addresses 354 354
using this CIDR or CIDR notation. 355 355
Now, when we do this, 356 356
we don't have to write out the subnet mask. 357 357
Instead, we just write the IP address, a slash and a number. 358 358
This is known as our CIDR notation. 359 359
So if I have an IP address of 192.168.1.4 360 360
with a subnet mask of 255.255.255.0, 361 361
I can abbreviate this using CIDR notation as 192.168.1.4/24. 362 362
Oftentimes, you'll hear this called CIDR or slash notation. 363 363
Now, if I had an IP address of 192.168.1.4, 364 364
but my subnet mask was 255.255.255.192, 365 365
I can abbreviate that as 192.168.1.4/26 366 366
because remember, I borrowed two bits from the host portion. 367 367
So I went from 24 as my default subnet mask, /24, 368 368
into a /26, 369 369
by borrowing two bits and making my network portion 370 370
that much larger, 371 371
bringing it from 24 up to 26. 372 372
Now, when you're trying to calculate your CIDR notation, 373 373
it's really going to be easiest 374 374
when you're dealing with classful subnet masks. 375 375
The CIDR notation here is really, really easy. 376 376
Now, for the classful subnet masks, 377 377
our CIDR notation is going to be rather simple. 378 378
If you have a class A classful subnet mask, 379 379
you're going to have a /8 after the IP address. 380 380
This means that the subnet mask is 255.0.0.0, 381 381
or it has eight bits of ones, 382 382
which is the /8, 383 383
and then 24 bits of zeros inside the subnet mask. 384 384
Now, if you have a class B classful subnet mask, 385 385
you're going to use a /16 after your IP address. 386 386
This means the subnet mask is 255.255.0.0. 387 387
Also, it means that it has 16 bits of ones 388 388
and 16 bits of zeros in that subnet mask. 389 389
Now, if you have a class C class will subnet mask, 390 390
you're going to use a /24 after the IP address. 391 391
This means that the subnet mask is going to be 255.255.255.0, 392 392
or that it has 24 bits of ones 393 393
and then eight bits of zeros in that subnet mask. 394 394
Next, we need to talk about 395 395
two different types of IPv4 addresses. 396 396
These are called public and private IPs, 397 397
and you may also hear them called routable 398 398
and non-routable IPs. 399 399
When an IP is considered a public or a routable IP, 400 400
this IP address can be directly accessed over the internet 401 401
and assigned to your network 402 402
by your internet service provider. 403 403
Routable IPs are publicly routable 404 404
across the entire internet, 405 405
and therefore, they're globally managed by ICANN. 406 406
ICANN is the Internet Corporation 407 407
for Assigned Names and Numbers. 408 408
So if you want a public IP address, 409 409
like for running a web server for your company 410 410
or a Minecraft server for your kids, 411 411
you can buy that IP address 412 412
and ICANN is the one who will lease those out to you. 413 413
Now, ICANN has five different groups underneath them 414 414
who are responsible for actually 415 415
handing out these public IPs 416 416
based on where you actually live in the world. 417 417
There is ARAIN, A-R-I-N, which is for North America. 418 418
There's LACNIC, L-A-C-N-I-C, which is for Latin America. 419 419
There's ethnic AFNIC, A-F-N-I-C, which is for Africa. 420 420
There's APNIC, A-P-N-I-C, 421 421
which is for Asia and the Pacific region. 422 422
And there's RIPE, R-I-P-E, which is for Europe. 423 423
These are the ones who are responsible for the management 424 424
of the public IP space on behalf of ICANN 425 425
in each of those different regions. 426 426
Now, since I'm located in America, 427 427
if I wanted a public IP address, 428 428
I should go to ARIN, right? 429 429
Well, not exactly. 430 430
ARIN will be way too busy to handle that. 431 431
They're not just going to sell me one address, 432 432
they're only going to sell me IPs 433 433
if I want a whole bunch of IPs. 434 434
So instead, I'm going to have to go to a reseller 435 435
who will sell me just a single IP. 436 436
In my case, I can contact my internet service provider, 437 437
somebody like Verizon or Comcast 438 438
and tell them that I want a public IP. 439 439
Then Verizon will pick me out one 440 440
out of their entire chunk from ARIN that they have 441 441
such as a class A with 16.7 million IPs, 442 442
or a class B with 65,536 IPs and assign one to me. 443 443
This way, Verizon can lease out that single IP 444 444
or a small subnet worth of IPs for my company 445 445
'cause maybe I need 5 or 10 of them. 446 446
Public IPs must be purchased before you can use them 447 447
and you do this 448 448
through your local internet service provider. 449 449
Now, on the other hand, 450 450
there are also non-routable IPs known as private IPs, 451 451
because, well, they're not public. 452 452
Private IPs can be used by anyone at any time, 453 453
but only within their own local area networks. 454 454
This is why these IPs are considered not routable 455 455
because no one is controlling who's using them 456 456
and in which networks. 457 457
In fact, 458 458
if you look at your IP address of your computer right now, 459 459
I bet you're using an IP address 460 460
and it starts with either a 10, a 172, or a 192 461 461
as its first octet. 462 462
Don't believe me? 463 463
Go ahead, pause this video and check. 464 464
If you don't know how to check, 465 465
I'm going to tell you how to do it right now. 466 466
If you're on a Windows computer, 467 467
I want you to hold down the Windows key 468 468
and press the R key at the same time. 469 469
Then type CMD and hit enter. 470 470
This stands for command. 471 471
Next, you have this black window on your screen. 472 472
Type in ipconfig for IP configuration, 473 473
and then hit enter and look at your IP address. 474 474
Does it start with a 10, a 172 or a 192? 475 475
I bet it does. 476 476
Now, if you're on a Mac, don't worry. 477 477
I'm not leaving you out. 478 478
You can go ahead and look at this as well. 479 479
If you're watching this video 480 480
over a wireless network connection, 481 481
go ahead and hold down your option key 482 482
and then click on the Wi-Fi icon 483 483
in the top right of your menu bar. 484 484
Look down under your wireless networks name, 485 485
and you're going to see your IP address. 486 486
Again, I bet it starts today with either a 10, 487 487
a 172 or a 192 as part of that IP. 488 488
Now, am I a magician 489 489
being able to tell you what your IP address is? 490 490
Well, not really. 491 491
You see those three values 492 492
are part of what we call the private IP ranges. 493 493
This includes something like 10.0.0.something, 494 494
or 172.16.1.something, 495 495
or 192.168.1.something 496 496
and a bunch of other IPs as well. 497 497
So, if you're using one of these private IPs, 498 498
and I said they're not routable, 499 499
how are you actually getting out to the internet 500 500
to watch this video? 501 501
Well, when you go out to the internet, 502 502
your router actually conducts a little trick 503 503
known as Network Address Translation, 504 504
and it changes your private IP into a public IP. 505 505
Now, we're going to cover the concept 506 506
of Network Address Translation 507 507
and Port Address Translation in a separate lesson 508 508
because it's really important for you understand that. 509 509
But for now, 510 510
let's stick to talking about these private IPs. 511 511
All right. 512 512
For the exam 513 513
and your life as a real world network technician, 514 514
it's going to be really important for you to understand 515 515
the ranges for private IP addresses. 516 516
Now, these are defined in something known as RFC 1918. 517 517
Now, RFC just stands for request for comments. 518 518
And request for comments is a formal publication 519 519
from the Internet Society 520 520
and the Internet Engineering Task Force or IETF. 521 521
These RFCs are authored by individuals 522 522
or groups of computer scientists 523 523
to document new technologies or standards. 524 524
In this case, the RFC 1918, 525 525
this is going to be used to document how organizations 526 526
can conduct address allocation for private internet, 527 527
which we now call intranet or your local area networks. 528 528
Now in RFC 1918, 529 529
there are specific ranges of private IPs described 530 530
within class A, B and C that anyone can use. 531 531
If you're looking at class A addresses, 532 532
anything that starts with a 10 in the first octet 533 533
is going to be considered a private IP. 534 534
So, you can have anything from 10.0.0.0 535 535
all the way up to 10.255.255.255 as your address, 536 536
and it's going to be a private IP. 537 537
This gives you a total of 16.7 million IP addresses 538 538
that anyone can use. 539 539
Now, in addition to that, 540 540
we also have some class B addresses, 541 541
and this one's a little bit harder to memorize. 542 542
For class B addresses, 543 543
anything that starts with a 172.16 544 544
all the way up to 172.31 545 545
is going to be part of a private IP range. 546 546
This includes over 1 million IP addresses 547 547
because we have 16 times 256 times 256. 548 548
Now, if you're looking at a class C address, 549 549
anything that starts with a 192.168 550 550
is considered a private IP. 551 551
This includes a range of 192.168.0.0 552 552
all the way up to 192.168.255.255. 553 553
This gives you 65,536 IP addresses 554 554
that are there for you to use if you want them. 555 555
Now, I want you to commit these ranges to memory. 556 556
Remember, class A is really easy. 557 557
Anything that starts with a 10 558 558
dot something dot something dot something 559 559
is a private IP in the class A range. 560 560
Now, class C is also pretty easy 561 561
because anything that is 192.168 dot something dot something 562 562
is also considered a private address, in this case, 563 563
a class C private address. 564 564
But class B is where most people are going to struggle 565 565
because it's a little bit different. 566 566
It's going to contain any addresses 567 567
that start with 172.16 dot something dot something 568 568
all the way up to 172.31 dot something dot something. 569 569
This is essentially 16 classes of class B addresses 570 570
that are all next to each other, 571 571
and you could use any of them as a private IP. 572 572
Now, on test day, 573 573
CompTIA may try to trick you and say something like, 574 574
which of these addresses is not a private IP? 575 575
And then they're going to give you something like 576 576
172.12 dot something dot something. 577 577
Now, this starts with a 172, 578 578
so it looks like a private IP, 579 579
but because it's 172.12, 580 580
it's not between 172.16 and 172.31. 581 581
So 172.12 dot something dot something 582 582
is actually a private IP 583 583
because it's outside of my private range. 584 584
You have to be especially careful 585 585
when you see an address that starts with 172 586 586
because it has to be between 172.16 to 172.31 587 587
to be a private IP. 588 588
All of the other 172 dot something addresses 589 589
will be public. 590 590
Now, the next thing we need to talk about 591 591
is some specialized IPS, 592 592
and there are two big categories that we need to cover: 593 593
the loopback address and APIPA addresses. 594 594
Now, the first special IP is the loopback address. 595 595
This is assigned as 127.0.0.1. 596 596
Now, when this was created 597 597
all the way back in the early days of the internet, 598 598
the designers weren't too worried about wasting IPs 599 599
because they never envisioned 600 600
that we were going to use a lot of IP addresses 601 601
in the entire world. 602 602
So they simply dedicate an entire range that's 127.0.0.1/8 603 603
or 16.7 million IP addresses 604 604
to be used as internet hosts loopback addresses. 605 605
Now, this allows any higher level protocol 606 606
to send data to the host itself 607 607
without actually going out to a switch or a router. 608 608
Essentially, this creates a loop back to the host 609 609
and it tests your networking protocols. 610 610
So it's often used in troubleshooting 611 611
and testing that were protocols on a given system 612 612
to make sure your drivers are working properly. 613 613
Now, because of the way the standard was developed, 614 614
anything you see 615 615
that starts with 127 dot something dot something 616 616
dot something is considered a loopback address, 617 617
although most people just use 127.0.0.1 618 618
as our loopback address by default. 619 619
This means the other 16.7 million IPs are pretty much wasted 620 620
because we're using this range 621 621
to be the entire loopback range, 622 622
even though most of us only use this one IP address. 623 623
Now, you may have heard the old joke 624 624
that some network technicians like to use. 625 625
There's no place like 127.0.0.1, 626 626
which means there's no place like here, home, right? 627 627
That's one 127.0.0.1. 628 628
It's the local host. 629 629
Now, and during the COVID pandemic, 630 630
I also saw a couple of funny memes saying stay at 127.0.0.1 631 631
and wear a 255.255.255.0, 632 632
which essentially says, 633 633
stay at home and wear a mask. 634 634
Now, when it comes to the IP address of 127.0.0.1, 635 635
you're going to hear it called either the loopback 636 636
or you might hear people call it the local host, 637 637
like I did earlier. 638 638
Now, the word local hosts will always resolve to 127.0.0.1 639 639
on every computer as part of its local DNS settings. 640 640
So if you ping 127.0.0.1 or you ping local hosts, 641 641
you're going to get the same result. 642 642
It's going to result to the IP address 643 643
of that loopback IP, 127.0.0.1. 644 644
Now, the second special IP addresses we have 645 645
is known as APIPA, A-P-I-P-A. 646 646
This is also known as the Automatic Private IP Addresses. 647 647
These addresses are dynamically assigned 648 648
by your operating system 649 649
whenever your DHCP server is unavailable 650 650
and an IP address has not already been statically assigned. 651 651
APIPA addresses are always going to start with 652 652
169.254 dot something dot something. 653 653
So you're going to find them 654 654
in the address range of 169.254.0.0 655 655
all the way up to 169.254.255.255. 656 656
So if you ever see an IP address in this range 657 657
when you look at the IP of a network device, 658 658
it means that there is something wrong with the DHCP process 659 659
and the device isn't getting a normal private IP 660 660
from one of our class A, class B or class C ranges. 661 661
Now, as your workstation boots up, 662 662
it's going to attempt to get its own IP address 663 663
using dynamic IPS using the DHCP protocol. 664 664
This goes through a four-step process known as DORA. 665 665
This is discover, offer, request and acknowledge. 666 666
If something goes wrong 667 667
with this DORA negotiation process with DHCP, 668 668
the system simply can't get an address 669 669
and your computer would eventually just crash 670 670
because it wouldn't know what to do, 671 671
and it would keep trying over and over again. 672 672
So with the brilliant engineers 673 673
of the Internet Task Force did was create this APIPA range. 674 674
Now, basically what it says is that 675 675
if a workstation can't get a DHCP assignment 676 676
for a dynamic IP address within some amount of time, 677 677
the workstation is simply going to pick its own address 678 678
from this special APIPA range. 679 679
Basically, any IP at once, 680 680
as long as it starts with 681 681
169.254 dot something dot something. 682 682
So if you find a computer 683 683
that can not connect to the internet, 684 684
the first thing you should do is check its IP address. 685 685
You can do this using ipconfig on Windows, 686 686
or ifconfig on Mac or Linux machines. 687 687
Now, if you see an IP address of 688 688
169.254 dot something dot something, 689 689
you know you have a DHCP problem 690 690
and you need to check your DHCP server 691 691
to ensure it's working properly, 692 692
and that it's handing out private IP addresses 693 693
from class A, class B or class C assigned ranges. 694 694
Now, that's as deep as we need to go into DHCP right now, 695 695
but I promise we are going to go back to DHCP later on, 696 696
and we'll talk about all of these things 697 697
and how it provides these IP addresses 698 698
and how those are going to be used inside your networks. 699 699
Now, the last two things we need to discuss 700 700
in terms of IPv4 addressing 701 701
is the concept of virtual IP addresses and subinterfaces. 702 702
Now, first let's talk about virtual IP addresses, 703 703
usually abbreviate as VIP or VIPA. 704 704
Now, a virtual IP address is an IP address 705 705
that does not correlate 706 706
to an actual physical network interface. 707 707
Instead, these virtual IP addresses 708 708
are usually used for network address translation, 709 709
fault-tolerance and virtualization. 710 710
In your computer, 711 711
you have a network interface card, 712 712
and normally you can only configure 713 713
that network interface card with a single IP address 714 714
because there's only one physical network interface, 715 715
namely this network interface card. 716 716
Now, with a virtual IP address, 717 717
you can actually configure that network interface card 718 718
to respond to numerous IP addresses 719 719
and have them all resolved 720 720
back to your physical network interface 721 721
to establish the connectivity. 722 722
Routers will often use virtual IP addresses 723 723
to provide redundancy in their connectivity options as well. 724 724
By having a single virtual IP 725 725
assigned to the default gateway, for example, 726 726
we can have multiple routers 727 727
that can answer up on behalf of that virtual IP. 728 728
This would allow us to have a primary device 729 729
to use during normal conditions 730 730
and alternate device that can be used 731 731
when the primary device fails, 732 732
so we could fail over to that secondary device. 733 733
We'll talk more about this concept 734 734
when we start digging into routers 735 735
and covering concepts like redundancy. 736 736
But for right now, 737 737
I just wanted to introduce you to the concept 738 738
that virtual IP addresses exist 739 739
and we use them for things like redundancy 740 740
and giving an interface, one physical interface, 741 741
multiple different IP addresses. 742 742
Now, the second concept we need to cover here 743 743
is the idea of subinterfaces, 744 744
which is a virtual interface 745 745
that's created by dividing up one physical interface 746 746
into multiple logical interfaces. 747 747
This goes hand-in-hand 748 748
with the concept of a virtual IP address 749 749
because each of these virtual interfaces 750 750
that we're going to create is going to be able 751 751
to be assigned a virtual IP address as well. 752 752
These subinterfaces are often used 753 753
for inter-VLAN routing of traffic 754 754
by creating two subinterfaces for one physical interface, 755 755
and then assigning each of those subinterfaces 756 756
with an IP address from the appropriate subnet. 757 757
This then allows the rider to connect these two subnets 758 758
or villains virtually 759 759
instead of requiring us 760 760
to dedicate two physical network interfaces 761 761
and attaching a real patch cable between them. 762 762
All right. 763 763
I know that was a ton of information in this long video. 764 764
So if I went too fast for you, 765 765
please watch this lesson a second time. 766 766
There is a lot of important information 767 767
about IPv4 addressing that you just have to know. 768 768
It is critical that you understand 769 769
the different classes of IP addresses, 770 770
the public and private IPs, 771 771
and when each of these are used, 772 772
as well as the different special IP addresses that we have 773 773
such as the loopback, APIPA and others.