Routers don’t really care about hosts, they only care about networks and the best path to each network. The logical network address or IP address of the destination host is used to route packets to a network through a routed network, then the hardware address or MAC address of the host is used to deliver the packet from a router to the correct destination host.
Routing involves two basic activities: determining optimal routing paths and transporting packets through an internetwork. Part of this process involves analyzing a routing table to determine the best path.
Routing protocols use metrics to evaluate what path will be the best for a packet to travel. A metric is a standard of measurement, such as path bandwidth, that is used by routing algorithms to determine the optimal path to a destination. To aid the process of path determination, routing algorithms initialize and maintain routing tables, which contain route information. Route information varies depending on the routing algorithm used.
Routing algorithms fill routing tables with a variety of information. Destination/next hop associations tell a router that a particular destination can be reached optimally by sending the packet to a particular router representing the "next hop" on the way to the final destination. When a router receives an incoming packet, it checks the destination address and attempts to associate this address with a next hop.
Routing algorithms have used many different metrics to determine the best route. The following metrics can be used to determine best path
• Path length - Path length is the sum of the costs associated with each link traversed. Other routing protocols define hop count, a metric that specifies the number of passes through internetworking products, such as routers, that a packet must take en route from a source to a destination.
• Reliability - refers to the dependability (usually described in terms of the bit-error rate) of each network link.
• Delay - refers to the length of time required to move a packet from source to destination through the internetwork.
• Bandwidth - refers to the available traffic capacity of a link.
• Load - refers to the degree to which a network resource, such as a router, is busy. Load can be calculated in a variety of ways, including CPU utilization and packets processed per second.
• Communication cost
Routing tables also can contain other information, such as data about the desirability of a path. Routers compare metrics to determine optimal routes, and these metrics differ depending on the design of the routing algorithm used.
Routers communicate with one another and maintain their routing tables through the transmission of a variety of messages. The routing update message is one such message that generally consists of all or a portion of a routing table. By analyzing routing updates from all other routers, a router can build a detailed picture of network topology.
Classes of routing protocols:
Distance Vector:
Link State: