---
title: "W5100S UDP Sendto zero ip address"
url: "https://maker.wiznet.io/forum/14626"
markdown_url: "https://maker.wiznet.io/forum/14626/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "erg144"
created: "2022-08-25T16:28:07+09:00"
last_activity: "2022-09-05T05:53:03+09:00"
language: "en"
views: 422
replies: 1
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W5100S UDP Sendto zero ip address

## Question

Asked by erg144 on 2022-08-25 in Ethernet Chips.

When a do a sendTo van give a valid destination ip and port, wire shark is reporting that I am sending an ip of 0.0.0.0 with port 0.

I’ve created the socket with:
returncode = socket(UDP_SOCK_ENC, Sn_MR_UDP, UDP_PORT_ENCAP, SF_MULTI_ENABLE);

I write to the socket with:

ret = sendto(sn, dataPointer + sentsize, len - sentsize,desAddr.bytes,destport);

where destAddr.bytes is 192.168.1.4 and port is 4515.
However, wireshark is rseporting ip of zero.

## Replies

### Reply 1 by lawrence, 2022-09-05

Hi [@erg144](https://maker.wiznet.io/u/erg144)

I could not know exacty the value of your code with

> returncode = socket(UDP_SOCK_ENC, Sn_MR_UDP, UDP_PORT_ENCAP, SF_MULTI_ENABLE);

If you want to handle UDP socket as multicast, you need to setup Sn_DHAR as multicat mac address.

please check the below flows:
// Multicast init
setSn_DHAR(socket_num, mac addr);
setSn_DIPR(socket_num, multicast addr);
setSn_DPORT(socket_num, multicast_port);
socket(socket_num, Sn_MR_UDP, sock_port, enable_multicast);
sendto(socket_num, buf, len, multicast_addr, multicast_port);

Thank you,

---

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