Damn. I wrote almost all of this out, then I must have hit refresh or backspace while outside of the text box or something, because then Opera caused me to lose all my text. Bleh.

Anyway, this is about Subnet masks, as I understood them when clicking 'reply', anyway.
Now I've made it it's own thread.

I will assume people know about BINARY NOTATION, because I don't want to have to write that part all out again.

A subnet mask often looks curiosly akin to an IP address, but they are different things. A subnet mask lets your computer figure out which addresses are local, or near you, in your office, for instance, and which ones are outside.
Common masks are:

Which, in binary, are:
The computer compares the mask to the destination IP addresses, such as: = 11001111.11011100.00001100.00010111
or = 11000111.11011001.00011110.01011010

and your own IP, such as: = 11000111.11011001.00011110.01010100

IP 1    11001111.11011100.00001100.00010111   (
IP 2    11000111.11011001.00011110.01011010   (
YOUR IP 11000111.11011001.00011110.01010100   (
Mask    11111111.11111111.11111111.00000000   (
So it takes your IP, and takes away all the digits in your IP which correspond to digits that are 0's in the mask, and then does the same thing with the destination IP, leaving:
Destination 1:
Destination 2:
It then compares yours and the desination. If they match, then it knows you are sending to a computer that is on your LAN, and if they don't, it knows that the destination could be halfway across the world. In the above example, IP #1 Is not local, and IP #2 is local.

The tricky part comes when you have a subnet mask that is NOT just 255s and zeros, such as
MASK = = 11111111.11111111.11111100.00000000
Can you see the difference?

Lets whip up a new set of IP addresses.
IP 1    11000111.11011001.10101110.00000011   (
IP 2    11000111.11011001.00011011.01001010   (
IP 3    11000111.11011001.00011111.01001010   (
YOUR IP 11000111.11011001.00011110.01010100   (
MASK    11111111.11111111.11111100.00000000   (
So, running all of these through the mask, we get:

IP 1    11000111.11011001.101011--.--------   (
IP 2    11000111.11011001.000110--.--------   (
IP 3    11000111.11011001.000111--.--------   (
YOUR IP 11000111.11011001.000111--.--------   (
As you can clearly see, only IP #3 is the same as your own IP, IP's #1 and #2 are *SLIGHTLY* different, but different enough to be non-local. As I hint, I'd say the most important thing to know about subnet masks is that is ONLY short-hand for:
11111111.11111111.11111100.00000000 !

Just because the number has 252, doesn't mean you get ((255 - 0) * (255 - 252))=765 addresses that are local, you get 11111111.11111111.11111100.00000000 ten binary digits, or 1024 local addresses!

Some people may also have heard of or use CIDR, which shows addresses and their masks like this: (Using previous example) / 22
which means that the FIRST 22 DIGITS of the mask are 1s, and the last 10 are zeros. So it is like saying:
Address, subnet mask 11111111.11111111.11111100.00000000
(The first 22 digits are ones.)

Anyway, I hope that helps, and correct me if I made a mistake, I don't deal with this stuff for a living or anything. Shout outs to UltraEdit, for letting me actually write this thing out again without worrying about losing it on the web

EDIT: Changed [pre] and [/pre] to [(/)code] tags.
EDIT: Changed the way I phrased that last edit message so that it didn't look weird onscreen because of the way it was parsed by the board.