[Home] - [Resources] - [Words] - [Pictures] - [Music/Shows] - [Social Work] - [People] - [Computing] - [Goods]

Net stuff


power of two      2^7   2^6   2^5   2^4   2^3   2^2   2^1   2^0
value in decimal  128    64    32    16    8     4     2     1
bits "borrowed"    1     2     3     4     5     6     7     8
netmask octet     128   192   224   240   248   252   254   255

What does it all mean?

If I have a 1 in that space in binary, it represents that 
   power of two, or that value, in decimal.  for example:
      octet = 00100000 = 2^5 = 32
      octet = 00100100 = (2^5 + 2^2) = (32 + 4) = 36
      octet = 10000001 = (2^7 + 2^0) = (128 + 1) = 129

If I have this octet in my netmask, this many bits are "borrowed" 
   by the network part of the address.  for example:
      mask = 255.255.240.0 = 11111111.11111111.11110000.00000000
                            four bits borrowed \__/ 
      mask = 255.192.0.0 = 11111111.11000000.00000000.00000000
                  two bits borrowed \/ 
      mask = 255.255.225.252 = 11111111.11111111.11111111.11111100
                                        six bits borrowed \____/ 

the number of hosts = 2^n, where n is the number of host bits.

addresses are divided into a NETWORK part and a HOST part.
for a given IP address and mask, for example:
  ip   146.115.138.66
  mask 255.255.255.0

            NETWORK PART ONLY     + HOST PART ONLY         = ADDRESS
ip address  actual   146.115.138  + actual           .66  = 146.115.138.66
network     actual   146.115.138  + all zeros        .0   = 146.115.138.0
first host  actual   146.115.138  + one in last bit  .1   = 146.115.138.1
broadcast   actual   146.115.138  + all ones         .255 = 146.115.138.255
last host   actual   146.115.138  + ones except last .254 = 146.115.138.254
netMASK     all ones 255.255.255  + all zeros        .0   = 255.255.255.0

CAUTION: When he asks for the HOST PART ONLY, don't
give the WHOLE ADDRESS!  Use only column two above!!

another example, this one supersized:
  ip   202.45.83.105  (83=01010011 in binary)
  mask 255.255.240.0  (4 bits borrowed for network)

            NETWORK PART ONLY    + HOST PART ONLY          = ADDRESS            
ip address  actual   202.45.80   + actual           3.105  = 202.45.83.105
network     actual   202.45.80   + all zeros        0.0    = 202.45.80.0
first host  actual   202.45.80   + one in last bit  0.1    = 202.45.80.1
broadcast   actual   202.45.80   + all ones         15.255 = 202.45.95.255
last host   actual   202.45.80   + ones except last 15.254 = 202.45.95.254
netMASK     all ones 255.255.240 + all zeros        0.0    = 255.255.240.0       


Back to: resources

This page last revised Tue Jul 17 21:28:33 EDT 2001 by leaf