How to write in network address/netmask the following address space?

1.8k views Asked by At

I'd like to ask how to write in network address/netmask the following address space:

63.39.191.192 - 63.40.192.223

On paper, I couldn't figure any way of doing it, so I tried using a network address calculator to figure it out.

I inputed the first IP address and started toying with the netmask.

What I couldn't understand is how the first and last usable address varied based on the netmask.

So, here I am, hoping that you might explain to me how the first and last IP address are determined based on the netmask and how to solve that problem.

1

There are 1 answers

0
jwg On

There are two things that someone might mean by a address/netmask pair. One option is something that looks like 192.168.0.1/24. This means that the first 24 bits of an acceptable address must match the given address. This is a common way of expressing subnets, however it is not possible to express your range like this. This means that you will not be able to work out a solution in the calculator you linked, which uses this method as input.

The other way is as a pair of dotted quads. The subnet above would be expressed like this: 192.168.0.1/255.255.255.0. Everything which can be expressed in the first way can be expressed in the second way, but the converse is not true.

To understand how to solve your problem using the second format, you have to know something about binary numbers. Each part of the dotted quad is a number 0-255 and can be expressed as a binary number with eight digits (bits). Thus the whole address is a binary number made up of 32 bits, each of which is either 0 or 1.

A network specification is an address, followed by another 32-bit number, expressed as an address. What the second number means is this: each place in that number where the digit is 1, the first address has to match on that digit. Each place where the digit in the netmask is 0, no match is needed. So you see how matching the first 24 bits is the same as matching 255.255.255.0, which is a 32-bit number made up of 24 1's followed by 8 0's.

You can also see how some netmasks can't be expressed in the first type. Any netmask which isn't one string of repeated 1's followed by the rest 0's, can't be written like this. The reason for the first type is that most real-world networks do have netmasks of this form.

To construct a netmask of the second type, you can work with one byte at a time. The first byte of the address has to match exactly 63. So the address will be 63.x.x.x and the mask will be 255.x.x.x. As before 255, made up of all 1's, means match every bit. The second byte can be either 39 (00100111 in binary), or 40 (00101000). This one can't be expressed as any number plus a set of bits to match. Only the first four bits of the two numbers match, but if we try to do something like 63.39.x.x/255.224.x.x (224 is 11110000), we will match any second byte from 32 to 47. You should check your previous question to see if this is right, however, you should hopefully be able to figure some more out if you understand binary.

If you're not completely sure how binary works, please go away and make sure you really get it before looking into netmasks further. It really will help and it's a very good thing to know about anyway.