Nov 14, 2011

Abstract of CCNA study guide-10 - Subnetting

Continue the series of  Abstract CCNA study guide book .
Subnetting Basics
What happens if you wanted to take one network address and create six networks from it? You would have to do something called subnetting , because that’s what allows you to take one larger network and break it into a bunch of smaller networks.

There are loads of reasons in favor of subnetting, including the following benefits:
Reduced network traffic : Routers create broadcast domains. The more broadcast domains you create, the smaller the broadcast domains and the less network traffic on each network segment.

Optimized network performance: This is a result of reduced network traffic.

Simplified management: It’s easier to identify and isolate network problems in a group of smaller connected networks than within one gigantic network.

Facilitated spanning of large geographical distances: Because WAN links are slower and expensive Links, a single large network that spans long distances can create problems in every area previously listed. Connecting multiple smaller networks makes the system more efficient.



IP Subnet-Zero

in the past, Cisco courseware and exam, didn’t cover it—but it certainly does now! This command allows you to use the first and last subnet in your network design. For example, the Class C mask of 192 provides subnets 64 and 128, but with the ip subnet-zero command, you now get to use subnets 0, 64, 128, and 192.



How to Create Subnets
To create subnetworks, you take bits from the host portion of the IP address and reserve them to define the subnet address. This means fewer bits for hosts, so the more subnets, the fewer bits available for defining hosts.
you need to understand that in this first section, we will be discussing classful routing, which means that all hosts (all nodes) in the network use the exact same subnet mask. When we move on to Variable Length Subnet Masks (VLSMs), I’ll discuss classless routing, which means that each network segment can use a different subnet mask.
Understanding the Power of 2
The power of 2 should commit to memory
2^1 =2 , 2^2=4 ,2^3 =8 ,2^4 =16 ,2^5 =32 ,2^6 =64 ,2^7 =128 ,2^8 =256

Subnet Masks
For the subnet address scheme to work, every machine on the network must know which part of the host address will be used as the subnet address. This is accomplished by assigning a subnet mask to each machine.
A subnet mask is a 32-bit value that allows the recipient of IP packets to distinguish the network ID portion of the IP address from the host ID portion of the IP address.
The network administrator creates a 32-bit subnet mask composed of 1s and 0s. The 1s in the subnet mask represent the positions that refer to the network or subnet addresses.
Next Table shows the default subnet masks for Classes A, B, and C. These default masks cannot change.

Classless Inter-Domain Routing (CIDR)
Another term you need to familiarize yourself with is Classless Inter-Domain Routing (CIDR).
It’s basically the method that ISPs (Internet service providers) use to allocate a number of addresses to a company, a home—a customer. They provide addresses in a certain block size, something I’ll be going into in greater detail later in this chapter.
When you receive a block of addresses from an ISP, what you get will look something like this: 192.168.10.32/28. This is telling you what your subnet mask is. The slash notation (/) means how many bits are turned on (1s). Obviously, the maximum could only be /32 because a byte is 8 bits and there are 4 bytes in an IP address. But keep in mind that the largest subnet mask available can only be a /30 because you’ve got to keep at least 2 bits for host bits.


next Table  has a listing of every available subnet mask and its equivalent CIDR slash notation.
Class A Only
Subnet mask
CIDR value
Class A and B Only
Subnet mask
CIDR value
Class A,B and C
Subnet mask
CIDR value
255.0.0.0
/8
255.255.0.0
/16
255.255.255.0
/24
255.128.0.0
/9
255.255.128.0
/17
255.255.255.128
/25
255.192.0.0
/10
255.255.192.0
/18
255.255.255.192
/26
255.224.0.0
/11
255.255.224.0
/19
255.255.255.224
/27
255.240.0.0
/12
255.255.240.0
/20
255.255.255.240
/28
255.248.0.0
/13
255.255.248.0
/21
255.255.255.248
/29
255.252.0.0
/14
255.255.252.0
/22
255.255.255.252
/30
255.254.0.0
/15
255.255.254.0
/23




Subnetting Class C Addresses
When you’ve chosen a possible subnet mask for your network and need to determine the number of subnets, valid hosts, and broadcast addresses of a subnet that the mask provides, all you need to do is answer five simple questions:
- How many subnets does the chosen subnet mask produce?
- How many valid hosts per subnet are available?
- What are the valid subnets?
- What’s the broadcast address of each subnet?
- What are the valid hosts in each subnet?

-How many subnets? 2^x = number of subnets.
 x is the number of masked bits, or the 1s. For example, in 11000000, the number of 1s gives us 2^2 subnets. In this example, there are 4 subnets.
-How many hosts per subnet? 2^y - 2 = number of hosts per subnet.
 y is the number of unmasked bits, or the 0s. For example, in 11000000, the number of 0s gives us 2^6 – 2 hosts. In this example, there are 62 hosts per subnet. You need to subtract 2 for the subnet address and the broadcast address, which are not valid hosts.

_ What are the valid subnets? 256 – subnet mask = block size.
An example would be 256 – 192 = 64. Start counting at zero in blocks of 64 until you reach the subnet mask value and these are your subnets. 0, 64, 128, 192.

_ What’s the broadcast address for each subnet? Since we counted our subnets in the last section as 0, 64, 128, and 192, the broadcast address is always the number right before the next subnet. For example, the 0 subnet has a broadcast address of 63 because the next subnet is 64. The 64 subnet has a broadcast address of 127 because the next subnet is 128. And so on. And remember, the broadcast address of the last subnet is always 255.

_What are the valid hosts? Valid hosts are the numbers between the subnets,omitting the all 0s and all 1s.
For example, if 64 is the subnet number and 127 is the broadcast address, then 65–126 is the valid host range—it’s always the numbers between the subnet address and the broadcast address.
Subnetting Practice Examples: Class C Addresses
Practice Example #1C: 255.255.255.128 (/25)
192.168.10.0 = Network address
255.255.255.128 = Subnet mask
Now, let’s answer the big five:
_ How many subnets? Since 128 is 1 bit on (10000000), the answer would be 2^1 = 2.
_ How many hosts per subnet? We have 7 host bits off (10000000),   2^7 – 2 = 126 hosts.
_ What are the valid subnets? 256 – 128 = 128.so our subnets are 0, 128.
_ What’s the broadcast address for each subnet? For the zero subnet, the next subnet is 128, so the broadcast of the 0 subnet is 127.
_ What are the valid hosts? These are the numbers between the subnet and broadcast address. The easiest way The following table shows the 0 and 128 subnets, the valid host ranges of each, and the broadcast address of both subnets:
Subnet            0          128
First host        1          129
Last host         126      254
Broadcast       127      255

Practice Example #2C: 255.255.255.192 (/26)
192.168.10.0 = Network address
255.255.255.192 = Subnet mask
Now, let’s answer the big five:
_  subnets? Since 192 is 2 bits on (11000000), the answer would be 2^2 = 4 subnets.
_  hosts? We have 6 host bits off (11000000),  2^6 – 2 = 62 hosts.
_  valid subnets? 256 – 192 = 64.subnets are 0, 64, 128, and 192.
_  broadcast address for each subnet? For the zero subnet, the next subnet is 64, so the broadcast address for the zero subnet is 63.
_  the valid hosts? These are the numbers between the subnet and broadcast address.

_  broadcast address for each subnet (always the number right before the next subnet)?
_ valid hosts (the numbers between the subnet number and the broadcast address)?

The subnets (do this first)                                         0          64        128      192
Our first host (perform host addressing last)         1          65        129      193
Our last host                                                              62        126      190      254
The broadcast address (do this second)                  63        127      191      255


Subnetting in Your Head: Class C Addresses
It really is possible to subnet in your head. Even if you don’t believe me, I’ll show you how.
take the following example:
192.168.10.33 = Node address
255.255.255.224 = Subnet mask
First, determine the subnet and broadcast address of the above IP address. You can do this by answering question 3 of the big five questions: 256 – 224 = 32. 0, 32, 64. The address of 33 falls between the two subnets of 32 and 64 and must be part of the 192.168.10.32 subnet.
The next subnet is 64, so the broadcast address of the 32 subnet is 63. The valid host range is 33–62.

Okay, let’s try another one. We’ll subnet another Class C address:
192.168.10.33 = Node address
255.255.255.240 = Subnet mask
What subnet and broadcast address is the above IP address a member of? 256 – 240 = 16. 0, 16, 32, 48.
the host address is between the 32 and 48 subnets. The subnet is 192.168.10.32, and the broadcast address is 47 . The valid host range is 33–46 .

Regardless of whether you have a Class A, Class B, or Class C address, the /30 mask will provide you with only two hosts, ever. This mask is suited almost exclusively—as well as suggested by Cisco—for use on point-to-point links.

Subnetting Class B Addresses

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 have to leave at least 2 bits for host addressing).
The process of subnetting a Class B network is the same as it is for a Class C, except that you just 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:
First subnet                16.0                 32.0
Second subnet            31.255                         47.255

The preceding example is true only until you get up to /24 . after that it's the same as Class  C

Subnetting Practice Examples: Class B Addresses
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 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.
_ Broadcast address for each subnet?
_ Valid hosts?
Subnet            0.0                   128.0
First host        0.1                   128.1
Last host         127.254           255.254
Broadcast       127.255           255.255

Practice Example #5B: 255.255.255.0 (/24)
255.255.255.0 This is a Class B subnet mask with 8 bits of subnetting—it’s considerably 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?
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 #7B: 255.255.255.192 (/26)
 Since the third octet has a 255 in the mask section, whatever number is listed in the third octet is a subnet number. However, 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.
-Broadcast address for each subnet?
-Valid hosts?
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

Subnetting in Your Head: Class B Addresses
Question: What subnet and broadcast address is the IP address 172.16.10.33 255.255.255.224 (/27) a member of?
Answer: The interesting octet is the fourth octet. 256 – 224 = 32. 32 + 32 = 64. Bingo:33 is between 32 and 64. However, 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.

Q: What subnet and broadcast address is the IP address 172.16.66.10  255.255.192.0 (/18) a member of?
A: The interesting octet is the third octet instead of the fourth octet. 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.

Q: What subnet and broadcast address is the IP address 172.16.50.10 255.255.224.0 (/19) a member of?
A: 256 – 224 = 0, 32, 64 . The subnet is 172.16.32.0, and the broadcast must be 172.16.63.255 since 64.0 is the next subnet.

Q: 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 interesting to us. 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.

Q: What subnet and broadcast address is the IP address 172.16.45.14 255.255.255.252 (/30) a member of?
A: Where is the interesting octet? 256 – 252 = 0, 4, 8, 12, 16 (in the fourth octet). The subnet is 172.16.45.12, with a broadcast of 172.16.45.15 because the next subnet is 172.16.45.16.

Q: 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?
A: 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, 192. 191 is the broadcast address of the 128 subnet, so a router, by default, will discard any broadcast packets.

Subnetting Class A Addresses
Class A subnetting is not performed 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.

Subnetting Practice Examples: Class A Addresses
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 since 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?
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?
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^8 – 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
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

The following 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

Subnetting in Your Head: Class A Addresses
This sounds hard, but as with Class C and Class B, the numbers are the same; we just start in the second octet. What makes this easy? You only need to worry about the octet that has the largest block size (typically called the interesting octet; one that is something other than 0 or 255)—for example, 255.255.240.0 (/20) with a Class A network. The second octet has a block size of 1, so any number listed in that octet is a subnet. The third octet is a 240 mask, which means we have a block size of 16 in the third octet. If your host ID is 10.20.80.30, what is your subnet, broadcast address, and valid host range?
The subnet in the second octet is 20 with a block size of 1, but the third octet is in block sizes of 16, so we’ll just count them out: 0, 16, 32, 48, 64, 80, and 96 (By the way, you can count by 16s by now, right?) This makes our subnet 10.20.80.0, with a broadcast of 10.20.95.255 because the next subnet is 10.20.96.0. The valid host range is 10.20.80.1 through 10.20.95.254. And yes, no lie! You really can do this in your head if you just get your block sizes nailed!

Okay, let’s practice on one more, just for fun!
Host IP: 10.1.3.65/23
First,  /23, is 255.255.254.0. The interesting octet here is the third one: 256 – 254 = 2. Our subnets in the third octet are 0, 2, 4, 6, etc. The host in this question is in subnet 2.0, and the next subnet is 4.0, so that makes the broadcast address 3.255. And any address between 10.1.2.1 and 10.1.3.254 is considered a valid host.

No comments:

Post a Comment