Time to live, or TTL, is an expiration date for information passing across the internet. When the data hits its limit, it's dropped or revised.
TTL limits ensure that the internet isn't cluttered with old, outdated requests. TTL can also ensure that you're working with the newest and latest piece of information you've requested.
Digging deeper: What is TTL?
In 1981, the Network Working Group defined TTL as part of the Internet Control Message Protocol (ICMP). These rules describe how information passes across the internet.
Per the ICMP, TTL is:
- Measured in seconds
- Placed within the IP header
- At least as long as the number of gateways (or routers) the message will pass through
Let's break this down into layman's terms.
When you create a piece of information and send it across the internet, you use ICMP. The unit of information is called an IP packet, and it contains a header and a data section. Headers detail what your message contains, where it's headed, and where it comes from. TTL sits within that header.
Your data likely zooms through several routers and switches as it heads to your destination. At each waypoint, one unit is removed from your TTL.
If you have nothing left within the TTL and your message hasn't arrived, you'll get a "Time Exceeded" message back from ICMP.
TTL put to use: 3 examples
We've given a simplified version of TTL within IP packets. Let's push through deeper examples.
In addition to IP packets, you could also use TTL for:
- DNS records. The domain name system (or DNS) also uses TTLs. Each time you access a website, your device performs a DNS lookup. The TTL value determines how long a server can cache information before asking for a new copy.
- HTTP. Programmers may also use TTLs to outline when records expire. Values help servers understand when to flush their cache and ask for new information from servers.
All of these approaches should both improve performance and ensure clean communication paths.
TTL is just one part of ICMP system administrators should know and maintain. Read our guide to find out more about how you can use this protocol to protect critical data.
Internet Control Message Protocol. (September 1981). Network Working Group.