routing

Definition of routing in The Network Encyclopedia.

What is Routing (in computer networking)?

The process of selecting a path through an internetwork over which to transmit packets to a destination host or hosts and then having devices called routers forward the packets to those hosts. For routing to occur, a routable protocol such as TCP/IP or IPX/SPX must be used.

How It Works

Routing takes place at the network layer (layer 3) of the Open Systems Interconnection (OSI) reference model. On a TCP/IP internetwork, this means that routing involves delivering packets to destination IP addresses on the internetwork.

The first and main part of the routing process consists of determining the path over which packets will travel from the sending, or original, host to the receiving, or destination, host. The second part of the process involves having routers switch packets from one successive segment, or “hop,” of the path to the next until the packets arrive at their destination.

Routers are devices that join subnets, which are separate and distinct networks that make up an internetwork. The routers maintain internal tables called routing tables, which contain information describing the potential paths that data can take to travel through the internetwork. Between any two subnets on the internetwork, there can be more than one path or route by which packets can travel. The routing information stored in the routing tables describes the metric or cost value for each possible route between different subnets. When packets need to be sent to a host or hosts on another network, they are forwarded to a router that is connected to the local network, which then checks its routing tables to determine which path the packets should take. Packets are usually sent along the path with the lowest cost value or metric. If two paths to the same destination have the same metric, packets can be load-balanced between the two routes.

The value of the metric for a specific path depends on several factors. For example, the metric might be proportional to the number of routers that the packet stream must be switched through (the number of hops traversed) in order to reach the end of the path. The metric might also depend on other factors such as the delay or latency of packets when they are processed by each router, the amount of traffic congestion (load) at the router, available bandwidth, and the relative reliability of the routers. Network administrators can manually specify metrics for each path and enter them into routing tables by using static routers, or they can use dynamic routers, which use a routing algorithm to automatically calculate metrics for each possible path. Dynamic routers automatically calculate metrics by communicating with each other using special protocols called routing protocols. Examples of routing protocols include Routing Information Protocol (RIP) and Open Shortest Path First (OSPF) Protocol.

Once the routing table of a router has been configured (or once the tables of all dynamic routers have “converged” and stabilized), the router carries out its switching function. This switching function is essentially independent of the particular routing protocol being used. It works like this: If a host on the local network needs to send a packet to a host on a remote network, it checks its own internal routing table to determine which router to contact and then uses Address Resolution Protocol (ARP) to obtain the MAC address of the local router interface that connects the local network to the remote network. The host then sends the packet directly to the local router interface. The network layer header of the packet contains the logical network address (the IP address on a TCP/IP internetwork) of the destination host that the packet needs to be delivered to. The router receives the packet, inspects the network-layer destination address in the packet’s header, and compares the address to the route information stored in the router’s internal routing table in order to determine what to do with the packet. If the router cannot determine what to do with the packet, it simply drops the packet. Otherwise, it forwards the packet to another router, which forwards it again until the packet finally reaches its destination network. As the packet is switched from router to router, its network layer destination address remains the same, but its MAC address keeps changing to that of the next router interface along the path.

NOTE

Although routing is normally considered the exclusive job of routers, routing actually occurs in two places on a network such as a TCP/IP internetwork:

  • At the host itself (host routing). Each host on the internetwork normally maintains its own internal routing table. This table is used to determine whether to send a packet to the local network, to a specific router interface, or to the default gateway address.
  • At the routers that connect the various subnets (router routing).

Routing in a network can suffer from a number of problems. One problem is the existence of routing loops, which occur when a packet passes through the same router more than once on a given trip. The result is that the packet loops until its lifetime decreases to zero and a router discards it. The originating host usually never knows that the packet was dropped and did not reach its destination. Routing loops occur most often in networks that use incorrectly configured static routers. Routing algorithms for dynamic routers can usually detect loops and reconfigure routing tables to eliminate them.

Another problem is convergence. In a large internetwork using dynamic routers, it might take some time for a change in one router’s tables to propagate to all other routers in the internetwork. In the meantime, temporary routing loops can occur and less efficient network paths might be chosen, resulting in more traffic congestion.

TIP

To view the internal routing table of a computer running Microsoft Windows 2000 or Windows NT, type route print at the command prompt.

See also: