Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: TCP/IP Addressing & Subnetting

  1. #1
    Senior Member
    Join Date
    Oct 2001

    Lightbulb TCP/IP Addressing & Subnetting

    Hey guys, found this on the net and thought it could be of some intrest to you Internet Buffs out there . Now I'm hoping you know what this is about, obviously by the name of the thread...

    Every IP address can be broken down into 2 parts, the Network ID(netid) and the Host ID (hostid). All hosts on the same network must have the same netid. Each of these hosts must have a hostid that is unique in relation to the netid. IP addresses are divided into 8 octets with each having a maximum value of 255. We view IP addresses in decimal notation such as, but it is actually utilized as binary data so one must be able to convert addresses back and forth.

    Decimal          Binary
    When converting binary data to decimal, a "0" is equal to 0. "1" is equal to the number that corresponds to the field it is in. For example, the number 213 would be 11010101 in binary notation. This is calculated as follows:

    Remember that this only represents 1 octet of 8 bits, while a full IP address is 32 bits made up of 4 octets. This being true, the IP address would look like 11010101 10000000 01000100 10000010. If you understand this then you are a geek and all of your friends will laugh at you. Believe me - I know!

    Class          Range
    IP addresses can be class A, B or C.
    • Class A addresses are for networks with a large number of hosts. The first octet is the netid and the 3 remaining octets are the hostid.
    • Class B addresses are used in medium to large networks with the first 2 octets making up the netid and the remaining 2 are the hostid.
    • A class C is for smaller networks with the first 3 octets making up the netid and the last octet comprising the hostid.



    A subnet mask blocks out a portion of an IP address and is used to differentiate between the hostid and netid. The default subnet masks are as follows:

    Class          Default Subnet          # Of Subnets          # Of Hosts Per Subnet
    Class A------,777,214
    Class B------,384------------------65,534
    Class C------,097,152---------------254
    In these cases, the part of the IP address blocked out by 255 is the netid.

    The table above shows the default subnet masks. What subnet mask do you use when you want more that 1 subnet? Lets say, for example, that you want 8 subnets and will be using a class C address. The first thing you want to do is convert the number of subnets into binary, so our example would be 00001000. Moving from left to right, drop all zeros until you get to the first "1". For us that would leave 1000. It takes 4 bits to make 8 in binary so we add a "1" to the first 4 high order bits of the 4th octet of the subnet mask (since it is class C) as follows:
    11111111.11111111.11111111.11110000 =

    There is our subnet mask. Lets try another one...Lets say that you are the network administrator for a chain of dry cleaning stores in New York and you have stores in 20 different neighborhoods and you want to have a separate subnet on your network for each store. It will be a class B network. First, we convert 20 to binary - 00010100. We drop all zeros before the first "1" and that leaves 10100. It takes 5 bits to make 20 in binary so we add a "1" to the first 5 high order bits which gives:
    11111111.11111111.11111000.00000000 =

    The following table shows a comparison between the different subnet masks.

    Mask            # of Subnets          ClassA Hosts          ClassB Hosts          ClassC Hosts
    ...This Space For Rent.


  2. #2
    Senior Member
    Join Date
    Oct 2001
    Thanks WebCarnage. If people need some help understanding the binary side of this, here's a link to a tutorial I wrote on this subject. Read it here.
    OpenBSD - The proactively secure operating system.

  3. #3
    Join Date
    Oct 2001
    Good post [WebCarnage], keep em coming

  4. #4
    Yep, that's some good stuff there, definitely worthwhile reading. Good job, [WebCarnage]!
    - Maverick

  5. #5
    AO French Antique News Whore
    Join Date
    Aug 2001
    Remember that this only represents 1 octet of 8 bits, while a full IP address is 32 bits made up of 4 octets. This being true, the IP address would look like 11010101 10000000 01000100 10000010. If you understand this then you are a geek and all of your friends will laugh at you. Believe me - I know!
    What are we when we can move binary into hex?
    -Simon \"SDK\"

  6. #6
    AntiOnline Jr. Member
    Join Date
    Feb 2002
    as far as the classes go class A is set aside for large companys, government, corperations or extremly larde networks with a massive amount of hostsand a limited amount of networks.
    the first octec is the net class A 1-126 B 128- and C 192-
    class B are set aside for schools, organizations or mid sized networks
    and class C are for home users small bussinesses and smaller networks. this class can have many networks but fewr hosts class Cn.n.n.h class B n.n.h.h class A n.h.h.h
    these were created before the internet. before that it was ARPA net which was defense
    and government oriented.
    but as u may or may not know the class C is relativley small compared to the other classes
    because it was never thought that they would need many IPs for home pc use.
    subnetting was to alleviate the need of more IPs and create many LANS (Local Area Network) but class C is running out.
    I have heard that they have devised a new classless IP network, but am unsure of how.
    With the implementation of CIDR in 1994 it allowed the internet to grow by more efficiently aggregate routing info.
    in other words a single entry in a routing table can represent the addressspaces of many networks. which reduces the size of routing tables which increses scalability.
    there is muc more to this i just gave u a taste

  7. #7
    Senior Member
    Join Date
    Aug 2001
    I like your post [webcarnage]. I always wanted to know how to convert ips to binary but thought it would be a bit harder than that and nice tutorial also smirc.

  8. #8
    AntiOnline Jr. Member
    Join Date
    Feb 2002
    i read the post on binary to hex above and if you dont know how to convert its really easy
    this may be a refresher for most but there are those who dont know

    say we took 10110011.11101001.10110101.01011011
    now thats a bg # right well split the octet in two
    we will take the first one 10110011 split it in two right down the middle 1011/0011
    now all u do is deal with each side the left side is 11 but in hex its B
    hex is 0,1,2,3,4,5,6,7,8,9 instead of 10 ,10 is a 11 is b 12 c 13d 14 e 15f
    so the first half of the octet is B the second half is 3
    so your answer in hex is B3 the next octet is E9 the next is B5 and the last is 5B
    and 1 more 11111111 convert 1111/1111 is FF in hex
    i hope this simple conversion helps
    have fun!

  9. #9
    AntiOnline Senior Member
    Join Date
    Oct 2001
    Excellent and informative post, WC.
    [shadow]uraloony, Founder of Loony Services[/shadow]
    Visit us at

  10. #10
    Senior Member
    Join Date
    Sep 2001
    hey that was really helpful WC keep posting....

    A laptop, internet connection and beer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts