title: How do we determine the class of the IP address?
body: <p>I am currently trying to understand the IP address's class. I came across two ways to determine the class of IP address: </p>
  
  <p>1) Format (eg. N.H.H.H = class A, N.N.H.H = class B)</p>
  
  <p>2) bits in the beginning of the IP address ( eg. 0xxx.xxxx.xxxx = class A)</p>
  
  <p>Is the identification of class of IP determined by 1 &amp;&amp; 2 (by this I mean satisfy rule 1 and 2) rule or 1 || 2( by this I mean satisfy rule 1 or 2)?</p>
  
  <pre><code>For 128.138.243.100/26
  
  Address:   128.138.243.100       10000000.10001010.11110011.01 100100
  Netmask:   255.255.255.192 = 26  11111111.11111111.11111111.11 000000
  Wildcard:  0.0.0.63              00000000.00000000.00000000.00 111111
  =&gt;
  Network:   128.138.243.64/26     **10**000000.10001010.11110011.01 000000 (Class B)
  Broadcast: 128.138.243.127       10000000.10001010.11110011.01 111111
  HostMin:   128.138.243.65        10000000.10001010.11110011.01 000001
  HostMax:   128.138.243.126       10000000.10001010.11110011.01 111110  
  Hosts/Net: 62                    
  </code></pre>
  
  <p>How could 128.138.243.100/26 be class B if we flow rule 1. Since rule 1 says class B should be N.N.H.H but in the above example clearly the N part of the IP address is beyond N.N.N.(here it even encroaches two bit of the H ).  </p>