# What does a forward slash followed by a number mean in IP? [duplicate]

If an IP Address is indicated like this: 10.39.25.151/24 , what does the /24 mean?

• I think it's called CIDR notation. It tells you something about the range of IP addresses for the network. For details beyond that you'd have to read about subnets and subnet masks. Jan 5 '17 at 3:16
• @barlop : Yes, this is absolutely CIDR notation (also known as "slash notation"). I am certain of that. Fooey; I thought about that while writing my answer, but somehow left it off my answer. (I have since added that into the answer, for anyone who may just reads answers and not comments.) Thank you for the worthy addition of that good comment. Jan 5 '17 at 5:38

It indicates the subnet mask of the IP.

IP has 32 bits, and number after the slash tells you where does the network part end, host part starts.

IP 10.39.25.151 written in binary format looks like this:

00001010001001110001100110010111

and /24 says that first 24 bits are used for network designation, while last 8 bits are used for various hosts inside that network.

/24 means that hosts on network can have IPs that are different by last 8 bits only, so IPs from range 10.39.25.1 - 10.39.25.255, with last .255 IP being used as broadcast address for the network.

https://support.microsoft.com/en-us/kb/164015

/24 indicates a subnet mask of 255.255.255.0, or in binary octets.

11111111.11111111.11111111.00000000

• i'm a bit rusty, but reading through what you wrote, it all sounds brilliant and spot on. With one single exceltion. The last sentence you wrote. Classes are FAMOUSLY way out of date, and the only people that tend to make the mistake of talking about classes are people that learnt from cisco textbooks that are out of date on that and they never researched to find out that they were out of date on that. In fact the CIDR or slash notation, that C of CIDR is CLASSLESS.. as opposed to classful. Classful addressing hasn't been used for maybe even decades now. Jan 5 '17 at 6:27
• is there any difference then between 172.18.0.150/24 and 172.18.0.0/24? Feb 17 '19 at 14:06
• @JoãoPimentelFerreira Have you figured it out? Aug 21 '19 at 0:20

The number after the slash refers to the size of the network.

Specifically, the number after the slash specifies how many bits in the netmask have a value set to 1 before the first bit that is set to zero. This style of specifying a network's size is most formally called "CIDR notation", and is sometimes also called "slash notation".

What this means is that 24 bits are used to specify a network ID, leaving 8 bits to identify a host. There are 2 possible values in binary, and 2 raised to the 8th power is 256, so there are 256 addresses that can be in that network. So, the 192.0.2.0/24 network goes from 192.0.2.0 through 192.0.2.255.

Similarly, the 192.0.2.0/29 network goes from 192.0.2.0 through 192.0.2.7. (Since 29 of the bits are reserved for identifying the subnet, that leaves 3 bits for the addresses. 2 raised to the 3rd power is 8.)

Side note: All of those addresses are part of the subnet. In IPv4, they are not all "usable", based on the IPv4 standard of the first and last addresses being "unusable", for compatibility with various equipment that may support "broadcast packets". The last address is typically called the "broadcast address". The first address is typically called the "Network ID", but the technical reason that the Network ID was ever declared to be unusable was from historical concerns of compatibility with some equipment that broadcasted on the first address.

For more fun of looking at different subnet sizes, you may want to look at a VLSM chart.

The reason why /24 is so common is because IPv4 addresses tend to be written out in octets. /24 allows the Network bits and the Host bits to be split after 24 bits, which ends up being after the third octet. So, people can tell rather easily (and without being very error prone) whether a device is part of a specific network, or a different network.

• some of what you've written sounds really confusing. You wrote "The number after the slash refers to the size of the network." OK. Then you write "Specifically, if you have a netmask, it refers " So that suggests that you can have a number after a slash and not have a netmask, and I don't think that is correct. And you haven't said the key point, that the number after the slash IS the netmask. When you have a slash and a number, there is no "if you have a netmask" (afaik anyway!) It's not an if. You Have. Jan 5 '17 at 6:32
• you wrote "There are 2 possible values in binary, " <-- err no. A Binary digit can have 2 possible values. . Nobody would say there are 10 possible values in decimal. It's a decimal digit can have 10 possible values. But an infinite number of possible values can be represented in any base, binary, decimal, whatever. (though funnily enough probably not every value! e.g. a 1/3 without a division sign, can perhaps not really be represented in base 10 e.g. one has to write 0.3333333 but that's another matter). Jan 5 '17 at 6:34
• @barlop : Regarding your first comment, my second sentence did say what the number after the slash is. However, I used the word "it", and the sentence's pronoun could have been interpreted as referring to the netmask. I agree with your point, and decided fixing would be worthwhile, so I re-wrote for clarity. Regarding your 2nd comment (the one about possible values), I declare that's just being picky, so I don't intend to expend effort re-phrasing that. Jan 6 '17 at 6:51
• re that second comment, It's not picky, it's just quoting you saying something plain wrong. and saying it's wrong. And if somebody doesn't know much about binary then they might believe it and parrot it as a fact , taking it as its word / literally, while they try to understand the concepts, and they'll have a completely wrong concept. If somebody was teaching a class and said that, then they should be sacked, because it's blatantly wrong and very bad if you're telling somebody that doesn't already understand what you're explaining, well enough to spot your error and see past it. Jan 9 '17 at 21:51
• Okay, @barlop , but have you considered that perhaps it's not wrong? After re-reading what I wrote, it still didn't feel "wrong" to me. If interpreted that as "There are 2 possible values [a number can have,] in binary", it seems wrong. If interpreted as meant, as "There are 2 possible values [a digit can have,] in binary", then it's right. The statement was more ambiguous than it could've been, but if you really want to get technical, I didn't say that there are "only 2 possible values". There are two possible values in decimal (along with eight more possible values a single digit may have) Jan 10 '17 at 2:05