custom.ribbon_feed
annuler
Affichage des résultats de 
Rechercher plutôt 
Vouliez-vous dire : 
cancel
372
Visites
0
Compliment
7
Réponses

Longest prefix match exercise again...

LetMePass
Spotlight
Spotlight

Hello Cisco Community,

I am once more time struggling with longest prefix match exercise.

On the picture below how will be routed packet by router R1 with destination address 192.168.3.0/24?

LetMePass_1-1712415405437.png

I guess it's either 192.168.4.0/24, or 192.168.5.0/24, but I believe it's 192.168.4.0/24.

What is the answer, and could you explain to me again in simple terms how you find the route?

Best Regards,

Chris

 

1 SOLUTION APPROUVÉE

Solutions approuvées

Q-ZRK
Level 1
Level 1

Hello,

The packet will not be routed because there is no route for the network 192.168.3.0/24

I'm sorry but it seems that you don't master subnetting, you have to learn that first to answer this question yourself

Regards,

Q

Voir la solution dans l'envoi d'origine

7 RÉPONSES 7

Q-ZRK
Level 1
Level 1

Hello,

The packet will not be routed because there is no route for the network 192.168.3.0/24

I'm sorry but it seems that you don't master subnetting, you have to learn that first to answer this question yourself

Regards,

Q

Hi there,

Actually it is very logical, but I made the assumption that there must be a route if the question is asked.

Don't be sorry, I am aware that I struggle with subnetting, I really focus on that now. I also lack a lot of practice, because the theory does not help much to shape my mind.

I have taught subnetting and it is a hard topic for many. Keep at it. Eventually it will 'click' for you. If you are looking for additional resources let us know. I can think of several good ones. 

Maren

Yes, let us talk about it. For example, I like the attached PDF. It makes me consider that, while the best route is ideal, there are alternative routes.

Now, I am not sure how am I supposed to determine the best route?

Either I check each network/broadcast IP address individually to locate valid hosts, or I can see it at a glance?

Ex 1 is not hard at all

LetMePass_0-1712684900015.png

Ex 3 is a try hard

LetMePass_1-1712684966577.png

158.80.0.x? but why it's not 158.80.1.x?

What are your thoughts on this matter?

EDIT:

158.80.1.x prefix never really match the IP.

158.80.1.217 -

00000001.11011001

-----------------------------------------------------------

*158.80.1.210/30

00000001.11010010

-----------------------------------------------------------

**158.80.1.192/28

00000001.11000000

Etc, etc..

Nonetheless, do you quickly calculate in your mind? I had to write my conversions and it took me 10m..

 

The way to figure out the best route while you are learning is to calculate out the IP blocks represented by all of the routes, then determine which one is best. That will give you practice. In the example you gave, there are two routes that include the target IP of 158.80.1.217 and you would select between the two based on administrative distance:

158.80.0.0/16   = 158.80.0.0 - 158.80.255.255 Admin Distance = 90
158.80.1.0/25 = 158.80.1.0 - 158.80.1.127
158.79.1.216/30 = 158.79.1.216 - 158.79.1.219
158.76.0.0/15 = 158.76.0.0 - 158.77.255.255
158.80.1.0/26 = 158.80.1.0 - 158.80.1.63
158.80.0.216/30 = 158.80.0.216 - 158.80.0.219
158.80.1.210/30 = 158.80.1.210 - Not valid NetID is 158.80.1.208
158.80.1.192/28 = 158.80.1.192 - 158.80.1.207
158.80.0.0/16 = 158.80.0.0 - 158.80.255.255 Admin Distance = 1
158.80.1.0/25 = 158.80.1.0 - 158.80.1.127
158.80.1.216/32 = 158.80.1.216

By the way HUGE RESPECT for going down to binary. That was what made it click for me and, in the end, it is how the computers work so understanding the binary behind subnetting is important.

The way to calculate quickly is by using the "Magic Number" method. Remembering that blocks of IP addresses are determined by the subnet mask - and magically if you subtract the last part of the subnet mask from 256 you get the size of the block of IPs with that subnet mask.

For instance:

  • A /28 subnet mask is 255.255.255.240
  • Subtract: 256-240 = 16
  • Each subnet is in a block of 16, so:  158.80.1.0, then 158.80.1.16, then 158.80.1.32 and so on.

It gets a little trickier when you have something like a /20, but if you remember that the "0's" part of the subnet mask traverses two octets the same holds true so:

  • A /20 subnet mask is 255.255.240.0.
  • Subtract: 256-240 = 16
  • So subnets rise by 16 in the third octet 10.4.0.0-156.4.15.255 and then 10.4.16.0-10.4.31.255 and then 10.4.32.0-10.4.47.255

Go do a search for "subnetting using magic number" and you'll find resources. There is an excellent pair of videos by Russell Hughes of Sunset Learning (a Part 1 and a Part 2) that describe how to do this.

Subnetting Made Easy:  https://www.youtube.com/watch?v=GSX1GlaznKM 

Subnetting Made Easy Pt. 2 - Variable-Length Subnet Mask (VLSM):  https://www.youtube.com/watch?v=U9dVVIk8_zA 

I hope you find this helpful.

Maren

Thank you for clarifying the exercise. I make an effort to avoid using automatic calculators online. I do not feel I can be a decent network specialist if I only use internet tools. Additionally, I don't want to be caught off guard during an interview. I also like the magic number method, I find it very fast. Now having said that, the downside is when it comes to /30 netmask. It will give 64 subnets.

Let me take an example again: 

Let's pretend the destination is not 158.80.1.217 but 158.80.0.217/30

So 256-252=4 (second network ID)

First network 158.80.0.0 - Broadcast - 158.80.0.3

Second network 158.80.0.4 - Broadcast - 158.80.0.7

 

Third network 158.80.0.8 - Broadcast - 158.80.0.11

But the time I get to 158.80.0.216/30, my time is up.. I only use Magic number method when I get asked to find the first three subnets. 

It seems the best method for the longest prefix match appears to be binary conversion, however this is prone to human error, particularly when under pressure. 

Nonetheless, some of the questions can be answered with a short glance, while others demand a lot more attention.

With a better understanding of subnetting and more practice, I could have rapidly determined the answer to the following question. I received it during an interview, and it probably resulted in my elimination. The good thing is it taught me a valuable lesson, and I am very grateful about that!

LetMePass_0-1713094543675.png

 

 

The videos by Russ teach the methodology and are not automatic calculators. I do recommend them for anyone learning subnetting.

For a /30 when using the Magic Number method the thing to remember is that whatever number is the subnet ID must be divisible by 4. So, for the .217 IP address I'd think about "what number a little less than my target IP is divisible by 4"? The answer is .216. So the /30 that contains .217 is the 158.80.0.216/30 network. 

Ditto - as another example - for a /29 where the magic number is 8. "What number that is just below my target IP is divisible by 8?". That will be - and MUST be - your network ID.

This works for all of the magic numbers, for that matter. Once you get fast at that the longest match exercise will go much faster.

I'm sorry you got eliminated.

Maren