When we hear the term "subnet mask," IP addresses often come to mind, right? However, I've recently realized that many technologists and engineers don’t fully understand what a subnet mask is.

To explain, I encountered a network with a specific IP range, and the subnet mask was 255.255.192.0. The machine we needed to communicate with had the IP address 10.10.64.121, so I suggested setting an IP address of 10.10.100.121. However, the on-site technician disagreed, insisting I was wrong.

Let’s break this down. Most tech professionals are familiar with the OSI model, which is crucial when working with data communications. For our discussion on subnet masks, let’s focus on three OSI layers: the Physical layer, the Data Link layer, and the Network layer.

The Physical and Data Link layers together make up Ethernet. These two layers package data into small frames and transmit them across wires. The Network layer, also known as the routing layer, is where IP (and related protocols) reside.

Ethernet Cabling:

For most computers, we only use 2 out of the 4 twisted pairs in a CAT 5 cable. One pair is for receiving data (Rx), and the other is for sending data (Tx) in full-duplex mode. RJ45 connectors connect machines, and it's important to note that Gigabit Ethernet uses all 4 pairs in a CAT 5 cable.

MAC Address:

The MAC (Media Access Control) address, also known as the hardware address, is 48 bits long and is grouped in chunks of 4 bits. It’s written in hexadecimal, where every 4 bits form one hexadecimal digit. You can think of a MAC address as a unique name, like a person's name—e.g., Felix.

IP Protocol:

IP addresses are used for routing. There’s IPv4, which uses 32-bit addresses, and IPv6, which uses 128-bit addresses. IPv4 is still the dominant protocol.

Think of an IP address as your postal address. A 32-bit IP address is divided into four groups of 8 bits, represented in decimal. For example:

192.100.100.1

In binary, that would be:

1100 0000. 0110 0100. 0110 0100. 0000 0001

Within an IP address, there are two key components:

  1. The NetID (like a zip code)
  2. The HostID (like a street address)

Subnet Mask:

A subnet mask helps us distinguish the NetID (zip code) and the HostID (street address) in an IP address. The subnet mask acts as a guide for the “postman” (Layer 3 of the OSI model), directing them to the correct network (NetID) to deliver data.

The subnet mask uses 1s to mark the NetID portion of the IP address and 0s for the HostID portion. Essentially, the subnet mask highlights the area code or NetID, showing which part of the address refers to the network.

For example, consider the IP address 10.10.64.121 with a subnet mask of 255.255.192.0:

0000 1010. 0000 1010. 0100 0000. 0111 1001 = IP Address

1111 1111. 1111 1111. 1100 0000. 0000 0000 = Subnet Mask

From this, we can see that as long as the IP address falls within the range defined by the subnet mask, the last two octets of the IP address can be modified, not just the last octet. Therefore, the IP address 10.10.100.121 would still fall within the same subnet as 10.10.64.121.

Subnet Mask