UDP data packet on W5500



I am looking at the code for the UDP receive function, UDPRecv.
It is taking the first 6 bytes as being the destination IP address?
I thought the header was like this:
2 bytes, source port
2 bytes, destination port
2 bytes, data length
2 bytes, check sum
Then the data.

Is the W5500 changing the UDP header, or am I missing something here?



Yes, the W5500 (and also W5200 and W5100) return a custom UDP packet info structure.

I think the W5500 manual misses this information, but the W5200 manual has it, look it up there.

UDP data is specially structured in the RX memory, like this:

4 bytes: destination IP address
2 bytes: destination port number
2 bytes: byte size (N) of data packet
N bytes: real data


As ventosus said, The rx buffer for UDP have no 2byte checksum because it is off-loaed by W5500.
The udp header info rx buffer is re-ordered by WIZnet.
Thank you.



W5x00 series all have the same UDP header frame.

Best regards.


Thanks for the reply.
I got the W5200 manual and that answered a few questions I had.
The whole section 5 of the W5200 data sheet is missing from the W5500 manual,
I hope this gets included in the W5500 datasheet for people like me that have not
used a previous wiz chip.