time-to-live (TTL)

Contributor(s): John Burke

Time-to-live (TTL) is a value in an Internet Protocol (IP) packet that tells a network router whether or not the packet has been in the network too long and should be discarded. In IPv6 the TTL field in each packet has been renamed the hop limit.

An IP TTL is set initially by the system sending the packet. It can be set to any value between 1 and 255; different operating systems set different defaults. Each router that receives the packet subtracts at least 1 from the count; if the count remains greater than 0, the router forwards the packet, otherwise it discards it and sends an Internet Control Message Protocol (ICMP) message back to the originating host, which may trigger a resend.

The point of the TTL/hop limit is to keep streams of undeliverable packets stuck in routing loops (perhaps due to incorrect routing tables) from circulating forever and clogging up the networks in question. In Multiprotocol Label Switching (MPLS) clouds, the MPLS TTL is copied from the IP TTL when the IP packet enters the cloud. On egress, the MPLS TTL value is copied into the IP TTL field (as long as it is less than the value in the field).

Time-to-live ping detail

The ping and the traceroute utilities both make use of the TTL value to attempt to reach a given host computer or to trace a route to that host. Traceroute sends a stream of packets with successively higher TTLs so each will be discarded in turn by the next hop (router) on the route to the destination: The first packet has a TTL of one and is discarded by the first router, the second has a TTL of two and is discarded by the next router, and so on. The time between sending the packet and receiving back the ICMP message that it was discarded is used to calculate each successive hop travel time.

In IP multicast, the TTL controls the scope or range in which a packet may be forwarded. By convention:

  • 0 is restricted to the same host
  • 1 is restricted to the same subnet
  • 32 is restricted to the same site
  • 64 is restricted to the same region
  • 128 is restricted to the same continent
  • 255 is unrestricted

The term time-to-live is also used to describe the time for which a DNS record can be returned from cache. In this context, TTL is a numerical value, set in a DNS record on the authoritative DNS server for the domain, defining the number of seconds for which a caching server can provide its cached value for the record. When that many seconds have elapsed since the last refresh, the caching server will reach out to the authoritative server again and receive the current (and possibly changed) value for the record.

In HTTP, time-to-live describes the number of seconds for which which cached Web content can be returned before the Web server is required to check again that it is still "fresh." A default value is defined by settings on the Web server, but can be overridden by cache-control tags (which define which kinds of servers, if any, can cache the data) or expires tags (which define a date and time at which the content is stale) in HTML page headers.

This was last updated in November 2015

Continue Reading About time-to-live (TTL)

Dig Deeper on IP Networking



Find more PRO+ content and other member only offers, here.

Join the conversation


Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

What benefit can you see in setting any TTL to a small value?
We had one vendor supplied application that had very long TTL set by default for any connection that was made to the application’s API. One problem that the long TTL contributed to was that the pool of available connections would be quickly consumed when our other system made many calls to that one, which was fairly typical when end-week processes were being performed by the user. Setting the TTL to a very small value allowed each request to be serviced, but then the connection was freed and made available for use by other incoming connections.
TTL is used to find out which path is used for sending the data. Trace router. TTL use UDP. TTL will decremented by one at each standing host.


File Extensions and File Formats