---
title: "can't receive multicast packet and respond"
url: "https://maker.wiznet.io/forum/12371"
markdown_url: "https://maker.wiznet.io/forum/12371/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "ganzo"
created: "2017-07-13T15:51:04+09:00"
last_activity: "2017-07-17T00:24:55+09:00"
language: "en"
views: 2592
replies: 2
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# can't receive multicast packet and respond

## Question

Asked by ganzo on 2017-07-13 in Ethernet Chips.

I initialized the 2nd socket according to the manual like below.

```
{
START:
Sn_MR = 0x02; /* sets UDP mode */
Sn_PORT0 = source_port; /* sets source port number */
Sn_CR = OPEN; /* sets OPEN command */
/* wait until Sn_SR is changed to SOCK_UDP */
if (Sn_SR != SOCK_UDP) Sn_CR = CLOSE; goto START;
}
```

i can receive broadcast, unicast packet. But can’t receive multicast. I tested it on w5100 and works too. But not with w5500.

I can able to make it work on w5500 by enabling multicast like below. But i can’t respond with unicast packet to the multicast sender. It can only responds multicast packet. Could anybody please help me on this? Thank you.

```
{
START:
/* set Multicast-Group information */
Sn_DHAR0 = 0x01; /* set Multicast-Group H/W address(01:00:5e:01:01:0b) */
Sn_DHAR1 = 0x00;
Sn_DHAR2 = 0x5E;
Sn_DHAR3 = 0x01;
Sn_DHAR4 = 0x01;
Sn_DHAR5 = 0x0B;
Sn_DIPR0 = 211; /* set Multicast-Group IP address(211.1.1.11) */
Sn_DIPR1 = 1;
Sn_DIPR2 = 1;
Sn_DIRP3 = 11;
Sn_DPORT0 = 0x0BB8; /* set Multicast-GroupPort number(3000) */
Sn_PORT0 = 0x0BB8; /* set SourcePort number(3000) */
Sn_MR = 0x02 | 0x80; /* set UDP mode & Multicast on Socket n Mode Register */
Sn_CR = OPEN; /* set OPEN command */
/* wait until Sn_SR is changed to SOCK_UDP */
if (Sn_SR != SOCK_UDP) Sn_CR = CLOSE; goto START;
}
```

## Replies

### Reply 1 by jim, 2017-07-17

Dear ganzo

I think you have to use the other socket for unicast packet.
Please refer to the following link.

![](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/7/72981214f48a245373a6534eded4be05101de4a5.png) [wiznet.io](https://www.wiznet.io/product-item/w5100/)

### [W5100 | WIZnet Co., Ltd.](https://www.wiznet.io/product-item/w5100/)

W5100 is a Hardwired TCP/IP embedded Ethernet controller and embedded internet

Please download W5100 Application Note.
There are example source and tutorial PDF file.
Unfortunately, there are no Application Note for the W5500.
You can modify W5100 case to W5500 case by the reference link below.
<http://wizwiki.net/wiki/doku.php?id=products:w5500:application:udp_function#multicast>

Thanks.

### Reply 2 by ganzo, 2017-07-17

Dear Jim
Thank you for your answer. I was able to make it work by doing exactly what you said.
I configured 1 socket for multicast reception. And other socket for unicast reply.
So in total 2 sockets were used.

Thank you

---

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