How To Calculate the Subnetmask

104 17
    • 1). Determine how many hosts and networks you need. This will tell you how many bits you need to "borrow." Subnets are determined by powers of two for every bit borrowed. Let's say that you need 6 subnets capable of holding 20 hosts. Since more than 256 addresses are needed, we assume this is a Class C network, which has a default subnet mask of 255.255.255.0 -- only the last octet is borrowed from.

    • 2). Round the number of networks you need up to the next largest higher power of two. For example, you'd need to round 6 up to 8 (which is 2^3) to accommodate your subnet needs. 8 Class C subnets can utilize 30 hosts in each subnet, which is adequate. This means that the subnet mask needs to borrow 3 bits in the octet to make 8 subnets. In binary form, this is expressed as 11111111.11111111.11111111.11100000

    • 3). Convert binary to decimal. Each digit in an octet is represented by a power of two, from 2^7, to 2^0. These, in descending order, are 128, 64, 32, 16, 8, 4, 2 and 1. The sum of each "on" (represented by 1) bit is what determines the decimal value. When all bits are on, you get a sum of 255 from 128+64+32+16+8+4+2+1. Since only three bits are "on" in this subnet mask, you only need to add "128+64+32" to get a sum of 224. Therefore, our subnet mask is 255.255.255.224.

Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.