WIZnet Developer Forum

W5500 ARP - Can I get destination MAC?


I am using the W5500 in a new design and need to know the MAC address of the destination. This is all handled by ARP in the W5500. Is there a way of reading the MAC address?

I hope someone can help.


I believe, the “Socket n Destination Hardware Address” (Sn_DHAR0…5) is what you need to read…
You need to initiate an ARP resolve for the remote system (you can send an dummy UDP packet to it) and then read the Sn_DHAR0,1,2,3,4,5.
Maybe there is another easy way, I am only at the beginning with these chips… :smiley:

I’ve tried reading the Sn_DHAR registers after a successful UDP transfer and they are all 0xFF. Interestingly, when I try and set Sn_DHAR to something they always come back as 0xFF.

Anyone from Wiznet like to comment?

I have half solved my problem

When there is an active TCP connection I can read the destination MAC address from the DHAR registers however when I read them after receiving a UDP packet I get them all set to 0xFF.

W5500 don’t have MAC information register for UDP receive packet
in case of UDP, (Sn_DHAR0…5) just have MAC address of sending packet, and also it is possible to only send to local network. if you send to external network, you just will get the MAC address of gateway.
so, It seems not reasonable, there is no perfect way to get MAC address if you use UDP.

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