Senior Acquisitions Editor: Kenyon Brown Development Editor: Kim Wimpsett



Yüklə 22,5 Mb.
Pdf görüntüsü
səhifə20/69
tarix26.10.2019
ölçüsü22,5 Mb.
#29436
1   ...   16   17   18   19   20   21   22   23   ...   69
Todd Lammle CCNA Routing and Switching


Subnetting Class B Addresses

Before we dive into this, let’s look at all the possible Class B subnet masks

first. Notice that we have a lot more possible subnet masks than we do

with a Class C network address:

255.255.0.0 (/16)

255.255.128.0 (/17) 255.255.255.0 (/24)

255.255.192.0 (/18) 255.255.255.128 (/25)

255.255.224.0 (/19) 255.255.255.192 (/26)

255.255.240.0 (/20) 255.255.255.224 (/27)

255.255.248.0 (/21) 255.255.255.240 (/28)

255.255.252.0 (/22) 255.255.255.248 (/29)

255.255.254.0 (/23) 255.255.255.252 (/30)

We know the Class B network address has 16 bits available for host

addressing. This means we can use up to 14 bits for subnetting because

we need to leave at least 2 bits for host addressing. Using a /16 means you

are not subnetting with Class B, but it is a mask you can use!

By the way, do you notice anything interesting about that list

of subnet values—a pattern, maybe? Ah ha! That’s exactly why I had

you memorize the binary-to-decimal numbers earlier in Chapter 2,

“Ethernet Networking and Data Encapsulation.” Since subnet mask

bits start on the left and move to the right and bits can’t be skipped,

the numbers are always the same regardless of the class of address. If

you haven’t already, memorize this pattern!

The process of subnetting a Class B network is pretty much the same as it

is for a Class C, except that you have more host bits and you start in the

third octet.

Use the same subnet numbers for the third octet with Class B that you

used for the fourth octet with Class C, but add a zero to the network

portion and a 255 to the broadcast section in the fourth octet. The

following table shows you an example host range of two subnets used in a

Class B 240 (/20) subnet mask:

Subnet address 16.0

32.0

Broadcast address 31.255 47.255



Just add the valid hosts between the numbers and you’re set!

The preceding example is true only until you get up to /24.

After that, it’s numerically exactly like Class C.

Subnetting Practice Examples: Class B Addresses

The following sections will give you an opportunity to practice subnetting

Class B addresses. Again, I have to mention that this is the same as

subnetting with Class C, except we start in the third octet—with the exact

same numbers!

Practice Example #1B: 255.255.128.0 (/17)

172.16.0.0 = Network address

255.255.128.0 = Subnet mask

Subnets? 2

1

= 2 (same amount as Class C).



Hosts? 2

15

– 2 = 32,766 (7 bits in the third octet, and 8 in the fourth).



Valid subnets? 256 – 128 = 128. 0, 128. Remember that subnetting is

performed in the third octet, so the subnet numbers are really 0.0 and

128.0, as shown in the next table. These are the exact numbers we

used with Class C; we use them in the third octet and add a 0 in the

fourth octet for the network address.

Broadcast address for each subnet?

Valid hosts?

The following table shows the two subnets available, the valid host range,

and the broadcast address of each:

Subnet

0.0

128.0

First host 0.1

128.1

Last host 127.254 255.254



Broadcast 127.255 255.255

Okay, notice that we just added the fourth octet’s lowest and highest

values and came up with the answers. And again, it’s done exactly the


same way as for a Class C subnet. We just used the same numbers in the

third octet and added 0 and 255 in the fourth octet—pretty simple, huh? I

really can’t say this enough: it’s just not that hard. The numbers never

change; we just use them in different octets!

Question: Using the previous subnet mask, do you think 172.16.10.0 is a

valid host address? What about 172.16.10.255? Can 0 and 255 in the

fourth octet ever be a valid host address? The answer is absolutely, yes,

those are valid hosts! Any number between the subnet number and the

broadcast address is always a valid host.

Practice Example #2B: 255.255.192.0 (/18)

172.16.0.0 = Network address

255.255.192.0 = Subnet mask

Subnets? 2

2

= 4.



Hosts? 2

14

– 2 = 16,382 (6 bits in the third octet, and 8 in the fourth).



Valid subnets? 256 – 192 = 64. 0, 64, 128, 192. Remember that the

subnetting is performed in the third octet, so the subnet numbers are

really 0.0, 64.0, 128.0, and 192.0, as shown in the next table.

Broadcast address for each subnet?

Valid hosts?

The following table shows the four subnets available, the valid host range,

and the broadcast address of each:

Subnet

0.0

64.0

128.0 192.0

First host 0.1

64.1

128.1


192.1

Last host 63.254 127.254 191.254 255.254

Broadcast 63.255 127.255 191.255 255.255

Again, it’s pretty much the same as it is for a Class C subnet—we just

added 0 and 255 in the fourth octet for each subnet in the third octet.

Practice Example #3B: 255.255.240.0 (/20)

172.16.0.0 = Network address

255.255.240.0 = Subnet mask


Subnets? 2

4

= 16.



Hosts? 2

12

– 2 = 4094.



Valid subnets? 256 – 240 = 0, 16, 32, 48, etc., up to 240. Notice that

these are the same numbers as a Class C 240 mask—we just put them

in the third octet and add a 0 and 255 in the fourth octet.

Broadcast address for each subnet?

Valid hosts?

The following table shows the first four subnets, valid hosts, and

broadcast addresses in a Class B 255.255.240.0 mask:

Subnet

0.0

16.0

32.0

48.0

First host 0.1

16.1

32.1


48.1

Last host 15.254 31.254 47.254 63.254

Broadcast 15.255 31.255 47.255 63.255

Practice Example #4B: 255.255.248.0 (/21)

172.16.0.0 = Network address

255.255.248.0 = Subnet mask

Subnets? 2

5

= 32.



Hosts? 2

11

– 2 = 2046.



Valid subnets? 256 – 248 = 0, 8, 16, 24, 32, etc., up to 248.

Broadcast address for each subnet?

Valid hosts?

The following table shows the first five subnets, valid hosts, and

broadcast addresses in a Class B 255.255.248.0 mask:

Subnet

0.0

8.0

16.0

24.0

32.0

First host 0.1

8.1

16.1


24.1

32.1


Last host 7.254 15.254 23.254 31.254 39.254

Broadcast 7.255 15.255 23.255 31.255 39.255



Practice Example #5B: 255.255.252.0 (/22)

172.16.0.0 = Network address

255.255.252.0 = Subnet mask

Subnets? 2

6

= 64.



Hosts? 2

10

– 2 = 1022.



Valid subnets? 256 – 252 = 0, 4, 8, 12, 16, etc., up to 252.

Broadcast address for each subnet?

Valid hosts?

The following table shows the first five subnets, valid hosts, and

broadcast addresses in a Class B 255.255.252.0 mask:

Subnet

0.0

4.0

8.0

12.0

16.0

First host 0.1

4.1

8.1


12.1

16.1


Last host 3.254 7.254 11.254 15.254 19.254

Broadcast 3.255 7.255 11.255 15.255 19.255



Practice Example #6B: 255.255.254.0 (/23)

172.16.0.0 = Network address

255.255.254.0 = Subnet mask

Subnets? 2

7

= 128.



Hosts? 2

9

– 2 = 510.



Valid subnets? 256 – 254 = 0, 2, 4, 6, 8, etc., up to 254.

Broadcast address for each subnet?

Valid hosts?

The following table shows the first five subnets, valid hosts, and

broadcast addresses in a Class B 255.255.254.0 mask:

Subnet

0.0

2.0

4.0

6.0

8.0

First host 0.1

2.1

4.1


6.1

8.1


Last host 1.254 3.254 5.254 7.254 9.254

Broadcast 1.255 3.255 5.255 7.255 9.255

Practice Example #7B: 255.255.255.0 (/24)

Contrary to popular belief, 255.255.255.0 used with a Class B network

address is not called a Class B network with a Class C subnet mask. It’s

amazing how many people see this mask used in a Class B network and

think it’s a Class C subnet mask. This is a Class B subnet mask with 8 bits

of subnetting—it’s logically different from a Class C mask. Subnetting this

address is fairly simple:

172.16.0.0 = Network address

255.255.255.0 = Subnet mask

Subnets? 2

8

= 256.



Hosts? 2

8

– 2 = 254.



Valid subnets? 256 – 255 = 1. 0, 1, 2, 3, etc., all the way to 255.

Broadcast address for each subnet?

Valid hosts?

The following table shows the first four and last two subnets, the valid

hosts, and the broadcast addresses in a Class B 255.255.255.0 mask:

Subnet

0.0

1.0

2.0

3.0

… 254.0

255.0

First host 0.1

1.1

2.1


3.1

… 254.1


255.1

Last host 0.254 1.254 2.254 3.254 … 254.254 255.254

Broadcast 0.255 1.255 2.255 3.255 … 254.255 255.255

Practice Example #8B: 255.255.255.128 (/25)

This is actually one of the hardest subnet masks you can play with. And

worse, it actually is a really good subnet to use in production because it

creates over 500 subnets with 126 hosts for each subnet—a nice mixture.

So, don’t skip over it!

172.16.0.0 = Network address

255.255.255.128 = Subnet mask

Subnets? 2

9

= 512.



Hosts? 2

7

– 2 = 126.



Valid subnets? Now for the tricky part. 256 – 255 = 1. 0, 1, 2, 3, etc.,

for the third octet. But you can’t forget the one subnet bit used in the

fourth octet. Remember when I showed you how to figure one subnet

bit with a Class C mask? You figure this the same way. You actually get

two subnets for each third octet value, hence the 512 subnets. For

example, if the third octet is showing subnet 3, the two subnets would

actually be 3.0 and 3.128.

Broadcast address for each subnet? The numbers right before the

next subnet.



Valid hosts? The numbers between the subnet numbers and the

broadcast address.

The following graphic shows how you can create subnets, valid hosts, and

broadcast addresses using the Class B 255.255.255.128 subnet mask. The

first eight subnets are shown, followed by the last two subnets:

Practice Example #9B: 255.255.255.192 (/26)

Now, this is where Class B subnetting gets easy. Since the third octet has

a 255 in the mask section, whatever number is listed in the third octet is a

subnet number. And now that we have a subnet number in the fourth

octet, we can subnet this octet just as we did with Class C subnetting.

Let’s try it out:

172.16.0.0 = Network address

255.255.255.192 = Subnet mask



Subnets? 2

10

= 1024.



Hosts? 2

6

– 2 = 62.



Valid subnets? 256 – 192 = 64. The subnets are shown in the

following table. Do these numbers look familiar?



Broadcast address for each subnet?

Valid hosts?

The following table shows the first eight subnet ranges, valid hosts, and

broadcast addresses:


Subnet

0.0 0.64 0.128 0.192 1.0 1.64 1.128 1.192

First host 0.1

0.65 0.129 0.193 1.1

1.65 1.129 1.193

Last host 0.62 0.126 0.190 0.254 1.62 1.126 1.190 1.254

Broadcast 0.63 0.127 0.191 0.255 1.63 1.127 1.191 1.255

Notice that for each subnet value in the third octet, you get subnets 0, 64,

128, and 192 in the fourth octet.



Practice Example #10B: 255.255.255.224 (/27)

This one is done the same way as the preceding subnet mask, except that

we just have more subnets and fewer hosts per subnet available.

172.16.0.0 = Network address

255.255.255.224 = Subnet mask

Subnets? 2

11

= 2048.



Hosts? 2

5

– 2 = 30.



Valid subnets? 256 – 224 = 32. 0, 32, 64, 96, 128, 160, 192, 224.

Broadcast address for each subnet?

Valid hosts?

The following table shows the first eight subnets:



Subnet

0.0 0.32 0.64 0.96 0.128 0.160 0.192 0.224

First host 0.1

0.33 0.65 0.97 0.129 0.161 0.193 0.225

Last host 0.30 0.62 0.94 0.126 0.158 0.190 0.222 0.254

Broadcast 0.31 0.63 0.95 0.127 0.159 0.191 0.223 0.255

This next table shows the last eight subnets:



Subnet

255.0 255.32 255.64 255.96 255.128 255.160 255.192

First host 255.1

255.33 255.65 255.97 255.129 255.161

255.193


Last host 255.30 255.62 255.94 255.126 255.158 255.190 255.222

Broadcast 255.31 255.63 255.95 255.127 255.159 255.191

255.223

Subnetting in Your Head: Class B Addresses


Are you nuts? Subnet Class B addresses in our heads? It’s actually easier

than writing it out—I’m not kidding! Let me show you how:



Question: What is the subnet and broadcast address of the subnet in

which 172.16.10.33 /27 resides?



Answer: The interesting octet is the fourth one. 256 – 224 = 32. 32 +

32 = 64. You’ve got it: 33 is between 32 and 64. But remember that the

third octet is considered part of the subnet, so the answer would be the

10.32 subnet. The broadcast is 10.63, since 10.64 is the next subnet.

That was a pretty easy one.

Question: What subnet and broadcast address is the IP address

172.16.66.10 255.255.192.0 (/18) a member of?



Answer: The interesting octet here is the third octet instead of the

fourth one. 256 – 192 = 64. 0, 64, 128. The subnet is 172.16.64.0. The

broadcast must be 172.16.127.255 since 128.0 is the next subnet.

Question: What subnet and broadcast address is the IP address

172.16.50.10 255.255.224.0 (/19) a member of?



Answer: 256 – 224 = 0, 32, 64 (remember, we always start counting at

0). The subnet is 172.16.32.0, and the broadcast must be 172.16.63.255

since 64.0 is the next subnet.

Question: What subnet and broadcast address is the IP address

172.16.46.255 255.255.240.0 (/20) a member of?



Answer: 256 – 240 = 16. The third octet is important here: 0, 16, 32,

48. This subnet address must be in the 172.16.32.0 subnet, and the

broadcast must be 172.16.47.255 since 48.0 is the next subnet. So, yes,

172.16.46.255 is a valid host.



Question: What subnet and broadcast address is the IP address

172.16.45.14 255.255.255.252 (/30) a member of?



Answer: Where is our interesting octet? 256 – 252 = 0, 4, 8, 12, 16—

the fourth. The subnet is 172.16.45.12, with a broadcast of 172.16.45.15

because the next subnet is 172.16.45.16.

Question: What is the subnet and broadcast address of the host

172.16.88.255/20?



Answer: What is a /20 written out in dotted decimal? If you can’t

answer this, you can’t answer this question, can you? A /20 is

255.255.240.0, gives us a block size of 16 in the third octet, and since

no subnet bits are on in the fourth octet, the answer is always 0 and

255 in the fourth octet: 0, 16, 32, 48, 64, 80, 96. Because 88 is between

80 and 96, the subnet is 80.0 and the broadcast address is 95.255.

Question: A router receives a packet on an interface with a destination

address of 172.16.46.191/26. What will the router do with this packet?



Answer: Discard it. Do you know why? 172.16.46.191/26 is a

255.255.255.192 mask, which gives us a block size of 64. Our subnets

are then 0, 64, 128 and 192. 191 is the broadcast address of the 128

subnet, and by default, a router will discard any broadcast packets.



Subnetting Class A Addresses

You don’t go about Class A subnetting any differently than Classes B and

C, but there are 24 bits to play with instead of the 16 in a Class B address

and the 8 in a Class C address.

Let’s start by listing all the Class A masks:

255.0.0.0 (/8)

255.128.0.0 (/9) 255.255.240.0 (/20)

255.192.0.0 (/10) 255.255.248.0 (/21)

255.224.0.0 (/11) 255.255.252.0 (/22)

255.240.0.0 (/12) 255.255.254.0 (/23)

255.248.0.0 (/13) 255.255.255.0 (/24)

255.252.0.0 (/14) 255.255.255.128 (/25)

255.254.0.0 (/15) 255.255.255.192 (/26)

255.255.0.0 (/16) 255.255.255.224 (/27)

255.255.128.0 (/17) 255.255.255.240 (/28)

255.255.192.0 (/18) 255.255.255.248 (/29)

255.255.224.0 (/19) 255.255.255.252 (/30)

That’s it. You must leave at least 2 bits for defining hosts. I hope you can

see the pattern by now. Remember, we’re going to do this the same way

as a Class B or C subnet. It’s just that, again, we simply have more host

bits and we just use the same subnet numbers we used with Class B and

C, but we start using these numbers in the second octet. However, the

reason Class A addresses are so popular to implement is because they

give the most flexibility. You can subnet in the second, third or fourth

octet. I’ll show you this in the next examples.


Subnetting Practice Examples: Class A Addresses

When you look at an IP address and a subnet mask, you must be able to

distinguish the bits used for subnets from the bits used for determining

hosts. This is imperative. If you’re still struggling with this concept,

please reread the section “IP Addressing” in Chapter 3. It shows you how

to determine the difference between the subnet and host bits and should

help clear things up.

Practice Example #1A: 255.255.0.0 (/16)

Class A addresses use a default mask of 255.0.0.0, which leaves 22 bits

for subnetting because you must leave 2 bits for host addressing. The

255.255.0.0 mask with a Class A address is using 8 subnet bits:



Subnets? 2

8

= 256.



Hosts? 2

16

– 2 = 65,534.



Valid subnets? What is the interesting octet? 256 – 255 = 1. 0, 1, 2, 3,

etc. (all in the second octet). The subnets would be 10.0.0.0, 10.1.0.0,

10.2.0.0, 10.3.0.0, etc., up to 10.255.0.0.

Broadcast address for each subnet?

Valid hosts?

The following table shows the first two and the last two subnets, the valid

host range and the broadcast addresses for the private Class A 10.0.0.0

network:


Subnet

10.0.0.0

10.1.0.0

… 10.254.0.0

10.255.0.0

First host 10.0.0.1

10.1.0.1

… 10.254.0.1

10.255.0.1

Last host 10.0.255.254 10.1.255.254 … 10.254.255.254 10.255.255.254

Broadcast 10.0.255.255 10.1.255.255 … 10.254.255.255 10.255.255.255

Practice Example #2A: 255.255.240.0 (/20)

255.255.240.0 gives us 12 bits of subnetting and leaves us 12 bits for host

addressing.

Subnets? 2

12

= 4096.



Hosts? 2

12

– 2 = 4094.



Valid subnets? What is your interesting octet? 256 – 240 = 16. The

subnets in the second octet are a block size of 1 and the subnets in the

third octet are 0, 16, 32, etc.

Broadcast address for each subnet?

Valid hosts?

The following table shows some examples of the host ranges—the first

three subnets and the last subnet:

Subnet

10.0.0.0

10.0.16.0 10.0.32.0 … 10.255.240.0

First host 10.0.0.1

10.0.16.1

10.0.32.1

… 10.255.240.1

Last host 10.0.15.254 10.0.31.254 10.0.47.254 … 10.255.255.254

Broadcast 10.0.15.255 10.0.31.255 10.0.47.255 … 10.255.255.255

Practice Example #3A: 255.255.255.192 (/26)

Let’s do one more example using the second, third, and fourth octets for

subnetting:

Subnets? 2

18

= 262,144.



Hosts? 2

6

– 2 = 62.



Valid subnets? In the second and third octet, the block size is 1, and in

the fourth octet, the block size is 64.



Broadcast address for each subnet?

Valid hosts?

The following table shows the first four subnets and their valid hosts and

broadcast addresses in the Class A 255.255.255.192 mask:

Subnet

10.0.0.0 10.0.0.64 10.0.0.128 10.0.0.192

First host 10.0.0.1

10.0.0.65

10.0.0.129

10.0.0.193

Last host 10.0.0.62 10.0.0.126 10.0.0.190

10.0.0.254

Broadcast 10.0.0.63 10.0.0.127 10.0.0.191

10.0.0.255

This table shows the last four subnets and their valid hosts and broadcast

addresses:

Subnet


10.255.255.0 10.255.255.64 10.255.255.128 10.255.255.192

First host 10.255.255.1

10.255.255.65 10.255.255.129 10.255.255.193

Last host 10.255.255.62 10.255.255.126 10.255.255.190 10.255.255.254

Broadcast 10.255.255.63 10.255.255.127 10.255.255.191 10.255.255.255



Yüklə 22,5 Mb.

Dostları ilə paylaş:
1   ...   16   17   18   19   20   21   22   23   ...   69




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin