[ale] IP Calculations

Ken Nagorski kenn at refriedgeek.com
Fri Dec 14 16:10:37 EST 2001


OK, there is something you need to know. 

Is it classless or classful? if it is classful then 

0-127 is a class A ( first bit 0)
128-191 is in the clash B (first bits 10 )
192-223 class C ( fist bits 110 )

However mostly the world uses VLSM or CIDR, (classless) In this case you
need to know how many bits are on for subnetting,

Lets say 24 (255.255.255.0) bits are on... Then you have 8 bits left for the
network

You need to calculate 2^8 - 2 = 254 ( this is the amount of useable hosts )

The network will be the lowest IP ( before you minus 2 )
The broadcast is the last IP in the block

Ken

> Chris Fowler wrote:
>> 
>> If someone gives me an IP address in the form of "192.168.4.6" , a
>> string, is there an easy way I can calculate the netmask, and
>> broadcast of that address? 
> 
> With CIDR, no. You need to be told the netmask as well.
> Without CIDR, the top three bits (I think) of the most-
>significant byte tell you the address class, which tells
> you the netmask, but I don't remember exactly how the
> class scheme works; you'll need to google that up
> yourself.
> 
> Cheers,
> 
> -- Joe
> 
> ---
> This message has been sent through the ALE general discussion list. See
> http://www.ale.org/mailing-lists.shtml for more info. Problems should
> be  sent to listmaster at ale dot org.


----------------------------------------------
But I don't want to go among mad people,
Alice remarked.
Oh, you can't help that, said the Cat:
we're all mad here. I'm mad. You're mad.
How do you know I'm mad? said Alice.
You must be, said the Cat,
or you wouldn't have come here.


---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list