---
title: "Can udp client got server MAC?"
url: "https://maker.wiznet.io/forum/15134"
markdown_url: "https://maker.wiznet.io/forum/15134/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "role 2099"
created: "2024-01-27T02:42:28+09:00"
last_activity: "2024-02-19T06:17:21+09:00"
language: "en"
views: 126
replies: 2
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Can udp client got server MAC?

## Question

Asked by role 2099 on 2024-01-27 in Ethernet Chips.

![Snipaste_2024-01-27_10-40-35](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/9/973c72f06a642c9652cad87698ac9254215710cb.jpeg)

```
if((ret=getSn_RX_RSR(0))>0)
{ 
  memset(gDATABUF,0,ret+1);
  recvfrom(0,gDATABUF, ret, DstIP,&DstPort);
  sendto(0,gDATABUF,data_length, DstIP, DstPort);
}
```

DstIP is udp server ip, DstPort is port, but how can I get server MAC

## Replies

### Reply 1 by Eugeny, 2024-01-27

[![dhar](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/2/2bea541eba58dc5ad8630c65addb5e6b6b296c91.png) dhar1098×443 49.7 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/2/2bea541eba58dc5ad8630c65addb5e6b6b296c91.png)

Good question. There seems to be no way to know MAC address from the received packet, but when you send UDP packet back to the target IP you’d get MAC address in the DHAR. So after your `sendto` you can obtain the MAC address, but not before it.

### Reply 2 by role 2099, 2024-02-19 (in reply to reply 1)

Many thanks! ARP can slove it.

---

Source: https://maker.wiznet.io/forum/15134
