Windows Routing Table - is the lookup recursive?

Michael Gopshtein 1 Reputation point
2022-06-05T19:31:09.297+00:00

Windows 10, the routing table contains the following lines:

Dest      Mask        NextHop     Interface   Metric  Policy/Proto/Type
 0.0.0.0   0.0.0.0     10.128.128.128   6      30      0/3/4
 10.0.0.0  255.0.0.0   169.254.254.1    21     0       0/3/4

Is the routing lookup recursive? Given, for example, IP 100.1.2.3, it should go to the default route, as defined in the first line - interface 6, IP 10.128.128.128. Will it use this selection, or will recursively look for IP 10.128.128.128 and eventually select interface 21?

Windows for business | Windows Client for IT Pros | Networking | Network connectivity and file sharing
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. risolis 8,741 Reputation points
    2022-06-05T20:20:15.877+00:00

    Hello @Michael Gopshtein

    Thank you for your post.

    I wonder if you are sharing a route print output cause seems to be kind of different....

    208507-image.png

    Now the only way your traffic can be move from one egress interface is using Automatic metric option on windows as it is shown below:

    https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/automatic-metric-for-ipv4-routes

    Cheers,

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


  2. Gary Nebbett 6,216 Reputation points
    2022-06-06T20:00:40.76+00:00

    Hello Michael,

    I have not been able to quickly identify an RFC that specifies the expected behaviour, but this is my understanding:

    • The first consideration is the "prefix" length: compare the destination address masked with the "netmask" value for each route and select the route with the longest prefix match.
    • If more than one route has the same length prefix match then select the one with the lowest metric.

    In your initial message there might be a typo - you use the example address 100.1.2.3 - that only matches the default route.

    If you meant 10.1.2.3, then that matches both routes but has a longer prefix match with route/netmask 10.0.0.0/255.0.0.0 (8 bits) than with 0.0.0.0/0.0.0.0 (0 bits) so interface 21 will be selected.

    There is nothing that can sensibly described as "recursive" about this process - a single scan, matching first prefix length and then metric determines the route. If two or more interfaces are equivalent after this matching process then one of those interfaces will be chosen on an implementation dependent basis.

    Gary

    0 comments No comments

  3. Limitless Technology 39,926 Reputation points
    2022-06-07T07:41:36.803+00:00

    Hello,

    So the process called recursive lookup - when a route table entry references to another IP address and not to a directly connected exit interface. Therefore another lookup has to be made. There can be more lookups, until the route with exit interface specified is found - so that's why it's called recursive.


    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.