Doubt:mrgreen:
sKGP
Member Posts: 26 ■□□□□□□□□□
in CCNA & CCENT
i was going through the subnetting part and could not understand this thing.
It says the
Number of networks in class A=2^7 - 2 , B=2^14 , C =2^21
Where as i understand the number of hosts per network part clearly
thanks in advance
It says the
Number of networks in class A=2^7 - 2 , B=2^14 , C =2^21
Where as i understand the number of hosts per network part clearly
thanks in advance
Comments
-
apr911 Member Posts: 380 ■■■■□□□□□□A bit of an odd way to describe it but to explain it
Class A networks are /8 networks with a range from 0.x.x.x to 127.x.x.x however, 0 is not a usable address and 127 is used as loopback and thus also not usable. Therefore, there are 128 - 2 available networks available in class A.
2 ^ 7 = 128
Class B networks are /16 networks with a range from 128.0.x.x to 191.255.x.x. All of these networks are usable and therefore there are 16,384 networks available in class B.
2 ^ 14 = 16,384
There is 63 major networks in the first octet
191 - 128 = 63 in binary is 00111111 thus 2^6
and 255 additional networks in the second octet of each primary octet
255 - 0 = 255 in binary is 11111111 thus 2 ^ 8
2 ^ 6 * 2 ^ 8 = 2 ^ 14
Class C networks are /24 networks with a range from 192.0.0.x to 223.255.255.x. Again all of these networks are usable and therefor there are 2,097,152 networks in class C.
2 ^ 21 = 2,097,152
There are 31 major networks in the first octet
223 - 192 = 31 in binary is 11111 thus 2 ^ 5
There are 255 additional networks in the second of each primary octet
255 - 0 = 255 in binary is 11111111 thus 2 ^ 8
There is a further 255 additional networks in the third octet of each higher order (1st and 2nd) octet
255 - 0 = 255 in binary is 11111111 thus 2 ^ 8
2^5 * 2 ^8 * 2^8 = 2 ^ 21
Hope this helps.
For the CCNA the important thing to remember is the leading bits.
Class A has 0 so the first octet of a binary translated class A address will be between 00000000 and 011111111
Class B is 10 so the first octet of a binary translated class B address will be between 10000000 and 10111111
Class C is 110 so the first octet of a binary translated class C address will be between 11000000 and 11011111
Class D (multicast) is 1110 so the first octet of a binary translated class D address will be between 11100000 and 11101111
Class E (experimental) is 1111 so the first octet of a binary translated class E address will be between 11110000 and 11111111Currently Working On: Openstack
2020 Goals: AWS/Azure/GCP Certifications, F5 CSE Cloud, SCRUM, CISSP-ISSMP -
chopsticks Member Posts: 389Another way to see it is:
In page 7 of the RFC 791 (Classful Addressing) [ http://www.ietf.org/rfc/rfc791.txt ] denoted this:
[Addresses are fixed length of four octets (32 bits). An address begins with a network number, followed by local address (called the "rest" field).]
There are three formats or classes of internet addresses:
in class a, the high order bit is zero, the next 7 bits are the network, and the last 24 bits are the local address;
in class b, the high order two bits are one-zero, the next 14 bits are the network and the last 16 bits are the local address;
in class c, the high order three bits are one-one-zero, the next 21 bits are the network and the last 8 bits are the local address.
Class A
The addresses must and are defined by a 0 in their network bits (if it's 1, then it is not a Class A address) :
00000000 . 00000000 . 00000000 . 00000000
and we are left with 7 network bits for use, hence 2^7
Class B
The addresses must and are defined by a 10 in their network bits (if it's 11, then it is not a Class B address) :
10000000 . 00000000 . 00000000 . 00000000
and we are left with 14 network bits for use, hence 2^14
Class C
The addresses must and are defined by a 110 in their network bits (if it's 111, then it is not a Class C address) :
11000000 . 00000000 . 00000000 . 00000000
and we are left with 21 network bits for use, hence 2^21
Additional info
1.
Class A ==> 0 to 127 (0.0.0.0 to 0.255.255.255)
Class B ==> 128 to 191 (128.0.0.0 to 191.255.255.255)
Class C ==> 192 to 223 (192.0.0.0 to 223.255.255.255)
2.
For Class A, it was also stated in the obsoleted RFC 1700, page 4 (now superceded by RFC 5732, page 3 [ RFC 5735 - Special Use IPv4 Addresses ] as referenced by IANA [ IANA IPv4 Address Space Registry ]), both network 0 and network 127 (loopback) are reserved and cannot be used.
So we have:
00000000 - Network 0 (Reserved)
00000001 - Network 1
.
.
.
01111110 - Network 126
01111111 - Network 127 (Reserved - Loopback)
3.
In RFC 1918, page 4 [ RFC 1918 - Address Allocation for Private Internets ]:
The Internet Assigned Numbers Authority (IANA) has reserved the following three blocks of the IP address space for private internets:
10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)