P2P in NETMF

Hi, does anybody know is there any way to use P2P in NETMF? Or maybe is there any announcment to add this lib in future releases?

Define P2P

Peer-to-peer is typically an architecture, not a protocol layer.

You can implement http client and server on two devices, which can then be used in p2p scenarios. You can do that today.

Brett is correct, but I’ll add that if you are referring to the Windows PNRP protocols, then no, those do not exist in NETMF (they are based on Win32 binary apis that do not exist in NETMF).

If you want to do peer-to-peer within a local network, do some UPnP discovery and use TCP sockets between peers. If you want to do internet-scale P2P, you can create a ‘reflector’ node in the cloud, or port one of the overlay network stacks (Pastry, Chord, etc), but those are usually overkill. There are .net implementations of many of these, but they would need to be ported to NETMF.

@ mcalsyn -
I was talk about the internet peer-to-peer and Windows PNRP protocols. Localy it’s better to use tcp/udp client-server architecture or web server, but i consider to use Windows PNRP services and want to overcome the NAT and not real IP addresses. I have a p2p ip camera and it’s very useful to control it if you even doesn’t have a static ip address, and i wish i had this in netmf…

PNRP requires IPv6, and isn’t in NETMF nor likely to ever be in a small platform like this. Do you want to talk to other existing PNRP devices, or do you just want something that works like PNRP?

Because if you don’t need to interop with PNRP devices, there are lots of alternatives that you can use to the same effect (pubnub, service bus and any number of roll-your-own solutions). If all you want is NAT traversal and p2p-like pub/sub behavior, then these other options should suffice.

If you really have to have PNRP, then you will have to provision a PC as a gateway device.

…as are many things, but here in today-land, this is what we got

(I do agree we’ll see IPv6 - I just don’t see anyone likely bothering with PNRP - it is quite fat in many ways - though I would be happy to be proved wrong)

@ andre.m - I think you forgot your content in that message. I can see that my language was ambiguous, though. I was trying to say that PNRP was unlikely to show up in NETMF. If you were trying to make some other point - it wasn’t clear at all, or your message was incomplete.

Again - totally tangential and useless to the core conversation which was about options for today, and hopefully Alex, you now have some options to work with. I have done both PNRP gateways, pubnub, and servicebus, so if there’s anything I can help with, please ask.

1 Like

“Today Land” I like that !

@ mcalsyn -
Thank you for help. I don’t have a real IP address, my internet provider doesn’t provide it and i want to control my robot via internet. I tried different approaches (port forwarding, DynDNS, No-Ip and so on), but no one works for me. Because i stay under the providers NAT and my WAN IP doesn ping from outside. But i have a P2P video camera and it works without any problems even under the NAT. I can connect to it from my Android smartphone and control it. Because of it i considered the P2P.

Can you advice how to control gadgeteer via internet in my case?

Yes - there are still a wide variety of approaches that will work. One option is to have your robot contact an event hub like Azure service bus (which can be fairly complicated, and requires https) or pubnub (a simple HTTP REST publish/subscribe mechanism).

Your robot would contact a pubnub or Azure SB endpoint in the cloud and subscribe to messages. It can also publish messages to the cloud to notify you of events. I typically use Azure, but I have a fair size investment in framework code for Azure. You may find pubnub a lot easier to get started with (hint: use the REST api - not the C# api, which is aimed at .Net 4.5 and contains a lot of language features that are not NETMF compatible).

Using an approach like this, your robot will be reachable, even if it cannot receive and external TCP connection (because, in effect, it is now always the connection originator).

1 Like

References:
pubnub : https://www.pubnub.com/
pubnub REST example : PubNub REST API Documentation | PubNub Docs
pubnub source repository : PubNub ¡ GitHub
C# frameworks for silverlight, mono, .net that might help you create a netmf framework : GitHub - pubnub/c-sharp: PubNub clients for C-Sharp based languages, including MS Windows C#/.net, Silveright, IIS, and Mono

1 Like

@ mcalsyn -
Thank you so much!!! Now i am waiting the wifi module, after i can connect to home network and test it. I looked-in the links you provided and i will definitely study it closely on the weekend. I hope this approach will work for me. And someday i post a video of my internet controlled robo that say hello from under tha NAT :wink: