• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download

TCP/IP Troubleshooting: A Structured Approach - Part 2: Troubleshooting Routing Tables

\u2022
Launched: Oct 17, 2006
\u2022
Updated: Nov 15, 2006
\u2022
Section: Articles & Tutorials :: Network Troubleshooting
\u2022
Author: Mitch Tulloch
This article explains how routing tables work and how to troubleshoot routing
problems in Windows-based networks.

In the first article of this series, I outlined a structured approach for troubleshooting TCP/IP networking issues on Windows-based networks. Key to this structured approach was three things:

\u2022
Understanding the networking technologies and protocols that underlie the
problem.
\u2022
Determining the different elements of the problem and their attributes.
\u2022
Determining which troubleshooting steps and tools should be applied to
resolve the problem.

I displayed these items as a bullet list instead of a numbered list because network troubleshooting generally isn't as easy as 1-2-3. In other words, it's often more of an art (i.e. based on intuition) than a science (based on a methodology).

At the foundation of TCP/IP networking is the routing table, a data construct on each
host on a TCP/IP network. Routing tables serve the following three purposes:
\u2022
They are used to store the information about other subnets on the network and
how you can reach hosts on these networks.
\u2022

They are used to determine which host (called the next-hop IP address) each packet should be forwarded to in order to reach the host this packet is ultimately destined for.

\u2022

They are used to determine which network interface (called the next-hop interface) should be used to forward this packet so it gets to its ultimate destination.

Understanding routing tables is therefore essential if you want to be able to effectively troubleshoot routing issues on a TCP/IP network. Let's look at how routing tables work, what they look like in different scenarios, and what troubleshooting steps and tools might be indicated in different situations. We'll begin by examining the routing table on a single-homed server (a server with a single network interface) that has a single IP address assigned to it. I've chosen this example because it's the easiest one to understand, and in next month's follow up article we'll look at more complicated scenarios including servers with multiple IP addresses (such as web servers) and

servers with multiple network interfaces (such as servers that are connected to both
the LAN and to a separate network used for running backup jobs).
Routing Table for Single-Homed Server with a Single
IP Address
The following routing table is for a server that has IP address 172.16.11.30 on the
172.16.11.0/24 network:
To display this routing table, you open a command prompt window and typeroute
print at the command line. Let's take this table apart so we can understand how it
works.
Each routing entry (or route) in the routing table is comprised of five fields:
\u2022
Network Destination. An IP address or subnet representing a possible target
destination to which IP packets may be forwarded.
\u2022
Netmask. A bitmask used for matching the destination field in a packet's IP
address to one of the possible network destinations above.
\u2022
Gateway. The next-hop IP address to which the packet must be forwarded to
reach the particular destination network.
\u2022
Interface. The next-hop interface which must be used to forward the packet to
reach the particular destination network.
\u2022
Metric. The cost of the route.
Example 1: Destination Host on Local Subnet

For our first example, let's say this particular server (172.16.11.30) has to send a packet to another host with IP address 172.16.11.80, which is on the same subnet. This packet will thus have source address 172.16.11.30 and destination address

172.16.11.80. Here is how Windows uses its routing table to decide which route to
use:1. Windows first takes each route from the table in turn and performs a bitwise

AND between the destinations address in the packet (172.16.11.80) and the bitmask (Netmask) of the selected route. Here are the results, where each route in the table is identified by its network destination:

Route
Netmask
172.16.11.80 AND Netmask
0.0.0.0
0.0.0.0
0.0.0.0
127.0.0.0
255.0.0.0
172.0.0.0
172.16.11.0
255.255.255.0
172.16.11.0
172.16.11.30
255.255.255.255
172.16.11.80
172.16.255.255
255.255.255.255
172.16.11.80
224.0.0.0
224.0.0.0
160.0.0.0
255.255.255.255
255.255.255.255
172.16.11.80

2. For each route, the result of this ANDing is then compared with the Network Destination field of the route, and a match means the route can be used to forward the packet to its destination address. If more than one match is found, Windows uses the route with the longest match (the route whose Netmask has the highest number of 1 bits). If this doesn't result in a unique match, Windows uses the match that has the lowest cost (Metric). Finally, if more than one match has the same lowest cost, Windows arbitrarily chooses one of them as the route to use. From the table above, you can see that this ANDing process results in two matches (routes 1 and 3) so Windows chooses the one that has the longest match, which is row 3. The result of all this is that Windows now knows which route to use to get this packet to its destination. Here\u2019s what this route looks like in the server's routing table:

Network
Destination
Netmask
Gateway
Interface
Metric
172.16.11.0 255.255.255.0 172.16.11.30 172.16.11.30 20
3. Windows now uses the following algorithm to decide what to do next:

A. If the route's Gateway field matches the address of one of the network interfaces on the server (or if the Gateway is empty) then Windows sends the packet directly to its destination address using the interface specified in the route.

B. If the route's Gateway field does not match the address of any of the network interfaces on the server, then Windows sends the packet to the address in the route's Gateway field.

Clearly, condition A is the case here since the route's Gateway field (172.16.11.30) is the address assigned to the server's single network card. Windows therefore determines that the destination address is on the local subnet and that means Windows can send the packet directly to that address without needing to forward it to any routers. So in this case, Windows simply sends the packet to 172.16.11.80 using the server's 172.16.11.30 network interface, and the receiving host gets it.

of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...