TLS with TCP_NODELAY?

  • 1
  • Question
  • Updated 5 months ago
Using a U-Blox cellular modem, I can connect to my server in insecure mode and send data back and forth with no delays, using TCP_NODELAY setting on both ends so they don't hold data waiting for large packets. But when I connect securely, the modem tells me that it has received each small packet, but they don't arrive at the server until much later. It appears that they are being held up in transit by someone not honoring the TCP_NODELAY. I suspect it's you or the carrier, not the modem. Should this work, or is there a setting I need to change somewhere?
Photo of Lee Crocker

Lee Crocker

  • 2 Posts
  • 0 Reply Likes

Posted 5 months ago

  • 1
Photo of Lee Crocker

Lee Crocker

  • 2 Posts
  • 0 Reply Likes
From empirical testing, the problem seems to be only with packets < 32 bytes. Since that's the AES block size, that makes me suspect some piece of code somewhere in the TLS stack is happy to pad the last block of an odd-sized packet but not the first one.