Finding Matching Routers

DrTechDrTech Member Posts: 7 ■□□□□□□□□□
Hi All,

At the moment I'm feeling pretty confident with subnetting, but one thing is bothering me regarding the topic of routing with overlapping router.

See below the route that matches 172.16.4.3 is shown as 172.16.0.0, I don't understand why the 172.16.0.0/22 is not also a valid route for 172.16.4.3?

Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 5 subnets, 4 masks
R 172.16.1.1/32 [120/1] via 172.16.25.2, 00:00:04, Serial0/1/1
R 172.16.1.0/24 [120/2] via 172.16.25.129, 00:00:09, Serial0/1/0
R 172.16.0.0/22 [120/1] via 172.16.25.2, 00:00:04, Serial0/1/1
R 172.16.0.0/16 [120/2] via 172.16.25.129, 00:00:09, Serial0/1/0
R 0.0.0.0/0 [120/3] via 172.16.25.129, 00:00:09, Serial0/1/0
R1#show ip route 172.16.4.3
Routing entry for 172.16.0.0/16

Thanks in advance!

Comments

  • mikej412mikej412 Member Posts: 10,086 ■■■■■■■■■■
    I thought this looked familiar: http://www.techexams.net/forums/ccna-ccent/61323-how-does-router-choose-route-send-packet.html

    And the answer is:
    No. 172.16.0.0/22 is equivalent to 172.16.0.0 to 172.16.3.255, so 4.3 doesn't fit.

    Problems like this are one of the reasons it's important to have your subnetting skills down.
    :mike: Cisco Certifications -- Collect the Entire Set!
  • DrTechDrTech Member Posts: 7 ■□□□□□□□□□
    yes that makes sense, the '0' in the third octet is actually a valid number and not a null value.

    Many thanks guys
  • Greenmet29Greenmet29 Member Posts: 240
    So... correct me if i'm wrong, but 172.16.0.0/22 is valid for:
    0.1-3.254
    4.1-7.254
    8.1-11.254
    ...
    252.1-255.254

    172.16.0.0/16 is valid for:
    172.16.0.1-172.16.255.254

    So because the first network of /22 doesn't fit 172.16.4.3 and /16 does, it would send it out the /22 interface, right?
  • Forsaken_GAForsaken_GA Member Posts: 4,024
    Greenmet29 wrote: »
    So... correct me if i'm wrong, but 172.16.0.0/22 is valid for:
    0.1-3.254
    4.1-7.254
    8.1-11.254
    ...
    252.1-255.254

    172.16.0.0/16 is valid for:
    172.16.0.1-172.16.255.254

    So because the first network of /22 doesn't fit 172.16.4.3 and /16 does, it would send it out the /22 interface, right?

    No, it's only valid for 172.16.0.0 through 172.16.3.255

    You have the concept of range down, but you're not quite grasping the concept of binary AND'ing and understanding how a router determines whether or not a route is contained in that.

    172.16.0.0 in binary is as follows:

    10101100 00010000 00000000 00000000

    The /22 means that the first 22 bits indicate the network number, which is

    10101100 00010000 000000

    That means that for any IP within that prefix, those bits *MUST* be the same value. The remaining 10 bits can be in whatever combination you want.

    Now, let's take a look at 172.16.4.0/22

    10101100 00010000 00000100 00000000

    if you take the first 22 bits, it looks like this:

    10101100 00010000 000001

    Notice the difference between that and the previous example of 22 bits. The very last bit has changed, it's now a 1 instead of a 0. That means it's an entirely different subnet, and does not fall in under the previous /22 anymore.

    The /22 tells you how many bits are masked, and the bits that are masked are immutable for that subnet, they will ALWAYS be the same for the subnet that precedes the CIDR value. It's only the unmasked bits that are allowed to change.

    4 to 7 would be 172.16.4.0/22
    8 to 11 would be 172.16.8.0/22

    and so on.

    172.16.0.0/16 is valid ofr 172.16.0.0 through 172.16.255.255, so only the /16 prefix contains that route, so it goes out that interface
  • Greenmet29Greenmet29 Member Posts: 240
    ok... I completely understand now. Do you have any suggestions on places that I can get more questions like this?
  • rogue2shadowrogue2shadow Member Posts: 1,501 ■■■■■■■■□□
    Greenmet29 wrote: »
    ok... I completely understand now. Do you have any suggestions on places that I can get more questions like this?

    subnettingquestions.com - Free Subnetting Questions and Answers Randomly Generated Online

    It'll definitely increase your subnetting ability. My bad for the fail answer earlier OP; I've sick throughout the holiday and its been about 10 months (6 months since packet tracer) since I've gotten down and dirty with live lab equip.
  • hypnotoadhypnotoad Banned Posts: 915
    DrTech wrote: »
    Hi All,
    R 172.16.0.0/22 [120/1] via 172.16.25.2, 00:00:04, Serial0/1/1
    R 172.16.0.0/16 [120/2] via 172.16.25.129, 00:00:09, Serial0/1/0

    By the way, the /22 is more specific than /16, so all other things being equal, the more specific route would be chosen.

    That's assuming you have a network that matches both. The network mask length is the tie breaker (ok, one of the tie breakers). In this case, /22.
  • Greenmet29Greenmet29 Member Posts: 240
    I think what was confusing me, and it might be helpful to others with this same problem, is that 172.16.0.0/22 and 172.16.0.0/16 are the actual network numbers. It isn't asking what different subnets, etc that you can get from it. I have to get that into my head.
  • Forsaken_GAForsaken_GA Member Posts: 4,024
    Greenmet29 wrote: »
    I think what was confusing me, and it might be helpful to others with this same problem, is that 172.16.0.0/22 and 172.16.0.0/16 are the actual network numbers. It isn't asking what different subnets, etc that you can get from it. I have to get that into my head.

    Right. while you're learning, they may give you something like a classB and then ask you to subnet it down, you're basically going to list everything.

    With output from a routing table, that's not the case. The prefixes that show in the routing table are specific and discrete blocks of IP's, and if you're being given an IP and asked which route does that IP match, you look for the one with the longest specific match.

    What that question is really asking is can you identify which IP's each route you're shown covers. So for the example in the OP, they're trying to trip you up. You're drilled with 'longest prefix match wins, look for the long prefix!' and you see the /22, and you think that's the most likely candidate, since you're looking for a long prefix and the IP looks like it might fit. Unless you actually do the conversions to figure out which IP's that /22 actually covers, you'll probably get the question wrong. If you do the conversion (and do it right, ie, starting from 0 instead of starting from 1), it'll become readily obvious that the /22 doesn't fit, and the only route that matches is the /16, which is the shortest prefix in the entire list (but still the longest one that matches).

    Cisco does this stuff all the time. The trick is to understand the question they're actually asking you, not the question you think they're asking. *always* read a question twice and try to reword it in your head to make sure you understand what they're actually asking for. They will give you just enough rope to hang yourself, you've just got to be nimble at dodging the noose. If there is *anything* in a question that gives you pause, make sure you trust that instinct and look deeper. Most of the time you'll find yourself in the middle of an exam going 'you sneaky bastards!'
  • Greenmet29Greenmet29 Member Posts: 240
    The trick is to understand the question they're actually asking you, not the question you think they're asking. *always* read a question twice and try to reword it in your head to make sure you understand what they're actually asking for.

    I haven't taken the exam yet, but I think that this might be the best tidbit of advice that has been given to me while studying. Thanks!icon_thumright.gif
Sign In or Register to comment.