WIZnet Developer Forum

W5300 ICMP ping reply data error when UDP communication via MACRAW socket


I’am using wiznet W5300 in MACRAW mode with software UDP socket and W5300 hardware ICMP for ping answers.

I noticed ICMP ping reply data corruption after UDP communication via MACRAW socket.
In ICMP reply ICMP Fields Type, Code and Checksum are correct.
ICM Fields Identifier, Sequence number and Data are corrupted.

Error occures only after W5300 receives UDP packet, after W5300 transmitts UDP - ICMP reply is ok.

How can i solve this problem?

Thank you in advance.

Hi, Alex

Could you give me more details about Error occurred after W5300 receive UDP packet ?

It is hard to guess why it doesn’t work with MACRAW mode and give the error and find solution.

Thank you,


Hi, Lawrence!

Wireshark capture file in attachment. Screenshots below.

W5300 ip, PC ip

W5300 configuration:
SOCKET0 - MACRAW, 54k rx/tx mem,
SOCKET1-4 - TCP/IP 4*2k rx/tx mem,
SOCKET5 - UDP 2k rx/tx mem
16 bit bus mode, FIFO SWAP Bit set.

Ping from PC to W5300. After UDP packet send (frame #8) ping reply (frame #10) is corrupted.

Wireshark packet sequence screenshots:

Wireshark ICMP ping corrupted packet details:
Id, Sequence and Data are corrupted. Data partly can be identified as previously sent UDP packet (‘public’ community string).

Wireshark ICMP ping normal packet details:

Thank you,

w5300 icmp repley error.rar (841 Bytes)

Hi, Alex

Sorry to late.

Many times I read and though why it happened.

But I can not reach the solution and have more wonders.

At the first, you siad [quote]ICM Fields Identifier, Sequence number and Data are corrupted.[/quote]
Is it about #9 packet in the wireshark??

If it is correct… I only think that the ICMP sending packet is wrong.

W5300 only supports MACRAW then everything depends on the software.

So, I wonder If the buffer has some left data after handling UDP packet, It will make a trouble with next sending packet.

I recommend the bugging with the buffer first.

Sorry with no clear answer… Thank you.


Hi, Lawrence!

Yes, packet #9 contains corrupted data.

I’ve made some research.

I configured W5300 SOCKET0 in macraw only. No more sockets configured.
I configured W5300 MAC and IP adress. W5300 answers ICMP ping hardware.

I only receive macraw packets, make no send activity.

After I send any UDP packet from PC to IP address W5300 is configured the next ICMP answer data from W5300 was always corrupted.
ICMP reply data starting from ICMP Identifier field contains exacly UDP received packet data starting from IP Identification field.

Moreover when I only configured W5300 SOCKET0 in MACRAW mode, configured IP and halted CPU I got the same corrupted ICMP answer after every UDP packet was sent to W5300. W5300 process ICMP hardware, no software processing involved on MACRAW SOCKET0.

So there were no W5300 SOCKET0 activity and buffer operations but ICMP answer data corrupted always after UDP packet received by W5300.

I suppose you have problem with ICMP ping in macraw mode.

Thank you,

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.