I’m evaluating W5300 for a project of high performance data transmission, however I’m failing to understand how W5300 would be used to ensure maximum bandwidth (like minimum or no gap between packets).
I understand that I need to check the free space (TX_FSR) before loading data to FIFO. That’s fine, suppose I have 64KB assigned to this socket. So after loading up to 64KB to TX_FIFOR I would do a SEND command.
Documentation says that I must wait for SENDOK before being able to do another SEND (“In order to send the next data, it should be checked if previous SEND command is completed. If the next SEND command is performed before previous one is not completed, it can cause any error”)
However SENDOK is said to depend on ACK receiving (“If DATA packet is successfully transmitted to the peer by SEND (when DATA/ACK packet is received from the peer), Sn_TX_FSR is increased by the size of transmitting DATA packet.”)
So, unless I got something wrong, the sequence seems to be:
- After SEND command, W5300 will start transmitting TX buffered bytes.
- We must wait the last buffered byte to reach the other end, and then confirmation (ACK) to return. => 1 round-trip-time.
- SENDOK so now we may return to step 1 for another SEND.
What puzzles me is that during step 2 (~RTT) the transmission would be stalled, is that right?
Suppose I have 2 ms of RTT. 64KB/10e6 = 6.4 ms. So maximum theoretical throughput would be 6.4/(6.4+2) ~ 76%?
However if TX buffers allow me some sort of double buffering (does it start sending before the SEND command is used?) I would then use 2x32KB packets instead of 1x64KB to achieved better performance. That is:
- SEND (32 KB) ~ 3.2ms
- SEND (32 KB) ~ 3.2ms, but in 2 ms it will receive ack from (1)
- Since SENDOK is already high (ack was received during 2) we may go directly to (1) again.
May you clarify which of the above scenarios is correct?