An IP address like this 223.248.0.0/24 or 223.248.0.0/16
What's the last number mean in the IP address (24 or 16 in the above example)? Is there a simple way to understand how to set the number after the slash?
|
An IP address like this What's the last number mean in the IP address (24 or 16 in the above example)? Is there a simple way to understand how to set the number after the slash? |
||||
|
|
|
An IP address is just a number. One that - as I'm sure you know - uniquely identifies a computer on a network. But still just a number, which we will get back to. Let's take an example: 192.168.1.105 You'll notice that the IP address is broken up into four parts: {192, 168, 1, 105}. And you probably also know that each of those parts can have a value from 0-255. It turns out that the numbers 0..255 can be represented in 8 bits. So an IP address consists of four sections, and each section can have a value 0..255. This means that each section can be represented with 8 bits. With four of these sections, you have (4 sections) * (8 bits/section) = 32 bits. To represent the entire IP address. Remember when we said that an IP address is just a number? Well, an IP is a 32-bit integer. For convenience, we write it as "192.168.1.105" but you could easily write it as In binary, all 32 binary digits in their glory: Okay. So now your question: what does 192.168.1.105/24 mean? It means that the first 24 bits of the IP address are the "subnet". It means that the first 24 bits of items on your network are the same. As you add new computers, you only have 8 bits remaining (remember, an IP is a 32-bit number) for addressing new devices. Because you have 8 bits worth of addressability, in this example, you may only add 255 devices.
Let's break apart the subnet:
See? Same example with a /16 subnet: 192.168.1.105/16
So in this case, every IP address begins with 192.168 - the first 16 bits of the IP address. And then we have 16 bits remaining for new devices. 16 bits = 65535 devices. So if you have a small subnet, you have a larger portion of internet addresses. MIT owns a /8 subnet - that is, have a block IP addresses and they can add 2^24 devices. Very cool! |
|||||||||||
|
|
Those aren't ip addresses per se, they are ranges. The last number (which, as psusi mentions is called a subnet mask) indicates the number of relevant bits: |
|||||
|
|
It is the subnet mask for the network. In other words, it says how large the network is. A /24 is a class C network, having 256 addresses and a subnet mask of 255.255.255.0. A /16 is class B, with a subnet mask of 255.255.0.0. |
|||||||||||
|