HOW TO CALCULATE IP ADDRESS, SUBNET MASK AND NET ID


 SUBNETTING CONCEPT

Subnetting is a material that comes out a lot in the CCNA exam with a variety of questions. It is also a scourge for students or instructors who are completing the CCNA 1 curriculum for the CNAP (Cisco Networking Academy Program) program. To explain about subnetting, I usually use some illustrations and analogies that we are familiar with around us. I wrote this article intentionally for colleagues who are studying networking, who are preparing to take the CCNA exam, and who are taking CCNA 1 training.

Actually what is subnetting and why should it be done? this question can be answered with the analogy of a road. The street named Taylor swift consists of several houses numbered 01-08, with house number 08 being the house of the Head of the RT who has the task of announcing any information to all houses in the Jl. Taylor Swift.

When there are more houses in the area, of course, it is likely to cause confusion and congestion. Because of that, then another arrangement was made, alleys were made, the houses that entered the alleys were given a new house number, each alley had its own RT head. So that this will solve congestion, efficiency and optimization of transportation, and each gang has its own privilege in managing its territory. So draw a new region like below:

This concept is actually the concept of subnetting. On the one hand, it wants to simplify management, for example an office wants to divide work into 3 divisions with each division having 15 computers (hosts). On the other hand, it is also for optimization and efficiency of network work, because traffic lanes are not concentrated in one large network, but are divided into several aisles. The first analogy is Jl Taylor swift. with houses around it can be applied to networks such as NETWORK ADDRESS (street name) and HOST ADDRESS (house number). Meanwhile, the Head of the RT is played by BROADCAST ADDRESS (192.168.1.255), who is in charge of sending messages to all hosts on the network.

Still following the analogy of the path above, we apply it to network subnetting as shown below. Gang is SUBNET, each subnet has HOST ADDRESS and BROADCAST ADDRESS.

So what is a SUBNET MASK? The subnetmask is used to read how we divide roads and alleys, or divide networks and hosts. Which address serves as a SUBNET, which one is the HOST and which one is BROADCAST. We can know all that from the SUBNET MASK. The Taylor swift street without gangs that I showed at the beginning can be understood as using the SUBNET MASK DEFAULT, or in other words it can also be said that the Network has no subnets (Roads without Gangs). The DEFAULT SUBNET MASK for each IP Address Class is as follows:

CLASS OKTET PERTAMA SUBNET MAS DEFAULT PRIVATE ADDRESS

A         1-127                           255.0.0.0                                10.0.0.0-10.255.255.255

B         128-191                           255.255.0.0                        172.16.0.0-172.31.255.255

C         192-223                         255.255.255.0                        192.168.0.0-192.168.255.255

Subnetting Calculation

After understanding the concept of Subnetting well. This time it's time for you to learn the technique of calculating subnetting. Subnetting calculations can be done in two ways, a relatively slow binary method and a faster special method. Essentially all questions about subnetting will revolve around four issues: Number of Subnets, Number of Hosts per Subnet, Subnet Blocks, and Host-Broadcast Addresses.

Writing the IP address generally is 192.168.1.2. But sometimes it is written as 192.168.1.2/24, what does this mean? This means that the IP address is 192.168.1.2 with a subnet mask of 255.255.255.0. How can it be like that? Yes, /24 is taken from calculating that the 24 bit subnet mask is shrouded with binary 1. Or in other words, the subnet mask is: 111111111.11111111.11111111.00000000 (255.255.255.0). This concept is called CIDR (Classless Inter-Domain Routing) which was first introduced in 1992 by IEFT.

The next question is what Subnet Mask can be used to do subnetting? This is answered with the table below:

Subnet Mask        CIDR value                        Subnet Mask        CIDR value

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

SUBNETTING ON IP ADDRESS CLASS C

Ok, now let's just practice. What kind of subnetting happens with a NETWORK ADDRESS 192.168.1.0/26 ?

Analysis: 192.168.1.0 means class C with Subnet Mask /26 means 11111111.11111111.11111111.11000000 (255.255.255.192).

Calculation: As I mentioned earlier all questions about subnetting will center on 4 things, number of subnets, number of hosts per subnet, subnet blocks, valid host and broadcast addresses. So we finish in such order:

  1. Number of Subnets = 2x, where x is the number of binaries 1 in the last octet of the subnet mask (2 last octets for class B, and the last 3 octets for class A). So the number of subnets is 22 = 4 subnets
  2. Number of Hosts per Subnet = 2y – 2, where y is the reciprocal of x, which is the number of 0 binaries in the last octet of the subnet. So the number of hosts per subnet is 26 – 2 = 62 hosts
  3. Subnet block = 256 – 192 (last octet value of subnet mask) = 64. The next subnet is 64 + 64 = 128, and 128+64=192. So the complete subnets are 0, 64, 128, 192.
  4. How about host address and valid broadcast? We immediately create the table. For the record, the first host is 1 number after the subnet, and broadcast is 1 number before the next subnet.
Subnet      192.168.1.0 192.168.1.64 192.168.1.128 192.168.1.192
First host     192.168.1.1 192.168.1.65 192.168.1.129 192.168.1.193
Last host      192.168.1.62 192.168.1.126 192.168.1.190 192.168.1.254
Broadcast     192.168.1.63 192.168.1.127 192.168.1.191 192.168.1.255
We have finished subnetting for Class C IP addresses. And we can continue again for other subnet masks, with the same concepts and techniques. The subnet mask that can be used for class C subnetting is as below. Please try to calculate as above for other subnetmasks.
Subnet Mask    CIDR value
255.255.255.128 /25
255.255.255.192 /26
255.255.255.224 /27
255.255.255.240 /28
255.255.255.248 /29
255.255.255.252 /30
SUBNETTING ON IP ADDRESS CLASS B

Next we will try to do subnetting for class B IP addresses. First, the subnet mask that can be used for subnetting class B is as below. I deliberately separated it into two, the left and right blocks because each has a different technique, especially for the octet that is "played" based on the subnet block. The CIDR /17 to /24 method is exactly the same as the Class C subnetting, only the subnet block is inserted directly into the third octet, not like Class C is "played" in the fourth octet. While the CIDR /25 to /30 (multiple) of the subnet block we "play" in the fourth octet, but after the third octet is finished, we move forward (coeunter) from 0, 1, 2, 3, and so on.

Subnet Mask    CIDR value               Subnet Mask            CIDR value
255.255.128.0     /17                             255.255.255.128 /25
255.255.192.0     /18                             255.255.255.192 /26
255.255.224.0     /19                             255.255.255.224 /27
255.255.240.0     /20                             255.255.255.240 /28
255.255.248.0     /21                             255.255.255.248 /29
255.255.252.0     /22                             255.255.255.252 /30
255.255.254.0     /23
255.255.255.0 /24
Ok, let's try two questions for both subnetting techniques for Class B. We start with using a subnetmask with a CIDR of /17 to /24. Example network address 172.16.0.0/18.
Analysis: 172.16.0.0 means class B, with Subnet Mask /18 means 11111111.11111111.110000000000000 (255.255.192.0).
Calculation:

  1. Number of Subnets = 2x, where x is the number of binaries 1 in the last 2 octets. So the number of subnets is 22 = 4 subnets
  2. Number of Hosts per Subnet = 2y – 2, where y is the reciprocal of x, which is the number of 0 binaries in the last 2 octets. So the number of hosts per subnet is 214 – 2 = 16,382 hosts
  3. Block Subnet = 256 – 192 = 64. The next subnet is 64 + 64 = 128, and 128+64=192. So the complete subnets are 0, 64, 128, 192.
  4. Valid host and broadcast addresses?
Subnet 172.16.0.0                  172.16.64.0             172.16.128.0           172.16.192.0
First Host 172.16.0.1             172.16.64.1             172.16.128.1           172.16.192.1
Last Host 172.16.63.254        172.16.127.254       172.16.191.254       172.16.255.254
Broadcast 172.16.63.255       172.16.127.255        172.16.191.255       172.16..255.255


Next we try another one for Class B, especially for those using the CIDR /25 to /30 subnetmask. Example network address 172.16.0.0/25.
Analysis: 172.16.0.0 means class B, with Subnet Mask /25 means 11111111.11111111.11111111.10000000 (255.255.255.128).

Calculation:
Number of Subnets = 29 = 512 subnets
Number of Hosts per Subnet = 27 – 2 = 126 hosts
Subnet Block = 256 – 128 = 128. So the complete is (0, 128)
Valid host and broadcast addresses?

Subnet            172.16.0.0       172.16.0.128         172.16.1.0         …      172.16.255.128
First Host       172.16.0.1       172.16.0.129         172.16.11           …      172.16.255.129
Last Host       172.16.0.126    172.16.0.254         172.16.1.126     …      172.16.255.254
Broadcast       172.16.0.127    172.16.0.255         172.16.1.127     …      172.16.255.255

Still confused too? Ok, before entering Class A, try again from Class C, and read slowly

SUBNETTING ON IP ADDRESS CLASS A

If it's solid and understandable, we can move on to Class A. The concepts are all the same. The difference is in which OCTET we play the subnet block. If Class C is in the 4th (last) octet, class B is in the 3rd and 4th octet (last 2 octet), if Class A is in the 2nd, 3rd and 4th octet (last 3 octet). Then the subnet masks that can be used for subnetting class A are all subnet masks from CIDR /8 to /30.
We try to practice for the network address 10.0.0.0/16.
Analysis: 10.0.0.0 means class A, with Subnet Mask /16 means 111111111.11111111.000000000000000 (255.255.0.0).

Calculation:
  1. Number of Subnets = 28 = 256 subnets
  2. Number of Hosts per Subnet = 216 – 2 = 65534 hosts
  3. Subnet Block = 256 – 255 = 1. So the complete subnet is: 0.1,2,3,4, etc.
  4. Valid host and broadcast addresses?
Subnet          1.  0.0.0                 1.  254.0.0 
                         2.  10.0                2.  255.0.0
First Host        1.  0.0.1                 1.  254.0.1
                         2.  1.0.1                 2.  255.0.1
Last Host        1.  0.255.254         1.  254.255.254
                         2.  1,255,254         2.  255.255.254
Broadcast       1.  0.255.255         1. 254.255.255
                        2.  1,255.255          2. 255.255.255
Hopefully after you read this last paragraph, you have understood the calculation of subnetting well. Even if you don't understand, you continue to repeat this article slowly from above. For a faster subnetting memorization technique, wait for the next article

Note: All subnet calculations above assume that IP Subnet-Zeroes (and IP Subnet-Ones) are calculated by default. The latest versions of Todd Lamle's books as well as CCNA after 2005 have accommodated this IP Subnet-Zeroes (and IP Subnet-Ones) problem. CCNA pre-2005 does not include it by default (although in fact we can activate it with the command ip subnet-zeroes), so maybe in some books about CCNA and CNAP test questions, you still find the formula for calculating the number of subnets = 2x – 2

Komentar

Postingan populer dari blog ini

Configuring a DHCP Server Using PNETLAB

4.1 STATIC ROUTE 2 Router

1.3 UPGRADE DAN DOWNGRADE