Subnetting?

ratbuddyratbuddy Member Posts: 665
I've been reading about subnetting for about 5 minutes, and I think I have a crystal clear understanding of what a subnet is and how to figure out the size and address range of one. What else is there to learn about them? I see people griping about having to learn 'subnetting' for CCNA-type exams, is that in reference to practical application, or just the theory?

Comments

  • CodeBloxCodeBlox Member Posts: 1,363 ■■■■□□□□□□
    You need to be able to do it quickly (In my opinion) to do well on the exams. You can get caught up on figuring out subnets and waste time.
    Currently reading: Network Warrior, Unix Network Programming by Richard Stevens
  • ratbuddyratbuddy Member Posts: 665
    I'm not sure what you mean by 'do it' though. Just translate a subnet mask and IP to a range? That seems pretty trivial, is there more to the testing?
  • CodeBloxCodeBlox Member Posts: 1,363 ■■■■□□□□□□
    Some folks get hung up in the details of calculating the subnets when it's thrown into a larger problem on the exams. You don't want to waste the time and loose points because you calculated the subnet incorrectly. You sound pretty confident (and arrogant) so you shouldn't have anything to worry about. I personally worked on subnetting until I could do it in my head quickly (without memorizing a table). It took some practice for me. I'm just saying, I wouldn't take it lightly.
    Currently reading: Network Warrior, Unix Network Programming by Richard Stevens
  • ratbuddyratbuddy Member Posts: 665
    Not arrogant whatsoever. I just want to understand what the subnet 'problem' is. I thought it would be something more abstract than understanding binary :)
  • AwesomeGarrettAwesomeGarrett Member Posts: 257
    You'll eventually realize that the people that REALLY complain about subnetting are the ones who don't understand it. They just did it for the exam and never gained the skill. I personally think of it as riding a bike, once you learn it you'll never really have a problem with it.
  • ZartanasaurusZartanasaurus Member Posts: 2,008 ■■■■■■■■■□
    Go to subnettingquestions.com and start answering the questions.
    Currently reading:
    IPSec VPN Design 44%
    Mastering VMWare vSphere 5​ 42.8%
  • CodeBloxCodeBlox Member Posts: 1,363 ■■■■□□□□□□
    Currently reading: Network Warrior, Unix Network Programming by Richard Stevens
  • stryder144stryder144 Member Posts: 1,684 ■■■■■■■■□□
    Like any subject, some people naturally understand it after a brief explanation. Some people struggle constantly before the "ah-ha" moment occurs. And, sadly, some just memorize a bunch of stuff that allows them to get through the test or the interview and then promptly forget because they don't truly understand it.

    What truly matters, natural or not, is that you understand it from every direction. Once you've got the 360 degree understanding, teach it to someone else. If you can't explain it, you probably need a bit more study time with the subject. I taught my 8 year old how to convert IP addresses to binary and that really reinforced the concepts for me.

    Cheers
    The easiest thing to be in the world is you. The most difficult thing to be is what other people want you to be. Don't let them put you in that position. ~ Leo Buscaglia

    Connect With Me || My Blog Site || Follow Me
  • ratbuddyratbuddy Member Posts: 665
    I'm a little bored, and I was thinking about subnets, so here is my attempt to explain it as simply and briefly as possible. I'd appreciate corrections if I have made any errors or explained things badly. I'm typing this off the top of my head with no reference material, so there's bound to be some mistakes.

    Every IPv4 address is made up of 32 bits, or 4 bytes. Each group of 8 bits is an octet or byte, and from left to right, each bit equals 128, 64, 32, 16, 8, 4, 2, 1. The octets are seperated by . symbols in an IPv4 address, for example 123.123.123.123.

    00000000.00000000.00000000.00000000 in binary is 0.0.0.0 in decimal, and 11111111.11111111.11111111.11111111 binary is 255.255.255.255 decimal. 10101010 in binary is 128+0+32+0+8+0+2+0, or 170. Just look at the value for each bit and do some addition to find other numbers.

    A subnet is just what it sounds like, a subdivision of a network. It's a range of addresses that all fall under another more general network address. Machines in the subnet do not need to wory about the first X binary digits of the address space.

    The subnet mask defines the local (to the subnet) address space. The range of addresses in a subnet depends on the subnet mask, and includes two special addresses. The first IP in the subnet range is the network ID, and the last IP address in the range is the broadcast address. Neither can be assigned. That's why you'll never see an odd number (besides 255) in a subnet mask: the smallest division that still gives you usable addresses is a subnet of 4 addresses, or 2 bits.

    As far as I know, subnet masks are always filled with 1s on the left side, and 0s on the right side, so to have an odd number, that octet would have to equal 255, giving no subdivision at all.

    A subnet mask can be expressed as X.X.X.X, or as a /## following an IP address. An example of the former is 255.255.224.0, and the same subnet mask expressed in the /## format would be /19 at the end of an address.

    This /19 represents the first 19 bits which don't matter when communicating on the subnet: 11111111.11111111.11100000.00000 or 255.255.224.0. That leaves you with 5 bits in the second octet, and the full 8 bits in the last octet, for a total of 13 bits left to play with.

    To determine the size and number of possible subnets with a 255.255.224.0 subnet mask, I've seen it advised to use something called a 'magic number' which is simply 256 minus the non-255/non-0 number in the subnet mask. I guess a magic number is ok if you don't care about the theory, but I had to think about why it works.

    In this case, the magic number would be 256-224=32. That means such a mask allows subnets of 32 addresses in the third octet, with a total of 8 such subnets possible for each possible set of first two octets. Why 8? Because this subnet is found by the first 3 bits in the third octet (011XXXXX) and the highest you can count with 3 bits is 0 through (1+2+4)=7, a range of 8.

    Since each subnet also includes the addresses in the fourth octet, each one has 32*256 or 8192 total addresses. Working in the other direction to check the math, with 13 bits you can count to 1+2+4+8+16+32+64+128+256+512+1024+2048+4096=8191, including 0 that's 8192 addresses.

    That said, how do you determine the subnet range for an arbitrary address once you know the subnet mask? Just divide. Given the arbitrary IP address 121.121.121.121 with the above subnet mask of 255.255.224.0, or simply 121.121.121.121/19, we can see that the 121.121. will always be the starting address of the subnet range.

    The third and fourth octets will change depending on the subnet and address. We have those 13 bits to play with, but only the leftmost 5 of those bits really matter right now. Converting the third octet of the IP address to binary, we get 01111001 or 0+64+32+16+8+0+0+1. The 011 (0+64+32) part of the address is fixed, so looking at the 5 bits that matter, this is the 16+8+1=25th possible third octet address in the subnet, the first one being 121.121.96.XX and the last being 121.121.(96+31=127).XX which would be 01111111.

    Thus in this IP/subnet, the range of addresses is 121.121.96.0 through 121.121.127.255, with 121.121.96.1 through 121.121.127.254 being usable, because 121.121.96.0 is the network ID, and 121.121.127.255 being the broadcast address. 121.121.128.000 would be the network ID of the next such subnet, and it would continue on through 121.121.(128+31=)159.255

    That said, yeah, for everyday use or test taking, using the magic number and a division table is probably faster, but it doesn't give any understanding of the theory behind subnetting and what the numbers actually mean. I don't usually write this sort of thing, so it's probably an eyesore, and I apologize in advance if I wasted anyones time :)
  • it_consultantit_consultant Member Posts: 1,903
    stryder144 wrote: »
    Like any subject, some people naturally understand it after a brief explanation. Some people struggle constantly before the "ah-ha" moment occurs. And, sadly, some just memorize a bunch of stuff that allows them to get through the test or the interview and then promptly forget because they don't truly understand it.

    What truly matters, natural or not, is that you understand it from every direction. Once you've got the 360 degree understanding, teach it to someone else. If you can't explain it, you probably need a bit more study time with the subject. I taught my 8 year old how to convert IP addresses to binary and that really reinforced the concepts for me.

    Cheers

    Poor Kid icon_smile.gif

    Truthfully, I would not bother learning subnetting any farther than being able to explain what a subnet and CIDR address is. They have calculators for that and something in IT more important to memorize than subnetting. You will never ever need to convert binary to hex to decimal for IPv4 addresses in the real world.

    IPV6 is something we all need to learn and it totally obsolesces all of your IPv4 knowledge - including things like NAT.
  • phoeneousphoeneous Member Posts: 2,333 ■■■■■■■□□□
    Go to subnettingquestions.com and start answering the questions.

    ^This. If you can answer 15 of those questions in your head under 15 seconds each, then you can subnet well.

    And by 'do it' something basic like, with a subnet of 192.168.255.8/28, what is the range, first usable, last usable, broadcast.
  • ratbuddyratbuddy Member Posts: 665
    Just for practice, in the example above I see there are 4 bits of addressability, meaning 16 addresses per subnet, so the range is 192.168.255.0 (also the network ID) through 192.168.255.15 (which is broadcast address), first/last usable would be 192.168.255.1 and 192.168.255.14. Yeah?
  • ZartanasaurusZartanasaurus Member Posts: 2,008 ■■■■■■■■■□
    Poor Kid icon_smile.gif

    Truthfully, I would not bother learning subnetting any farther than being able to explain what a subnet and CIDR address is. They have calculators for that and something in IT more important to memorize than subnetting. You will never ever need to convert binary to hex to decimal for IPv4 addresses in the real world.

    IPV6 is something we all need to learn and it totally obsolesces all of your IPv4 knowledge - including things like NAT.
    There's going to be plenty of NAT going on when/if IPv6 ever gets serious adoption.
    Currently reading:
    IPSec VPN Design 44%
    Mastering VMWare vSphere 5​ 42.8%
  • CodeBloxCodeBlox Member Posts: 1,363 ■■■■□□□□□□
    This /19 represents the first 19 bits which don't matter when communicating on the subnet: 11111111.11111111.11100000.00000 or 255.255.224.0. That leaves you with 5 bits in the second octet, and the full 8 bits in the last octet, for a total of 13 bits left to play with.


    These are the bits that DO matter... The rest are considered "don't care bits" because so long as your network bits don't change you can modify your host bits with assurance that you are in the same subnet.
    Currently reading: Network Warrior, Unix Network Programming by Richard Stevens
  • it_consultantit_consultant Member Posts: 1,903
    I would be surprised if NAT continues on in IPV6, I know that they ratified a way to do it but no one wants too. If you are running dual-stack and you are retaining IPv4 WAN connectivity then you will still need NAT. Otherwise there is no need for it in IPV6 unless you simply enjoy NAT'ing.

    IPv6.com - Network Address Translation (NAT) - an in-depth look.
    No NAT in IPv6?

    Lets face it, IPv6 is an inevitability and the bulk of us who will not retire in the next 10 years will be better served learning IPv6 than memorizing how to subnet when an online calculator is readily available.
  • DevilWAHDevilWAH Member Posts: 2,997 ■■■■■■■■□□
    All IT is basic, its all just 1 and 0. Knowing the theory of subnetting is one thing, and like many I found it a very logical and clear concept when learning it.

    Having said that, understanding the theory of subnetting is a world away from using it in the real world or in exams. Or when trouble shooting issues, Knowing where its still relivent to know class full and classless, and what technologies such as BGP and EIGRP do when summarising or advertising routes.

    And then we get on to wild card masks and prefix lists, and how they differ and extend the capabilities of sub netting. Don't worry if you find sub-netting straight forwards as many people do there are 1000's of other concepts to trip over on as you get in to networking. and when you do there will be lots of people shaking there head wondering how you can get confused but such simple stuff.

    That's the thing about a forum, every one has strengths and weaknesses, the idea is when you understand a subject you help others out, and when you are struggling others help you. however i not sure if you intended it but you post came across as a bit condescending and bragging, you may not have meant this but you have to be careful with wording on the internet.
    • If you can't explain it simply, you don't understand it well enough. Albert Einstein
    • An arrow can only be shot by pulling it backward. So when life is dragging you back with difficulties. It means that its going to launch you into something great. So just focus and keep aiming.
  • it_consultantit_consultant Member Posts: 1,903
    DevilWAH wrote: »
    All IT is basic, its all just 1 and 0. Knowing the theory of subnetting is one thing, and like many I found it a very logical and clear concept when learning it.

    Having said that, understanding the theory of subnetting is a world away from using it in the real world or in exams. Or when trouble shooting issues, Knowing where its still relivent to know class full and classless, and what technologies such as BGP and EIGRP do when summarising or advertising routes.

    And then we get on to wild card masks and prefix lists, and how they differ and extend the capabilities of sub netting. Don't worry if you find sub-netting straight forwards as many people do there are 1000's of other concepts to trip over on as you get in to networking. and when you do there will be lots of people shaking there head wondering how you can get confused but such simple stuff.

    That's the thing about a forum, every one has strengths and weaknesses, the idea is when you understand a subject you help others out, and when you are struggling others help you. however i not sure if you intended it but you post came across as a bit condescending and bragging, you may not have meant this but you have to be careful with wording on the internet.

    +1 on this

    My experience is that a lot of written documentation on topics in IT are so obtusely written that it either confuses people or they lose interest by the time they get to the important bits.

    I have explained to CCNP's the ins and outs of dot 1 Q and in 30 minutes got them to a level of thorough understanding that they never had before. I can literally see the lights come on in their brains. Its not that they were stupid, its just that they never had it broken out in a way that made sense.
  • ratbuddyratbuddy Member Posts: 665
    Nope, not condescending or bragging. I'm just a straight shooter and asked an honest question.

    Personally, I'm trying to wrap my head around control flow in OOP. I'm sure other people pick it up very quickly, but I haven't. Too much BASIC as a kid, I guess.
Sign In or Register to comment.