Routing protocols are used to automatically maintain routing tables in routers. Distance vector routing protocols like RIP use the distributed Bellman-Ford algorithm, where each router only knows its local state - the link metrics and estimates of distances to destinations from its neighbors. Using this information, routers periodically exchange distance updates with neighbors and recalculate path costs to determine the optimal next-hop for each destination. While simple and distributed, distance vector protocols are prone to slow convergence and routing loops in certain network conditions.