 Now, let us know about distance vector routing protocol. This protocol is executed by the routers in a network. The protocol determines best route for data packets based on distance between source and destination. Here, you can see a graph containing four nodes A, B, C and D with some links connecting them. A, B, C and D in a network can be network connecting devices like routers. Numbers on these links signify the distance between them. This distance can be a measure of number of hops or bandwidth or network latency, etc. between the nodes. The protocol works with a vector representation of these distances between the nodes hence the name distance vector routing protocol. Let us see how this protocol works. We start at time 0 and see what happens in each iteration. Initially, the routing table for each router is empty. Here we are looking at the structure of a routing table used by this protocol. The routing table for A would contain distance from A to the node which is connected to it via some node. The empty routing table gets populated when it is connected to a network. The distance information is updated when it receives broadcasts from other nodes in the network directly connected to it. You can see that A is broadcasting its routing table to B and C. The routing table says that the distance from A to B via B is 3 which means B is directly connected to A and the distance from A to C via C is 23 which means C is also directly connected to A. Now let us see what happens in first iteration that is at t is equal to 1. Here every node has information about the nodes that are directly connected to them. For example, we saw what the routing table of A would contain. A broadcasts this routing table to B and C and B broadcasts its routing table to the nodes directly connected to it. So at the end of first iteration we have the following routing tables which are being broadcast from A, B, C and D. Now let us see what happens at t is equal to 1 sorry t is equal to 2. In second iteration every node gets distance information about those nodes that are two hops away. The yellow cells in this table denotes the distances populated in this iteration whereas white cells denote the distances populated in a previous iteration that is A now knows that there is another root to C via B which costs only 5 units. So it updates its routing table accordingly. The algorithm for updating is as follows. A node compares the existing shortest distance in its table with the calculated one based on information from a broadcast received. For example, current distance from A to C is 23 but at t is equal to 2 it discovers that B has a route to C that is 2 units and it can send packets to B in 3 units. So in a total of 5 units A can send packets to C. This becomes the new shortest distance. Similarly all the nodes A, B, C and D calculate their or update their routing table based on the broadcasts that they receive. In third iteration that is at t is equal to 3 every node gets distance information about nodes that are 3 hops away that is A now knows that there is another route to D via C which costs only 10 units. So it updates its routing table accordingly. Similarly other nodes B, C and D also update their routing table. At t is equal to 4 we see that .