Date: Wed, 27 Aug 2003 16:41:28 -0300 From: "Daniel C. Sobral" <dcs@tcoip.com.br> To: Christoffer Pio <cp@cvt.dk> Cc: freebsd-net@freebsd.org Subject: Re: subnetting C class into /26 /25 /26, why can this be done? Message-ID: <3F4D0968.5050800@tcoip.com.br> In-Reply-To: <3F4CBA6A.5AA7DEB0@cvt.dk> References: <3F4CBA6A.5AA7DEB0@cvt.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
Christoffer Pio wrote: > Is it not possible to subnet a C class into 3 nets, like > > 0-63 > 64-191 <-- Offending network (?) > 192-255 No. > If so, why is this? Because it there is no mask that will fit. In binary, you have: 0 0000 0000 63 0011 1111 64 0100 0000 127 0111 1111 128 1000 0000 191 1011 1111 192 1100 0000 255 1111 1111 Now, how do masks work? Where there are 1's in a mask, the address is supposed to never change. Where there are 0's, any value is accepted. The problem you have is that between 64 and 191 there is absolutely no digits that won't change (in fact, you can see that the 191 is the very opposite of 64 in every bit). So any network that includes both 64 and 191 will necessarily include everything from 0 to 255. Mind you /25 and /26 are just a simplification of the way masks are almost always used. Usually, the left side of the mask is all 1's up to a certain point, and from there to the end there are just 0's. It is _possible_ to use masks in a different way, but I have only seen such configurations as a result of errors. For example, it would be theoretically possible to have a network composed of 0-63 and 128-191. Fortunately, I haven't seen anyone do that intentionally. :-) So /25 means that the first 25 bits of the 32 bits that compose an address are 1's, and the remaining are 0's. (and anyone picking on my usage of "first", please relate it to how people write numbers in oriental languages and arabic -- no sense in setting the bar too low :) -- Daniel C. Sobral (8-DCS) Gerencia de Operacoes Divisao de Comunicacao de Dados Coordenacao de Seguranca VIVO Centro Oeste Norte Fones: 55-61-313-7654/Cel: 55-61-9618-0904 E-mail: Daniel.Capo@tco.net.br Daniel.Sobral@tcoip.com.br dcs@tcoip.com.br Outros: dcs@newsguy.com dcs@freebsd.org capo@notorious.bsdconspiracy.net We Klingons believe as you do -- the sick should die. Only the strong should live. -- Kras, "Friday's Child", stardate 3497.2
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F4D0968.5050800>