Subnetworks or Subnets are used by local area networks that are often connected to the internet and are used to divide a larger network into smaller subnets. How and why a subnet is implemented is based on the preference of the networking administrator. All devices that are connected to the same subnet can communicate with each other directly over the subnet, however devices outside of the subnet (i.e. not connected to the subnet) have to communicate via a router. By utilising a subnet, not only does this reduce overall network traffic, but it also adds an extra layer of security to all devices and data on the subnet as inbound data must always be transmitted through a router, which has firewall capabilities. In addition, local network traffic on the subnet is contained within the subnet and never reaches the broader network or the internet, minimising its exposure to viruses or corruption.

In order for a device to be connected to a subnet, its IP address must match the subnet's IP address for the length of the subnet mask. A subnet mask is a numerical value within an IP address that defines a broader range of IP addresses that are connected to a particular part or section of a network. For example, if the subnet's mask is 192.168.255.X then any device that wishes to connect to it must also have 192.168.255 as the first 3 group values of its IP address. The subnet mask can never include the 4th value in any IP address, this is reserved for the devices that will ultimately want to be connected to the device.

For example: I want to connect 3 computers to a subnet. The subnet mask is 192.168.255.X (Where X is reserved for the device and this is a subnet of /24). I have connected 2 of the PC's to the subnet as 192.168.255.1 and 192.168.255.2. The 3rd PC has the IP address 192.168.200.3, this wont connect to the subnet as the subnet mask on the device does not match that of the subnet. Changing 200 to 255 would allow the 3rd PC to connect as well.

There are a range of different subnet that use different notations, see the table below:

Addresses Hosts Netmask
/30 4 2 255.255.255.252
/29 8 6 255.255.255.248
/28 16 14 255.255.255.240
/27 32 30 255.255.255.224
/26 64 62 255.255.255.192
/25 128 126 255.255.255.128
/24 256 254 255.255.255.0
/23 512 510 255.255.254.0
/22 1024 1022 255.255.252.0
/21 2048 2046 255.255.248.0
/20 4096 4094 255.255.240.0
/19 8192 8190 255.255.224.0
/18 16348 16382 255.255.192.0
/17 32768 32766 255.255.128.0
/16 65536 65534 255.255.0.0