Return Home
Application Development


Home

Back

FS Intra-Net

TCP/IP Subnet Masks

A mask is used to determine what subnet an IP address belongs to. An IP address has two components, the network address and the host address. For example, consider the IP address 150.215.017.009. Assuming this is part of a Class B network, the first two numbers (150.215) represent the Class B network address, and the second two numbers (017.009) identify a particular host on this network.

Subnetting enables the network administrator to further divide the host part of the address into two or more subnets. In this case, a part of the host address is reserved to identify the particular subnet. This is easier to see if we show the IP address in binary format. The full address is: 

10010110.11010111.00010001.00001001

The Class B network part is:

10010110.11010111

and the host address is

00010001.00001001

If this network is divided into 14 subnets, however, then the first 4 bits of the host address (0001) are reserved for identifying the subnet.

The subnet mask is the network address plus the bits reserved for identifying the subnetwork. (By convention, the bits for the network address are all set to 1, though it would also work if the bits were set exactly as in the network address.) In this case, therefore, the subnet mask would be 11111111.11111111.11110000.00000000. It's called a mask because it can be used to identify the subnet to which an IP address belongs by performing a bitwise AND operation on the mask and the IP address. The result is the subnetwork address:

Subnet Mask 255.255.240.000 11111111.11111111.11110000.00000000
IP Address 150.215.017.009 10010110.11010111.00010001.00001001
Subnet Address 150.215.016.000 10010110.11010111.00010000.00000000
The subnet address, therefore, is 150.215.016.000.
    


Related Links 
 

Understanding IP addressing  
Excellent overview of IP addressing from 3Com. Also includes a large section on subnetting. Updated on Apr 25, 1999

Connected Encyclopedia's description of subnet masks
Explains how subnetting is implemented on the Internet using subnet masks. Includes a link to the Internet Standard Subnetting Procedure RFC.

Fast Guide to Subnets
Explains the different portions of an IP address and highlights common examples of IP networks. Also provides a table with subnet mask valid ranges and information on routing. Updated on Mar 26, 1998

TCP/IP subnet calculator
Calculates subnet masks, lists the subnets, and figures out the node and network components of a TCP/IP address. Updated on Apr 24, 1998

Variable Length Subnet Masking (VLSM)
A very good explanation of what happens when a company divides their network into subnets using variable length masking.

   

Class C Subnet Mask Table

Decimal Mask Hex Mask Slash Mask Subnets Avail. Hosts Avail.
255.255.255.0
255.255.255.128
255.255.255.192
255.255.255.224
255.255.255.240
255.255.255.248
255.255.255.252
FF-FF-FF-00
FF-FF-FF-A
FF-FF-FF-CO
FF-FF-FF-EO
FF-FF-FF-FO
FF-FF-FF-F8
FF-FF-FF-FC
/24
/25
/26
/27
/28
/29
/30
1
2
4
8
16
32
64
254
126
62
30
14
6
2
dot_clear.gif (46 bytes)
255.255.255.128   255.255.255.248 255.255.255.252
1 to 126
129 to 254
1 to 6
9 to 14
17 to 22
25 to 30
33 to 38
41 to 46
49 to 54
57 to 62
65 to 70
73 to 78
81 to 86
89 to 94
97 to 102
106 to 110
113 to 118
121 to 126
129 to 134
137 to 142
145 to 150
153 to 158
161 to 166
169 to 174
177 to 182
185 to 190
193 to 198
201 to 206
209 to 214
217 to 222
225 to 230
233 to 238
241 to 246
249 to 254
1 to 2
5 to 6
9 to 10
13 to 14
17 to 18
21 to 22
25 to 26
29 to 30
33 to 34
37 to 38
41 to 42
45 to 46
49 to 50
53 to 54
57 to 58
61 to 62
65 to 66
69 to 70
73 to 74
77 to 78
81 to 82
85 to 86
89 to 90
93 to 94
97 to 98
101 to 102
105 to 106
109 to 110
113 to 114
117 to 118
121 to 122
125 to 126
129 to 130
133 to 134
137 to 138
141 to 142
145 to 146
149 to 150
153 to 154
157 to 158
161 to 162
165 to 166
169 to 170
173 to 174
177 to 178
181 to 182
185 to 186
189 to 190
193 to 194
197 to 198
201 to 202
205 to 206
209 to 210
213 to 214
217 to 218
221 to 222
225 to 226
229 to 230
233 to 234
237 to 238
241 to 242
245 to 246
249 to 250
253 to 254

255.255.255.192

1 to 62
65 to 126
129 to 190
193 to 254

255.255.255.224

1 to 30
33 to 62
65 to 94
97 to 126
129 to 158
161 to 190
193 to 222
225 to 254

255.255.255.240

1 to 14
17 to 30
33 to 46
49 to 62
65 to 79
81 to 94
97 to 110
113 to 126
129 to 142
145 to 158
161 to 174
177 to 190
193 to 206
209 to 222
225 to 238
241 to 254
dot_clear.gif (46 bytes)
   © 1999 First Step Computer Consultants, Inc. All rights reserved.
Information and Inquiries contact info@firstep.com