Subnetmask is use to isolate the network ID and Host ID. eg- if an IP is:192.168.0.1 then the default subnet is:255.255.255.0 because it is a C Class Address C Class Add. have 3 network octate and 1 host octate i.e.
The use of subnet mask actually tells you the number of host/terminals that could be used on the same network. It is actually very simple for eg an IP address 192.168.0.1 with the subnet mask of 255.255.255.0. Just look at the 'ON' bits in this subnet mask (11111111.11111111.11111111.00000000) this clearly indicates that the number of host/terminal that can use the same network are configured and assigned from the last octet. So the number of combination one can drive from the last octect (2x2x2x2x2x2x2x2) 255 (0-254) which is number of devices that can be used over the network
A subnet allows the flow of network traffic between hosts to be segregated based on a network configuration. By organizing hosts into logical groups subnetting can improve network security and performance. the most recognizable aspect of subnetting is the subnet mask. Like IP addresses a subnet mask contains four bytes (32 bits) and is often written using the same dotted-decimal notation. For example a very common subnet mask in its binary representation
11111111 11111111 11111111 00000000
is typically shown in the equivalent more readable form
Subnetmak is used to identify the network based on the number of bits and the main purpose of subnetmask is to make independent and equal of the network.