The TTL is a small exact timer for this toy answer.

highlighted = computed this step

TTL is counted in seconds

This answer starts with 300 seconds of freshness in the toy cache.

seconds=300\text{seconds}=300
TTL is secondsThe answer record is decoded from the exact DNS response bytes.Answer NAME pointer16 bits / 2 bytes0xc00cbyte 0byte 11100000000001100markeroffset12marker: 3Answer record fields112 bits / 14 bytes0x000100010000012c00045db8d822byte 0byte 1byte 2byte 300000000000000010000000000000001byte 4byte 5byte 6byte 700000000000000000000000100101100byte 8byte 9byte 10byte 1100000000000001000101110110111000byte 12byte 131101100000100010type0x0001class0x0001ttl300rdlength4rdata93.184.216.34(cont.)

It is not the answer length

RDLENGTH is 4, while TTL is 300. They are separate fields.

300≠4300\ne4
TTL is secondsThe answer record is decoded from the exact DNS response bytes.Answer NAME pointer16 bits / 2 bytes0xc00cbyte 0byte 11100000000001100markeroffset12marker: 3Answer record fields112 bits / 14 bytes0x000100010000012c00045db8d822byte 0byte 1byte 2byte 300000000000000010000000000000001byte 4byte 5byte 6byte 700000000000000000000000100101100byte 8byte 9byte 10byte 1100000000000001000101110110111000byte 12byte 131101100000100010type0x0001class0x0001ttl300rdlength4rdata93.184.216.34(cont.)

The next chapter subtracts elapsed time

A cache does not invent a new address; it subtracts elapsed seconds from the TTL.

starting TTL=300\text{starting TTL}=300
TTL is secondsThe answer record is decoded from the exact DNS response bytes.Answer NAME pointer16 bits / 2 bytes0xc00cbyte 0byte 11100000000001100markeroffset12marker: 3Answer record fields112 bits / 14 bytes0x000100010000012c00045db8d822byte 0byte 1byte 2byte 300000000000000010000000000000001byte 4byte 5byte 6byte 700000000000000000000000100101100byte 8byte 9byte 10byte 1100000000000001000101110110111000byte 12byte 131101100000100010type0x0001class0x0001ttl300rdlength4rdata93.184.216.34(cont.)

Summary

TTL is the starting freshness timer for this exact answer.

start=300\text{start}=300
TTL is secondsThe answer record is decoded from the exact DNS response bytes.Answer NAME pointer16 bits / 2 bytes0xc00cbyte 0byte 11100000000001100markeroffset12marker: 3Answer record fields112 bits / 14 bytes0x000100010000012c00045db8d822byte 0byte 1byte 2byte 300000000000000010000000000000001byte 4byte 5byte 6byte 700000000000000000000000100101100byte 8byte 9byte 10byte 1100000000000001000101110110111000byte 12byte 131101100000100010type0x0001class0x0001ttl300rdlength4rdata93.184.216.34(cont.)