When you have your network devices physically connected, you then need to configure them to be able to talk to one another.
Every device on a network needs a unique address, to be able to talk to one another.
IP Addresses are a device’s identity on an Ethernet network. They are formed of four 8bit numbers (with a value of 0-255), known as octets separated by dots. For example, 192.168.0.1. Every device needs an IP address, which can either be manually assigned to a device, or automatically assigned to a device by a DHCP Server.
It is recommended (but not required) to use IP addresses within the following ranges:
- 10.0.0.0 - 10.255.255.255
- 172.16.0.0 - 172.31.255.255
- 192.168.0.0 - 192.168.255.255
These IP addresses have been reserved for use on local networks by IANA (Internet Assigned Numbers Authority).
The fourth octet of an IP, should not be configured to 255. The last octet therefore has a range of 0-254.
Every device, will also have a subnet mask along with their IP address. The subnet mask also uses the same format as IP addresses, with four octets separated by dots. The Subnet mask indicates what a device can see on the network. This is because the subnet mask is used to split the device's IP address into the "network address", and "host address".
There are three classes of subnets, also known as "natural masks":
- Class A - Subnet of 255.0.0.0 (can be displayed as a "/8" prefix after an IP address)
- Class B - Subnet of 255.255.0.0 (can be displayed as a "/16" prefix after an IP address)
- Class C - subnet of 255.255.255.0 (can be displayed as a "/24" prefix after an IP address)
As can be seen, working from octet one through to octet three of the subnet, each class changes the next octet to "255", rather than "0". Typically in show networks, subnets in use will either be a class A, B or C.
Put simply, if there is a "255" in an octet of a device's subnet, this device can only talk to other devices with an identical value in that octet of their IP addresses.
With a class A subnet, all devices must all have an identical first octet of their IP address, with the remaining octets not having to match. For example, all devices could have 10.x.y.z, where x and y can be any number between 0-255, and z can be any number between 0-254. Every device must have a unique address within this range. In this example, "10" is considered the network address - any devices that want to talk must all be on network number 10. The remaining three octets "x.y.z" are then the host address - each device (or "host") has a unique address within that network number.
With a class C subnet, all devices must share the first three octets of their IP address, leaving only the last octet to be unique for the device. For example, 192.168.1.x where x can be any number between 0-254. Every device must have a unique address within this range. As you can see, with a class C subnet, only 254 different devices will be able to talk to one another. In this example, "192.168.1" is considered the network address. Any devices that want to talk on this network must all be on network number 192.168.1. The remaining octet "x" is the host address. Each device (or "host") must have a unique address within that network number.
For example, these two devices could talk:
- Device 1 - IP: 10.1.1.10, Subnet: 255.255.255.0
- Device 2 - IP:10.1.1.20, Subnet: 255.255.255.0
They have a "class C" subnet, and therefore have the first 3 octets of their IP identical. "10.1.1" is the network address.
These devices could talk:
- Device 1 - IP: 10.1.2.10, Subnet - 255.255.0.0
- Device 2 - IP: 10.1.3.10, Subnet - 255.255.0.0
They have a "class B" subnet, and therefore have the first 2 octets of their IP identical. "10.1" is the network address.
These devices could not talk:
- Device 1 - IP:10.1.2.10, Subnet: 255.255.255.0
- Device 2 - IP:10.2.3.10, Subnet: 255.255.255.0
They have a "class C" subnet, and therefore the first 3 octets must match. In this example however, they don't, meaning device 1 is on network address "10.1.2", and device 2 is on network address "10.2.3".
Thankfully, there is a way of avoiding needing to worry about all this. Instead, we can use a DHCP server, to automatically assign your devices their required IP address and subnets.