Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many Number of Networks for class B and class C?

Tags:

In the tutorial on ip4 adress classes:
http://www.tutorialspoint.com/ipv4/ipv4_address_classes.htm

Class B has 16384 (2**14) Network addresses and 65534 (2**16-2) Host addresses.
Class C gives 2097152 (2**21)Network addresses and 254 (2**8-2) Host addresses. enter image description here

In the tutorial on ip4 adress classes:
http://www.vlsm-calc.net/ipclasses.php

Class B has 163842(2**14-2)Network addresses and 65534 (2**16-2) Host addresses.

Class C gives 20971520(2**21-2) Network addresses and 254 (2**8-2) Host addresses.
enter image description here Both of them for class A ,the number of networks is 126 (2**7 – 2).
Which number of networks on class B and class C is correct?
For class B , the number of networks is (2**14-2) or (2**14)?
For class C , the number of networks is (2**21-2) or (2**21)?

like image 776
showkey Avatar asked May 29 '16 03:05

showkey


People also ask

How many networks are there in Class B?

Class B has 16384 (214) Network addresses and 65534 (216-2) Host addresses.

How many networks are in a class C?

A Class C address consists of a 24-bit network address and an 8-bit local host address. The first three bits in the network address indicate the network class, leaving 21 bits for the actual network address. Therefore, there are 2,097,152 possible network addresses and 256 possible local host addresses.

How many number of networks are there in class B IP address?

Class B IP addresses are used for medium and large-sized networks in enterprises and organizations. They support up to 65,000 hosts on 16,000 individual networks. Class C addresses are most common and used in small business and home networks. These support up to 256 hosts on each of 2 million networks.

What is the maximum number of networks in Class C?

Class C Networks (/24 Prefixes) It is a 21-bit network number with 8-bit host number. This class defines a maximum of 2,097,152 (2 21 ) /24 networks.


1 Answers

Rather than point to a reference, I'm going to enumerate them all, and then use mathematics:

  1. Class A addresses go from 0.X.X.X to 127.X.X.X - a total of (127-0+1)=128 networks.
    [Note that 127.X.X.X is reserved as the LocalHost network - most assume that means only 127.0.0.1, but it's actually all of them.]
    • With the .X.X.X, each network cannot use .0.0.0 or .255.255.255, so that's the -2 in the Host count.
  2. Class B addresses go from 128.0.X.X to 191.255.X.X - a total of (191-128+1) * (255-0+1) = 16,384 networks.
    • With the .X.X, each network cannot use .0.0 or .255.255, so that's the -2 in the Host count.
  3. Class C addresses go from 192.0.0.X to 223.255.255.X - a total of (223-192+1) * (255-0+1) * (255-0+1) = 2,097,152 networks.
    • With the .X, each network cannot use .0 or .255, so that's the -2 in the Host count.

In short, neither source is correct if they both say that there are 126 Class A networks.

As a final example: in the old "Classful" networks neither 0.0.0.0 nor 0.255.255.255 is a valid Host address, but any of 0.0.0.1, 0.0.0.255, 0.0.1.0 and 0.255.255.254 are.

[If you want a source, how about https://en.wikipedia.org/wiki/Classful_network#Introduction_of_address_classes]

like image 148
John Burger Avatar answered Nov 14 '22 05:11

John Burger