What exactly is the purpose of the subnet mask?

Special K

Diamond Member
Jun 18, 2000
7,098
0
76
I have a speedstream 5660 dsl modem/router and I when I was learning how to use the IP filtering rules, I started wondering what the uses of the subnet masks were. All I really know is that when I make a new filtering rule, I can set a source and a destination IP address, and then use the masks to specify what range of IPs to block. For example, I could enter the destination IP to be 24.76.113.45. Then if I enter a 0 for the corresponding octet in the mask, it will match any value to that octet, and if I enter a 255, it will only match that number. In that case if my mask was 255.255.0.0, then all packets with a destination IP of 24.76.x.x would be filtered. My question is this: what significance does the subnet mask have in the settings for my NIC? My router has 2 subnet masks, a WAN one and a LAN one. It didn't seem to matter if my NIC used the routers WAN or LAN subnet mask. So what is the use of the subnet masks in windows settings?
 

sohcrates

Diamond Member
Sep 19, 2000
7,949
0
0
Found this on google:

A subnet mask is a 32-bit number, written in dotted decimal form, in much the same way an IP address is displayed. For example 255.255.255.192. Only hosts that are on the same subnet can communicate with others without a router. Computers on different subnets can not see each other?s local broadcasts, and they will need to communicate to each other through a router, even though they may be on the same network.

An example of how a subnet marks works, is say for example you have a class c network address, and you would prefer to configure six networks of 30 hosts each, you would use the subnet mask 255.255.255.224. Subnet 0, with the binary representation 000, is reserved to refer to ?this subnet,? and subnet 7, with the binary representation 111, is reserved for broadcasts to all subnets on this network. Thus subnets one through six are available. Host number 0 and host number 31 are reserved, so there are 30 potential host IDs, numbered 1 to 30, that could be assigned.

With this subnet mask, there are 180 total IP addresses possible on this Class C network. With no subnetting, a Class C network has 254 total addresses. Subnets clearly can result in wasted IP addresses, although the alternative of not employing subnets at all will likely result in even worse waste?for example, multiple Class C networks being used to segment a small number of users.
 

SuperMachoMan

Member
May 24, 2002
92
0
0
An IP address consists of both a network address and a host address. The subnet mask designates the portion that makes up the network address.

So if you have an IP address of 255.255.255.0 (or 11111111.11111111.11111111.00000000 in binary), that denotes that the first three octets of your IP address make up your network address.

Given an IP address of 10.10.10.1 with a subnet mask of 255.255.255.0, for example, the network address would be 10.10.10.0 and the host address would be 1. Whereas with a subnet mask of 255.0.0.0, your network address would be 10.0.0.0 and your host address would be 10.10.1.

Hope that helps.
 

Fatt

Senior member
Dec 6, 2001
339
0
0
a subnet mask and a wildcard mask do the same things.

They tell some protocol which bits to check and which to ignore.
If you line up the subnet mask under it it'll work like a filter. Sort of.

Those "ones" in the subnet mask says: "yeah, ok.... make sure the bits in those first 3 octets match the IP address we're comparing it agains, but don't worry about the last octet.

192.168.0.1 = = = 11000000.10101000.00000000.00000001
255.255.255.0 == 11111111.11111111.11111111.00000000


Subnet masks use a "1" to signify "check" and Wildcard masks use a "0"
 

rw120555

Golden Member
Jun 13, 2001
1,263
0
0
If you are interested, here are some subnet calculators available from zdnet. According to Zdnet, these let you "Collect and analyze subnet and supernet IP address data for resource analysis, availability, cost analysis, and more. " Why exactly you would want to do this, I don't know, but I assume there is some reason Zdnet decided to mention them in their "downloads digest" today.