A
routing protocol specifies how
routers communicate with each other, disseminating information that enables them to select routes between any two
nodes on a
computer network.
Routing algorithms determine the specific choice of route. Each router has
a priori knowledge only of networks attached to it directly. A routing protocol shares this information first among immediate neighbors, and then throughout the network. This way, routers gain knowledge of the topology of the network.