Understanding Network Notations: Slash 24 (/24) vs. 255.255.255.0 — Any Differences?

Vagner Bom Jesus
3 min readMay 8, 2024

--

The mask, associated with an IP address, can be displayed in a number of ways. Today we’re going to talk a little bit about how we can represent a mask of a network address. Slash 24 (/24) or 255.255.255.0?

An IPv4 address is made up of 32 bits, which is the same as having four octets represented in decimal form (e.g., 192.168.0.1).

One part of that address tells us which network it belongs to, and the other part tells us which host it is on that network. To determine which part of the IP address identifies the network and which part identifies the machine, we will have to resort to the associated subnet mask (subnet mask or netmask). To make it easier, we have produced the following outline to help with understanding.

Consider that In each octet there is a scale equal to that found in the yellow ellipse.

Let’s look at an example about netmasks

Let’s consider the mask for example 255.255.255.0. We start by calculating the first 255. To do this, we “look” at the yellow ellipse and check which values we have to assign 0 or 1 to get the value 255, that is, we basically pass 255 to the corresponding binary value.

For 255 it’s easy, as we’d have to put everything at 1. Adding 128+64+32+16+8+4+2+1 We then have the 255.

So we can consider that 255.255.255.0 is equal to:

So how do you calculate the corresponding slash? (also known as CIDR (Classless Inter-Domain Routing) notation)

Well, this part is even simpler, as all you have to do is count the number of 1'. For the previous case they are 24 (i.e. 8 bits + 8 bits + 8 bits)

So considering that we have the address 192.168.0.1 with the mask: 255.255.255.0 is equal to saying that I have 192.168.0.1/24

We can further conclude that for the address 192.168.0.1 with the mask 255.255.255.0:

  • The part that identifies the network is: 192.168.0 (first 3 octets)
  • The part of the machine is the .1 (last octet)

Now consider that the mask was 255.255.240.0?

Imagine that I have the address 172.16.32.1 with the mask 255.255.240.0, I can simply represent this address as 172.16.32.1/20.

--

--

Vagner Bom Jesus
Vagner Bom Jesus

Written by Vagner Bom Jesus

Licenciatura em Engenharia Informática

No responses yet