Possible Duplicate:
How does Subnetting Work?

Subnet mask is usually something like And until now, its the field I usually ignore.

I am trying to read the wikipedia entry, but its pretty loaded with jargon.

Can anyone explain in simple terms what a subnet mask is for and how it works?

marked as duplicate by jscott, Chris S, pauska, DanBig, coredump Apr 14 '11 at 14:10

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Simply put, it tells the OS which part of the IP address refers to the network, and which part refers to a host on that network. If the host needs to send data to an IP address where the network portion of the address differs, then it routes that data through whatever the default gateway/router address happens to be.

So if your subnet mask is, then the first three bytes of your IP address are the network, and the fourth byte refers to hosts within that network. If any of those first three bytes are different, the host will send the data through its default gateway (or fail if one isn't configured).

  • Pretty good summary. However, it doesn't always send to the default gateway: if there is a specific route saying "this network is reached via this machine", then it sends the packet to that machine's ip instead (usually, a router). ex: this is often the case if for example you have a client network accessible via a specific machine : on the hosts which needs access, the client's network range will have to be routed via this specific machine. (it's more complicated than that, but this simple case is possible) – Olivier Dulac Dec 28 '12 at 13:49

IP && MASK = Network ID
IP && !MASK = Host ID (on that network)

Not the answer you're looking for? Browse other questions tagged or ask your own question.