Results 1 to 7 of 7

Thread: Subnet masks

  1. #1
    Senior Member IcSilk's Avatar
    Join Date
    Aug 2001
    Posts
    296

    Subnet masks

    I have been reading networking, tcp/ip udp smtp tuts and info. etc etc etc literally all day. That means almost (literally) all the AOL tuts on them and many of the links posted on those tuts and I know alot more now than before but there is still something Im not satisfied about . . . subnetting.

    Really its subnetting masks and their association(s) with IP addressing - I can't even think of how to properly formulate the question . . One question might be 'Are subnet masks distinctive to individual hosts? (like IP addresses)' or something like that . . .

    On this site a bit more than halfway down is a table (Table 30-2 Class B Subnetting Reference Chart). Can someone explain this to me and why. Don't go into base numbers and bits and bytes and octets etc etc because I know already. . I just don't/can't completely fathom the why's and why not's of this structure illustrated on these tables.
    "In most gardens they make the beds too soft - so that the flowers are always asleep" - Tiger Lily

  2. #2
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,915
    Hey Hey,

    Hopefully this will sum up what you are asking.... I'd like to completly avoid binary and octets and bits and bytes for you... but you can't do subnetting without them... Ask the 37 people in my CCNP course that just failed a VLSM/CIDR test...

    Anways you have an IP Address.. 4 octets (bytes).... 32 bits.

    XXXXXXXX.XXXXXXXX.XXXXXXXX.XXXXXXXX

    You have 5 classes of addresses...

    Class A - 1.0.0.0 - 126.0.0.0
    Class B - 128.0.0.0 - 191.0.0.0.0
    Class C - 192.0.0.0 - 223.0.0.0
    Class D - 224.0.0.0 - 239.0.0.0
    Class E - 240.0.0.0 - 255.0.0.0

    Class E is classed as research I believe... .so you can ignore it...
    Class D is classed as multicast (RIP2, OSPF, IGRP, etc)... ignore it..

    The three types of classes that you'll run into are A, B, and C..

    They have the format of
    A - N.H.H.H
    B - N.N.H.H
    C - N.N.N.H

    For a standard subnet mask.. the N (network) bits are 1s and the H (host bits) are 0...

    Now you start subnetting... you borrow host bits to form new networks...

    for a class A you have 24 Host bits... you can't borrow all of them... and you can't borrow 1 (it'd be useless for a number of reasons that are beyond the scope of this)... That leaves you with borrowing none (standard subnet mask).. or borrowing 2 to HostBits -2... So for Class A you can borrow 2 - 22 bits... Class B 2 - 14 Bits and Class C 2 - 6 Bits.

    When you borrow bits they become Network bits... so they have to become 1s in the mask...

    Example:

    Class C
    Borrow 4 bits...
    Normal Mask: 11111111.1111111.1111111.00000000 (I hope those all have 8) (255.255.255.0)
    New Subnet Mask: 11111111.11111111.1111111.11110000 (255.255.255.240)

    That's where their first column comes from..
    The next two for hosts and subnets comes from a simple formula...

    Subnets = 2^(bits borrowed)... 2 ^ 4 = 16
    Usable Subnets = 2 ^ (bits borrowed) - 2 = 2^4 - 2 = 14

    Host = 2 ^ (total host bits - bits borrowed)... 2 ^ (8 - 4) = 2 ^ 4 = 16
    Usable Subnets = 2 ^ (total host bits - bits borrowed) - 2... 2 ^ (8 - 4) - 2 = 14

    So to use one of their examples:

    Bits = 9
    Subnet Mask = 255.255.255.128
    Subnets = 510
    Hosts = 126

    Class B Default Mask 1111111.11111111.00000000.00000000 (255.255.0.0)
    Class B 9 Bits Borrowed Mask 11111111.1111111.1111111.10000000 (255.255.255.128)

    Subnets = 2 ^ 9 = 512
    Usable = 2 ^ 9 - 2 = 510

    Hosts = 2 ^ (16 - 9) = 2 ^ 7 = 128
    Usable = 2 ^ (16 - 9) - 2 = 2 ^ 7 - 2 = 126.

    Hopefully that all makes sense... If you have any questions just post them or send me a PM.... That's a little cluttered... partially because of the time and partially because I'm not sure which part you're stuck with... but send me a PM with more details (or reply here) and I'll help you work through them..... I love subnetting... I actually get my jollies from it :P..

    Peace,
    HT

  3. #3
    Senior Member IcSilk's Avatar
    Join Date
    Aug 2001
    Posts
    296
    I can see where it would be captivating if completely understood - hell its captivating enough trying to figure it out . .

    On that note I do have a few confusions still unsettled . .

    Now you start subnetting... you borrow host bits to form new networks::::When you borrow bits they become Network bits... so they have to become 1s in the mask...
    I just about completely understand this but I'm left with not seeing the reason for borrowing initially . . I know Im missing something . . but I can't see the reason for the need of this.

    Class C
    Borrow 4 bits...
    Normal Mask: 11111111.1111111.1111111.00000000 (I hope those all have 8) (255.255.255.0)
    New Subnet Mask: 11111111.11111111.1111111.11110000 (255.255.255.240)
    And obviously these four bits must be placed sequentially rather than arbitrarily dispersed within the octet?

    I just read your reply for about the 7th time and it gets clearer every time, haha - If anything I am clearer now on the nature of my question and what it is. lol

    Subnets = 2^(bits borrowed)... 2 ^ 4 = 16
    Usable Subnets = 2 ^ (bits borrowed) - 2 = 2^4 - 2 = 14

    Host = 2 ^ (total host bits - bits borrowed)... 2 ^ (8 - 4) = 2 ^ 4 = 16
    Usable Subnets = 2 ^ (total host bits - bits borrowed) - 2... 2 ^ (8 - 4) - 2 = 14
    I'm not having any problem with these formulas other than if I better understood the reason behind borrowing bits I'd have complete control over these formulas.

    and going back to the 'Class C' quote up top - what are the differances in functionality of the normal mask and the new subnet mask?

    I hope Im not sounding completely stupid but this is not blatently obvious for me as it may be to some . .
    "In most gardens they make the beds too soft - so that the flowers are always asleep" - Tiger Lily

  4. #4
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,915
    Hey Hey,

    Basically then... your question is Why Subnet?

    The original idea was that you have Class A Networks for big companies... Class B Networks for Midsized Companies and Class C for ISPs and Small Companies... The problem is that you end up with one big network.. No need for a router... but you'd have one big broadcast domain.

    In an unsubnetted class A you'd send a broadcast packet and it would be sent to 16777216 Hosts.... that's a lot of traffic if everyone sends even 1 broadcast a day (194 broadcasts every second)...

    There's also security issues.... You wouldnt be able to filter inside your networks... unless you did host by host filtering.... There's nothing to really segment who's who...

    Then you have the problem of... we're running out of IP addresses... why'd we give Nortel 16 Million IP Addresses... so you stop giving out a full network... you can assign a subnetwork

    What you do when you subnet is take one big network and turn it into many smaller networks.. you stick a router in between to route traffic from one network to another and you have smaller broadcast domains, more security (1 subnet for admin, 1 for end user, 1 for private, etc) and if someone only needs a 2 IP addresses.. you no longer have to give them 256.. you can give them 2...

    It also allows for logical segmenting....

    To give you an example without too many details... one of the Residences at the college I work at has 1 Class B Address assigned to it.... That class B is subnetted as if it was a class C (Borrow 8 bits)... Now each floor gets one of these subnets... so when we see traffic we can immediately identify which floor it is coming from....

    So here's a simple real life example... I've got a private network (192.168.1.0/24) (You can Read RFC 1918 for more information ont he private networks)... so I've got 256 Hosts.. but I've got 3 offices... one in New York.. One in LA and one in Toronto...

    That would be a hell of a LAN link to try and sync these things up on one network..

    so I subnet... I need 3 Networks ... I borrow 3 bits.. 2^3 - 2 = 6.. that's more than enough networks..
    Code:
    Subnet 0 --- 192.168.1.0                 192.168.1.2 - 192.168.1.30        192.168.1.31
    Subnet 1 --- 192.168.1.32               192.168.1.33 - 192.168.1.61      192.168.1.62
    Subnet 2 --- 192.168.1.64               192.168.1.1.65 - 192.168.1.94      192.168.1.95
    Subnet 3 --- 192.168.1.96               192.168.1.1.97 - 192.168.1.126     192.168.1.127
    Subnet 4 --- 192.168.1.128             192.168.1.129 - 192.168.1.158     192.168.1.159
    Subnet 5 --- 192.168.1.160             192.168.1.161 - 192.168.1.190     192.168.1.191
    Subnet 6 --- 192.168.1.192             192.168.1.193 - 192.168.1.222     192.168.1.223
    Subnet 7 --- 192.168.1.224             192.168.1.225 - 192.168.1.254     192.168.1.255
    Subnet 0 and Subnet 7 are considered unuseable (in traditional subnetting) because they contain the original network address (the .0) and the original broadcast address (the .255)... Within the other subnets I've segmented them... the first number is the network number for each subnet.... the middle section is the host range and the end number is the broadcast for each subnet...

    Now back to our example.. I can assign Subnet 1 to NY.... Subnet 2 to LA and Subnet 3 to TO.... this allows you setup routers and route between networks.. and I still have Ranges left over to assign to future expansions.... had I been using the full networks.. I'd have needed three (IP Addresses can be costly)... and I'd have wasted a lot...


    I apologize if this isn't making sense... it's kind of late.... but hopefully you're getting the idea out of it..... This example is very basic and would have many other blaring ommisions/problems in real life... but it serves our purpose....

    If you need more clarification let me know and I'll try my best.

    Peace
    HT

  5. #5
    Senior Member IcSilk's Avatar
    Join Date
    Aug 2001
    Posts
    296
    Interesting - its amazing how complicated I was making it . . So

    Bit substitution is an integral component of sub-netting - there really isn't one without the other .???
    Its late for me too, mate, and maybe a good reason why I haven't been grasping this fully.

    Gawd, I hope this isn't stupid and I haven't completely overlooked something . .

    What are some determining factors that would influence ones decision on which class of network to set up?


    You ought to put your responses together for a tut, mate - haha
    "In most gardens they make the beds too soft - so that the flowers are always asleep" - Tiger Lily

  6. #6
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,915
    Hey Hey,

    Bit Substitution is basically what subnetting is... yes.

    As far as factors that decide what class of network.... Well as we 'run out of' IP addresses IP addresses aren't really assigned in full Class chunks anymore.... now we provide Classless Chunks... Basically you're assigned a subnet.... and then you can further Subnet the subnet using VLSM (variable length subnet masking)... You see a lot of addresses written as 192.168.1.0/24... I know nmap will accept this sort of input.... After the / you are listing the number of network bits in the mask... it's called CIDR or Classless Inter Domain Routing. Also because of things like NAT and PAT you can now have one Public IP Address and on your internal network use Private IP Addresses...

    Private (RFC 1918) Addresses:

    10.0.0.0/8 (range = 10.0.0.0 - 10.255.255.255)
    172.16.0.0/12 (range = 172.16.0.0 - 172.31.255.255)
    192.168.0.0/16 (range = 192.168.0.0 - 192.168.255.255)

    Subnetting as a whole is a rather broad subject there's actually quite a bit to it and then there are little things that spawn off of it...

    Hopefully this makes sense to you... again any more questions and just fire them off.

    Peace
    HT

  7. #7
    Senior Member IcSilk's Avatar
    Join Date
    Aug 2001
    Posts
    296
    Its amazing how much more sense this is making to me - not fully, but it is coming together in pieces . .

    I am going to go research it more deeply - specifically NAT and PAT and CIDR . .

    I'm not lazy and I won't pose a question that I am too lazy to research the answer of myself -
    So I'm just going to lay out a few things I'm still not sure about and give you sweet time to answer while I go and look up these other things -

    VLSM is the standard that allows for [****.****.****.****/**] the string after the backslash here? and it is also what allows for private IPs within a Public network??
    Can you elaborate alittle more on VLSM?

    Private (RFC 1918) Addresses:

    10.0.0.0/8 (range = 10.0.0.0 - 10.255.255.255)
    172.16.0.0/12 (range = 172.16.0.0 - 172.31.255.255)
    192.168.0.0/16 (range = 192.168.0.0 - 192.168.255.255)
    I know that somewhere within this thread is a not-so-obvious answer to this question:

    How do the /** addition (# of bits in the mask - obviously not borrowed bits because I seem to remember that 14 was the largest number of bits allowed to borrow and I see a 16 here) determine the range you have supplied in ()'s? I know its simple but what is throwing me is the second one down where the 2nd octet from left goes from .16. to .31. (Is this in reference to those formulas in the last post?)

    Maybe I'm being a bit redundant in my questioning, I apologize - but on the brighter side, for anyone that is following this thread, experiencing the same issues with subnetting that I am and trying to sort through them- at least the same topics are being hit from differant angles - - - usually a good thing in facilitating understanding.

    Though I have a feeling your going to tell me that I will find the answer to these questions as I research . . lol
    "In most gardens they make the beds too soft - so that the flowers are always asleep" - Tiger Lily

Posting Permissions

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