Skip to main content

Easy Subnetting: How to do subnet: Part #1

Subnetting




Having one large network is not a good thing, but how would you fix the out of control problem that Figure 4.1 illustrates?

Subnetting because it’s the best way to break up a giant network into a bunch of smaller ones. Take a look at Figure 4.2 and see how this might look.
What are those 192.168.10.x addresses shown in the figure? Well that is what this article will explain! How to make one network into many networks!

How to Create Subnets

Creating subnetworks is essentially the act of taking bits from the host portion of the address and reserving them to define the subnet address instead. Clearly this will result in fewer bits being available for defining your hosts, which is something you’ll always want to keep in mind.
Okay—to create a subnet, we’ll start by fulfilling these three steps:
  1. Determine the number of required network IDs:
    • One for each LAN subnet
    • One for each wide area network connection
  2. Determine the number of required host IDs per subnet:
    • One for each TCP/IP host
    • One for each router interface
  3. Based on the above requirements, create the following:
    • A unique subnet mask for your entire network
    • A unique subnet ID for each physical segment
    • A range of host IDs for each subnet

Subnet Masks

Every machine on the network must know which part of the host address will be used as the subnet address. A subnet mask is a 32-bit value, This 32-bit subnet mask is composed of 1s and 0s, where the 1s represent the positions that refer to the network subnet addresses.
Not all networks need subnets, and if not, it really means that they’re using the default subnet mask, which is basically the same as saying that a network doesn’t have a subnet address. Table 4.1 shows the default subnet masks for Classes A, B, and C.



Classless Inter-Domain Routing (CIDR)

It’s basically the method that Internet service providers (ISPs) use to allocate a number of addresses to a company, a home—their customers.
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: (4 n 8 = 32). But keep in mind that regardless of the class of address, the largest subnet mask available relevant to the Cisco exam objectives can only be a /30 because you’ve got to keep at least 2 bits for host bits.
Take, for example, a Class A default subnet mask, which is 255.0.0.0. This tells us that the first byte of the subnet mask is all ones (1s), or 11111111. When referring to a slash notation, you need to count all the 1-bits to figure out your mask. The 255.0.0.0 is considered a /8 because it has 8 bits that are 1s—that is, 8 bits that are turned on.
A Class B default mask would be 255.255.0.0, which is a /16 because 16 bits are ones (1s): 11111111.11111111.00000000.00000000.
Table 4.2 has a listing of every available subnet mask and its equivalent CIDR slash notation.



The /8 through /15 can only be used with Class A network addresses. /16 through /23 can be used by Class A and B network addresses. /24 through /30 can be used by Class A, B, and C network addresses. This is a big reason why most companies use Class A network addresses. Since they can use all subnet masks, they get the maximum flexibility in network design. No, you cannot configure a Cisco router using this slash format. But wouldn’t that be nice? Nevertheless, it’s really important for you to know subnet masks in the slash notation (CIDR).

IP Subnet-Zero

Even though IP subnet-zero is not a new command, Cisco courseware and Cisco exam objectives didn’t used to cover it. Know that Cisco certainly covers it now! This command allows you to use the first and last subnet in your network design.
For instance, the Class C mask of 255.255.255.192 provides subnets 64 and 128, another facet of subnetting that we’ll discuss more thoroughly later in this chapter. But with the ip subnet-zero command, you now get to use subnets 0, 64, 128, and 192. It may not seem like a lot, but this provides two more subnets for every subnet mask we use.
Router#sh running-config
Building configuration...
Current configuration: 827 bytes
!
hostname Pod1R1
!
ip subnet-zero
!


This router output shows that the command ip subnet-zero is enabled on the router. Cisco has turned this command on by default starting with Cisco IOS version 12.x and now we’re running 15.x code. When taking your Cisco exams, make sure you read very carefully to see if Cisco is asking you not to use ip subnet-zero. There are actually instances where this may happen.

Subnetting Class C Addresses

There are many different ways to subnet a network. The right way is the way that works best for you. In a Class C address, only 8 bits are available for defining the hosts. Remember that subnet bits start at the left and move to the right, without skipping bits. This means that the only Class C subnet masks can be the following:


We can’t use a /31 or /32 because, as I’ve said, we must have at least 2 host bits for assigning IP addresses to hosts. But this is only mostly true. Certainly we can never use a /32 because that would mean zero host bits available, yet Cisco has various forms of the IOS, as well as the new Cisco Nexus switches operating system, that support the /31 mask. The /31 is above the scope of the CCENT and CCNA objectives,

Subnetting a Class C Address—The Fast Way!

When you’ve chosen a possible subnet mask for your network and need to determine the number of subnets, valid hosts, and the broadcast addresses of a subnet that mask will provide, 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?
Here’s how you arrive at the answers to those five big questions:
  • 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^2subnets. So 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, or 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, or increment number. An example would be the 255.255.255.192 mask, where the interesting octet is the fourth octet (interesting because that is where our subnet numbers are). Just use this math: 256 – 192 = 64. The block size of a 192 mask is always 64. Start counting at zero in blocks of 64 until you reach the subnet mask value and these are your subnets in the fourth octet: 0, 64, 128, 192. Easy, huh?
  • What’s the broadcast address for each subnet? Now here’s the really easy part. 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. 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. Your valid range is always the group of numbers between the subnet address and the broadcast address.

Subnetting Practice Examples: Class C Addresses

Practice Example #1C: 255.255.255.128 (/25)

Since 128 is 10000000 in binary, there is only 1 bit for subnetting and 7 bits for hosts. We’re going to subnet the Class C network address 192.168.10.0.
192.168.10.0 = Network address 255.255.255.128 = Subnet mask
Now, let’s answer our 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), so the equation would be 2^7 – 2 = 126 hosts. Once you figure out the block size of a mask, the amount of hosts is always the block size minus 2. No need to do extra math if you don’t need to!
  • What are the valid subnets? 256 – 128 = 128. Remember, we’ll start at zero and count in our block size, so our subnets are 0, 128. By just counting your subnets when counting in your block size, you really don’t need to do steps 1 and 2. We can see we have two subnets, and in the step before this one, just remember that the amount of hosts is always the block size minus 2, and in this example, that gives us 2 subnets, each with 126 hosts.
  • What’s the broadcast address for each subnet? The number right before the value of the next subnet is all host bits turned on and equals the broadcast address. 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 to find the hosts is to write out the subnet address and the broadcast address, which makes valid hosts completely obvious. The following table shows the 0 and 128 subnets, the valid host ranges of each, and the broadcast address of both subnets:


Looking at Figure 4.3, you can see that there are two physical networks, so we’re going to implement a logical addressing scheme that allows for two logical networks.
Figure 4.3 shows us that both subnets have been assigned to a router interface, which creates our broadcast domains and assigns our subnets. Use the command show ip route to see the routing table on a router. Notice that instead of one large broadcast domain, there are now two smaller broadcast domains, providing for up to 126 hosts in each. The C in the router output translates to “directly connected network,” and we can see we have two of those with two broadcast domains and that we created and implemented them.

HOMEWORK

Practice Example #2C: 255.255.255.192 (/26)

Practice Example #3C: 255.255.255.224 (/27)

Practice Example #4C: 255.255.255.240 (/28)

Practice Example #5C: 255.255.255.248 (/29)

If you try to configure a router interface with the address 192.168.10.6 255.255.255.248 and receive this error: Bad mask /29 for address 192.168.10.6
It means that ip subnet-zero is not enabled. You must be able to subnet to see that the address used in this example is in the zero subnet!

Practice Example #6C: 255.255.255.252 (/30)


Subnetting in Your Head: Class C Addresses

It really is possible to subnet in your head? Yes, and it’s not all that hard either—take the following example:
192.168.10.50 = Node address 255.255.255.224 = Subnet mask
First, determine the subnet and broadcast address of the network in which the above IP address resides. You can do this by answering question 3 of the big 5 questions: 256 –224 = 32. 0, 32, 64, and so on.
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. Don’t forget that the broadcast address of a subnet is always the number right before the next subnet. The valid host range equals the numbers between the subnet and broadcast address, or 33–62. This is too easy!
Okay, let’s try another one. We’ll subnet another Class C address: 192.168.10.50 = Node address 255.255.255.240 = Subnet mask What is the subnet and broadcast address of the network of which the above IP address is a member? 256 – 240 = 16. Now just count by our increments of 16 until we pass the host address: 0, 16, 32, 48, 64. Bingo—the host address is between the 48 and 64 subnets. The subnet is 192.168.10.48, and the broadcast address is 63 because the next subnet is 64. The valid host range equals the numbers between the subnet number and the broadcast address, or 49–62.
Let’s do a couple more to make sure you have this down. You have a node address of 192.168.10.174 with a mask of 255.255.255.240. What is the valid host range? The mask is 240, so we’d do a 256 – 240 = 16. This is our block size. Just keep adding 16 until we pass the host address of 174, starting at zero, of course: 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176. The host address of 174 is between 160 and 176, so the subnet is 160. The broadcast address is 175; the valid host range is 161–174. That was a tough one!
One more—just for fun. This one is the easiest of all Class C subnetting: 192.168.10.17 = Node address 255.255.255.252 = Subnet mask What is the subnet and broadcast address of the subnet in which the above IP address resides? 256 – 252 = 0 (always start at zero unless told otherwise). 0, 4, 8, 12, 16, 20, etc. You’ve got it! The host address is between the 16 and 20 subnets. The subnet is 192.168.10.16, and the broadcast address is 19. The valid host range is 17–18. Now that you’re all over Class C subnetting, let’s move on to Class B subnetting. But before we do, let’s go through a quick review.

What Do We Know?

Okay—here’s where you can really apply what you’ve learned so far and begin committing it all to memory.
When you see a subnet mask or slash notation (CIDR), you should know the following:



The below table 4.3 puts all of the above information into one compact little table. You should practice writing this table out on scratch paper, and if you can do it, write it down before you start your exam!



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. As suggested by Cisco, this mask is suited almost exclusively for use on point-to-point links.



Next article will be continuing of Subnetting: Subnetting Class B Addresses Subnetting Practice Examples: Class B Addresses

Practice Example #1B: 255.255.128.0 (/17)

Practice Example #2B: 255.255.192.0 (/18)

Practice Example #3B: 255.255.240.0 (/20)

Practice Example #4B: 255.255.248.0 (/21)

Practice Example #5B: 255.255.252.0 (/22)

Practice Example #6B: 255.255.254.0 (/23)

Practice Example #7B: 255.255.255.0 (/24)

Practice Example #8B: 255.255.255.128 (/25)

Practice Example #9B: 255.255.255.192 (/26)

Practice Example #10B: 255.255.255.224 (/27)

Subnetting in Your Head: Class B Addresses

Comments

Popular posts from this blog

PART #2: Registration and Login System Tutorial Using PHP and MYSQL

PART #2: Registration and Login System Tutorial Using PHP and MYSQL Registration and login system using PHP and MySQL database, in this part you will do the following: 1- Creating the registration page. 2- Validating the registration form. 3- Sending the activation link on successful registration. note: you can find the mailserver tool here: [MailServerTool] Good luck. PHP,Mysql,Programming,web development,How to,Technology,web programming,web project ideas,safaa al-hayali,saf3al2a,Registration and login,Registration and login in php,php and mysql login system,registration system using php and mysql,login and register php,login and register php with database,database,php tutorial,learn php,tutorial

How To Play .srt Subtitles File in Windows Media Player

How To Play .srt Subtitles File in Windows Media Player links: https://sourceforge.net/projects/wmpsub/ wmp,.srt Subtitles File in Windows Media Player,How To Play .srt Subtitles File in Windows Media Player,How To,Safaa Al-Hayali,saf3al2a,srt subtitle in WMP,Windows,Windows Media Player,media,.ass,local subtitles

Virtual Box : How to Increase Disk Size - Windows

How to increase disk size or disk storage in oracle virtual box the command you have to use: vboxmanage.exe modifymedium "[YourPathToVdiFileOfYourVirtualMachine]" --resize [NUMBER] virtual,box,vbox,oracle,partition,size,disk,increase,resize,windows,10,microsoft,vdi,vboxmanage,configuration,Safaa AL-Hayali,saf3al2a,Oracle,VirtualBox,How to,windows 10