[Mishmash] Class of Address Part II

Fred Atkinson fatkinson at mishmash.com
Sun Jul 15 23:41:35 CDT 2007


    Here's the nuts and bolts of why IP addresses fall into the different classes (as defined by all of the Internet committees): 

    As you know, an IP address consists of four octets such as #.#.#.# where each # represents an octet (eight bits, also known as a byte).  

    Those of you that understand binary know that eight bits can represent 256 numbers (2 to the 8th power equals 256).  The range is from 0 to 255.  Thus each octet can be represented by any number from 0 to 255 (with one exception that I'll mention at the end).  

    In the decimal system, 123 represents a number consisting of one one hundred, two tens, and three ones.  Each column represents a different power of ten.  

    In the binary system, each column represents a power of two.  Example: 00000011 represents a decimal 3 in binary because the last one represents a one and the next to the last represents a 2.  

    00001111 represents decimal 15 because in addition to the 1 and the 2, the third from the end represents a 4, and the fourth from the end represents an 8.  1+2+4+8=15.  

    It works like this: 

                1   1   1   1   1   1   1   1
                -----------------------------------
                1   6   3   1   8   4   2   1
                2   4   2   6
                8

    For each one, you add the value.  In the case of 11111111, you'd add them like this: 

                128 
                +64
                +32
                +16
                 +8
                 +4
                 +2
                 +1
               ------
               255

    For 10101010 you add it like this: 

                128 
                +32
                 +8
                 +2
               ------
               170

    Remember that a computer can only work in ones and zeroes.  That's why we have to convert to binary.  

    We said that a Class A network always begins with a number from 0 to 127.  In binary, these numbers are represented as: 

        00000000 binary = 0 decimal 
        01111111 binary = 127 decimal 

    Do you see a similarity between the two binary values?  The first bit is a 0.  Hence you have a Class A address.  For all Class A addresses, the first bit of the first octet is always a 0.  This is because the Internet committees have decided that this is what identifies an IP address as a Class A address.  These same committees made the decisions for the other classes as well.  

    Class B's first octet can be anywhere from 128 to 191.  They are represented in binary as: 

        10000000 binary = 128 decimal 
        10111111 binary = 191 decimal  

    Do you notice any similarity in the binary values?  They both begin with 10.  That makes it a Class B address.  

    Class C address's first octet must be from 192 to 223.  They are represented in binary as: 

        11000000 binary = 192 decimal 
        11011111 binary = 223 decimal 

    The similarity here is that the first three bits are represented by 110.  

    There are Class D addresses for special purposes.  Their first octet's binary representation must begin with 1110.  For Class E (very limited use) they must begin with 11110.  

    They don't go higher than class E.  So the highest number in the first octet can be 11110111 binary = 247.  Hence, the first octet of an IP address can never be higher than 247 (that is the exception that I mentioned earlier).  

    I'm going to give a pop quiz on this soon. ;-)  

    Any questions, feel free to ask.  

    I'll explain the subnet mask another time.  

    Regards, 


                                                                Fred 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mishmash.net/pipermail/mishmash_mishmash.net/attachments/20070716/a7def0bb/attachment-0001.html 


More information about the Mishmash mailing list