Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Nov 2008 09:39:07 -0800
From:      George Davidovich <freebsd@optimis.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: inet hosts question
Message-ID:  <20081114173907.GA98636@marvin.optimis.net>
In-Reply-To: <491DAA89.80808@infracaninophile.co.uk>
References:  <000001c94666$5eb02360$1c106a20$@com> <491D9699.5000103@unsane.co.uk> <491DAA89.80808@infracaninophile.co.uk>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Fri, Nov 14, 2008, Matthew Seaman wrote:
> Vincent Hoffman wrote:
> > Gary Hartl wrote:
> 
> > > I thought I could do it by using the /class ie /32 for class c but
> > > i can't remember what the class delegation is for that size of
> > > pool, I think it is a class B.
> 
> > 192.168.0.0/16 for your example.  and yes this is a class B (not all
> > /16s are though.)
> >  
> > the /x notation is called CIDR (classless interdomain routing.)
> > http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing
> 
> Class C surely?  192.168.0.0/16 is the RFC1918 Class C reserved
> range of 256 /24 networks.
> 
> Yes, Class B networks were /16s, but the A, B, C... classification is
> derived from the number of leading 1's in the binary representation of
> the first octet of the address, not the netmask.  Thus
> 
> Binary:                 Decimal:    Class:  Used for:
> -----------------------------------------------------------------
> 0000 0000 -- 0111 1111  (0   - 127) Class A /8 Networks
> 1000 0000 -- 1011 1111  (128 - 191) Class B /16 Networks
> 1100 0000 -- 1101 1111  (192 - 223) Class C /24 Networks
> 1110 0000 -- 1110 1111  (224 - 239) Class D Multicast
> 1111 0111 -- 1111 1111  (240 - 255) Class E Reserved, experimental

As a suggestion to the OP, installing the ipcalc port might help make
things more understandable, or otherwise facilitate learning[1] about
networking generally. 

The output is optionally coloured, so the first three bits of the
Network address, for example, would appear in red to serve as a reminder
that an address beginning with 110 does indeed define it as a Class C
address.

% ipcalc 192.168.0.0
Address:   192.168.0.0          11000000.10101000.00000000. 00000000
Netmask:   255.255.255.0 = 24   11111111.11111111.11111111. 00000000
Wildcard:  0.0.0.255            00000000.00000000.00000000. 11111111
=>
Network:   192.168.0.0/24       11000000.10101000.00000000. 00000000
HostMin:   192.168.0.1          11000000.10101000.00000000. 00000001
HostMax:   192.168.0.254        11000000.10101000.00000000. 11111110
Broadcast: 192.168.0.255        11000000.10101000.00000000. 11111111
Hosts/Net: 254                   Class C, Private Internet

-----------
1.  Handy utilities in conjunction with a requisite amount of
    laziness may be considered an adequate substitute.

-- 
George



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20081114173907.GA98636>