Optimizing your network for fastest throughput is an ongoing, tedious job. With so many places to start, you never know where optimization should begin. Deb Shinder takes you straight to the routing table to show you a sure path to optimization.
Routing tables are databases—either manually created and updated by an administrator or automatically developed by dynamic routing protocols such as RIP and OSPF—used by hosts and routers to determine the route, or path through the network, that a packet will take to reach its final destination.
In this Daily Feature, I will discuss some ways of optimizing routing tables to ensure that data makes its way as quickly and efficiently as possible.
Getting there is half the battle
The first and most mission-critical task of the routing table is to get the packet to its destination. Getting it there as quickly as possible is secondary but also important in today’s “just in time” business environment. Routing occurs when a computer that is running a routable protocol (typically TCP/IP or IPX) sends a packet addressed to a computer that is on a different network or subnet. There are several points in the routing process where this journey can be slowed down or even disrupted completely.
Two types of routing
There are two types of routing: direct and indirect. Direct routing involves source and destination computers that are on the same network/subnet. In this Daily Feature, we will be discussing indirect routing, in which the source and destination machines are on different networks/subnets and must go through an intermediary router.
When routed packets arrive at their destinations late (or not at all), there are several issues to consider:
- Name resolution issues: Messages are usually sent by users using “friendly” computer names. TCP/IP uses DNS to resolve names to IP addresses; IPX queries the bindery or directory tree of the default server to resolve names to internetwork addresses. Optimizing the name resolution process will increase the overall speed with which routed packets reach their destinations.
- Address Resolution Protocol (ARP) issues: In order to reach the destination, the logical (IP or IPX) address must be resolved to a physical address (also called the Media Access Control or MAC address). Persistent entries can be added to the ARP cache to optimize access to frequently used destinations.
- Host configuration issues: A host computer that doesn’t have a routing table and has no default gateway configured may be able to determine where to send a routed packet by broadcasting or multicasting a query using a routing protocol such as RIP for IPX (the message is called a GetLocalTarget message).
- Source routing issues: Some protocols (including IP) allow the sender to specify the entire path from source to destination computer, instead of having each router along the way make the decision as to where the packet should be forwarded next.
- Routing table issues: The routing table may be updated automatically by dynamic routing protocols, allowing routers to communicate with each other and “learn” the best routes, or they may be maintained manually (this is called a static routing table). Static routing tables may have only one entry—the default route—or may contain entries that specify the routes to often-accessed networks or hosts.
While this article focuses on the last issue, you should be aware of how all these issues impact performance. Source routing, for example, tends to be slow and bandwidth intensive. Likewise, the dynamic (or query) routing method of determining routes takes extra time and adds to network traffic. Your first step in optimizing routing may be to ensure that you aren’t using these methods unless there is a compelling need to do so. You should also ensure that DNS and ARP are operating at optimal levels.
All routes are not created equal
In a large internetwork, there may be many different paths that a packet could take to reach a particular destination. Even if all roads lead to Rome, some will get you there more quickly than others. To optimize routing, you (or a routing protocol) must determine which routes are more “cost effective.”
Measuring the “cost” of a route
The “cost” of a route is expressed in the routing table as a metric. This is a numerical value assigned to the route to indicate its priority or preference. Generally, a lower value indicates a more cost-effective route. The metric may be based on the following:
- Hop count: The number of routers a packet must go through from source to destination
- Throughput: The amount of data that can be sent per second using the specified route
- Delay: The amount of time required for a packet to arrive at the destination
- Reliability: The relative probability that the links comprising this route will not fail
While hop count is a commonly used metric, it often does not give an accurate picture of the true performance cost of a route; just as you may be able to reach a destination in your car more quickly by taking a route that involves traveling more actual miles because the “shorter” path is congested or has many traffic lights or a much lower speed limit.
Optimizing static routing tables
When using dynamic routing, the routing protocols allow routers on the internetwork to exchange information with one another via messages that are sent at regular intervals or on demand. This process is automatic.
Know the internetwork topology
When using static routing, the administrator must manually configure the routing table. This requires accurate, current knowledge of the internetwork. You must know which routers are connected by high-speed links and which are connected by slow WAN links. To optimize the static routing table, you must know the network’s topology.
Add routes to frequently used destinations
Host computers, as well as routers, can have routing tables. In many cases, the host’s routing table will contain only one route: the default route (which routes packets destined for addresses outside the subnet to the default gateway router). You can speed the process by adding additional network and host route entries for frequently used destinations.
A network route specifies the path to a particular network ID (subnet). A host route specifies the path to a particular node on the specified subnet.
Add and remove routes promptly when internetwork topology changes
Each time a new subnet is added to the internetwork, you must manually add the route to the routing table. To optimize performance, you should also remove any routes to subnets that are no longer active.
If a router or a link fails, and the routing table is not reconfigured, this can result in a black hole, in which packets are dropped and data is lost, without an indication that there is an error.
Avoid routing loops
You should not configure two neighboring routers with default routes that point to one another. This can create a routing “loop” for packets with an unreachable destination. A loop occurs when the path taken by the packet loops back on itself.
Optimize routing table size
To conserve the space occupied by the routing table, aggregation can be used to reduce the size of the routing table. IP supernetting is an aggregation technique. Classless interdomain routing (CIDR) addressing uses aggregation to reduce routing table sizes.
Additional optimization tips
Not all methods of optimizing routing involve configuration of the routing table. There are several additional methods you can use to optimize the transmission of routed data.
Avoid forwarding broadcast messages
Some routable protocols allow for forwarding of broadcast messages across routers. This can result in a broadcast storm if a host computer malfunctions, slowing or completely disrupting network traffic. It is best to disable forwarding of broadcasts unless you have a compelling need.
Disable source routing
Unless you need to specify the entire specific path to override the route that would normally be used (usually done for testing or debugging purposes), you should disable source routing and allow routing decisions to be made based on the local routing tables on the hosts and routers.
Evaluate the use of static vs. dynamic routing
An important factor in optimizing routing is to know when you should use static, rather than dynamic, routing. It is generally recommended that static routing tables be used only in small internetworks, in which the topology does not often change. The purpose of the algorithms used by dynamic routing protocols is to optimize the routing tables and the routing process. However, the routing protocols require a certain amount of overhead and the convergence process can cause delays. Thus, sometimes even on medium-to-large internetworks, if the topology is stable, predefining static routes can conserve bandwidth and speed up processing time.
If the network topology is such that there are no redundant paths to any destination, dynamic routing is probably not necessary, as its primary purpose is the discovery of alternate routes and determination of the best of multiple paths.
Routing tables are essential for the forwarding of packets from one network/subnet to another across an internetwork. The speed with which the packets travel can be increased by optimizing the routing tables used by hosts and routers to determine the path to be taken through the internetwork. In this Daily Feature, I have discussed some of the ways in which routing tables can be optimized and routing performance enhanced.