New Wiki

 The powers of 2 for 8 binary digits:

  11111111 -  1  = 2**0
  |||||||+-   2  = 2**1
  |||||+ --   4  = 2**2
  ||||+ ---   8  = 2**3
  |||+ ----  16  = 2**4
  ||+ -----  32  = 2**5
  |+ ------  64  = 2**6
  + ------- 128  = 2**7

 Maximum value all bits turned on, 255  (add them up!)

 The first byte (8 bits) of a 'dotted quad' determines the network
 class, when using class.

 In discussion of each Class below, we will symbolize:

 X = bits in the byte unique to a particular network
 N = network bytes
 H = host bytes

 When we discuss the maximum value of a byte,
 we mean all 'X's set to '1'

 Classes cannot overlap.

 Examples showing the reasons for ranges of the different
 network classes.

 ========================================================================
 Class A network:
 First byte: 0XXXXXXX

 So maximum value of first byte = 255 - 128 = 127
                      (128 = 2**7)

 N.H.H.H

 Special reserved addresses:
 0.0.0.0 = default route
 127.    = loopback addresses
 10.     = non-routable internal addresses

 So range of first byte = 1 (just above default route)
                              to 126 (just below loopback)

 ========================================================================
 Class B network:
 First byte: 10XXXXXX

 So maximum value of first byte = 255 - 64 = 191
                      (64 = 2**6)

 N.N.H.H

 Special reserved addresses:
 172.16.  = non-routable internal addresses

 So range of first byte = 128 (just above class A) to 191 (Class B maximum)

 ========================================================================
 Class C network:
 First byte: 110XXXXX

 So maximum value of first byte = 255 - 32 = 223
                      (32 = 2**5)

 N.N.N.H

 Special reserved addresses:
 192.168.  = non-routable internal addresses

 So range of first byte = 192 (just above class B) to 223 (Class C maximum)

 ========================================================================
 Class D network:
 First byte: 1110XXXX

 So maximum value of first byte = 255 - 16 = 239
                      (16 = 2**4)

 "Distributed", Multicasting addresses, multiple destinations

 So range of first byte = 224 (just above class C) to 239 (Class D maximum)

 ========================================================================
 Class E network:
 First byte: 11110XXX

 So maximum value of first byte = 255 - 8 = 247
                      (8 = 2**3)

 "Experimental", Research addresses

 So range of first byte = 240 (just above class D) to 247 (Class E maximum)

 ========================================================================

 A network mask example

 address: 010.197.160.99
 netmask: 255.255.248.0

 The first address byte, 010, or 10, determines things as Class A,
 so the remaining 3 bytes can be used for either subnet or host addresses
 as needed.

 The Netmask first two bytes of 255 force the first two bytes
 of the address to be totally used for network addressing.
 The third byte of 248 in the net mask uses the first 5 bits
 for network address issues, leaving the last 3 bits for host address use.
 with three bits, ranges of 1 to 7 can be expressed:

 000   or 0
 001   or 1
 010   or 2
 011   or 3
 100   or 4
 101   or 5
 110   or 6
 111   or 7

 so possible addresses using the netmask 255.255.255.0 can range from

 010.197.160.0  to 010.197.167.255

 but these two extremes are ruled out because all host address bits turned
 off, set to 0 is reserved for the network address, and all host address
 bits turned on is reserved for the network broadcast address, so the
 real range would be:

 010.197.160.1  to 010.197.167.254

 so addresses like

  010.197.160.1
  010.197.163.99
  010.197.166.132
  010.197.167.33

 Are perfectly valid on this subnet.

 Dallas E. Legan II / legan@acm.org / dallas.legan@gmail.com / aw585@lafn.org
 07 Nov 2007

Help