To understand subnets, you need first to understand IP. Subnetting is used to better control network traffic, allows you to classify network traffic based on network settings, and improves network security by grouping computers (hosts) into logical groups.
IP in version 4 is 32 bits long. Some bits of an IP address define the network, and other bits define the portion of the address that is used to identify network devices (hosts). Each IP address has a subnet mask. By using the subnet mask we can distinguish which part of the address is the network part and which part is the host part, or by using the subnet mask we get the network address and the broadcast address.
IP addresses are divided into several classes. The most commonly used classes are A, B, and C. Each class has a default subnet mask.
Class A has 8 bits reserved for defining the network portion of the address. That's why we mark the default subnet mask for class A as ip_address/8 (for example, 10.0.0.0/8). The remaining 24 bits are reserved for host identification.
Class B has 16 bits to define the network portion of the address. We can write it as ip_address/16 (for example, 172.16.0.0/16). The remaining 16 bits represent hosts.
Class C has 24 bits reserved for defining the network portion of the address. We can write it as ip_address/24 (for example, 192.168.1.0/24). The remaining 8 bits are reserved for host identification.
The subnet mask is a 32-bit number that has the same form as an IP address. Only clients with the same subnet mask can communicate with each other without using a router. A subnet mask is used by a group of computers and network devices.
Depending on the selected network class, it is also assigned a subnet mask by default: Class A (255.0.0.0), Class B (255.255.0.0), Class C (255.255.255.0).
To know which subnet mask to assign to a particular part of the network, we need to know what network structure is required, which parts of the network can communicate with each other, how many clients we have on the network, etc. There are subnet mask calculator programs that do this job elegantly.
So, by defining the subnet mask in your case, you are defining the entire range of IP addresses that can be accessed. But make sure that the set of subnet masks should be the same on the client and server (both sides). Perhaps for a better understanding, you can use a free online subnet calculator and see what I'm talking about (just enter your details and you'll see the options).