I am trying to understand how a router's forward table works. As such, I am working on the following problem.
Problem:
A router’s forwarding table has the following entries.
\begin{array} {|r|r|}\hline Network \, Number & Next \, Hop \\
\hline 0.0.0.0/0 & 15.15.1.2 \\
\hline 192.140.20.0/24 & 15.15.1.8 \\
\hline 192.140.20.0/20 & 15.15.1.9 \\
\hline \end{array}
Now, if the router is given an IP address like $192.140.20.3$ which row of the table would be used?
Here is how I see it. The first row of the table is not a match. It is going to match either the second or third row. The addresses given in the two rows are the same expect for the qualification. That is, the first address has a subnet mask of $24$ bits. The second one has a subnet mask of 20 bits. We do not know how big the subnet mask of the IP Address given is. So, I do not know what the router will do.
In the forwarding table given there is no metric field. If there was, in this case, it would be used to select either row 2 or row 3. Am I right about this?