TCP send process - retry send?

#1

Hi,

as stated inside the “W5500 TCP Function” application note, it is recommended to check if the requested number of bytes has really been transmitted by W5500. Which makes me curious: In case I have a large data block to send by W5500, I would assume that i fill the TX buffer (best in multiples of MTU), start send process, wait for IR_SENDOK, and then continue with next send data block until all data has been sent.

When do I need to check for correct amount of data sent? If IR_SENDOK has been set, can I assume then that all data has been sent correctly which was ordered to sent by Sn_TX_WR register?

Please clarify.

Michael

#2

Hi,
You can not assume the completed to send data by just checking SENDOK.
Because TCP protocol may be retransmitted the data and It occurred the TIMEOUT when the retransmition failed.
If you want to check the data sending to be completed, You should be check the Sn_TX_FSR.
Sn_TX_FSR represents the transmitible data size.
Assume that you send 100 byte data when Sn_TX_FSR = 1000.

  1. Sn_TX_FSR becomes 900 when SENDOK is checked.
  2. No occurrence TIMEOUT.
  3. When the peer send the ACK of the data, Sn_TX_FSR becomes 1000 again.

That is, If the Sn_TX_FSR value after sending data is equal to the previous Sn_TX_FSR value before sending data,
You can be sure of sending the data to the peer.

Thank you.