SUBNET MASK

If you have any queries please leave a message here
Your Message
×


IP addressing was originally designed around the assumption of a strict two-level hierarchy for internetworks: the first level was the network, and the second level the host. Each organization was usually represented by a single network identifier (network ID) that indicated a Class A, B, or C block dedicated to them. Within that network, the organization needed to put all of the devices it wanted to connect to the public IP network.

Subnetting adds an additional level to the hierarchy of structures used in IP addressing. To support this, IP addresses must be broken into three elements instead of two. This is done by leaving the network ID along and dividing the host ID into a subnet ID and host ID.

In a non-subnetted classful environment, routers use the first octet of the IP address to determine what the class of the address is, and from this they know which bits are the network ID and which are the host ID. When you used subnetting, these routers also need to know how that host ID is divided into subnet ID and host ID.

In a subnetting environment, the additional information about which bits are for the subnet ID and which are for the host ID must be communicated to devices that interpret IP addresses. This information is given in the form of a 32-bit binary number called a subnet mask.

the number of bits in an IP address is fixed at 32. This means that in splitting the host ID into subnet ID and host ID, you reduce the size of the host ID portion of the address. In essence, you are stealing bits from the host ID to use for the subnet ID. Class A networks have 24 bits to split between the subnet ID and host ID; Class B networks have 16; and Class C networks have only 8.

Let’s take a brief example to see how this works. Imagine that you start with Class B network 154.71.0.0, with 16 bits for the network ID (154.71) and 16 are for the host ID. In regular classful addressing, there are no subnets and 65,534 hosts total. To subnet this network, you can use the following :

NOTES -The subnet mask is a 32 bit binary number where a 1 represents each bit that is part of the network ID or subnet ID, and a 0 represents each bit of the host ID.


Determining the subnet ID of an IP Address through Subnet Mask


DEFAULT SUBNET MASK

In order to better understand how subnets divide a Class A, B, or C network, let’s look at how the Class A, B, and C networks are represented in a subnetted environment. This might seem unnecessary if you aren’t planning to create subnets, but the fact is, once subnetting became popular, most operating systems, networking hardware, and software assumed that subnetting would be used. Even if you decide not to subnet, you may need to express your unsubnetted network using a subnet mask.

The subnet mask for a default, unsubnetted Class A, B, or C network has ones for each bit that is used for the network ID or subnet ID and zeros for the host ID bits. Of course, I just said you aren’t subnetting, so there are no subnet ID bits! Thus, the subnet mask for this default case has ones for the network ID portion and zeros for the host ID portion. This is called the default subnet mask for each of the IP address classes.

Since Class A, B, and C divide the network ID from the host ID on octet boundaries, the subnet mask will always have all ones or all zeros in an octet. Therefore, the default subnet masks will always have 255s or 0s when expressed in decimal notation.

IP Address ClassDefault Subnet Mask
First OctetSecond OctetThird OctetFourth Octet
Class A11111111 (255)00000000 (0)00000000 (0)00000000 (0)
Class B11111111 (255)11111111 (255)00000000 (0)00000000 (0)
Class C11111111 (255)11111111 (255)11111111 (255)00000000 (0)

Thus, the three default subnet masks are 255.0.0.0 for Class A, 255.255.0.0 for Class B, and 255.255.255.0 for Class C.

While all default subnet masks use only 255 and 0, not all subnet masks with 255 and 0 are defaults. There are a small number of custom subnets that divide on octet boundaries as well. These are as follows :

255.255.0.0 This is the default mask for Class B, but can also be the custom subnet mask for dividing a Class A network using 8 bits for the subnet ID (leaving 16 bits for the host ID).

255.255.255.0 This is the default subnet mask for Class C, but can be a custom Class A with 16 bits for the subnet ID or a Class B with 8 bits for the subnet ID.


CUSTOM SUBNET MASK

A default subnet mask doesn’t really represent subnetting because you are assigning zero bits to the subnet ID. To do real subnetting, you must dedicate at least one of the bits of the presubnetted host ID to the subnet ID.

For example - In class C network has 24 bits Network ID and 8 bits Host ID. We considered that the Host ID is divided into 3 bits for the Subnet ID and 5 bits for the Host ID. So the Subnet Mask is :

Binary Representation -
11111111 11111111 11111111 11100000
Decimal Representation -
255.255.255.224

In a class B network has 16 bits Network ID and 16 bits Host ID. We considered that the Host ID is divided into 5 bits for the Subnet ID and 11 bits for the Host ID. So the Subnet Mask is :

Binary Representation -
11111111 11111111 11111000 00000000
Decimal Representation -
255.255.248.0

Custom Subnet Mask for Class C Network

Subnet Mask (Binary/Dotted Decimal)Slash/CIDR NotationNumber of Subnet ID and Host ID
11111111 . 11111111 . 11111111 . 00000000
255.255.255.0
/240 Subnet ID Bits, 8 Host ID Bits
(20 = 1 Subnet, 28 - 2 = 254 Hosts)
11111111 . 11111111 . 11111111 . 10000000
255.255.255.128
/251 Subnet ID Bits, 7 Host ID Bits
(21 = 2 Subnets, 27 - 2 = 126 Hosts Each)
11111111 . 11111111 . 11111111 . 11000000
255.255.255.192
/262 Subnet ID Bits, 6 Host ID Bits
(22 = 4 Subnet, 26 - 2 = 62 Hosts Each)
11111111 . 11111111 . 11111111 . 11100000
255.255.255.224
/273 Subnet ID Bits, 5 Host ID Bits
(23 = 8 Subnet, 25 - 2 = 30 Hosts Each)
11111111 . 11111111 . 11111111 . 11110000
255.255.255.240
/284 Subnet ID Bits, 4 Host ID Bits
(24 = 16 Subnet, 24 - 2 = 14 Hosts Each)
11111111 . 11111111 . 11111111 . 11111000
255.255.255.248
/295 Subnet ID Bits, 3 Host ID Bits
(25 = 32 Subnet, 23 - 2 = 6 Hosts Each)
11111111 . 11111111 . 11111111 . 11111100
255.255.255.252
/306 Subnet ID Bits, 2 Host ID Bits
(26 = 64 Subnet, 22 - 2 = 2 Hosts Each)

In the Class C network there are eight bits in the original host ID, which gives you six different subnetting options (you can’t use seven or eight bits for the subnet ID)

You’ve seen how you must subtract two from the number of hosts allowed in each network in regular classful addressing. This is necessary because two host IDs in each network have special meanings: the all-zeros host ID (for “this network”) and the all-ones host ID (for broadcasts to all hosts on the network). These restrictions apply to each subnet under subnetting, too, which is why you must continue to subtract two from the number of hosts per subnet. (This is also why dividing the eight host ID bits of a Class C network into seven bits for subnet ID and one bit for host ID is meaningless: It leaves 21 – 2 = 0 hosts per subnet, which is not particularly useful.)

KEY CONCEPT - The number of hosts allowed in each subnet is the binary power of the number of host ID bits remaining after subnetting, less two. The reduction by two occurs because the all-zeros and all-ones host IDs within each subnet are reserved for two special meaning addresses: to refer to the subnetwork itself and to refer to its local broadcast address. In some implementations, the number of subnets is also reduced by two because the all-zeros and allones subnet IDs were originally not allowed to be used.


Custom Subnet Mask for Class B Network

Subnet Mask (Binary/Dotted Decimal)Slash/CIDR NotationNumber of Subnet ID and Host ID
11111111 . 11111111 . 00000000 . 00000000
255.255.0.0
/160 Subnet ID Bits, 16 Host ID Bits
(1 Subnet, 65534 Hosts)
11111111 . 11111111 . 10000000 . 00000000
255.255.128.0
/171 Subnet ID Bits, 15 Host ID Bits
(2 Subnet, 32766 Hosts Each)
11111111 . 11111111 . 11000000 . 00000000
255.255.192.0
/182 Subnet ID Bits, 14 Host ID Bits
(4 Subnet, 16382 Hosts Each)
11111111 . 11111111 . 11100000 . 00000000
255.255.224.0
/193 Subnet ID Bits, 13 Host ID Bits
(8 Subnet, 8190 Hosts Each)
11111111 . 11111111 . 11110000 . 00000000
255.255.240.0
/204 Subnet ID Bits, 12 Host ID Bits
(16 Subnet, 4094 Hosts Each)
11111111 . 11111111 . 11111000 . 00000000
255.255.248.0
/215 Subnet ID Bits, 11 Host ID Bits
(32 Subnet, 2046 Hosts Each)
11111111 . 11111111 . 11111100 . 00000000
255.255.252.0
/226 Subnet ID Bits, 10 Host ID Bits
(64 Subnet, 1022 Hosts Each)
11111111 . 11111111 . 11111110 . 00000000
255.255.254.0
/237 Subnet ID Bits, 9 Host ID Bits
(128 Subnet, 510 Hosts Each)
11111111 . 11111111 . 11111111 . 00000000
255.255.255.0
/248 Subnet ID Bits, 8 Host ID Bits
(256 Subnet, 254 Hosts Each)
11111111 . 11111111 . 11111111 . 10000000
255.255.255.128
/259 Subnet ID Bits, 7 Host ID Bits
(512 Subnets, 126 Hosts Each)
11111111 . 11111111 . 11111111 . 11000000
255.255.255.192
/2610 Subnet ID Bits, 6 Host ID Bits
(1024 Subnet, 62 Hosts Each)
11111111 . 11111111 . 11111111 . 11100000
255.255.255.224
/2711 Subnet ID Bits, 5 Host ID Bits
(2048 Subnet, 30 Hosts Each)
11111111 . 11111111 . 11111111 . 11110000
255.255.255.240
/2812 Subnet ID Bits, 4 Host ID Bits
(4096 Subnet, 14 Hosts Each)
11111111 . 11111111 . 11111111 . 11111000
255.255.255.248
/2913 Subnet ID Bits, 3 Host ID Bits
(8192 Subnet, 6 Hosts Each)
11111111 . 11111111 . 11111111 . 11111100
255.255.255.252
/3014 Subnet ID Bits, 2 Host ID Bits
(16384 Subnet, 2 Hosts Each)


Custom Subnet Mask for Class A Network

Subnet Mask (Binary/Dotted Decimal)Slash/CIDR NotationNumber of Subnet ID and Host ID
11111111 . 00000000 . 00000000 . 00000000
255.0.0.0
/80 Subnet ID Bits, 24 Host ID Bits
(1 Subnet, 16277214 Hosts)
11111111 . 10000000 . 00000000 . 00000000
255.128.0.0
/91 Subnet ID Bits, 23 Host ID Bits
(2 Subnet, 8388606 Hosts)
11111111 . 11000000 . 00000000 . 00000000
255.192.0.0
/102 Subnet ID Bits, 22 Host ID Bits
(4 Subnet, 4194302 Hosts)
11111111 . 11100000 . 00000000 . 00000000
255.224.0.0
/113 Subnet ID Bits, 21 Host ID Bits
(8 Subnet, 2097150 Hosts)
11111111 . 11110000 . 00000000 . 00000000
255.240.0.0
/124 Subnet ID Bits, 20 Host ID Bits
(16 Subnet, 1048574 Hosts)
11111111 . 11111000 . 00000000 . 00000000
255.248.0.0
/135 Subnet ID Bits, 19 Host ID Bits
(32 Subnet, 524286 Hosts)
11111111 . 11111100 . 00000000 . 00000000
255.252.0.0
/146 Subnet ID Bits, 18 Host ID Bits
(64 Subnet, 262142 Hosts)
11111111 . 11111110 . 00000000 . 00000000
255.254.0.0
/157 Subnet ID Bits, 17 Host ID Bits
(128 Subnet, 131070 Hosts)
11111111 . 11111111 . 00000000 . 00000000
255.255.0.0
/168 Subnet ID Bits, 16 Host ID Bits
(256 Subnet, 65534 Hosts)
11111111 . 11111111 . 10000000 . 00000000
255.255.128.0
/179 Subnet ID Bits, 15 Host ID Bits
(512 Subnet, 32766 Hosts Each)
11111111 . 11111111 . 11000000 . 00000000
255.255.192.0
/1810 Subnet ID Bits, 14 Host ID Bits
(1024 Subnet, 16382 Hosts Each)
11111111 . 11111111 . 11100000 . 00000000
255.255.224.0
/1911 Subnet ID Bits, 13 Host ID Bits
(2048 Subnet, 8190 Hosts Each)
11111111 . 11111111 . 11110000 . 00000000
255.255.240.0
/2012 Subnet ID Bits, 12 Host ID Bits
(4096 Subnet, 4094 Hosts Each)
11111111 . 11111111 . 11111000 . 00000000
255.255.248.0
/2113 Subnet ID Bits, 11 Host ID Bits
(8192 Subnet, 2046 Hosts Each)
11111111 . 11111111 . 11111100 . 00000000
255.255.252.0
/2214 Subnet ID Bits, 10 Host ID Bits
(16384 Subnet, 1022 Hosts Each)
11111111 . 11111111 . 11111110 . 00000000
255.255.254.0
/2315 Subnet ID Bits, 9 Host ID Bits
(32768 Subnet, 510 Hosts Each)
11111111 . 11111111 . 11111111 . 00000000
255.255.255.0
/2416 Subnet ID Bits, 8 Host ID Bits
(65536 Subnet, 254 Hosts Each)
11111111 . 11111111 . 11111111 . 10000000
255.255.255.128
/2517 Subnet ID Bits, 7 Host ID Bits
(131072 Subnets, 126 Hosts Each)
11111111 . 11111111 . 11111111 . 11000000
255.255.255.192
/2618 Subnet ID Bits, 6 Host ID Bits
(262144 Subnet, 62 Hosts Each)
11111111 . 11111111 . 11111111 . 11100000
255.255.255.224
/2719 Subnet ID Bits, 5 Host ID Bits
(524288 Subnet, 30 Hosts Each)
11111111 . 11111111 . 11111111 . 11110000
255.255.255.240
/2820 Subnet ID Bits, 4 Host ID Bits
(1048576 Subnet, 14 Hosts Each)
11111111 . 11111111 . 11111111 . 11111000
255.255.255.248
/2921 Subnet ID Bits, 3 Host ID Bits
(2097152 Subnet, 6 Hosts Each)
11111111 . 11111111 . 11111111 . 11111100
255.255.255.252
/3022 Subnet ID Bits, 2 Host ID Bits
(4194304 Subnet, 2 Hosts Each)


Subnet Mask Example

Consider a class C network - 192.168.45.0
The default subnet mask for this network is - 255.255.255.0
Total number of hosts present in this network is - 254
If we use the subnet mask - 255.255.255.192 for this network (192.168.45.0) then the network is break down into 4 networks (192.168.45.0, 192.168.45.64, 192.168.45.128 and 192.168.45.192) and the number of hosts in each network is 62. These four networks would have as valid host addresses :

NetworkSubnet MaskHost Address Range
192.168.45.0255.255.255.192192.168.45.1 - 192.168.45.62
192.168.45.64255.255.255.192192.168.45.65 - 192.168.45.126
192.168.45.128255.255.255.192192.168.45.129 - 192.168.45.190
192.168.45.192255.255.255.192192.168.45.193 - 192.168.45.254

Remember, again, that binary host addresses with all ones or all zeros are invalid, so you cannot use addresses with the last octet of 0, 63, 64, 127, 128, 191, 192, or 255.

You can see how this works by looking at two host addresses, 192.168.45.70 and 192.168.45.135. If you used the default Class C subnet mask of 255.255.255.0, both addresses are on the 192.168.45.0 network. However, if you use the subnet mask of 255.255.255.192, they are on different networks; 192.168.45.70 is on the 192.168.45.64 network, 192.168.45.135 is on the 192.168.45.128 network.


Variable Length Subnet Masking (VLSM)

The main weakness with conventional subnetting is that the subnet ID represents only one additional hierarchical level in how IP addresses are interpreted and used for routing.

In large networks, divide the entire network into only one level of subnetworks doesn’t represent the best use of the IP address block. you have already seen that since the subnet ID is the same length throughout the network, you can have problems if you have subnetworks with very different numbers of hosts on them. The subnet ID must be chosen based on whichever subnet has the greatest number of hosts, even if most of subnets have far fewer. This is inefficient even in small networks, and can result in the need to use extra addressing blocks while wasting many of the addresses in each block.

For example, consider a relatively small company with a Class C network, 205.45.208.0/24. The administrators have six subnetworks in their network. The first four subnets (S1, S2, S3, and S4) are relatively small, containing only 10 hosts each. However, one of them (S5) is for their production floor and has 50 hosts, and the last (S6) is their development and engineering group, which has 100 hosts. The total number of hosts needed is thus 190.

Without subnetting, the company has enough hosts in the Class C network to handle them all. However, when they try to subnet, they have a big problem. In order to have six subnets, they need to use three bits for the subnet ID. This leaves only five bits for the host ID, which means every subnet has the identical capacity of 30 hosts. This is enough for the smaller subnets but not enough for the larger ones. The only solution with conventional subnetting, other than shuffling the physical subnets, is to get another Class C block for the two big subnets and use the original for the four small ones. But this is expensive and means wasting hundreds of IP addresses!

KEY CONCEPT - Variable Length Subnet Masking (VLSM) is a technique for which subnetting is performed multiple times in iteration to allow a network to be divided into a hierarchy of subnetworks that vary in size. This allows an organization to better match the size of its subnets to the requirements of its networks.

VLSM subnetting is done the same way as regular subnetting; it just involves extra levels of subnetting hierarchy. To implement it, you first subnet the network into large subnets and then further break down one or more of the subnets as required. You add bits to the subnet mask for each of the sub-subnets and sub-sub-subnets to reflect their smaller size.

For example, consider the class C network, 205.45.208.0/24. You do three subnettings as follows :



ABOUT US

QuestionSolves.com is an educational website that helps worldwide students in solving computer education related queries.

Also, different software like Visual Studio, SQL Server, Oracle etc. are available to download in different versions.

Moreover, QuestionSolves.com provides solutions to your questions and assignments also.


MORE TOPIC


Windows Command

UNIX Command

IGNOU Assignment Solution

IGNOU Question Paper Solution

Solutions of Different Questions


WHAT WE DO


Website Devlopment

Training

Home Learning

Provide BCA, MCA Projects

Provide Assignment & Question Paper Solution


CONTACT US


Follow Us