TCP receive process - data length

Hi,

as changing code from W5300 to W5500 one question is arising: I miss data format description in datasheet. For W5300 there was datalength present in buffer before payload, for W5500 there is no information on that issue.
Only for IPRAW I found some information in application note.
In case of UDP (as used for DHCP) this will also be an issue.

From hexdump of first received packet of HTTP GET I can only assume the Sn_RX_RSR contains the payload length of received packet in case of TCP socket. Is this correct?

What happens in case of big socket RX buffer? In that case (HTTP upload) several packets may get received at once in buffer, so will Sn_RX_RSR show the payload size of first packet received only, or the total sum of payloads of packets already received (difference between Sn_RX_RD and Sn_RX_WR)?

Some clarification would really be helpful. Someone from WizNet, maybe?

Michael

Dear Michael,

=> In cast of UDP, Packet frame is as below
|-- Destination IP Address (4bytes) --|-- Destiantion Port number (2bytes) --|-- Payload length (2bytes) --|

=> Your understand is correct.

=> Socket Received Size register represents the received data length in socket rx buffer.
So, Sn_RSR indicates the total sum of payloads of packets

Thanks,

[quote]=> Socket Received Size register represents the received data length in socket rx buffer.
So, Sn_RSR indicates the total sum of payloads of packets[/quote]

So there is no way of finding out the size of different received packets inside the RX buffer?

Michael

Hi mboehmer,
W5300’s TCP processing is differ from W5500.
In W5300, To support 16bit data bus direct access mode, W5300 have a PACKET_INFO as data bytes length.
But, In W5500, There is no need to have PACKET_INFO as data bytes length becase it can be access only by SPI interface.

So, You should remove the code of PACKET_INFO processing for migration W5500.

Thank you.