ip address increment

Status
Not open for further replies.

Celtic_Tiger

Baseband Member
Messages
29
Good day all

Im currently studying for an exam which requires a knowledge of ip addressing and although I can get the correct answers from the exercises I still feel I need to be aware of how eg a class a ip address can yield 16 million addresses. In the books they just say it yields x addresses but dont show the pattern.

so does it go like (class a)

1.0.0.0
1.0.0.1
1.0.0.2
1.0.0.3
skip to end.....1.0.0.255

1.0.1.0
1.0.1.2
1.0.1.3
skip to end.....1.0.1.255

so thats 1.0.0.x yields 256 addresses
range 1.0.2.x yields 256 x 256 = 65,536 addresses

skip to .....1.0.2.0

so im confused, can some one show me the pattern used and calculations to arrive at the 16,777,216 addresses of a class a address. I need to see it visually to understand it.

thanks
 
If we look at the range of 1.0.0.0 to 1.255.255.255
each segment gives you 256 possibilities. Since there are 3 segments:
256x256x256 = 16,777,216
or 256^3
 
Hefe is absolutely correct, and Celtic, you are correct with your pattern :

1.0.0.0
1.0.0.1
1.0.0.2
1.0.0.3
skip to end.....1.0.0.255

1.0.1.0
1.0.1.2
1.0.1.3
skip to end.....1.0.1.255

You increment to the next subnet up numerically. So 1.0.1.255 would next increment to 1.0.2.0 and so on. But Hefe consolidated it all perfectly, I wanted to add my part to assure you that your incrementing pattern is correct.
 
I thought I would add in my two cents. While, Hefe and oldskool are indeed correct, we need to remember that ip addresses are base 2 math. An easier way to look at it, from my perspective.

Each ip address has 32 bits, at least in IPv4.

For Class A we have the first 8 bits dedicated to the network portion of the address, while the other 24 are used for the hosts. N represents network, H for for hosts.

Class A
N.H.H.H

Class B
N.N.H.H

Class C
N.N.N.H

For any class all you need to do to determine the highest amount of hosts, is to count the number of host bits, and plug it into this forumla.

2 to the X power = number of hosts. Whereas X equals the number of host bits.

Class A
2 ^ 24 = 16,776,216

Class B
2 ^ 16 = 65.536

Class C
2 ^ 8 = 256

One other thing to keep in mind is that two address are not usable, one being the overrall network address, and the other reserved for broadcasts. To get the most accurate amount of hosts usable this is the true formula:

2^x - 2 = number of usable hosts.
 
Status
Not open for further replies.
Back
Top Bottom