Loop example in distance vector protocol that uses the split horizon technique. Graph: Destination 1. Nodes 2, 3, and 4 are connected in a triangle. Edge lengths (2,3) = 1, (3,4) = 1, and (4,1) = 2. We also have edges (2,1) = L and (4,1) = 1. So the SPT is 2->3->4->1. Suppose edge (4,1) breaks. Then 4 sets its distance to 1 to be inf. It broadcasts this information to both 3 and 2. Meanwhile 2 sends message to 4 saying that its distance to 1 is 3. 4 updates its distance to be 5 and forwards this information to 3. 3 updates its distance to be 6 and forwards this to 2. 2 updates its distance to be 7 and forwards this to 4. This cycle continues. How does DSDV avoid loops? DSDV uses sequence numbers associated with each destination. Nodes exchange distance vectors as usual, but now a node u updates its next-hop and/or distance in the following cases: -- if the new info has a newer sequence number, then the distance is changed accordingly. if the distance is inf, then next-hop is set to nil. -- if the new info has an old sequence number, then this is ignored. -- if the new info has the same sequence number but a smaller distance, then the distance is changed accordingly. Proof of loop-freedom. The claim is that all points of time, the edges (i, p(i)) -- where p(i) is the parent of i -- form a forest, with the root of each tree being either the destination or a node that has p(i) = NIL. Furthermore, the sequence number at a root with p(i) = NIL is higher than any of its children. The proof is by induction on the number of events. When a link (u,v) breaks and v is u's next-hop, then u sets its next-hop to NIL and increases the sequence number. This action is going to maintain the forest property and also ensure that the sequence number of root is higher than its children. When a node receives new information from a parent node, it updates its information accordingly, adopting the new sequence number and setting its parent to nil if the parent's distance is infinity. When a node receives information from another node, it checks the sequence number. If the distance is better than currently or sequence number is new, it updates the distance and new next-hop, maintaining the invariant.