Discussion Locked

The purpose of a subnet mask?

0 helpful
20 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I'm wondering what's the use of a subnet mask in the protocol of TCP/IP Protocol. I know that the I.P Address is the one that identifies the computer in the network. But what I can't understand is why do we have to specify the subnet mask of a computer everytime you assign an I.P Address to a computer. Any site that can explain me this question

20 replies

by levick

Every IP address consists of two parts, one
identifying the network and one identifying the
node. The Class of the address and the
subnet mask determine which part belongs to
the network address and which part belongs
to the node address. Subnetting an IP
Network can be done for a variety of reasons,
including organization, use of different
physical media (such as Ethernet, FDDI, WAN,
etc.), preservation of address space, and
security. The most common reason is to
control network traffic. In an Ethernet network,
all nodes on a segment see all the packets
transmitted by all the other nodes on that
segment. Performance can be adversely
affected under heavy traffic loads, due to
collisions and the resulting retransmissions.
A router is used to connect IP networks to
minimize the amount of traffic each segment
must receive. Applying a subnet mask to an IP
address allows you to identify the network and
node parts of the address. Performing a
bitwise logical and operation between the IP
address and the subnet mask results in the
Network Address or Number. Additional bits
can be added to the default subnet mask for a
given Class to further subnet, or break down,
a network. When a bitwise logical and
operation is performed between the subnet
mask and IP address, the result defines the
Subnet Address. Subnetting always reduces
the number of possible nodes for a given
network.

by levick

Every IP address consists of two parts, one
identifying the network and one identifying the
node. The Class of the address and the
subnet mask determine which part belongs to
the network address and which part belongs
to the node address. Subnetting an IP
Network can be done for a variety of reasons,
including organization, use of different
physical media (such as Ethernet, FDDI, WAN,
etc.), preservation of address space, and
security. The most common reason is to
control network traffic. In an Ethernet network,
all nodes on a segment see all the packets
transmitted by all the other nodes on that
segment. Performance can be adversely
affected under heavy traffic loads, due to
collisions and the resulting retransmissions.
A router is used to connect IP networks to
minimize the amount of traffic each segment
must receive. Applying a subnet mask to an IP
address allows you to identify the network and
node parts of the address. Performing a
bitwise logical and operation between the IP
address and the subnet mask results in the
Network Address or Number. Additional bits
can be added to the default subnet mask for a
given Class to further subnet, or break down,
a network. When a bitwise logical and
operation is performed between the subnet
mask and IP address, the result defines the
Subnet Address. Subnetting always reduces
the number of possible nodes for a given
network.

by bluriz

The subnet mask identifies the network part of the address and the host machine part. ie in 10.1.2.30 address with a mask of 255.255.255.0 shows a network address of 10.1.2 and the host is at 30 whereas 10.1.2.30 with a mask of 255.0.0.0 shows a network address as 10 and the host is at 1.2.30. Hope that makes sense!

by jo_ash

Another reason for using a subnet mask is to change the number of hosts available to the network. A class B network (eg 172.100.0.0) has 65534 hosts available. Subnet that using 255.255.248.0 (instead of the default 255.255.0.0) and now you've got2046 hosts available.

This allows you to split one class B network into multiple subnet masked networks.

Why do you have to specify the subnet mask everytime? Most operating systems will default, and you only have to enter anything if you wish to change it. What o/s are you using?

by curlergirl

By all means, do read the article referred to above. A simple, non-technical explanation of a subnet mask without referring to the bits of the address, etc.: Each IP address has 4 parts separated by periods, for example, 10.1.1.1. Each part of the ip address can (theoretically) be any value between 1 and 255 (this is not true in actual practice, but for the purposes of this explanation we'll ignore that). When you think about how many possible addresses that could be - well, it's a LOT. So, there has to be some way to break it down to make assigning and searching for ip addresses easier and quicker over the whole wide range of possible addresses. This is VERY basically what a subnet mask does - it "narrows down" the possible range ofIP addresses that could exist within a particular part of the total range of addresses, thus creating what is called a "subnet". So, subnet masks are used to identify for the browsing computer which network a certain host is located on. So, let's say I have an IP address of 190.2.3.4 on my host computer with a subnet mask of 255.255.255.0. The 255's indicate that the first 3 numbers (called "octets") will always stay the same for this particular subnet, and only the fourth number will change. So, immediately my router knows that it must look (in its routing table - a subject for an essay all by itself) for a way to reach the network 190.2.3.x. You can see where this would make things go much faster, rather than having to search through every number in every octet. Like I said, this is VERY basic and non-technical, and there's a lot more to it when you get under the hood, but I hope this helps to give you an answer to your basic question!

by shmaltz

I'll try to explain this in short:
Since IP is a protocol that connects 1000's of different networks, It needs a way to route it between networks. To route between networks you need to tell IP a Gateway. In order for IP to know when to use the gateway you have to give it a Subnet mask so it knows which IP address is located localy, so it doesn't have to send the packet out to the gateway. And which IP address is located on a remote network so it knows it has to send it to the gateway in order to reach the remote computer (IP). Even if you don't have a gateway (I.E. you are not connected to the Internet, And you only have one subnet), you still need a subnet mask so IP knows that the IP address is not local so IP knows that it is not reachable.
Continued...

by shmaltz

Glossary:
IP = Internet Protocol.
IP Address = A unique address assigned to a computer (in tech = a 32 bit [2^32] number that represents a unique address on the network).
Subnet = Computers participating in a network that are connected thru the same physical network (I.E. the same Hub/Switch or chain of Hub/Switch, In tech terms = on the same MAC broadcast zone).
Subnet Mask = A number that allows you to calculate which part of an IP Address is network part, and which part is the host part.
MAC = Media Access Control. The address assigned to the Phisycal hardware that connects you to the network in Ehternet networks.
Router = Hardware or software (the difference between hardware and software is that; hardware is something you purchase that the only software it's running is the router software. While software can be any computer that also runs routing software) that routes/connects IP address between 2 subnets.
Gateway = The router dirctly connect to your subnet that will connect you to another subnet, or another router.
Default Gateway = The router that IP will use for any address that it does not know a direct route to (in simple networks there is most of the times only one gateway, which is also the default gateway.With the subnet mask IP always knows the route to your local network/subnet so it will never use the default gateway. If however it doesn't match the subnet mask it knows to send it to a gateway. If only one gateway exists in the IP stack then this is the default gateway and it is always used. If there is more than one gateway, then each gateway needs a subnet mask so IP knows which subnet uses which gateway).
I hope this is enough info.

by bkaralee

Think of this like an address for a house...
Let's say your address is 123 Ave B North. Ave.B North is your street address (network) and 123 is your house address (node). This is probably the easiest way to look at it. Your subnet mask designates how many bits of the IP are being used for your Network ID. If you have a subnet mask of 255.255.255.0, you are using 24 bits of the IP for your Network ID. If your subnet mask is 255.255.248.0, you are now using 21 bits of your IP for your Network ID. Hope this helps.

This discussion is closed to new replies.