12 Replies Latest reply: Sep 12, 2008 5:45 AM by Stuart Sheffield RSS

    Route Selection ?



      I'm confused....



      Given the output of 'show ip route rip' cmd below, what route would be selected for packets destined for ?






      Gateway of last resort is not set.


      / 16 is variably subnetted, 5 subnets, 4 mastks



      R / 32 via, Serial 0/1/1

      R / 24 via Serial 0/1/0

      R / 22 [120/1\ via Serial 0/1/0

      R / 16 via Serial 0/1/0

      R / 0 via Serial 0/1/0



      I've always understood that when a destination ip falls within the range of multiple routes, the route with the longest prefix wins. So my choice was the 3rd route from the top - / 22. But the answer given is the 4th line down - / 16.



      If the text is correct, what am I missing?






        • 1. Re: Route Selection ?

          I don't know why the AD and metric is lined out above....

          • 2. Re: Route Selection ?





            Hello Mr. TX858,



            The correct is 4th option i.e. the packet destined for will follow



            R / 16 120/2 via Serial 0/1/0






            According to you, the answer should be / 22. But can u make a subnet with network address ?



            No u can't do that.. because 4 means that you require 00000100 in the 3rd octet.



            But the possible options for 3rd octet for / 22 are



            00000000 this is / 22



            00000001 this is / 22



            00000010 this is / 22



            00000011 this is / 22



            So u see, as only 2 bits are available in the 3rd octet......this is the not the match for packet to



            I hope everything is clear now..






            • 3. Re: Route Selection ?
              Sandeep N


              Hello MR chetan,



              Referring the original scenario,



              1) What if there is a host with IP (Whose subnet address can be considered as In this case which will be prefered route?



              2) Also with / 22 we can make following subnet address.






              b) (This will contain IP






              and so on....



              I guess it is possible to make subnet with network address



              Please comment.....









              • 4. Re: Route Selection ?
                Stuart Sheffield





                Forgive me if I'm missing the point to this post but we are talking about RIP.



                As you all know this is a classful protocol and since the network in not in the routing table it is not known so will be forwarded at the bit boundary which is /16.



                hope I've not got the wrong end of the stick here.



                • 5. Re: Route Selection ?
                  Sandeep N





                  The route will be through (As RIP is classfull).....I guess.........



                  I was bit confused when chetan updated that we cannot make a subnet out of This created other question. I was trying to clarify it. Hope it is correct.









                  • 6. Re: Route Selection ?


                    Hello Sandeep,



                    Dear, even i got confused when u questioned my answer..



                    I think i didn't explain it properly




                    Here is what i was actually thinking .



                    With Network Address / 22, you can make a total of 64 subnets.



                    Subnets start from / 22, / 22, / 22...........and last one is / 22.



                    Here in the routing table, Rip is showing first subnet of the network address / 22.




                    is also known as Zero Subnet. The range of this subnet will be

           to with being the broadcast

                    address. So there is no way that fits into this range. Thatz why it will follow the path via



                    And regarding your first question what if there is a host with IP, Then in this case there will be an additional entry



                    in the routing table which shows like R / 22, so this would automatically become the preferred path instead of



           / 16 .



                    Please clear if i am not guessing it correctly.






                    • 7. Re: Route Selection ?


                      Here is another simple explaination for the answer.



                      The given routing table is as follows:



             / 16 is variably subnetted, 5 subnets, 4 masks




                      R / 32 120/1 via, Serial 0/1/1

                      R / 24 120/2 via Serial 0/1/0

                      R / 22 [120/1\ via Serial 0/1/0

                      R / 16 120/2 via Serial 0/1/0

                      R / 0 120/3 via Serial 0/1/0



                      To decide the destination network of a packet, there are two guidelines :



                      First, the IP of the packet must match a minimum of mask bits specified in the route in the routing table.



                      Second, In case of tie, follow the route with the longest prefix match.






                      If we assume that destination IP of packet is, there are two possible routes for this packet



                      Either ,

                      R / 16 120/2 via Serial 0/1/0




                      R / 0 120/3 via Serial 0/1/0



                      Since there are multiple possible routes for, so to decide the final route follow the Second guideline, which states that follow the route with longest prefix match.



                      Hence option 4 is the correct answer for TX's question.



                      As far as route

                      R / 22 [120/1\ via Serial 0/1/0 is concerned, packet can't follow this route.



                      I have explained this in my previous posting.



                      • 8. Re: Route Selection ?


                        Hi Stuart and Sandeep,



                        I have a question. You both wrote that RIP is classful. How can you say that classful RIP is used here in this question ?



                        Rip Version 1 is classful



                        Rip Version 2 is classless.



                        In the routing table, both RIPv1 and RIPv2 entries are shown starting with the same prefix "R".



                        So what made u think that classful version is in use here ??






                        • 9. Re: Route Selection ?
                          Steven King

                          RIPv1 is Classful but RIPv2 is Classless. We need to distinguish which version we are dealing with here.


                          For route R / 22 [120/1\ via Serial 0/1/0 You can not make out of that Address: 10101100.00010000.000000 00.00000000 Netmask: = 22 11111111.11111111.111111 00.00000000 Wildcard: 00000000.00000000.000000 11.11111111 => Network: 10101100.00010000.000000 00.00000000 HostMin: 10101100.00010000.000000 00.00000001 HostMax: 10101100.00010000.000000 11.11111110 Broadcast: 10101100.00010000.000000 11.11111111 Hosts/Net: 1022 Class B, Private Internet With route R / 16 120/2 via Serial 0/1/0


                          You can make a subnet. You have to ensure that the subnet matches the range of the route.




                          Address: 10101100.00010000. 00000000.00000000

                          Netmask: = 16 11111111.11111111. 00000000.00000000

                          Wildcard: 00000000.00000000. 11111111.11111111


                          Network: 10101100.00010000. 00000000.00000000

                          HostMin: 10101100.00010000. 00000000.00000001

                          HostMax: 10101100.00010000. 11111111.11111110

                          Broadcast: 10101100.00010000. 11111111.11111111

                          Hosts/Net: 65534 Class B, Private Internet




                          So as stated, the correct answer is

                          • 10. Re: Route Selection ?
                            Paul Stewart  -  CCIE Security

                            I would have thought the varying slash notation would have given away the fact that it is version 2. Althought RIPv1 is classless, you can use subnets. The prefix length is derived from the interface in which the packet is received. However, all the subnets of a particular network must be the same length in order for it to work in all cases.

                            • 11. Re: Route Selection ?


                              Thanks Chetan and all others!



                              I guess my brain went on vacation



                              I now have to avoid hurricane Ike!



                              • 12. Re: Route Selection ?
                                Stuart Sheffield


                                Very good question



                                The question/answer pointed to version 1 hence why I originally committed to that but......



                                Looking again at the routing table entries I notice variable length masks which have been learnt through the routing protocol.



                                This indeed indicates version 2 since in version 1 you can only have variable masks if those networks are known locally (i.e. connected).



                                Unfortunately all the entries are "R" and not "C" so I guess it is indeed version 2.



                                I need a lie down