What's the last number in this ip address?

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 0xC0A80169

In binary, all 32 binary digits in their glory: 11000000101010000000000101101001

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.

110000001010100000000001 01101001
------------------------
(subnet)

Let's break apart the subnet:

11000000 10101000 00000001 = 192 168 1

See?

Same example with a /16 subnet: 192.168.1.105/16

1100000010101000 0000000101101001
----------------
(subnet)

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: /16 means the network includes all numbers starting with the first 16 bits of the specified ip (223.248 in your example). A /8 is a class A network with 2^24 addresses, /16 is class B with 2^16 (65536), and a /24 is a class C with 2^8 = 256 addresses. You most often see this in local networks: 192.168.0.0/24 (usually used in small home networks) and 10.0.0.0/16, usually seen in larger company intranets. You can see other reserved ranges listed in subnet notation and a range list, and the total number of doamins on Wikipedia.


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.

Tags:

Ip

Networking