PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Noms de domaine > comp.protocols.tcp-ip > why AND-ing?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.protocols.tcp-ip TCP and IP network protocols.

why AND-ing?

Réponse
 
LinkBack Outils de la discussion
Vieux 05/06/2006, 12h18   #1
new guy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut why AND-ing?

I find AND-ing a confusing concept in subnetting and I was wondering if it's
necessary or not. To find the subnet where a host address lives on, we
simply turn off all host bits and find the subnets as multiple of last
subnet bit. The subnet where our host lives on is the subnet where the host
range includes our host, right?

Example: Host address 10.17.2.14/18
Class A, so turning off all hosts bits will give us the subnets as multiple
of 64. That is, 10.17.0.0; 10.17.64.0 etc.
Since in 10.17.2.14 number 2 is in the range of the subnet 0 (0 to 64) then
the answer is: Our host lives on subnet 0: 10.17.0.0

new guy



  Réponse avec citation
Vieux 05/06/2006, 15h39   #2
briggs@encompasserve.org
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: why AND-ing?

In article <iqUgg.242006$WI1.6924@pd7tw2no>, "new guy" <new guy@now.anonymous> writes:
> I find AND-ing a confusing concept in subnetting and I was wondering if it's
> necessary or not. To find the subnet where a host address lives on, we
> simply turn off all host bits and find the subnets as multiple of last
> subnet bit. The subnet where our host lives on is the subnet where the host
> range includes our host, right?


Yes. To find the subnet our host lives on, you round the host address
down to the next lower subnet boundary.

> Example: Host address 10.17.2.14/18
> Class A, so turning off all hosts bits will give us the subnets as multiple
> of 64. That is, 10.17.0.0; 10.17.64.0 etc.
> Since in 10.17.2.14 number 2 is in the range of the subnet 0 (0 to 64) then
> the answer is: Our host lives on subnet 0: 10.17.0.0


You choose to do this by iterating through the subnet boundaries with
repeated addition and comparing at each step to the target host address.

A computer does this with a logical AND.

Personally, I use a mental lookup table together with some ad hoc
simplification rules. ["18 is two narrower than 16, so we're talking
about 1/4 of a 'B', that puts the boundaries at 0, 64, 128 and 192,
and the relevant octet is the third one. Our host is at 2, so the net
is at 0, making the net address 10.17.0.0"].

Someone else may whip out a calculator, divide by the subnet size,
truncate to an integer and multiply by the subnet size.

Another person may browse to a web page with a subnet calculator.


They're all equivalent techniques and yield the same result.


If your approach is easy for you to use, understand and rely upon
then it is the right approach for you.
  Réponse avec citation
Vieux 06/06/2006, 01h29   #3
Barry Margolin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: why AND-ing?

In article <iqUgg.242006$WI1.6924@pd7tw2no>,
"new guy" <new guy@now.anonymous> wrote:

> I find AND-ing a confusing concept in subnetting and I was wondering if it's
> necessary or not. To find the subnet where a host address lives on, we
> simply turn off all host bits and find the subnets as multiple of last
> subnet bit. The subnet where our host lives on is the subnet where the host
> range includes our host, right?
>
> Example: Host address 10.17.2.14/18
> Class A, so turning off all hosts bits will give us the subnets as multiple
> of 64. That is, 10.17.0.0; 10.17.64.0 etc.
> Since in 10.17.2.14 number 2 is in the range of the subnet 0 (0 to 64) then
> the answer is: Our host lives on subnet 0: 10.17.0.0
>
> new guy


ANDing is used because the original subnetting specification used a bit
mask, not a prefix length. So a subnet mask could be 255.0.252.64,
meaning that the subnet consisted of bits 0-7, 16-21, and 25. As a
result, a subnet would not necessarily have a contiguous range of
addresses, and they aren't just simple multiples.

Over time we realized that this generality was not useful, and CIDR,
variable-length subnetting, and aggregation depend on the simpler notion
of prefix lengths rather than subnet masks. But the underlying
implementations still make heavy use of ANDing, both for backward
compatibility and because it's an easier operation for computers to
perform.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
  Réponse avec citation
Vieux 06/06/2006, 06h43   #4
new guy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: why AND-ing?


"Barry Margolin" <barmar@alum.mit.edu> wrote in message
news:barmar-F2A9A6.20295305062006@comcast.dca.giganews.com...
> In article <iqUgg.242006$WI1.6924@pd7tw2no>,
> "new guy" <new guy@now.anonymous> wrote:
>
>> I find AND-ing a confusing concept in subnetting and I was wondering if
>> it's
>> necessary or not. To find the subnet where a host address lives on, we
>> simply turn off all host bits and find the subnets as multiple of last
>> subnet bit. The subnet where our host lives on is the subnet where the
>> host
>> range includes our host, right?
>>
>> Example: Host address 10.17.2.14/18
>> Class A, so turning off all hosts bits will give us the subnets as
>> multiple
>> of 64. That is, 10.17.0.0; 10.17.64.0 etc.
>> Since in 10.17.2.14 number 2 is in the range of the subnet 0 (0 to 64)
>> then
>> the answer is: Our host lives on subnet 0: 10.17.0.0
>>
>> new guy

>
> ANDing is used because the original subnetting specification used a bit
> mask, not a prefix length. So a subnet mask could be 255.0.252.64,
> meaning that the subnet consisted of bits 0-7, 16-21, and 25. As a
> result, a subnet would not necessarily have a contiguous range of
> addresses, and they aren't just simple multiples.
>
> Over time we realized that this generality was not useful, and CIDR,
> variable-length subnetting, and aggregation depend on the simpler notion
> of prefix lengths rather than subnet masks. But the underlying
> implementations still make heavy use of ANDing, both for backward
> compatibility and because it's an easier operation for computers to
> perform.


Computers do not understand subnetting


  Réponse avec citation
Vieux 16/06/2006, 11h34   #5
q_q_anonymous@yahoo.co.uk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: why AND-ing?


Barry Margolin wrote:
> In article <iqUgg.242006$WI1.6924@pd7tw2no>,
> "new guy" <new guy@now.anonymous> wrote:
>
> > I find AND-ing a confusing concept in subnetting and I was wondering if it's
> > necessary or not. To find the subnet where a host address lives on, we
> > simply turn off all host bits and find the subnets as multiple of last
> > subnet bit. The subnet where our host lives on is the subnet where the host
> > range includes our host, right?
> >
> > Example: Host address 10.17.2.14/18
> > Class A, so turning off all hosts bits will give us the subnets as multiple
> > of 64. That is, 10.17.0.0; 10.17.64.0 etc.
> > Since in 10.17.2.14 number 2 is in the range of the subnet 0 (0 to 64) then
> > the answer is: Our host lives on subnet 0: 10.17.0.0
> >
> > new guy

>
> ANDing is used because the original subnetting specification used a bit
> mask, not a prefix length. So a subnet mask could be 255.0.252.64,
> meaning that the subnet consisted of bits 0-7, 16-21, and 25. As a
> result, a subnet would not necessarily have a contiguous range of
> addresses, and they aren't just simple multiples.
>
> Over time we realized that this generality was not useful, and CIDR,
> variable-length subnetting, and aggregation depend on the simpler notion
> of prefix lengths rather than subnet masks. But the underlying
> implementations still make heavy use of ANDing, both for backward
> compatibility and because it's an easier operation for computers to
> perform.
>
> --
> Barry Margolin, barmar@alum.mit.edu


what's the alternative to ANDing?

did you have in mind Right Shift k times and test if equal. ?

  Réponse avec citation
Vieux 17/06/2006, 06h50   #6
Walter Roberson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: why AND-ing?

In article <1150454067.336232.198160@g10g2000cwb.googlegroups .com>,
q_q_anonymous@yahoo.co.uk <q_q_anonymous@yahoo.co.uk> wrote:

>Barry Margolin wrote:


>> ANDing is used because the original subnetting specification used a bit
>> mask, not a prefix length.


>> Over time we realized that this generality was not useful, and CIDR,
>> variable-length subnetting, and aggregation depend on the simpler notion
>> of prefix lengths rather than subnet masks. But the underlying
>> implementations still make heavy use of ANDing, both for backward
>> compatibility and because it's an easier operation for computers to
>> perform.


>what's the alternative to ANDing?


>did you have in mind Right Shift k times and test if equal. ?


A number of architectures support direct bitfield examination
and manipulation -- sometimes only of 1 bit, and sometimes
of multiple consequative bits.

It is true, though, that on a number of architectures that support
setting bits, that the internal implementation is to read an
entire unit, manipulate the bits (perhaps using a mask...),
and then write out the entire unit again.

[The size of the unit depends upon the architecture -- there are
architectures that do all byte-level (well, octet-level) operations in
this manner, that turning out to be less complex (and so cheaper) than
writing a complete set of byte-level instruction microcodes. e.g., if
the processor pipelines, the extra overhead of being able to pipeline
bytes instead of words could end up slowing down everything, so
Yes, handing bytes internally as words can end up being faster
than keeping their byte-identity distinct in the internals
of the processor.]
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 19h24.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,15498 seconds with 14 queries