Network Masks / Netmasks for Dummies

By Angsuman Chakraborty, Gaea News Network
Tuesday, October 16, 2007

Network masks is a notation to group IP addresses. Let’s take a familiar analogy. My phone in US was 510-595-3830. 510 was the area code which included a large group of phone numbers in San Francisco-Oakland-Emeryville area. Similarly IP addresses are also grouped by their network prefix.

Netmasks are important for allocating sub-networks to individuals or organizations. They are also used to identify networks for routing purposes.

Each (IPv4) IP address contains a 4 8-bit integers in the form a.b.c.d. So an IPv4 IP address contains 32 bits. A netmask indicates the number of bits which are fixed for all IP addresses within the network.

Let’s take a network which contains IP addresses between 72.31.32.0 - 72.31.32.255. In this network the first 24 bits (first 3 8-bit integers) are constant for all IP addresses. So the network mask for this network will be denoted as /24.

There is a longer notation to describe network masks which is used in Windows and also Linux to specify the netmask of your own computer. Here instead of writing the number of constant bits in the IP address in decimal format you need to specify it in the IP address format. So /24 becomes 255.255.255.0. The first three 255 represents the 24 bits of the address.

Each network specified by the netmask can contain a maximum number of computers or IP address bearing devices (like routers) as limited by the netmask. For example a /24 network can contain a maximum of 28 -1 (255) computers. One of the address (highest one) is reserved for broadcast address of the network. The number 8 is derived by subtracting 24 from 32.

Refer to the table below for network masks in both forms and maximum number of machines for quick reference:

Short Form Full Form Maximum number of machines Comment
/8 /255.0.0.0 16, 777, 215 Class A address
/16 /255.255.0.0 65, 535 Class B address
/17 /255.255.128.0 32, 767  
/18 /255.255.192.0 16, 383  
/19 /255.255.224.0 8, 191  
/20 /255.255.240.0 4, 095  
/21 /255.255.248.0 2, 047  
/22 /255.255.252.0 1, 023  
/23 /255.255.254.0 511  
/24 /255.255.255.0 255 Class C address
/25 /255.255.255.128 127  
/26 /255.255.255.192 63  
/27 /255.255.255.224 31  
/28 /255.255.255.240 15  
/29 /255.255.255.248 7  
/30 /255.255.255.252 3  
Discussion
July 11, 2010: 6:23 am

Good article. Although old, it explains the net masking better than the comparable wikipedia article. Thanks a bunch.

YOUR VIEW POINT
NAME : (REQUIRED)
MAIL : (REQUIRED)
will not be displayed
WEBSITE : (OPTIONAL)
YOUR
COMMENT :