cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1951
Views
0
Helpful
3
Replies

Question about subnetting

vinsanity02
Level 1
Level 1

Hi Network Engrs,

I've always wanted to ask you this question. Based from the table below        

I pick one. Class A subnet 255.255.255.0 has 65536 effective subnets, while Class B 255.255.255.0 has 256 subnets.

So, how did it come up with these number of subnets? What's the formula?

The number of hosts is the same which is 254 = (2^8) - 2, where 8 is the number of zeroes 11111111.11111111.11111111.00000000 and

2 = 1 is for network ID + 1 for broadcast address. Just trying to get very familiar with IP subnetting. Thanks a lot :-)

Class A
Number of
Bits Borrowed            Subnet         Effective     Number of      Number of Subnet
from Host Portion        Mask           Subnets       Hosts/Subnet   Mask Bits
-------               ---------------       ---------     -------------  -------------
  1                    255.128.0.0            2       8388606           /9
  2                    255.192.0.0            4       4194302           /10
  3                    255.224.0.0            8       2097150           /11
  4                    255.240.0.0           16       1048574           /12
  5                    255.248.0.0           32        524286           /13
  6                    255.252.0.0           64        262142           /14
  7                    255.254.0.0          128        131070           /15
  8                    255.255.0.0          256         65534           /16
  9                    255.255.128.0        512         32766           /17
  10                   255.255.192.0       1024         16382           /18
  11                   255.255.224.0       2048          8190           /19
  12                   255.255.240.0       4096          4094           /20
  13                   255.255.248.0       8192          2046           /21
  14                   255.255.252.0      16384          1022           /22
  15                   255.255.254.0      32768           510           /23
  16                   255.255.255.0      65536           254           /24
  17                   255.255.255.128   131072           126           /25
  18                   255.255.255.192   262144            62           /26
  19                   255.255.255.224   524288            30           /27
  20                   255.255.255.240  1048576            14           /28
  21                   255.255.255.248  2097152             6           /29
  22                   255.255.255.252  4194304             2           /30
  23                   255.255.255.254  8388608             2*          /31

Class B Host/Subnet Table

Class B          Subnet               Effective       Effective    Number of Subnet
 Bits        Mask                 Subnets         Hosts        Mask Bits
-------  ---------------          ---------       ---------    -------------
  1      255.255.128.0                2             32766        /17
  2      255.255.192.0                4             16382        /18
  3      255.255.224.0                8              8190        /19
  4      255.255.240.0               16              4094        /20
  5      255.255.248.0               32              2046        /21
  6      255.255.252.0               64              1022        /22
  7      255.255.254.0              128               510        /23
  8      255.255.255.0              256               254        /24
  9      255.255.255.128            512               126        /25
  10     255.255.255.192           1024                62        /26
  11     255.255.255.224           2048                30        /27
  12     255.255.255.240           4096                14        /28
  13     255.255.255.248               8192                 6        /29
  14     255.255.255.252              16384                 2        /30
  15     255.255.255.254          32768                 2*       /31

Class C Host/Subnet Table

Class C      Subnet       Effective  Effective  Number of Subnet
 Bits        Mask         Subnets     Hosts     Mask Bits
-------  ---------------  ---------  ---------  --------------
  1      255.255.255.128      2        126        /25
  2      255.255.255.192      4         62        /26
  3      255.255.255.224      8         30        /27
  4      255.255.255.240     16         14        /28
  5      255.255.255.248     32          6        /29
  6      255.255.255.252     64          2        /30
  7      255.255.255.254    128          2*       /31
1 Accepted Solution

Accepted Solutions

Guru Mysoruu
Level 1
Level 1

Hi vinsanity,

IPv4 Ip address is 32 bit Binary address and which contains four octets.

so each octet is represented by eight bits



8 bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit


1286432168421
Class A0-12701111111
Class B128-19110111111
Class C192-22411011111

In  Classfull,Class A network i.e 8 bit value 128 will never become one.In  any other bit it may be 0 or one.at most it can have a value of  127.thats how classfull network defined.

Class A Network 10.0.0.0 can be represented has

10= (128*0)+(64*0)+(32*0)+(16*0)+(8*1)+(4*0)+(2*1)+(1*0)

   =8+2=10

0=(128*0)+(64*0)+(32*0)+(16*0)+(8*0)+(4*0)+(2*0)+(1*0)

  =0

0=(128*0)+(64*0)+(32*0)+(16*0)+(8*0)+(4*0)+(2*0)+(1*0)

=0

0=(128*0)+(64*0)+(32*0)+(16*0)+(8*0)+(4*0)+(2*0)+(1*0)

  =0

For class A Subnet mask

255= (128*1)+(64*1)+(32*1)+(16*1)+(8*1)+(4*1)+(2*1)+(1*1)

   =128+64+32+16+8+4+2+1

   =255

0=(128*0)+(64*0)+(32*0)+(16*0)+(8*0)+(4*0)+(2*0)+(1*0)

  =0

0=(128*0)+(64*0)+(32*0)+(16*0)+(8*0)+(4*0)+(2*0)+(1*0)

=0

0=(128*0)+(64*0)+(32*0)+(16*0)+(8*0)+(4*0)+(2*0)+(1*0)

  =0

For class A-It will start from 0-126,subnet will be 255.0.0.0 i.e /8

For Class B it will start from 128-192,subnet will 255.255.0.0.i.e /16

For Class C,it will start from 192-224,subnet will be 255.255.255.0 i.e /24

These are classfull networks.

In Classless network,as per our requirement changes will be done to subnet mask

In your Classfulll screen diagram,you have assigined 20 bits for network and 12 bit for host and for 16 subnets.i.e /20 network

In your classless,you have assigned 24 bit for network and 8 bit for host i.e /24 network

Regards,

Guru

View solution in original post

3 Replies 3

Guru Mysoruu
Level 1
Level 1

Hi vinsanity,

IPv4 Ip address is 32 bit Binary address and which contains four octets.

so each octet is represented by eight bits



8 bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit


1286432168421
Class A0-12701111111
Class B128-19110111111
Class C192-22411011111

In  Classfull,Class A network i.e 8 bit value 128 will never become one.In  any other bit it may be 0 or one.at most it can have a value of  127.thats how classfull network defined.

Class A Network 10.0.0.0 can be represented has

10= (128*0)+(64*0)+(32*0)+(16*0)+(8*1)+(4*0)+(2*1)+(1*0)

   =8+2=10

0=(128*0)+(64*0)+(32*0)+(16*0)+(8*0)+(4*0)+(2*0)+(1*0)

  =0

0=(128*0)+(64*0)+(32*0)+(16*0)+(8*0)+(4*0)+(2*0)+(1*0)

=0

0=(128*0)+(64*0)+(32*0)+(16*0)+(8*0)+(4*0)+(2*0)+(1*0)

  =0

For class A Subnet mask

255= (128*1)+(64*1)+(32*1)+(16*1)+(8*1)+(4*1)+(2*1)+(1*1)

   =128+64+32+16+8+4+2+1

   =255

0=(128*0)+(64*0)+(32*0)+(16*0)+(8*0)+(4*0)+(2*0)+(1*0)

  =0

0=(128*0)+(64*0)+(32*0)+(16*0)+(8*0)+(4*0)+(2*0)+(1*0)

=0

0=(128*0)+(64*0)+(32*0)+(16*0)+(8*0)+(4*0)+(2*0)+(1*0)

  =0

For class A-It will start from 0-126,subnet will be 255.0.0.0 i.e /8

For Class B it will start from 128-192,subnet will 255.255.0.0.i.e /16

For Class C,it will start from 192-224,subnet will be 255.255.255.0 i.e /24

These are classfull networks.

In Classless network,as per our requirement changes will be done to subnet mask

In your Classfulll screen diagram,you have assigined 20 bits for network and 12 bit for host and for 16 subnets.i.e /20 network

In your classless,you have assigned 24 bit for network and 8 bit for host i.e /24 network

Regards,

Guru

So I've finally come to understand it...

Class A

255.255.255.0

number of subnets = (2^16) = 65536

number of hosts = (2^8) - 2 = 254

255.255.255.128

number of subnets = (2^17) = 131072

number of hosts = (2^7) - 2 = 126

---------------------------------------------------------------

Class B

255.255.255.0

number of subnets = (2^8) = 256

number of hosts = (2^8) - 2 = 254

255.255.255.128

number of subnets = (2^9) = 512

number of hosts = (2^7) - 2 = 126

---------------------------------------------------------------

Class C

255.255.255.0

number of subnets = (2^0) = 1

number of hosts = (2^8) - 2 = 254

255.255.255.128

number of subnets = (2^1) = 2

number of hosts = (2^7) - 2 = 126

---------------------------------------------------------------

Number of 1's represent the subnet. Number of 0's represent the hosts.

Class A begins on second and third octet.

Class B on third and fourth octet, and

Class C on fourth octet.

---------------------------------------------------------------

Class A 255.255.255.0 = 11111111.11111111.11111111.00000000 = (2^16) = 65536 subnets, AND (2^8) - 2 = 254 hosts.

Class B 255.255.255.0 = 11111111.11111111.11111111.00000000 = (2^8) = 256 subnets, AND (2^8) - 2 = 254 hosts.

Class C 255.255.255.0 = 11111111.11111111.11111111.00000000 = (2^0) = 1 subnet, AND (2^8) - 2 = 254 hosts.

...whew!! Thank you very much, Guru=)

Another one, I guess we all have to follow the following IP address spaces when assigning IP addresses to our private network. Is that right?

Private IP Address Range:
Class A = 10.0.0.0 through 10.255.255.255
Class B = 172.16.0.0 through 172.31.255.255
Class C = 192.168.0.0 through 192.168.255.255

-------------------------------------------------------------------------------
Public IP Address Range:
Class A = 1.0.0.0 to 126.0.0.0

Internal loopback/testing = 127.0.0.0

Class B = 128.0.0.0 to 191.255.0.0
APIPA (reserved) = 169.254.0.0 to 169.254.255.255
Class C = 192.0.1.0 to 223.255.255.0

Class D (Multicast) = 224.0.0.0 to 239.255.255.255

Class E = Reserved for future use and includes the range of addresses with a first octet from 240 to 255

Review Cisco Networking for a $25 gift card