1

I noticed that in all tcp communications, in the tcp header option parts, tcp timestamp is always there is it mandatory or not? so if there is no tcp timestamp in a tcp packet, the tcp client or server will reject it?

besides, I don't find any source snippets for generating tcp timestamps can anyone provide some links or examples on how to generate tcp timestamps?

thanks!

1 Answer 1

3

TCP timestamps are not required, but can help in ordering packets in time. This likely would only matter when you have a lot of TCP retries going on. http://en.wikipedia.org/wiki/Transmission_Control_Protocol#TCP_timestamps

A TCP packet will not be rejected for lack of a TCP timestamp.

4
  • thanks, are there any source snippets for generation of tcp timestamps?
    – user138126
    Mar 20, 2013 at 20:34
  • From what I'v seen on the internet, there are no specific units. It's a 4-byte field that you drop your time into. See networksorcery.com/enp/protocol/tcp/option008.htm and msdn.microsoft.com/en-us/library/aa923592.aspx. It looks like the RFC was careful not to specify a unit. You can use a 32-bit representation of your system clock for example.
    – kmort
    Mar 20, 2013 at 20:42
  • you meant just use a random number? then how to increase the number for the next packet?
    – user138126
    Mar 20, 2013 at 21:42
  • You can use your system clock. I was just saying it doesn't specify if your LSB signifies seconds, nanoseconds, or microseconds or none of the above. That's up to you.
    – kmort
    Mar 21, 2013 at 4:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .