As an example, consider host c which may have a default route
pointing to router Y. The first time c sends a packet to
host a it will send it to Y. Y will forward it to
the correct router (Z), which then passes it on to a. Y
may also send an ICMP Redirect back to c which would say "Next
time you need to send a packet to a, send it to Z instead
of to me." The following entry would be added to c's routing table:
Prefix 10.0.1.1/32 (a) is delivered via 172.20.0.1 (Z).
There are two main kinds of routing protocols on the Internet: Internal and External. Internal routing protocols are used within an Autonomous System or AS, which is a set of routers under a common administrative control (for example, MITnet). External routing protocols are used to communicate between autonomous systems. Internal routing is largely concerned with optimizing the path length to reduce delay, since within an organization one generally wants to achieve the best connectivity one can, regardless of where the packets go. Common Internal routing protocols are RIP [RFC1058], RIPv2 [RFC1723], OSPF [RFC2178], and ISIS. External routing is largely concerned with enforcing policy. For example, only an ISP's customers should be able to use its infrastructure for through-traffic. The External routing protocol currently used on the Internet is BGP4 [RFC1771]. The following diagram illustrates the role of Internal and External routing protocols:
One problem with Distance Vector routing is the Count to Infinity problem. When there are multiple paths between two routers, and a link on the one being used breaks, sometimes a routing update will already be in transit around the long way, and indicate there's still a route. This gets advertised back and forth among the routers, with the metric growing by one each time, until it gets to some maximum defined by the protocol. The first solution to this was something called Split Horizon, which simply says "don't announce routes over the link that the route routes over." A later solution which works even faster is called Poisor Reverse, where the route is announced over that link, but with an infinite metric.
However, even with these fixes, Distance Vector routing protocols are
still fairly slow, so long transient loops can occur. (There is a proprietary
routing protocol designed by Cisco Systems called EIGRP which uses a Distance
Vector routing protocol but doesn't have these problems.)