P2P Toolkit on IIS

Nov 24, 2007 at 7:20 PM
A really great work with really good samples. But my question is: how can the WCF service for P2P (PeerToPeer Library provided with the source code) be published onto Internet Information Services, so that client applications on different computers can reach the service? Quickstart docs talk about trying client applications on the same machine. I'd like to add a configuration file and establish the ABC for the service inside this file instead of writing managed code. I have clear this concept but I'm wondering how to make it real :-)

Thanks and keep up the good work!

Alessandro Del Sole
Nov 26, 2007 at 2:50 PM
Hi Alessandro--

The really awsome thing about the underlying technology (wcf with NetPeerTcpBinding) is that it does this without requiring you to set up an IIS server. Microsoft by default has several "seed" servers which the peer2peer nodes use to build the mesh (ie allow multiple computers to find each other).

For me this is fantastic because everything should just work out of the box. ie. you should be able to build an application and send it to another vista computers. When someone runs the applications (and enters identical network names and password names) the applications should automatically be able to find each other by using the msft seed servers. Try one of the chat applications to see for yourself. If you have trouble, see the troubleshooting doc. If that doesn't work let me know!

For those privacy concerned individuals here's what I found regarding the use of the seed servers:http://download.microsoft.com/download/2/F/1/2F1A22FD-E838-4BC6-AC40-FBDBCC3A17A4/ANP_FAQ.htm

Does a PNRP seed server collect any personal information about me?

A: The Microsoft PNRP seed server acts as a peer in the network aiding in the referral of numeric identifiers to IP endpoints to other peers for the purpose of bootstrapping into the PNRP cloud. Since each peer in the cloud is responsible for caching a subset of identifier / IP endpoint pairs, a PNRP seed server must cache a subset of these pairs in order to do the referral. At any given point in time, an identifier / IP endpoint registered by a peer could be in the seed server’s cache. These identifiers could be used to identify an individual user and their IP address on the internet. These pairs are not logged by the seed server and will expire over time.

If this is unacceptable you can create and use your own seed server:

http://blogs.msdn.com/p2p/archive/2007/03/18/setting-up-a-private-pnrp-global-cloud.aspx

Let me know if this works for you and if you have any further questions!

Rob
Nov 26, 2007 at 6:49 PM
Hi Rob!
Your explanation was really clear, so now I've well understood what's behind the scenes. Before I tell you how wonderful it is, I just tried at home where I have a wireless network. I launched the same sample chat application on both my desktop pc and my notebook... and it did work!! The two computers could chat without writing a single line of code and with no need of IIS!

Now I can tell you, the PNRP technology is really wonderful! That's just what I needed. A further enhancement could be something like Windows Live Messenger, where you have a list of connected people and where you can write private messages in separate windows. But I know I'm asking too much, it will be a good exercise for the developers :-)

Just one question: I have to launch first the client on my desktop pc, where my router is connected to, to see other clients to connect correctly. If I try to launch a first client on my notebook (which is connected to the network via wireless), other clients are not recognized even if they've connected. Does this happen because in this case my desktop pc acts like a server?

Thanks again for your explanation and for your great job!

Regards,
Alessandro Del Sole
Nov 26, 2007 at 7:50 PM
Hey Alessandro--

I like the ideas you have: showing a list of connected nodes (people) and being able to write private messages. Hopefully we'll be able to incorporate those in a future version.

To answer your question:

It shouldn't matter which computer you start the application on first. Sometimes I've found that it takes ~1 minute before other nodes can join. I think this has something to do with how the nodes get registered on microsofts seed servers, but I'm not 100% sure. So the first thing I would try is to open the application on your notebook and connect. Wait for about a minute and then try to connect on your desktop.

If this doesn't here's what I would try on your notebook to narrow the problem down:

To determine whether or not you can contact the PNRP seed server, simply click “Start->Run”. Then in the dialog type “cmd”.

Then type: "netsh p2p pnrp diag ping seed Global_"

Here's the results I see for my machine:

C:\Users\Rob>netsh p2p pnrp diag ping seed Global_

SOLICIT sent to address: 2002:4136:e385:0000:0000:0000:4136:e385:3540.
ADVERTISE returned 5 ID(s) in 250 milliseconds.
f87e7e1fe8abbb7f7cac369e35ffbf90.f74205b11e046f839589dc51d2d0cf10
808a48de74a38aae0fcb61b040b28c74.7700660055004400c6e5a8920a67ced9
19b8421238c14b915bffbcfcedce9e62.77006600550044001485e13a3215fc47
240efeb6cc57ac37513816a882f15e25.d95a3d661e997bed7a0a8d7fce5cac7e
1ee3b584d9c16891052c2d946af08cce.77006600550044008a2c07a9d3318082

So this lets me know that I am seeing the seed servers. If you don't get a response then I would start to think it's a configuration issue with the router.
Let me know what you observe and we'll take it from there.

Glad to help!

Rob
Nov 27, 2007 at 2:45 PM

Hi Rob,
in fact I had just to wait a couple of minutes and everything worked even if connecting with the notebook for first. :-) Well done. I'm glad you like my ideas, so let's hope to see these new features for future versions :-)

I'm really excited by this toolkit. I'm surely going to write an article about it on the .NET web-site which I'm team member of (www.visual-basic.it) and on my blog (community.visual-basic.it/Alessandro) which gets visitors from all over the world. I'm seriously considering to talk about it also in my forthcoming book about VB 2008.

Thanks so much!

Alessandro
Nov 27, 2007 at 5:11 PM
Hey Alessandro--

Wow! that would be amazing for this to be mentioned on your blog or book. Please let me know if there's anything else I can do to help make that happen :-).

Rob