Tackling the Dreaded sub-netting

pandimuspandimus Member Posts: 651
Question regarding subnetting

If i am given this ip/sub mask

192.168.16.0/21

the /21 is obviously the subnet mask.

But the 21 does that mean 21 continuous 1's in the binary?

so a subnet mask of

255.255.248.0 ?
Xinxing is the hairy one.

Comments

  • WebmasterWebmaster Admin Posts: 10,292 Admin
    Yes the short notation /21 is in bits. Thus:
    11111111.11111111.11111000.00000000 =
    255.255.(128+64+32+16+8+0+0+0).0=
    255.255.248.0
  • pandimuspandimus Member Posts: 651
    cool thanks.. More to come "im sure."
    Xinxing is the hairy one.
  • WebmasterWebmaster Admin Posts: 10,292 Admin
    You're welcome. Keep'm coming, maybe I'll be able to wipe some dust of my subnetting skills ;)
  • pandimuspandimus Member Posts: 651
    Do you happen to remember if you can turn the calculator on your testing computer into a scientific calculator? Kinda like you can in windows?
    Xinxing is the hairy one.
  • 2lazybutsmart2lazybutsmart Member Posts: 1,119
    OK, let's scare the 'macro'-dust particles from WM's subnetting skills. icon_lol.gif

    The subnet mask is primarily used to determine the 'host' and 'network' part right? If I get that basic part right, there are 5 classes right (A,B,C,D,E) and each class has a default subnet mask. the first four are very obvious

    255.0.0.0 (class a)
    255.255.0.0 (class b)
    255.255.255.0 (class c)
    255.255.255.255 (d)

    what happened to the default subnet mask of class e?

    OK, now the mask tells which portion is 'host' and which is 'network'. On a class A network with the default subnet mask, the host part would be the first octet? What if the mask is not the default 255.0.0.0 (and instead, 254.0.0.0 for instance)? And (as in pandimus's previous example) why would a subnet mask have an octet less than 255 since all the mask does is split 'host' part from network part? And if the subnet mask does indeed contain an octet (usually the non-zero one, i guess) less than 255, does that mean it will signify a portion of an octet as network and another portion of the same octet as host?

    For example an IP address 180.123.12.10 with a subnet mask of 255.0.0.0, the network part would be 180 and the host part would be the rest 123.12.10.

    OK. here is where the whole thing gets really murky. why would a host have one octet number to represent it and another 2 otcets and yet another, 3 octects? If I undestand this right, the 180 network part mentioned in the previous example will direct packets to the network with 180 as the first octet. For instance:

    Network1 - starts with 180. and subnet mask is Class A default
    Computer1 - 180.123.12.10
    Computer2 - 180.123.12.11

    Network2 - starts with 181. and subnet mask is Class A default
    Computer1 - 181.123.12.10
    Computer2 - 181.123.12.11

    So pinging 181.123.12.11 would first look for the network that starts with 181, is that it? then once found, it would find the subsequent host matching the host portion of the IP adress? is that how it happens?

    and what if the subnet mask was 250.0.0.0, what would that mean?

    whew.. i hope i didn't confuse the he11 outa you guys cuz I sure am confused icon_lol.gif
    Exquisite as a lily, illustrious as a full moon,
    Magnanimous as the ocean, persistent as time.
  • WebmasterWebmaster Admin Posts: 10,292 Admin
    pandimus wrote:
    Do you happen to remember if you can turn the calculator on your testing computer into a scientific calculator? Kinda like you can in windows?
    It's been some years since I got my CCNA, but I did take the beta INTRO exam last summer just for fun. I can't remember the calculator even being available, but I can be wrong. I didn't need it though.

    It is kind of like learning to calculate when we were kids. At some point some outcomes just 'are' (1+1=2, 10x10=100, 12x12=144 etc.) Same goes for subnetting, there are a couple of numbers you need to remember and work with. 128, 64, 32, 16, 4, 2, 1 as well as 192, 224, 240, 248, 252, 254, 255. At some point you'll see a subnet mask 255.255.255.240, you should recognize it as being a 28 bit mask immediately, as well as (in case it is a class C address) that 4 bits are used to subnet the network (28-(3xicon_cool.gif= 4, which in turn leaves 4 bits for hosts.
  • WebmasterWebmaster Admin Posts: 10,292 Admin
    The subnet mask is primarily used to determine the 'host' and 'network' part right?
    Correct, and the reason they are split up in a host an a network part is because other wise we would have had a shortage of IP's many years ago. Subnetting itself is also a way to preserve addresses. Without subnetting an ISP would have to assign an entire class C (255 addresses) to a company that only needs 8 public addresses for example. With subnetting they can only assign a part (a subnet) of that class C network. A similar example is a street address. If we wouldn't have streets in a city, houses would be numbered from 1 to several thousands or millions even. But now we can have Mainstreet 1 as well as Bleekerstreet 1. Just like we can have host 1 in the Class C network 192.168.100.0, hence 192.168.100.1, as well as in the Class B network 146.12.0.0, hence 146.12.0.1.
    what happened to the default subnet mask of class e?
    For the purpose of learning subnetting, just focus on the ABC classes. Class D and E addresses have specific purposes (i.e. multicast) or are reserved. In case they use a subnet mask (ie. a group of multicast clients) the subnet mask is typically never on a octets boundary but variable to suit the specific needs.
    On a class A network with the default subnet mask, the host part would be the first octet?
    Yes, but note that this is not subnetting yet, using the default subnet mask is not subnetting. Subnetting is borrowing (also called stealing) bit from the host portion of an address so you have more bits available for the network portion. This allows you to create multiple subnets out of one network. For example, you need 2 ip addresses for a WAN link (address for network interface of router on one side and one for the router on the other side.). You wouldn't want to waste an entire class C network address on this so instead of, for example, assigning the class C network 192.168.1.0 - 192.168.1.255 (default mask 255.255.255.0) you would assign network 192.168.1.4 with subnet mask 255.255.255.252. the 252 is 6 bits, hence you borrowed 6 bits from the host portion of the class C address, which leaves 2 bits for the host part which allows for 2 usuable addresses (according to traditional subnetting you need to subtract 2 addresses (192.168.100.4 and 192.168.100.7) cause every network (hence also each subnetted network) needs a network and broadcast address (ie for the network 192.168.100.0 with class c mask the network address is 192.168.100.0 and the broadcast address is 192.168.100.255. For the (sub-)network 192.168.100.4 with mask 255.255.255.252, this is 192.168.100.4 and 192.168.100.7. The addresses available in the 192.168.100.0 255.255.255.0 address can be subnetted into 62 networks (remember that we borrowed 6 bits from the host portion, these 6 bits is 1+2+4+8+16+32 = 64 but according to traditional* subnetting we have to subtract two because we cannot use the first and last subnet because it contains the network and broadcast address for the unsubnetted network itself, hence allows 62 networks. But you probably don't need 62 networks contigiously connected with each 4 addresses available so you may put the remaining address together in 1 or more subnets with a different mask than 252, which is called VLSM (Variable Length Subnet Masking).
    What if the mask is not the default 255.0.0.0 (and instead, 254.0.0.0 for instance)?
    This is not an example to make it easier on yourself. This is not subnetting, but supernetting which can be considered the opposite of subnetting because now you are stealing bits from the network portion to use for the host portion. Ie. A class C network provides only 255 address, if you need twice as much, you can request two class C addresses and supernet them as one by using mask 255.255.254.0 =

    11111111.11111111.1111111|0.00000000 (pipe shows network|host portion boundary)
    As you can see you now got 9 bits available for hosts addresses (512).

    More soon, time to get some food inside of me ;)
  • pandimuspandimus Member Posts: 651
    I searched a few other forums after i posted the calculator question yesterday.

    I Know for a fact microsoft has a normal calculator. I saw a mention that cisco didnt.. But i was curious if that normal calculator can be changed like the on in my windows to a scientific calc. The only reason i would like it is for my powers 2^6 2^9 bla bla bla for my number of hosts on a network
    Xinxing is the hairy one.
  • 2lazybutsmart2lazybutsmart Member Posts: 1,119
    OK. I've been chewing on this for a while. Let's see if I get the drift.

    You mentioned a point I wasn't aware of and that's that every network requires 2 addresses for the network and broadcast. So does that mean I can't create a network with less than 4 IP addresses. and that would mean 1 address for the network, one for the broadcast, 1 for the host computer and one for the server? Or in other words, the address with all '0's in the host portion of the binary is the network adress and the address with all '1's in the host portion of the binary would be the broadcast. so the broadcase address would simply change the host portion to all 255 and the network address to all 0. icon_cry.gif

    The other point about the subnetting itself whereas borrowing bits from the network portion to create a subnet. If I had a network with a Class C network address of 192.168.25.0 with a subnet mask of 255.255.255.0 hence written 192.168.25.0/24 and by '24' that should mean the first 3 sets of 8 bits are used for the network portion and the remaining 8 for the host portion. I hope I got that part right? icon_cry.gif

    OK, now suppose I want a to create a subnet within my above mentioned network that will host 55 computers. The closet power of 2 that will equal 55 (or about 55) would be 2 power 6 = 64. So that would mean 6 out of the 32 bits available for the entire IP address. So the binary format of the subnet mask would probably look like.

    11111111.11111111.11111111.11(upto this point, that would be the network portion right, and the remaining six digits the host portion)000000

    (I did a little digging here on your (|) pipe methodology. and hence the slash stuff icon_wink.gif )

    and changing that into decimal would be 255.255.255.192

    icon_confused.gif So the hosts in the subnet mask would carry IP's 192.168.25.1/26 - 192.168.25.64/26 ((mask 255.255.255.192)

    With a network assigned all it's subnets and (as u mentioned) subs on subnets, how would a ping from an external network that goes through a router deterime where to go. would the network portion of the IP address always carry the subnet's address as well? what i'm trying to say here is, all hosts in a subnet carry the subnet's network address right? and the subnet itself carries the network address of it's parent network and so and so forth? i'm kinda confused on that part. icon_redface.gif [/quote]
    Exquisite as a lily, illustrious as a full moon,
    Magnanimous as the ocean, persistent as time.
  • PavlovPavlov Member Posts: 264
    You won't have to worry about the complicated calculations of subnetting for the 216. Yes, you need to know subnetting and how it works and even how to do it. But they are not going to give you deeply involved calculations. If you haven't already, you should spend some time poking around at Learn to Subnet.

    That site was tremendously helpful for me when I started thinking about subnetting icon_wink.gif
    Pavlov
    A+, Net+, i-Net+, CIW-A
    MCP NT4, MCSA 2K, MCSE 2K
  • WebmasterWebmaster Admin Posts: 10,292 Admin
    icon_lol.gif When the subject is subnetting, I automatically put my Cisco cap on.

    I don't think the calculator on MS exam can be switched to Scientific mode. I vaguely remember trying it ones, but it has been a while since my last MS exam so I could be wrong.

    The reason you say you need it is also the reason why I mentioned these:
    128, 64, 32, 16, 4, 2, 1 as these are the powers of two 2^8 2^7 2^6, you typically won't need 2^9 or higher but if you do just double the previous one, in this case 2^8, which, again, you should know by heart... and I'm sure you remember the days when video cards or PC had 512 KB, than 1024, 2048, 4096, 8192, and so on ;)

    Many give the advice, which is useful if you don't know them by heart, or easily black out on suchs things, to write them down on the sheets as soon as you sit down in exam room. I think however that the need of writing them down proofs that you haven't practiced enough with subnettings and binary calculation. Most experienced net/lan/wan admins/engineers/designers don't even calculate subnets, they just know. To get to that point is easier than it may seem when you start out with subnetting. Just keep repeating and repeating (like the tables back in school) until you know all the numbers and combinations of 'm. And it's kinda like riding a bike, once you really learned it you will never forget how to do it. It will make several exams that cover this topic a lot easier once you fully grapsed it.
  • pandimuspandimus Member Posts: 651
    Cool, i was so caught up in the subnetting i didnt even notice how those calculations came out..
    Xinxing is the hairy one.
  • 2lazybutsmart2lazybutsmart Member Posts: 1,119
    Pavlov wrote:
    You won't have to worry about the complicated calculations of subnetting for the 216. Yes, you need to know subnetting and how it works and even how to do it. But they are not going to give you deeply involved calculations. If you haven't already, you should spend some time poking around at Learn to Subnet.

    That site was tremendously helpful for me when I started thinking about subnetting icon_wink.gif

    great link, Pavlov. As a beginner, I'm finding it extremely helpful. Thanks.
    Exquisite as a lily, illustrious as a full moon,
    Magnanimous as the ocean, persistent as time.
  • pandimuspandimus Member Posts: 651
    Between that link and this link

    http://www.mcsefreak.com/subnetting.htm

    I was able to get it..

    The thing about learntosubnet.com is the fact you cant pause it, and you cant fast forward it, and that dude reiterates toooo much for me. It is interesting how much he empashizes.. "a subnet mask, a CUSTOM subnet mask". Plus he briefly repeats every previous lecture..
    Xinxing is the hairy one.
  • 2lazybutsmart2lazybutsmart Member Posts: 1,119
    There's one thing that I can't make head or tail of yet. I think I'm going to need to understand the OSI model or something. anyways, here we go.

    Suppose you have 4 routers connected together by ethernet cables. Each router connects to a LAN composed of 5 devices. Naturally, in each router, there would be a cable connecting it to his local LAN and another acting as a Gateway for its LAN devices to connect remotely with the other networks. This second cable would be connected to -say- router B which in turn has a cable to it's LAN and another going out to router 3 and so on.

    Now if I ping a device in the LAN of router5 from the network of router1, how will this reach that router. Like what 'route' would it go through? Would all devices in the network be aware of other devices participating in other subnets or are network devices within a subnet oblivious to others in another subnet?
    Exquisite as a lily, illustrious as a full moon,
    Magnanimous as the ocean, persistent as time.
  • WebmasterWebmaster Admin Posts: 10,292 Admin
    When a hosts needs to send a packet to another host it checks if the destination IP is in the same subject as its own. When it isn't it forwards the packets to the nearest interface on the nearest router which will (should ;) have a route in its routing table with the router that has an interface in the same network as the destination IP (which in your simply example would be in turn the default gateway from the destination's perspective.). The routes in the routin tables of the routers are build staticly (by an admin) or dynamically (by routing protocols such as RIP and OSPF). I think you should be able to find more details about this in our Network+ TechNotes.
  • 2lazybutsmart2lazybutsmart Member Posts: 1,119
    yeah thanks. I've skimmed through the pdf's although I'm rereading them again now. I don't know if it's the same with you, but I find it hard to continue studying something if I have a question in mind. It's gotta be solved although it serves as a dangerous means of distraction for me most of the times. icon_cry.gif

    Now the reason I'm asking this question is becuase I've seen this netowrk in real life where there were 4 routers connected together in four different cities. I was reading through the net+ technotes and the e1/t1 thing popped up and consequently the question. They were using e1 links with ethernet converts VIA microwave radios. Each with it's own LAN, I couldn't understand how the devices would be interconnected so as to serve as part of one network.

    But since you mentioned the routing table thing.... I guess that's the answer. Haven't reached that part yet though............. icon_lol.gificon_lol.gif
    Exquisite as a lily, illustrious as a full moon,
    Magnanimous as the ocean, persistent as time.
  • pandimuspandimus Member Posts: 651
    Does this seem reasonable?

    if i get an /24 I can just subtract that from 32 and then root the difference and I will have available hosts?
    Xinxing is the hairy one.
  • WebmasterWebmaster Admin Posts: 10,292 Admin
    /24 means 255.255.255.0 which is the default mask for a class C address, as you probably know there are 256 address in a class C network x.x.x.0 - x.x.x.255 (actual minus 2, because of the network and broadcast address, so 254 are available to hosts.)

    So anything that results in something else than 256, or better, 254, doesn't seem reasonable. icon_wink.gif
  • pandimuspandimus Member Posts: 651
    so my calculation is correct

    32-24=8

    2^8=256
    256-2=254
    Xinxing is the hairy one.
Sign In or Register to comment.