Subnetting... Il Ritorno

Tutto ciò che ha a che fare con le reti

Moderatore: Federico.Lagni

Rispondi
Avatar utente
greybear
n00b
Messaggi: 11
Iscritto il: ven 06 ott , 2006 7:50 pm
Località: roma
Contatta:

Ciao a tutti,

ho letto il documento "Indirizzi IP, classi e Subnetting" che è molto interessante, ma quello che mi chiedo è:

se io prendo due bit per creare le subnetting, ho secondo l'articolo, 2^2-2=2 subnetting "valide". Se faccio il calcolo con un subnetting calculator, me ne dd quattro (come mi aspetterei) ma mi avverte che per certi esami non vengono ritenute valide sutte le sottoreti.

La mia domanda (da n00b :? ) è: Perchè non sono tutte valide? Quale è la motivazione teorica/reale per questo?

Grazie in anticipo,
grey
[Dj][DMX]
Coamministratore
Messaggi: 428
Iscritto il: mer 24 nov , 2004 12:42 am
Località: Udine

1 è di network (il primo) e un'altro è di broadcast (l'ultimo)!
Io non so se Dio esiste, ma se esiste spero abbia una buona scusa!
Piergiorgio Welby
Avatar utente
cisketto
Cisco pathologically enlightened user
Messaggi: 178
Iscritto il: mar 20 dic , 2005 12:02 pm
Località: Milano

Non ho capito bene cosa intendi ma ti faccio un esempio....
se la tua rete è:

192.168.0.0 / 252

vuole dire che usi gli ultimi 2 ip e, quindi, 4 IP:

192.168.0.0
192.168.0.1
192.168.0.2
192.168.0.3

di cui:

il .0 è l'indirizzo della rete
il .1 è utilizzabile
il .2 è utilizzabile
il .3 è il broadcast

ovviamente la tua subnet successiva sarebbe:

192.168.0.4/252 e così via...

Ciao,
Cisketto!
Avatar utente
greybear
n00b
Messaggi: 11
Iscritto il: ven 06 ott , 2006 7:50 pm
Località: roma
Contatta:

Effettivamente non sono stato molto chiaro, per cui riporto il pezzo di documento a cui faccio riferimento:
http://www.ciscoforums.it/viewtopic.php?p=16522#16522

.........................
Determinare il numero di sottoreti necessarie.
E' necessario tenere presente che il numero di subnet che si possono creare è dato da 2^x-2
dove x è rappresentato dai bit presi in prestito dalla parte host dell'indirizzo ai quali
naturalmente bisogna levare l'indirizzo di broadcast e quello di rete non assegnabili. Esempio:
utilizzando prendendo in prestito 4 bit, sarà possibile creare 14 sottoreti;
........................

Questo vuol dire che se io prendo in prestito 4 bit dall'ultimo ottetto per generare delle subnet, io invece di 2^4=16 ho soltanto 14 subnet (2^4-2). La domanda quindi è: "Che fine fanno le altre due subnet?"

Ciao,
[Dj][DMX]
Coamministratore
Messaggi: 428
Iscritto il: mer 24 nov , 2004 12:42 am
Località: Udine

Allora non ci capiamo: te l'ho detto io, te l'ha detto cisketto e te lo ha detto pure il documento a cui fai riferimento:
greybear ha scritto: ai quali naturalmente bisogna levare l'indirizzo di broadcast e quello di rete non assegnabili.
Io non so se Dio esiste, ma se esiste spero abbia una buona scusa!
Piergiorgio Welby
Avatar utente
greybear
n00b
Messaggi: 11
Iscritto il: ven 06 ott , 2006 7:50 pm
Località: roma
Contatta:

[Dj][DMX] ha scritto:Allora non ci capiamo: te l'ho detto io, te l'ha detto cisketto e te lo ha detto pure il documento a cui fai riferimento:
greybear ha scritto: ai quali naturalmente bisogna levare l'indirizzo di broadcast e quello di rete non assegnabili.
Eh, si.... proprio non ci capiamo.

cisketto ha spiegato una parte del problema, ma non quello che ho chiesto. Siamo tutti daccordo sul fatto che per "ogni subnet" il primo indirizzo della subnet è quello della rete e l'ultimo indirizzo della subnet è quello di broadcasting. Qui proprio non ci piove!

Il documento (stringendo sul punto incriminato) dice:

"...prendendo in prestito 4 bit, sarà possibile creare 14 sottoreti"

Sappiamo tutti che 2 elevato alla quarta ( 2^4 ) fa:

2x2x2x2=16

mi aspetto quindi che se prendo in prestito 4 bit io possa generare 16 sottoreti ognuno con net/broad e cioè:

rete originatrice:
192.168.0.0/24

sottoreti ( /28 ):
1) 192.168.0.0 - 192.168.0.15 (255.255.255.240) .0=net, .15=broad
2) 192.168.0.16 - 192.168.0.31 (255.255.255.240) .16=net, .31=broad
3) 192.168.0.32 - 192.168.0.47
4) 192.168.0.48 - 192.168.0.63
5) 192.168.0.64 - 192.168.0.79
6) 192.168.0.80 - 192.168.0.95
7) 192.168.0.96 - 192.168.0.111
8) 192.168.0.112 - 192.168.0.127 ....
9) 192.168.0.128 - 192.168.0.143
10) 192.168.0.144 - 192.168.0.159
11) 192.168.0.160 - 192.168.0.175
12) 192.168.0.176 - 192.168.0.191
13) 192.168.0.192 - 192.168.0.207
14) 192.168.0.208 - 192.168.0.223
15) 192.168.0.224 - 192.168.0.239
16) 192.168.0.240 - 192.168.0.255 (255.255.255.240) .240=net, .255=broad

Queste sono esattamente "16" sottoreti così come ottenute dal subnet calculator http://www.subnet-calculator.com/

Nel testo sopra citato invece si parla di "14" sottoreti o subnet e questo è confermato in appendice al link sopra citato dove si fa l'esempio limite di una /24 divisa in due sole sottoreti (parlo sempre di classe C).

Riformulo quindi la domanda:

Di queste 16 sottoreti, quali sono le due che mancano e perchè?

Grazie a chi risponderà senza inalberarsi,
greybear




P.S. Riporto anche le note del subnet calculator:
Notes about the Subnet Calculator

1. The subnet calculator implements a classful / classed IP addressing scheme where the following rules are adhered to:

* Class A addresses have their first octet in the range 1 to 126 (binary address begins with 0).

* Class B addresses have their first octet in the range 128 to 191 (binary address begins with 10).

* Class C addresses have their first octet in the range 192 to 223 (binary address begins with 110).

2. The subnet calculator allows the use of a single subnet bit - for example, a class C address with a subnet mask of 255.255.255.128 is permitted.

3. The subnet calculator allows a subnet ID to have its final octet equal to the final octet of its subnet mask - for example, a class C network address of 192.168.0.192 with a subnet mask of 255.255.255.192 is permitted.

The above is generally accepted as being 'normal', however, certification students should keep in mind that, in some certification programs, the final two points are regarded as inacceptible.
Avatar utente
cisketto
Cisco pathologically enlightened user
Messaggi: 178
Iscritto il: mar 20 dic , 2005 12:02 pm
Località: Milano

Per quanto mi riguarda sono tutte e 16 utilizzabili... e la questione potrebbe risolversi così:

16 sottoreti utilizzabili da 14 IP l'una...

Ciao,
Cisketto!
Avatar utente
greybear
n00b
Messaggi: 11
Iscritto il: ven 06 ott , 2006 7:50 pm
Località: roma
Contatta:

Ciao cisketto,

su quello che dici sono daccordo, quello che chiedevo però era un'altra cosa e cioè perchè le sottoreti da sedici diventavano 14 con l'assurdo che una /25 non potesse esistere (2^n-2=2^1-2=0). Fortunatamente qualche volta anche io sono sfiorato dal "fattore C" e sono riuscito a trovare la risposta su Internet.

Praticamente le due sottoreti che non vengono usate sono la prima e l'ultima, quella cioè dove i bit delle sottoreti sono tutti uguali a zero o tutti uguali a uno. Il motivo sembra legato a problemi dei router di vecchia generazione (non so quanto vecchia) che non riuscivano a gestire correttamente queste reti quando erano composte di tutti zero o tutti uno (un po come la net e la broadcast).
Riporto qui sotto il testo:

.....

Subtracting Two From the Number of Hosts Per Subnet and (Possibly) Subnets Per Network

There's one more issue that needs to be explained regarding the split into subnet ID and host ID. We've already seen how in regular “classful” addressing, we must subtract 2 from the number of hosts allowed in each network. This is necessary because two host IDs in each subnet have “special meanings”: the all-zeroes host ID meaning “this network”, and the all-ones host ID which is a broadcast to “all hosts on the network”. These restrictions apply also to each subnet under subnetting too, which is why we must continue to subtract 2 from the number of hosts per subnet. (This is also why dividing the 8 host ID bits of a Class C network into 7 bits for subnet ID and 1 bit for host ID is not just silly, but in fact meaningless: it leaves 21-2=0 hosts per subnet. Not particularly useful.)

There is a similar issue that occurs with the subnet ID as well. When subnetting was originally defined in RFC 950, the standard specifically excluded the use of the all-zeroes and all-ones subnets. This was due to concern that routers might become confused by these cases. A later standard, RFC 1812 (Requirements for IP Version 4 Routers) removed this restriction in 1995. Thus, modern hardware now has no problem with the all-zeroes or all-ones subnets, but some very old hardware may still balk at it.

Key Concept: The number of hosts allowed in each subnet is the binary power of the number of host ID bits remaining after subnetting, less two. The reduction by two occurs because the all-zeroes and all-ones host IDs within each subnet are reserved for two “special meaning” addresses: to refer to the subnetwork itself and its local broadcast address. In some implementations, the number of subnets is also reduced by two because the all-zeroes and all-ones subnet IDs were originally not allowed to be used.



For this reason, you will sometimes see discussions of subnetting that exclude these cases. When that is done, you lose 2 potential subnets: the all-zeroes and all-ones subnets. If you do this, then choosing 1 bit for subnet ID is no longer valid, as it yields 2^1-2=0 subnets. You must choose 2 bits if you need 2 subnets.

Note: In this Guide I assume we are dealing with modern hardware and do not exclude the all-zeroes and all-ones subnets, but I do try to make explicit note of this fact wherever relevant.


Ciao,
grey
Avatar utente
cisketto
Cisco pathologically enlightened user
Messaggi: 178
Iscritto il: mar 20 dic , 2005 12:02 pm
Località: Milano

:?
Io le uso....
Avatar utente
greybear
n00b
Messaggi: 11
Iscritto il: ven 06 ott , 2006 7:50 pm
Località: roma
Contatta:

Anche io ... :roll:
Rispondi