IP addresses

Status
Not open for further replies.

xStevey_Bx

Baseband Member
Messages
33
I have a university project that I need to work on and part of it will require me assigning users a specific avatar when they log into the site.

To shake things up a little and remove the totally random aspect I want to set up ranges of IP addresses which each correspond to one of the avatars. This means that users from different areas will have a higher probability of recieving an avatar than users in another.

There are 4,200,000,000 odd Ip4 addresses and I need to split them up into 1000 ranges. How do Ip addresses incriment?

They start at 0.0.0.0, but is the next one 0.0.0.1?

What happens once the address reaches 0.0.0.255? Is the next one 0.0.1.0?

Any help or suggestions would be greatly appreciated!!
 
each octet actually contains 8 bits. in binary, this can be represented as 10101010.10101010.10101010.10101010

you're on the right track. you also need to account for network addresses and broadcast addresses as well.

the first address (0.0.0.0) is the network address and the last address (0.0.0.255) is the broadcast address. Number of host per network is 2^N - 2 , where n is the number of host bits.

For network, 192.168.0.0/24, the calcualtion is 2^8-2. should be 253

You are going to need to account for the subnet mask as well. The subnet mask is what separtates the host bits from the network bits.

Don't forget to exclude the private addresses.

reference
IP address - Wikipedia, the free encyclopedia




there is no method to this madness. i may be back later. I suggest researching subnetting a network.

IP addresses and Subnetting

good read on subnetting
 
In terms of what the OP wanted the addressess for, he doesn't really have to be concerned with subnetting/broadcast-addresses/network-addressess.
If he worried about that his job would be massive! A lot of networks don't have the same masks as eachother, e.g. different network and bc address.

to the OP: All you need to know is yes, you were right. That's how they increment. And Iuno, there might be a site somewhere which gives a rundown of block ip addresses in different areas of the world. That'd make your job easier.
 
Status
Not open for further replies.
Back
Top Bottom