1

I opened pcap file with Wireshark and saw in TCP header :

Options: (12 bytes), No-Operation (NOP), No-Operation (NOP), Timestamps
....TCP Option - No-Operation (NOP)
....TCP Option - No-Operation (NOP)
....TCP Option - Timestamps: TSval YYYYYY, TSecr XXXXXXXX

When I using python to send a TCP packet , how can I set those headers?

vtable
  • 302
  • 2
  • 15
  • I don't think you can set them. These values are used for retransmission timer calculations and need to be set by the same instance that is doing the calculation (which in most cases is OS kernel). You can enable or disable using this option. And this depends on the OS. See e.g. [this link](http://ithitman.blogspot.com/2013/02/enabling-tcp-timestamp-linux-and-windows.html). I can't find anything about how to enable them on a per-socket basis. – Effie Dec 27 '21 at 15:10
  • If you are using a raw socket to send packets, you could construct them with scapy and set the timestamp values. See, e.g., this: https://stackoverflow.com/questions/58234148/how-to-set-tcp-options-timestamp-and-sackok-via-scapy – JimD. Dec 30 '21 at 03:08

0 Answers0