by Dinesh Thakur Category: Naming and Addressing

• Subnet mask uses the same format and representation technique as IP addresses.

• Subnet mask has binary is in all bits specifying the network and subnetwork fields, and binary Os in all bits specifying the host field.

• A subnet address is created by borrowing the bits from host field.

• Subnet mask bits should come from the high-order (left most) bits of the host field.

• Various types of subnet mask exist for class Band C subnets.

• The default subnet mask for a class B address that has no subnetting is, while the subnet mask for a class B address that specifies eight bits of subnetting is The reason for this is that eight bits of subnetting or 28 - 2 (1 for the network address and 1 for the broadcast address) = 254 subnets possible, with 28 - 2 = 254 hosts per subnet.

                            A Sample Subnet-Mask

• The subnet mask for a class C address that specifies five bits of subnetting is with five bits available for subnetting, 25 - 2 = 30 subnets possible, with 23 - 2 = 6 hosts per subnet.

                             Subnet Mask Bits Come from the high order bits of host field


How subnet masks are used to determine the network number


• The router performs a set process to determine the network (or more specifically, the subnetwork) address.

• First, the router extracts the IP destination address from the incoming packet and retrieves the internal subnet mask.

• It then performs a logical AND operation to obtain the network number. In logical AND operation, 1 "ANDed" with 1 yields 1 and 1 "ANDed" with 0 yields 0.

• This causes the host portion of the IP destination address to be removed, while the destination network number remains.


• The router then looks up the destination network number and matches it with an outgoing interface.

• Finally, it forwards the frame to the destination IP address.

• Figure shows that when a logical AND of the destination IP address and the subnet mask is performed, the sub-network number remains, which the router uses to forward the packet.

                            Subnetwork number

If you liked this article, you can also catch us on facebook and Google+

Related Articles (You May Also Like)

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.

Search Content