E
E
Egor2015-10-30 15:40:19
Computer networks
Egor, 2015-10-30 15:40:19

Why the smaller the subnet mask, the more available addresses?

Why is it that the smaller the subnet mask, the more addresses are available on the network? For example: at 127.0.0.0/24, from 127.0.0.1 to 127.0.0.254 is available, and at 127.0.0.0/16, from 127.0.0.1 to 127.0.255.254 is available. Why is that?
Thank you very much in advance!

Answer the question

In order to leave comments, you need to log in

7 answer(s)
O
Oleg Tsilyurik, 2015-10-30
Repiev @ega22a

Why,

If you are not going to understand in detail how the IP network is arranged, then just take it on faith, as you were prompted here ... do not bother further.
If you plan to understand in detail how an IP network works, then short wiki stories will only create a false, distorted idea of ​​\u200b\u200bthat - then take it and understand it in its entirety. And the world's best guide on that is here: PS You can take a very brief look here: Network Programming in Linux .

A
Anton Nagaets, 2015-10-30
@gr1mm3r

I'll just leave this here. Subnet mask
and I advise you to look towards the binary number system.

K
Kirill, 2015-10-30
@GoooodBoy

Well, read the theory! Why such questions!
https://ru.wikipedia.org/wiki/Subnet
mask habrahabr.ru/post/129664

M
Maksim, 2015-10-30
@chumayu

As you were told earlier - break your keyboard.
And in short:
the IP address is 32 bits. xxxxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx
The mask is a kind of line between the network address and the address reserved for users.
for example, the mask /24 - 11111111.11111111.11111111 - the remaining network address, 00000000 - for users.
128+64+32+16+8+4+2+1 = 255
1 1 1 1 1 1 1 1 = 8
128+64+32+16+8+4+2+1 = 255
1 1 1 1 1 1 1 1 = 8 128 +64+32+16+ 8
+4+2+1 = 255

S
Stanislav Makarov, 2015-10-30
@Nipheris

It's pretty simple: the subnet mask breaks the entire IP address into two fragments: the network (subnet) address, and the machine address. Those. here you have 4 bytes of the address:
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
X is a binary digit, 0 or 1.
When you put a /14 mask, you put a conditional separator like this:
XXXX XXXX XXXX XX | XX XXXX XXXX XXXX XXXX
The numbers to the left of it are the subnet address, to the right are the machine address. Obviously, with a fixed address length of 4 bytes for IPv4, the more numbers you give under the "subnet" (i.e. on the left), the less will remain under the "machine", i.e. on right. Fewer numbers means fewer possible different values ​​that they can write down.

C
Cool Admin, 2015-10-30
@ifaustrue

I see that there are already a lot of answers, but I will also write.
Mask - that's why it's called that, because by imposing it on the address you get the network and host addresses divided in a certain proportion. The mask consists of a continuous set of zeros and ones, i.e. this is essentially a 32-bit number (which can be represented in different ways), written, in your case, as the number of ones.
Those. we take any address presented in binary form (and a mask): 11000000.10101000.00000000
.00000001 =
192.168.0.1
So it turns out that the shorter the section with ones (the smaller their number), the more nodes there can be in the address, and the fewer subnets.

V
Victor Bo, 2015-11-03
@victorbo

because subtraction is used in the calculation - the more you subtract, the less remains

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question