This chapter is from the book

Routers perform two main functions: switching and routing. The switching
function is the process of moving packets from an inbound interface to an
outbound interface. The switching function is also responsible for stripping the
data link layer information from a packet it receives and encapsulating it with
the data link layer information (MAC address) of the router's exiting
interface. Routing is a relay function in which packets are forwarded from one
location to another. The routing mechanism is responsible for learning and
maintaining awareness of the network topology. A router functions as a
hop-by-hop paradigm and performs best-effort packet delivery. The packet is
delivered to the downstream router that the sending router feels is closest to
the final destination. For a router to be an effective relay device, it must
perform both routing and switching functions.

There are two ways a router learns about routes a packet must take:
statically and dynamically. Static routes are entered manually by a network
administrator. Dynamic routes are learned by a routing protocol. Routing
protocols can be classified into two categories: interior and exterior. Interior
routing protocols learn about routes and route packets within an autonomous
system (AS). Exterior routing protocols learn about routes and route packets
between autonomous systems. Routing protocols use metrics to determine what path
is best for a packet to travel. A metric is a standard measurement, such as
distance, used by routing protocols to determine the optimum path to a
destination. Each routing protocol uses a different algorithm to determine its
metric. This chapter focuses on the interior routing protocols covered on the
ICND and CCNA exams.

Distance Vector Routing Protocols

RIP and IGRP are distance vector routing protocols. The name is derived from
the fact that routes are advertised as vectors of distance and direction.
Routers running distance vector protocols learn routes from neighboring
routers' perspectives and then advertise the routes from their own
perspective. Because each router depends on its neighbors for information,
distance vector routing is sometimes called "routing by rumor."
Routers running distance vector protocols store the route that has the best
administrative distance and metric in its routing table. RIP and IGRP are also
classful routing protocols. Classful routing protocols exchange routes to
subnetworks in the same major network (Class A, B, or C). In other words, all
networks in the internetwork must have the same subnet mask. This is because RIP
and IGRP do not send the subnet mask in their routing updates, thus assuming
that all networks use the same subnet mask assigned to the exiting
interface.