1

ss -o shows TCP timer in the following format:

timer:(<timer_name>,<expire_time>,<retrans>)

What do <expire_time> and <retrans> mean?

I found <expire_time> counts down to zero and then restart counting from some number again. Its starting value differs from TCP socket to TCP socket.

<retrans> seems always zero for all the TCP sockets.

1

expire_time is the time left until the timer expires. The TCP stack in the Linux kernel supports a number of timers, and they all have an expiration time.

retrans is the number of retransmissions which have occurred. TCP implementations retransmit packets they believe have been lost; they counts these retransmissions so that they will know when to give up. You shouldn’t see this too often; one way to force it is to try to open a connection on a port which isn’t rejected immediately, e.g. (based on an example in one of your previous questions):

curl http://www.google.com:9000

If you run that, you’ll see curl sitting there for a while, and ss -o will show a SYN-SENT entry with an increasing retransmission count. You’ll also see the back-off applied in such circumstances: the initial expiration time will increase every time the packet is retransmitted.

  • Is the expire_time reset when something is transmitted (whether retransmitted or not)? – Tim Feb 7 at 15:58
  • Yes, it resets when a packet is transmitted. – Stephen Kitt Feb 7 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.