Question: using multicast

23 views
Skip to first unread message

Paulo Brizolara

unread,
Jul 21, 2016, 9:53:32 AM7/21/16
to SMCP Developers
Hello all,

i am having troubles in using multicast with smcp.

I am trying to:
     1) Receive multicast requests in server
     2) Allow clients to receive multiple responses (from different servers) after doing a multicast request

I have tried with the 0.6.5 release and with the code from master branch on github.

Looks like sending a package to a multicast address is fine.
However, i still don't know how to receive multiple responses.
Using 'SMCP_TRANSACTION_NO_AUTO_END' flag i could partially achieve that.
But after receiving the first response, the transaction timeout after a while (even when setting the timeout to a big value).

Also i cannot receive any multicast message on a smcp server.
Inspecting the source code, looks like it should join to coap multicast address automatically.
But this is not done on the server socket (but in separated sockets).
The only way, i could receive multicast messages was using 'smcp_plat_get_fd' to get the socket and joining it to a multicast address "manually".

What should i do to use multicast?
If there is not full support to multicast yet, maybe i could contribute some code.

Paulo Brizolara

Robert Quattlebaum

unread,
Jul 21, 2016, 2:42:37 PM7/21/16
to Paulo Brizolara, SMCP Developers Group
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hello Paulo!

On Jul 21, 2016, at 6:53 AM, Paulo Brizolara <souzabr...@gmail.com> wrote:

> i am having troubles in using multicast with smcp.
>
> I am trying to:
>
> 1. Receive multicast requests in server
> 2. Allow clients to receive multiple responses (from different
> servers) after doing a multicast request
>
> I have tried with the 0.6.5 release and with the code from master
> branch on github.
>
> Looks like sending a package to a multicast address is fine.
> However, i still don't know how to receive multiple responses. Using
> `SMCP_TRANSACTION_NO_AUTO_END` flag i could partially achieve that.
> But after receiving the first response, the transaction timeout
> after a while (even when setting the timeout to a big value).

I'm pretty sure that multicast support is broken in release 0.06.05.
Receipt of IPv6 multicast packets does work for me using the `master`
branch, but honestly I haven't tried getting multiple responses. What
you are doing should work. I should probably a test case.

Please file an issue on github and I'll look into this. I can't
imagine it is something very difficult to get working, as very similar
machinery is already in place for observing. I suspect the duplicate
detection might somehow be going awry.

> Also i cannot receive any multicast message on a smcp server.
> Inspecting the source code, looks like it should join to coap
> multicast address automatically.

Are you using IPv4 or IPv6? For some reason I'm having trouble with
IPv4 multicast.

> But this is not done on the server socket (but in separated
> sockets). The only way, i could receive multicast messages was using
> `smcp_plat_get_fd` to get the socket and joining it to a multicast
> address "manually".

Although I seem to have had good experiences with multicast support
recently, sounds like something is definitely still broken. Go ahead
and file an issue on GitHub and we will get this sorted out.

Thanks!

- -\- RQ

-----BEGIN PGP SIGNATURE-----

iQEcBAEBCAAGBQJXkRdgAAoJEE6OLsxF2Ko6BJ4H/1N/9++4HntfUAXJqSyXrwxW
Pp4ByTij0dfRDO2e378tUMzlRYkroqgIlkHAy/GKZee0kJRbpfeefDLFPpNkj5ge
/PdoyD7cz0eXQDoYtvfPbvHzoajyOSzB0q1Dw53/8k0V9kOfn7H6V2+u13iBmq4Q
rD5/9152GidD8h3eiJFrMR5kUWBozPtWaSaqhi9P9QF14rqZMCWSuofh7IPIDp3V
unVNbm3JZzK12uawD/YKrhrnJs0RD/t/SiOEQSa0KkvceLZ3rORR4wJVbUJcnshu
NNns0qgGpaX0T7llRMwR4T2F51D36QvCofHppxHonR+Y+w/3QIRdcAUMHsSU6lU=
=admA
-----END PGP SIGNATURE-----

Paulo Leonardo

unread,
Jul 22, 2016, 11:05:45 AM7/22/16
to Robert Quattlebaum, SMCP Developers Group
Thanks, Robert!

I will open issues on github about these problems.


Paulo Brizolara

Shantanoo Desai

unread,
Jan 12, 2017, 7:08:29 PM1/12/17
to SMCP Developers
Hello Paulo and Robert,

I am catching up with the current bugs and PR for the Multicast Bug on the Repository and want to help out.
I am addressing my inputs here so as not to flood the Issue and PR Threads on GitHub.

It might take some time for me to dive deep into the recent works but here are some small observations made:

1. I can have tried the example-multicast-request in src/examples on my Linux Laptop which gives following inferences:

$ ./example-multicast-request

along with

$ ./example-1


 works well since I initial get the 205 Content packet and subsequently 205 Dup packets stating that
IPV6 with ff02::fd seems to work in terms of handling multicast requests.
however, using
$ ./smcpctl get coap://[ff02::fd]/ or ./smcpctl get coap://[ff02::fd]:5683/
Does not work and the timer runs out on the multicast-request

This has also been verified using Wireshark Packet Capture.

2. As the Issue and PR suggest IPv4 is acting strange with multicast binding which I too have faced on both master and bug/multicast  branch where there the timer runs out on multicast-request. I tried
$ ./example-multicast-request coap://224.0.1.187 with ./example-1 and smcpctl
Which does not respond to request. The same is result for

$ ./example-multicast-request coap://224.0.0.1 with ./example-1 and smcpctl


I think I am on the track with the issue and also could check the working into a real wireless ad-hoc network using Raspberry Pis (Loads of them, if need be!).

However I need some input from your sides as to where should I start looking into after this small play around.

Thanks,

Shan






Paulo Leonardo

unread,
Jan 16, 2017, 8:51:06 PM1/16/17
to Shantanoo Desai, SMCP Developers
Shantanoo, it's very nice you are looking for solutions on this also.

I have been working in other projects lately. But i still want to see full multicast support with coap.

So, i will need to take a look again at the PR, and test what i was working to refresh my memories.
But i believe that my branch was working (for me, at least). Did you tried using it?

When i take a look for what i was doing, i will give more info.
Also, tests is exactly what i was needing for this issue.
So if you can test the code, would be very nice.

Thanks.

Paulo

Shantanoo Desai

unread,
Jan 19, 2017, 2:15:51 PM1/19/17
to SMCP Developers
Hello All,

Please Check the Comment on the PR for Multicast. I have conducted Paulo's Code on a practical scenario and it works. Can be merged into the master branch.


Thanks for the work Paulo.

Regards,

Shan

Paulo Leonardo

unread,
Jan 19, 2017, 4:25:51 PM1/19/17
to Shantanoo Desai, SMCP Developers
Very nice, Shan!

I am happy to see the code working on real setup. :)
Also your tests look very detailed.
Nice!

Now, its up to Robert merge the changes (assuming it works on mac too).


Paulo

Robert Quattlebaum

unread,
Feb 8, 2017, 2:13:56 PM2/8/17
to Paulo Leonardo, Shantanoo Desai, SMCP Developers Group
I remember reviewing this and feeling like it was almost there but not quite.

But to the extent that it improves things on Linux, then I think it is worthwhile going ahead and accepting. I'll go ahead and merge.

Thank you both!

-- RQ
Reply all
Reply to author
Forward
0 new messages