7
7
2
00:00:11,380 --> 00:00:16,520
the past couple videos we talked about Ethernet
LAN switching, for example within this small
3
00:00:16,520 --> 00:00:22,689
network of PCs, attached to a switch. In this
video, however, we’ll start to expand our
4
00:00:22,689 --> 00:00:28,310
horizon, and take a look at how traffic is
forwarded not WITHIN a LAN, but between different
5
00:00:28,310 --> 00:00:34,690
LANs. Basically, we are going up the OSI model
from Layer 2, the data link layer, to Layer
6
00:00:34,690 --> 00:00:40,850
3, the network layer. Let’s do a quick review
of Layer 3.
7
00:00:40,850 --> 00:00:46,510
This slide is from Day 3’s video on the
OSI model. Let’s review some characteristics
8
00:00:46,510 --> 00:00:52,620
of Layer 3, the Network layer. The network
layer provides connectivity between end hosts
9
00:00:52,620 --> 00:01:00,090
on DIFFERENT networks, outside of the local
area network. Layer 3 provides logical addressing,
10
00:01:00,090 --> 00:01:06,640
specifically IP addresses. Whereas Layer 2
uses MAC addresses, which are assigned to
11
00:01:06,640 --> 00:01:12,120
the device when it is made, IP addresses are
logical addresses you assign when you configure
12
00:01:12,120 --> 00:01:19,900
the device. Layer 3 provides path selection
between source and destination. Over larger,
13
00:01:19,900 --> 00:01:25,360
more complex networks, for example the Internet,
there can be many different possible paths
14
00:01:25,360 --> 00:01:31,720
to a destination. Selecting the best path
to the destination is part of Layer 3’s
15
00:01:31,720 --> 00:01:36,970
functionality. Routers operate at Layer 3.
So far in this course we haven’t talked
16
00:01:36,970 --> 00:01:41,900
much about routers. That’s going to change
over these next few videos, however, as we
17
00:01:41,900 --> 00:01:48,040
talk about Layer 3. In this video, our focus
will be specifically on the logical Layer
18
00:01:48,040 --> 00:01:52,439
3 addresses, IP addresses.
19
00:01:52,439 --> 00:01:58,070
You may recognize this network from the previous
videos on Ethernet LAN switching. These PCs
20
00:01:58,070 --> 00:02:04,469
are all connected by switches, so they are
part of the same network. These Layer 2 devices,
21
00:02:04,469 --> 00:02:10,710
switches, do not separate different networks.
They connect and expand networks. I could
22
00:02:10,710 --> 00:02:16,280
connect two more switches, each with multiple
PCs connected to them, to this network, and
23
00:02:16,280 --> 00:02:23,010
it would still be one network, one LAN. Because
of this, the PCs all have IP addresses in
24
00:02:23,010 --> 00:02:35,230
the same Layer 3 network, 192.168.1.0/24.
PC1’s IP address is 192.168.1.1, PC2’s
25
00:02:35,230 --> 00:02:46,780
IP address is 192.168.1.2, PC3’s IP address
is 192.168.1.3, and PC4’s IP address is
26
00:02:46,780 --> 00:02:55,849
192.168.1.4. If PC1 sends a broadcast frame
with a destination MAC address of all Fs,
27
00:02:55,849 --> 00:03:01,640
After SW1 receives the frame, it will broadcast
it out of all of its interfaces except the
28
00:03:01,640 --> 00:03:04,209
one is was received on,
29
00:03:04,209 --> 00:03:11,360
so that means G0/1 and G0/2. SW2 will then
do the same with the frame, broadcasting it
30
00:03:11,360 --> 00:03:15,860
out of all of its interfaces, except the one
it was received on.
31
00:03:15,860 --> 00:03:23,080
so that means G0/0 and G0/1. As you can see,
all other PCs in the network have received
32
00:03:23,080 --> 00:03:29,970
the frame. Now, what if I put a router between
SW1 and SW2?
33
00:03:29,970 --> 00:03:36,220
Now I’ve put R1 in between the two switches.
Now instead of one network, the PCs have been
34
00:03:36,220 --> 00:03:45,959
split into two networks. Let’s say SW1,
PC1, and PC2 are still on the 192.168.1.0/24
35
00:03:45,959 --> 00:03:59,500
network, but now SW2, PC3 and PC4 are on the
192.168.2.0/24 network, with PC3 being 192.168.2.1
36
00:03:59,500 --> 00:04:07,829
and PC4 being 192.168.2.2. You may have noticed
that, in these network IP addresses, the first
37
00:04:07,829 --> 00:04:17,530
three groups of numbers, 192.168.1, and 192.168.2,
represent the network itself, and only this
38
00:04:17,530 --> 00:04:24,580
last 0 changes to represent the end hosts
on the network, the PCs. You may also have
39
00:04:24,580 --> 00:04:30,730
wondered what these /24s at the end mean.
Actually, they are used to tell you what part
40
00:04:30,730 --> 00:04:37,450
of the address represents the network, and
which part represents the end hosts, the PCs.
41
00:04:37,450 --> 00:04:44,389
/24 means that the first 3 groups of numbers
represent the network. In this video I’m
42
00:04:44,389 --> 00:04:49,780
going to go in depth about how these IP addresses
work. But first, there’s one more thing
43
00:04:49,780 --> 00:04:56,530
missing in this network diagram. The router
needs an IP address. Actually, not just one
44
00:04:56,530 --> 00:05:02,670
IP address, it needs an IP address for each
network it is connected to. So, let’s give
45
00:05:02,670 --> 00:05:12,080
R1’s G0/0 interface an IP address of 192.168.1.254,
and it’s G0/1 interface an IP address of
46
00:05:12,080 --> 00:05:16,919
192.168.2.254.
47
00:05:16,919 --> 00:05:23,660
This time, if PC1 sends a frame to the broadcast
MAC address of all Fs, SW1 will receive the
48
00:05:23,660 --> 00:05:26,000
frame…
49
00:05:26,000 --> 00:05:30,490
and it will forward it out of all of interfaces
except the one the frame was received on.
50
00:05:30,490 --> 00:05:38,330
So, it sends the frame out of G0/1 and G0/2,
and PC2 and R1 receive the frame. However,
51
00:05:38,330 --> 00:05:44,160
that’s where it ends. The broadcast is limited
to the local network, it doesn’t cross the
52
00:05:44,160 --> 00:05:50,889
router and go to SW2, PC3, and PC4. I’ll
go more into detail about routing and Layer
53
00:05:50,889 --> 00:05:56,800
3 forwarding, but as I said, this video will
focus on IP addresses themselves, so let’s
54
00:05:56,800 --> 00:05:59,160
take a look.
55
00:05:59,160 --> 00:06:05,840
This is a chart from Wikipedia showing the
IP version 4 header. IP, or Internet protocol,
56
00:06:05,840 --> 00:06:11,810
is the primary layer 3 protocol in use today,
and version 4 is the version in use in most
57
00:06:11,810 --> 00:06:17,669
networks. As you can see, there are a lot
of different fields in the IPv4 header, more
58
00:06:17,669 --> 00:06:23,240
than in the Ethernet header. We’ll talk
more about the IPv4 header in another video,
59
00:06:23,240 --> 00:06:30,711
so today let’s look at these two fields,
the source IP address and IP address. These
60
00:06:30,711 --> 00:06:36,860
fields are both 32-bits in length, as you
can see they stretch from 0 to 31 in this
61
00:06:36,860 --> 00:06:43,780
chart. So, IP addresses are 32-bits, or 4
bytes, in length.
62
00:06:43,780 --> 00:06:53,780
Let’s take a look at this IPv4 address,
192.168.1.254. An IPv4 address is 32 bits
63
00:06:53,780 --> 00:07:02,300
long, so each of these four groups of numbers
represents 8 bits. 192 represents 8 bits,
64
00:07:02,300 --> 00:07:12,310
168 represents 8 bits, 1 represents 8 bits,
and 254 represents 8 bits. If we write these
65
00:07:12,310 --> 00:07:30,380
8 bits out at 1s and 0s, 192 is 11 00 00 00,
168 is 10 10 10 00, 1 is 00 00 00 01, and
66
00:07:30,380 --> 00:07:41,720
254 is 11 11 11 10. This way of writing numbers
using just 0s and 1s is called binary. However,
67
00:07:41,720 --> 00:07:47,129
binary is difficult to read and remember for
us humans, so IP address are written using
68
00:07:47,129 --> 00:07:54,080
what’s called dotted decimal, because there
are four decimal numbers, 192, 168, 1, and
69
00:07:54,080 --> 00:08:01,730
254, separated by dots. Let’s spend some
time learning about binary, which is important
70
00:08:01,730 --> 00:08:05,730
to understand IPv4 addresses.
71
00:08:05,730 --> 00:08:12,110
Before looking at binary, let’s review decimal
and hexadecimal. In decimal, also known as
72
00:08:12,110 --> 00:08:21,840
base 10, each digit increases by a factor
of 10. For example, this number 3294 consists
73
00:08:21,840 --> 00:08:35,289
of 1 four, 9 tens, 2 hundreds, and 3 thousands.
Notice that they increase by a factor of 10.
74
00:08:35,289 --> 00:08:45,769
1 x 10 is 10. 10 x 10 is 100. 100 x 10 is
1000, and next would be 1000 x 10, which is
75
00:08:45,769 --> 00:08:55,000
ten thousand. Now, let’s look at this number
in hexadecimal. Decimal 3294 is written in
76
00:08:55,000 --> 00:09:02,360
hexadecimal as C D E. How does that work?
Well, the first digit represents 1s, so this
77
00:09:02,360 --> 00:09:12,730
is E times 1, and E = 14, so that equals 14.
The next digit increases by a factor of 16,
78
00:09:12,730 --> 00:09:23,980
and 1 * 16 is 16 of course, so this is D times
16, and D = 13, making this equal to decimal
79
00:09:23,980 --> 00:09:31,070
208. Finally, the next digit increases by
a factor of 16 once again, and 16 times 16
80
00:09:31,070 --> 00:09:47,380
is equal to 256, so this is C times 256. C
= 12, so this is equal to decimal 3072. If
81
00:09:47,380 --> 00:09:55,829
you add those numbers up, you get 3294. So,
that’s a quick review of decimal and hexadecimal.
82
00:09:55,829 --> 00:09:57,950
Now let’s look at binary.
83
00:09:57,950 --> 00:10:05,829
So, looking back at this IP address 192.168.1.254,
let’s look at how each of these numbers
84
00:10:05,829 --> 00:10:15,290
is written in binary, starting with 192, which
is 11 00 00 00.
85
00:10:15,290 --> 00:10:22,440
Binary is base 2, meaning each digit increases
by a factor of 2, it doubles. So, that means
86
00:10:22,440 --> 00:10:35,660
that this 11 00 00 00 really is 0 1s, then
1 x 2 is 2, so 0 2s, then 2 x 2 is 4, so 0
87
00:10:35,660 --> 00:10:50,800
4s, then 4 x 2 is 8, so 0 8s, then 8 x 2 is
16, so 0 16s, 16 x 2 is 32, so 0 32s, 32 x
88
00:10:50,800 --> 00:11:05,260
2 is 64, so 1 64, and 64 x 2 is 128, so 1
128 If you add 128 and 64 together, you get
89
00:11:05,260 --> 00:11:08,329
192 again.
90
00:11:08,329 --> 00:11:16,070
Next let’s look at how 168 is converted
to binary 10 10 10 00.
91
00:11:16,070 --> 00:11:29,329
So, 10 10 10 00 in binary means 1 unit of
128, 1 unit of 32, and 1 unit of 8. 128 plus
92
00:11:29,329 --> 00:11:35,000
32 plus 8 is equal to 168.
93
00:11:35,000 --> 00:11:42,940
Next up is 1, which is the decimal representation
of binary 00 00 00 01.
94
00:11:42,940 --> 00:11:50,310
This is pretty simple. 1 is equal to 1 unit
of 1. Let’s go to the last 8 bits of the
95
00:11:50,310 --> 00:11:52,600
IP address.
96
00:11:52,600 --> 00:12:01,290
254 is equal to 11 11 11 10 in binary. Let’s
take a look.
97
00:12:01,290 --> 00:12:13,940
Binary 11 11 11 10 represents 1 unit of 128,
1 unit of 64, 1 unit of 32, 1 unit of 16,
98
00:12:13,940 --> 00:12:22,889
1 unit of 8, 1 unit of 4, and 1 unit of 2.
Add those all together, and you get 254.
99
00:12:22,889 --> 00:12:29,139
So, hopefully you have an idea of how binary
works now. Before we do some practice converting
100
00:12:29,139 --> 00:12:35,339
between decimal and binary, I want to teach
you one more term. You’ll often hear each
101
00:12:35,339 --> 00:12:41,199
of these 8 bit groups referred to as ‘octets’.
Now, let’s get some practice converting
102
00:12:41,199 --> 00:12:43,399
binary octets to decimal.
103
00:12:43,399 --> 00:12:53,060
Here’s an example. We have a binary octet
of 10 00 11 11. How can we go about converting
104
00:12:53,060 --> 00:12:59,480
this to decimal? First, I recommend writing
the value of each binary digit over the binary
105
00:12:59,480 --> 00:13:05,310
numbers. You can start with 1 on the right,
and then multiply by 2 for each digit as you
106
00:13:05,310 --> 00:13:12,459
move to the left. Or if you prefer, start
by writing 128 over the digit on the left,
107
00:13:12,459 --> 00:13:18,139
and divide by 2 as you move to the right.
Once you have written these values, simply
108
00:13:18,139 --> 00:13:30,139
add up the value of each 1, and you get the
answer. 128 + 8 + 4 + 2 + 1 equals 143. So,
109
00:13:30,139 --> 00:13:40,520
binary 10 00 11 11 is equal to decimal 143.
Let’s do another example.
110
00:13:40,520 --> 00:13:49,139
Now we have binary 01 11 01 10. Once again,
write the value of each binary digit over
111
00:13:49,139 --> 00:14:00,540
the octet. So, we have 1 unit of 64, 1 unit
of 32, 1 unit of 16, 1 unit of 4, and 1 unit
112
00:14:00,540 --> 00:14:08,880
of 2. Add each of those numbers together,
and you get the answer, which is 118. So,
113
00:14:08,880 --> 00:14:16,310
binary 01 11 01 10 is equal to decimal 118.
114
00:14:16,310 --> 00:14:24,260
What is binary 11 10 11 00 in decimal? This
time I won’t display the value of each binary
115
00:14:24,260 --> 00:14:31,350
digit above. Write down the number yourself,
or try to do the calculation in your head.
116
00:14:31,350 --> 00:14:45,740
Pause the video to figure out the answer.
Got it? 128 + 64 + 32 + 8 + 4 equals 236.
117
00:14:45,740 --> 00:14:51,699
Okay, we’ll do some more binary to decimal
conversion practice in the quiz for today’s
118
00:14:51,699 --> 00:14:54,420
video, let’s move on.
119
00:14:54,420 --> 00:14:59,070
Now let’s try converting in the opposite
direction, from decimal to binary. We have
120
00:14:59,070 --> 00:15:05,130
the decimal number 221, how can we go about
converting it to binary? I recommend writing
121
00:15:05,130 --> 00:15:11,680
out the values of each bit in a binary octet,
like this. Then, starting from 128, try to
122
00:15:11,680 --> 00:15:17,019
subtract each number from the decimal number
you’re trying to convert. As you can see,
123
00:15:17,019 --> 00:15:24,829
we can subtract 128 from 221, so write a 1
under 128. Now, we’ve got 93 left, can we
124
00:15:24,829 --> 00:15:35,339
subtract 64 from 93? Yes we can, and we’re
left with 29. So, write a 1 under 64. Next,
125
00:15:35,339 --> 00:15:41,860
can we subtract 32 from 29? Well, we can,
but we’d end up with a negative number,
126
00:15:41,860 --> 00:15:50,740
so for our purposes, no we can’t. So, write
a 0 under 32. Next, 16 is smaller than 29,
127
00:15:50,740 --> 00:16:00,029
so let’s subtract 16 from 29. We’re left
with 13, and write a 1 under 16. Next is 8,
128
00:16:00,029 --> 00:16:08,160
and it’s smaller than 13, so let’s subtract
8 from 13 and write a 1 under 8. Next, subtract
129
00:16:08,160 --> 00:16:15,810
4 from 5, and write a 1 under 4. We can’t
subtract 2 from 1, so write a 0 under the
130
00:16:15,810 --> 00:16:22,850
2 bit. And then finally subtract 1 from 1,
resulting in 0, and write a 1 under the 1
131
00:16:22,850 --> 00:16:31,660
bit. So, there’s our answer. Decimal 221
is equivalent to binary 1101 1101.
132
00:16:31,660 --> 00:16:40,130
Let’s do another example. Let’s convert
decimal 127 to binary. Try to figure it out
133
00:16:40,130 --> 00:16:49,899
yourself first. Pause the video to find the
answer. Okay, hopefully you found the answer,
134
00:16:49,899 --> 00:16:59,000
let’s check. We can’t subtract 128 from
127, so write a 0 under 128. We can subtract
135
00:16:59,000 --> 00:17:09,410
64 from 127, which leaves 63, and I’ll write
a 1 under 64. Then subtract 32 from 62, and
136
00:17:09,410 --> 00:17:19,870
write a 1 under 32. We’re left with 31,
and next subtract 16 from 31, . 15 remains,
137
00:17:19,870 --> 00:17:28,580
and I write a 1 under 16. Subtract 8 from
15, and write a 1 under 8. You’re left with
138
00:17:28,580 --> 00:17:38,070
7, so subtract 4 from 7 , you get 3, and write
a 1 under 4. Subtract 3 from 2, and write
139
00:17:38,070 --> 00:17:47,550
a 1 under 2. Finally, subtract 1 from 1 and
you’re left with 0. There’s our answer.
140
00:17:47,550 --> 00:17:54,240
Decimal 127 in binary is 01 11 11 11.
141
00:17:54,240 --> 00:18:00,220
Let’s do one more example of decimal to
binary conversion. Again, try to find the
142
00:18:00,220 --> 00:18:07,450
answer yourself. Write down the numbers and
convert decimal 207 to binary. Pause the video
143
00:18:07,450 --> 00:18:17,681
to think about your answer. Hopefully you
found the answer, let’s check. First, write
144
00:18:17,681 --> 00:18:24,890
out the values for each bit of the binary
octet. Subtract 128 from 207, and write a
145
00:18:24,890 --> 00:18:35,680
1 under 128. Subtract 64 from 79, and write
a 1 under 64. We can’t subtract 32 from
146
00:18:35,680 --> 00:18:46,340
15, so write a 0 under 32. You can’t subtract
16 from 15 either, so write a 0 under 16.
147
00:18:46,340 --> 00:18:55,549
Subtract 8 from 15, and write a 1 under 8.
Subtract 4 from 7, and write a 1 under 4.
148
00:18:55,549 --> 00:19:02,280
Subtract 2 from 3, and write a 1 under 2.
Finally, subtract 1 from 1 and you get 0.
149
00:19:02,280 --> 00:19:12,110
There’s the answer. Decimal 207 is equivalent
to 11 00 11 11 in binary.
150
00:19:12,110 --> 00:19:16,490
Before moving on, you probably figured this
out by yourself already, but the range of
151
00:19:16,490 --> 00:19:22,809
possible numbers that can be represented with
8 binary bits ranges from 0, if all bits are
152
00:19:22,809 --> 00:19:36,419
0, to 255, if all bits are 1, because 128
+ 64 + 32 + 16 + 8 + 4 + 2 + 1 equals 255.
153
00:19:36,419 --> 00:19:45,220
So, an IPv4 address is really a series of
32 bits. It is split up into 4 octets, and
154
00:19:45,220 --> 00:19:51,740
then written in dotted decimal format to make
it simpler for us humans to read and understand.
155
00:19:51,740 --> 00:19:58,130
However, you may remember there was this /24
that I said was used to identify which part
156
00:19:58,130 --> 00:20:04,960
of the IP address represents the network and
which represents the end host. Since an IP
157
00:20:04,960 --> 00:20:12,890
address is 32 bits, can you guess what this
/24 means? … It means that the first 24
158
00:20:12,890 --> 00:20:18,430
bits of this IP address represent the network
portion of the address, and the remaining
159
00:20:18,430 --> 00:20:21,080
8 represent the end host.
160
00:20:21,080 --> 00:20:31,179
So, the first 24 bits is equal to the first
3 octets, because 8 + 8 + 8 equals 24.
161
00:20:31,179 --> 00:20:39,780
So 192.168.1 is the network portion of the
address, and 254 is the host portion.
162
00:20:39,780 --> 00:20:49,130
Here’s a quick look back at our small network.
The IP address of PC1, PC2, and R1’s G0/0
163
00:20:49,130 --> 00:21:03,780
interface are 192.168.1.1/24, 192.168.1.2/24,
and 192.168.1.254/24. Notice that the network
164
00:21:03,780 --> 00:21:09,720
portion of each IP address is the same, because
they are all part of the same local network,
165
00:21:09,720 --> 00:21:18,120
only the host portion is different. Likewise,
the IP addresses of PC3, PC4, and R1’s G0/1
166
00:21:18,120 --> 00:21:31,799
interface are 192.168.2.1/24, 192.168.2.2/24,
and 192.168.2.254/24, only the host portion
167
00:21:31,799 --> 00:21:36,240
of the address is different because they are
on the same local network.
168
00:21:36,240 --> 00:21:42,500
Let’s follow the same process as before
with another IP address. If you want some
169
00:21:42,500 --> 00:21:49,350
extra practice, try to convert these 32 binary
bits into an IPv4 address. Pause the video
170
00:21:49,350 --> 00:21:57,850
if you want to try to find the answer on your
own. Okay, so the 32 bits can be split into
171
00:21:57,850 --> 00:22:06,120
4 octets like this. Then the four octets can
be converted into dotted decimal like this.
172
00:22:06,120 --> 00:22:13,780
This time, /16 is used instead of /24. Which
portion is the network portion and which is
173
00:22:13,780 --> 00:22:15,549
the host portion?
174
00:22:15,549 --> 00:22:23,790
Well, /16 means the first 16 bits, or the
first half, are the network portion. So, the
175
00:22:23,790 --> 00:22:29,880
first two octets are the network portion,
and the last two octets are the host portion.
176
00:22:29,880 --> 00:22:39,030
Therefore, 154.78 is the network portion,
and 111.32 is the host portion. Let’s do
177
00:22:39,030 --> 00:22:40,690
one more example.
178
00:22:40,690 --> 00:22:48,809
Here’s another IPv4 address. Try to convert
these 32 bits into dotted decimal. Pause the
179
00:22:48,809 --> 00:22:58,330
video now if you want to try. Okay, so you
can divide the 32 bits into 4 octets like
180
00:22:58,330 --> 00:23:06,250
this, and then convert the octets into dotted
decimal like this. This time, it’s /8. So,
181
00:23:06,250 --> 00:23:12,440
which part of the address is the network portion,
and which is the host portion?
182
00:23:12,440 --> 00:23:17,301
Since the first 8 bits are the network portion,
that means that the first octet is the network
183
00:23:17,301 --> 00:23:22,809
portion, and the last three octets are the
host portion.
184
00:23:22,809 --> 00:23:30,190
So 12 is the network portion, and 128.251.23
is the host portion.
185
00:23:30,190 --> 00:23:38,700
Now, IPv4 addresses are split up into 5 different
‘classes’. The class of an IPv4 address
186
00:23:38,700 --> 00:23:46,169
is determined by the first octet of the address.
The first is class A, which has a first octet
187
00:23:46,169 --> 00:23:52,070
beginning with 0. If the first octet begins
with 0, that means that the numeric range
188
00:23:52,070 --> 00:24:02,299
of the first octet is from 0 to 127, because
64 + 32 + 16 + 8 + 4 + 2 + 1 gives a maximum
189
00:24:02,299 --> 00:24:11,380
of 127. The second class is class B, which
has a first octet beginning with 1 0, and
190
00:24:11,380 --> 00:24:19,659
therefore a numeric range of 128 to 191. The
third class is class C, which has a first
191
00:24:19,659 --> 00:24:25,500
octet beginning with 1 1 0, and therefore
the numeric range for the first octet is 192
192
00:24:25,500 --> 00:24:35,100
to 223. Class D has a first octet beginning
with 1 1 1 0, and the numeric range of the
193
00:24:35,100 --> 00:24:45,470
first octet is 224 to 239. Finally, class
E has a first octet beginning with 1111, and
194
00:24:45,470 --> 00:24:50,899
therefore the numeric range for the first
octet is 240 to 255.
195
00:24:50,899 --> 00:24:57,929
However, the classes of address we’ll be
focusing on are A, B, and C. Addresses in
196
00:24:57,929 --> 00:25:04,390
class D are reserved for ‘multicast’ addresses.
Multicast is another type of address, separate
197
00:25:04,390 --> 00:25:09,850
from the unicast and broadcast addresses we
talked about in previous videos. We will talk
198
00:25:09,850 --> 00:25:15,049
about them, but that will be later in the
course. Class E addresses are reserved for
199
00:25:15,049 --> 00:25:21,039
experimental uses, we won’t talk about them
in this course. Now, one more thing about
200
00:25:21,039 --> 00:25:28,220
the Class A range. The end of the class A
range is usually considered to be 126, NOT
201
00:25:28,220 --> 00:25:33,400
127. Why is that? Let’s take a look.
202
00:25:33,400 --> 00:25:39,250
The 127 range is reserved for ‘loopback
addresses’. The range is anything with a
203
00:25:39,250 --> 00:25:51,440
first octet of 127, so 127.0.0.0 to 127.255.255.255.
These addresses are used to test the ‘network
204
00:25:51,440 --> 00:25:57,149
stack’ of the local device. If a device
sends any network traffic to an address in
205
00:25:57,149 --> 00:26:03,659
this range, is is simply processed back up
the TCP/IP stack as if it were traffic received
206
00:26:03,659 --> 00:26:11,960
from another device. In this image, I pinged
127.0.0.1 on my windows PC, and you can see
207
00:26:11,960 --> 00:26:19,470
the responses. My PC is responding to its
own pings. In this image, I sent a ping to
208
00:26:19,470 --> 00:26:30,700
a random address in the 127 range, 127.23.68.241,
and again my PC responds back to its own ping.
209
00:26:30,700 --> 00:26:36,510
Notice the round trip times, all 0 milliseconds.
That’s because the traffic isn’t going
210
00:26:36,510 --> 00:26:43,110
anywhere, my PC is just sending and receiving
these pings to and from itself.
211
00:26:43,110 --> 00:26:50,220
So here’s the chart again with just classes
A, B, and C. I’ve also added one more column,
212
00:26:50,220 --> 00:26:57,350
the prefix length, which is the /8, /16, and
/24 which is used to identify the length of
213
00:26:57,350 --> 00:27:04,710
the network portion of the address. Class
A addresses use a /8 prefix, Class B addresses
214
00:27:04,710 --> 00:27:11,590
use a /16 prefix, and Class C addresses use
a /24 prefix.
215
00:27:11,590 --> 00:27:16,760
Actually, if you look back at these three
addresses we used in our examples, you can
216
00:27:16,760 --> 00:27:23,520
see they are , Class A, class B, and Class
C addresses, and their prefix lengths match
217
00:27:23,520 --> 00:27:33,870
the table. /8 for class A, /16 for class B,
and /24 for class C. In class A, there are
218
00:27:33,870 --> 00:27:39,941
fewer possible network addresses, however
because the host portion is very long, there
219
00:27:39,941 --> 00:27:46,700
can be many hosts on each network. Class C
is the opposite, there are many more possible
220
00:27:46,700 --> 00:27:52,210
networks, but because the host portion is
smaller there are fewer hosts on each network.
221
00:27:52,210 --> 00:27:55,039
Let’s take a look at the numbers.
222
00:27:55,039 --> 00:28:01,610
So, this is another chart I’ve taken off
of wikipedia. The leading bits column refers
223
00:28:01,610 --> 00:28:07,700
to the first bits of the first octet, which
I displayed in my previous table. The ‘size
224
00:28:07,700 --> 00:28:12,100
of network number bit field’ displays the
number of bits in the network portion of the
225
00:28:12,100 --> 00:28:19,480
IP address, which as I mentioned is 8 for
class A, 16 for class B, and 24 for class
226
00:28:19,480 --> 00:28:26,160
C. ‘size of rest bit field’ indicates
the remaining number of bits in the address,
227
00:28:26,160 --> 00:28:33,550
the host portion of the address. 24 bits for
class A, 16 for class B, and 8 for class C.
228
00:28:33,550 --> 00:28:41,250
Now, this part here displays the number of
possible networks in each class. As I said,
229
00:28:41,250 --> 00:28:47,220
class A has fewer potential networks, but
more hosts in each network, class C is the
230
00:28:47,220 --> 00:28:55,640
opposite, and class B is in between. Class
A has 128 possible networks, Class B has about
231
00:28:55,640 --> 00:29:04,190
16,000 networks, and Class C has about 2 million
networks. Class A allows about 16.7 million
232
00:29:04,190 --> 00:29:11,039
hosts in each network, Class B allows about
65,000 hosts in each network, and class C
233
00:29:11,039 --> 00:29:17,830
allows 256 hosts in each network. However,
because the first address in each network
234
00:29:17,830 --> 00:29:24,299
is the network address, it cant be assigned
to hosts. Also the last address of the network
235
00:29:24,299 --> 00:29:29,179
is the broadcast address, the Layer 3 address
used when you want to send traffic to all
236
00:29:29,179 --> 00:29:35,990
hosts, and it can’t be assigned to hosts,
really the host count is two less, for example
237
00:29:35,990 --> 00:29:41,029
254 in class C.
238
00:29:41,029 --> 00:29:47,059
Now I want to briefly talk about another way
of writing these prefix lengths. Using a slash,
239
00:29:47,059 --> 00:29:51,520
followed by the length of the prefix, is a
newer and easier way of writing the prefix
240
00:29:51,520 --> 00:29:58,120
length. On Juniper network devices, for example,
you write prefix lengths using this slash
241
00:29:58,120 --> 00:30:04,050
notation. However, Cisco devices still use
an older, slightly more complicated way of
242
00:30:04,050 --> 00:30:10,750
writing the prefix length. That is using a
dotted decimal netmask. A netmask is written
243
00:30:10,750 --> 00:30:16,660
in dotted decimal like an IP address, where
the network portion is all 1s and the host
244
00:30:16,660 --> 00:30:26,150
portion is all 0s. For example, the network
mask of a class A address is 255.0.0.0. That’s
245
00:30:26,150 --> 00:30:34,279
the dotted decimal version of 11 11 11 11,
followed by 24 zeroes. So, what do you think
246
00:30:34,279 --> 00:30:43,330
the netmask of a Class B address is?... It’s
255.255.0.0, which is two octets of 1s, followed
247
00:30:43,330 --> 00:30:49,309
by two octets of zeroes, written in dotted
decimal. Finally, what do you think the netmask
248
00:30:49,309 --> 00:30:58,630
of a Class C address is?... It’s 255.255.255.0,
which is three octets of 1s, followed by 1
249
00:30:58,630 --> 00:31:05,429
octet of zeroes, written in dotted decimal
notation. So, these prefix lengths and these
250
00:31:05,429 --> 00:31:11,160
netmasks are the same thing, just written
in different ways.
251
00:31:11,160 --> 00:31:14,659
Before moving on to the quiz for today’s
video, I want to explain two more types of
252
00:31:14,659 --> 00:31:23,600
IP addresses, the network and broadcast addresses.
If the host portion of an IP address is all
253
00:31:23,600 --> 00:31:30,320
0’s, it means it is the Network address,
the identifier of the network itself. In our
254
00:31:30,320 --> 00:31:39,159
diagram here, you can see 192.168.1.0/24.
We know that /24 means the first three octets
255
00:31:39,159 --> 00:31:45,110
are the network portion, and the last octet
is the host portion. Since, the host portion
256
00:31:45,110 --> 00:31:55,480
is 0, it means the last octet, the host portion,
is all 0s. Therefore, this address, 192.168.1.0/24,
257
00:31:55,480 --> 00:32:02,260
is the network address. Keep in mind, , the
network address cannot be assigned to a host.
258
00:32:02,260 --> 00:32:07,269
The network address is the first address of
the network, but the first USABLE address
259
00:32:07,269 --> 00:32:14,409
is one above the network address, in this
case it’s 192.168.1.1, which is assigned
260
00:32:14,409 --> 00:32:15,889
to PC1.
261
00:32:15,889 --> 00:32:23,670
So, the network address is the first address,
with a host portion of all 0s. However, the
262
00:32:23,670 --> 00:32:29,190
LAST address in a network, with a host portion
of all 1s, is the broadcast address for the
263
00:32:29,190 --> 00:32:37,190
network. Like the network address, the broadcast
address CANNOT be assigned to a host. So although
264
00:32:37,190 --> 00:32:42,690
it’s the last address in the network the
last USABLE address in actually 1 under the
265
00:32:42,690 --> 00:32:50,950
broadcast address, in this case, that’s
192.168.1.254, the address assigned to R1’s
266
00:32:50,950 --> 00:32:53,310
G0/0 interface.
267
00:32:53,310 --> 00:32:58,929
So, the broadcast address is the layer 3 address
used to send a packet to all hosts on the
268
00:32:58,929 --> 00:33:04,850
local network. If a packet is sent with this
destination IP address, what do you think
269
00:33:04,850 --> 00:33:10,340
will be the destination MAC address of the
frame it is encapsulated in? Think about the
270
00:33:10,340 --> 00:33:18,659
Ethernet LAN switching videos... it will be
all F’s, the broadcast MAC Address. If PC1,
271
00:33:18,659 --> 00:33:29,539
for example, sent a ping to 192.168.1.255,
it would be received by PC2 and R1’s G0/0
272
00:33:29,539 --> 00:33:31,120
interface.
273
00:33:31,120 --> 00:33:35,490
Once again, I think we’ve covered a lot
of ground in this video. Let’s list what
274
00:33:35,490 --> 00:33:42,990
we covered before moving on to today’s quiz.
First, I talked about dotted decimal and binary.
275
00:33:42,990 --> 00:33:48,030
Binary is how computers think, but 32 bit
IPv4 addresses are difficult to remember for
276
00:33:48,030 --> 00:33:53,850
us humans, so we convert IPv4 addresses to
dotted decimal form to make them easier to
277
00:33:53,850 --> 00:34:02,570
read and remember. You learned that IPv4 addresses
consist of a network portion and a host portion.
278
00:34:02,570 --> 00:34:07,059
Hosts on the same network will have the same
network portion, but a unique host portion
279
00:34:07,059 --> 00:34:11,400
of their IP addresses. You learned about the
IPv4 address classes, including Class D, used
280
00:34:11,400 --> 00:34:13,870
for loopbacks, and Class E, which is reserved
for experimental purposes. We looked at the
281
00:34:13,870 --> 00:34:18,389
different ways of indicating the length of
the network prefix, by writing the prefix
282
00:34:18,389 --> 00:34:24,140
length with a slash or by using a netmask.
and finally, you learned about the network
283
00:34:24,140 --> 00:34:29,910
address, which has a host portion of all 0s,
which is used to identify the network itself,
284
00:34:29,910 --> 00:34:37,340
not any particular host on it. Also, the broadcast
address, which has a host portion of all 1s,
285
00:34:37,340 --> 00:34:41,389
which is used to sent network traffic to all
hosts on the network.
286
00:34:41,389 --> 00:34:46,280
So, before moving on to the quiz I want to
remind you to download and use the flashcards
287
00:34:46,280 --> 00:34:51,290
for this lesson to help you remember what
you’ve studied in this lesson. Now, for
288
00:34:51,290 --> 00:34:56,540
today’s quiz, I’m going to focus exclusively
on converting IPv4 addresses between binary
289
00:34:56,540 --> 00:35:03,610
and dotted decimal. There will be 10 questions,
instead of the usual 5, and hopefully afterward
290
00:35:03,610 --> 00:35:09,240
you’ll feel confident converting IPv4 addresses
between binary and dotted decimal. Let’s
291
00:35:09,240 --> 00:35:10,980
get started.
292
00:35:10,980 --> 00:35:17,609
Question 1. Convert the following IPv4 address
to dotted decimal notation. Pause the video
293
00:35:17,609 --> 00:35:25,099
to solve the question, then unpause to check
your answer.
294
00:35:25,099 --> 00:35:33,270
The answer is 63.56.231.19. Let’s go the
question 2.
295
00:35:33,270 --> 00:35:38,450
Convert the following IPv4 address to dotted
decimal notation. Pause the video to solve
296
00:35:38,450 --> 00:35:51,530
the question, then unpause to check your answer.
The answer is 243.127.98.1. Let’s go the
297
00:35:51,530 --> 00:35:54,430
question 3.
298
00:35:54,430 --> 00:35:59,690
Convert the following IPv4 address to dotted
decimal notation. Pause the video to solve
299
00:35:59,690 --> 00:36:12,510
the question, and unpause to check your answer.
The answer is 111.6.89.199. Let’s go the
300
00:36:12,510 --> 00:36:15,220
question 4.
301
00:36:15,220 --> 00:36:20,730
Convert the following IPv4 address to dotted
decimal notation. Pause the video to solve
302
00:36:20,730 --> 00:36:33,869
the question, and unpause to check your answer.
The answer is 207.198.47.76. Let’s go the
303
00:36:33,869 --> 00:36:37,250
question 5.
304
00:36:37,250 --> 00:36:42,690
Convert the following IPv4 address to dotted
decimal notation. Pause the video to solve
305
00:36:42,690 --> 00:36:55,810
the question, and unpause to check your answer.
The answer is 100.201.33.253. Let’s go the
306
00:36:55,810 --> 00:36:58,680
question 6.
307
00:36:58,680 --> 00:37:07,670
Convert the following IPv4 address to binary
notation. 88.46.90.91. Pause the video to
308
00:37:07,670 --> 00:37:16,300
solve the question, and unpause to check your
answer.
309
00:37:16,300 --> 00:37:23,980
And here’s the answer. Let’s go to question
7.
310
00:37:23,980 --> 00:37:34,599
Convert the following IPv4 address to binary
notation. 221.234.246.163. Pause the video
311
00:37:34,599 --> 00:37:42,410
to solve the question, and unpause to check
your answer.
312
00:37:42,410 --> 00:37:49,540
And here’s the answer. Let’s go to question
8.
313
00:37:49,540 --> 00:37:59,400
Convert the following IPv4 address to binary
notation. 3.41.143.222. Pause the video to
314
00:37:59,400 --> 00:38:07,530
solve the question, and unpause to check your
answer.
315
00:38:07,530 --> 00:38:14,010
And here’s the answer. Let’s go to question
9.
316
00:38:14,010 --> 00:38:22,700
Convert the following IPv4 address to binary
notation. 10.200.231.91. Pause the video to
317
00:38:22,700 --> 00:38:29,740
solve the question, and unpause to check your
answer.
318
00:38:29,740 --> 00:38:36,540
And here’s the answer. Let’s go to question
10.
319
00:38:36,540 --> 00:38:46,369
Convert the following IPv4 address to binary
notation. 248.87.255.152. Pause the video
320
00:38:46,369 --> 00:38:53,750
to solve the question, and unpause to check
your answer.
321
00:38:53,750 --> 00:38:54,980
And here’s the answer.
322
00:38:54,980 --> 00:39:02,480
Okay, that’s all for the quiz, I hope you
feel confident converting IPv4 addresses between
323
00:39:02,480 --> 00:39:04,800
binary and dotted decimal notation.