TTL in IP packets prevents routing loops — decremented by 1 at each router hop. When TTL=0, the packet is dropped and an ICMP Time Exceeded message is sent to the sender.
Traceroute exploits TTL: send packet with TTL=1 (first router drops it, sends ICMP back), TTL=2 (second router), etc. — revealing each hop. TTL values also reveal OS type (Windows=128, Linux=64). Low TTL = possible routing loop or misconfiguration.