PNRP service under Vista Ultimate (RTM) version is very instable !!

PNRP service under Vista Ultimate(RTM) version is very instable !!

I'm on a project about WCF P2P. Under Windows XP(PNRP V2) everything fine. But under Vista Ultimate (RTM), I have to always restart PNRP service manually after some P2P testing.

Anybody knows why?

[293 byte] By [hailong1977] at [2007-12-30]
# 1

Hi Hailong,

Sorry to hear you are running into problems. Could you please elaborate on why you need to restart the service ? What kind of environment (internet vs lan; single machine vs multi-machine) are you testing on?

As far as I've tested and worked with PNRP on Vista, I've never run into issues where I've crashed and have had to restart the PNRP service and am curious to know more about the issue you are seeing.

Thanks,

Shalini.

--Please do not send email directly to this alias. This alias is for newsgroup purposes only. This posting is provided "AS IS" with no warranties, and confers no rights.

ShaliniJoshiMSFT at 2007-10-9 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 2

Hi Shalini,

Thank you ! :)

My testing environment are:

1: Single machine local lan

OS: Windows Vista(TM) Ultimate, Japanese Version with all new updates, no virous protection software

Hardware: DLL dimension 9200( Intel(R) Core(TM)2 6400 @ 2.13GHZ 2.13GHZ; Memory 2046MB )

2: multi-machine local lan

OS: same as above

Hardware 1: same as above

Hardware 2: Dll dimension E521(AMD Athlon(tm) 64x2 Dual Core Processor 3800+ 2.00 GHZ; Memory 958MB)

Error like this:(I'm working for a Japanese company, but I cann't read Japanese :( )

After running my program about 10 times(crash or not), ServiceHost.Open() through a CommunicationException

System.ServiceModel.CommunicationException: ピア リゾルバが例外をスローしました。InnerException を参照してください。 > System.ServiceModel.Channels.PnrpPeerResolver+PnrpException: 到達できないネットワークでソケット操作を実行しようとしました。

If I didn't restart PNRP service after error occured, wait about 20 minutes, everything becomes to be fine.........

There is another problem, Teredo doesn't work as previrous Vista version. I didn't check the detial.

hailong1977 at 2007-10-9 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 3

Hi Hailong,

Thanks for the information. One of my colleagues, Peter, was able to provide a rough translation of hte InnerException that Pnrp reported - note that this looks more and more like an underlying Network issue rather than Pnrp. What exactly is causing your network problem is something we need to figure out better:

Here are some troubleshooting steps to begin with:-

1. Change the language settings on the machine you are testing from Japanese to English - I believe this can be done by going to Control Panel => Regional And Language Options. This will help us more in understanding the exact error that you are getting.

2. Try and repro the error and at the time it happens, can you share hte output of "ipconfig /all"

3. From an elevated command window (cmd => Run As => Administrator), the output of "netsh p2p pnrp cl sho state" - this will give a list of all PNRP available clouds (that correspond to Global/LinkLocal/SitelOcal IPv6 addresses for your machine) and the state they are in -

Please share out the output (you can also email me on shalinij@microsoft.com)

Below is the translation:

*******************************************

System.ServiceModel.CommunicationException: ? ?InnerException ? > System.ServiceModel.Channels.PnrpPeerResolver+PnrpException: ???

<Translation of the error message>

Piarizoruba ga <exception> wo threw. Inner exception wo sanshou <consult> shite kudasai. <English> toutatsu <arrive> dekinai network de socket souse <operation, handling, control> wo jikkou <execute> shiyou to shimashita.

Piarizoruba is a mangled English word, (or possibly two together), it is hard to figure out what it might be. Pia might be “peer” or “pair”, not sure about zoruba. Probably “peer”, given the context.

Pia rizoruba threw an exception.

Please see the inner exception. (pnrp exception).

Unable to arrive (unreachable?) network by means of socket operation obj. tried and failed to execute.

Windows tried, but couldn’t reach the network over the socket?

</translation>

Thanks,

Shalini.

ShaliniJoshiMSFT at 2007-10-9 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 4

I deleted my last reply, because it included some security information, I'm so sorry for that.

I've sent a email to Shalini. If the problem resolved latter, I'll publish the final result here.

hailong1977 at 2007-10-9 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 5

Thank Shalini's help very much, below is the explanation and resolution, by Shalini :

Make sure that “Windows Collaboration Computer Name Resolution Service” has been added to firewall exception list.
Since both Teredo and PNRP rely on UDP to communicate with the Teredo and PNRP seed servers resp, you (your domain admin) will need to allow UDP packets through your domain firewall to your local machine. This could be one factor when trying internet I am afraid, this is what has been causing problems for you...
Teredo state is not good unless it shows state as "qualified" instead of "Offline" like what i see on my machine:
netsh interface ipv6>sh tere
Teredo Parameters

Type : client
Server Name : teredo.ipv6.microsoft.com.
Client Refresh Interval : 60 seconds
Client Port : 34567
State : probe(restricted)
Type : teredo client
Network : unmanaged
NAT : restricted

netsh interface ipv6>sh tere
Teredo Parameters

Type : client
Server Name : teredo.ipv6.microsoft.com.
Client Refresh Interval : 60 seconds
Client Port : 34567
State : qualified
Type : teredo client
Network : unmanaged
NAT : restricted

From all your tests below it really looks like the basic bootstrapping for teredo and PNRP is not able to work in your domain scenario- causing PNRP to use a Teredo supplied Global address when it is really not usable (since Teredo never goes to teh Qualified state in the first place).
What still puzzles me is that how you manage to get a Global Teredo IPv6 address because from your output and tests, it looks like that your Teredo client on the test machine never gets to contact the Microsoft teredo server (i never see state = qualified ) ...Also, if punching UDP holes in the domain firewall is an issue, I am wondering how the scenario worked for your earlier XP tests ...
In the meanwhile, I would suggest, that in your application. you catch CommunicationException during serviceHost.open(), so that when your application does run into the socketexception that could occur in such situations, you dont crash..you can choose to retry recreating serviceHost instance or channel instance in the handler..
Let me know if there is anything else I can help you out with..
Thanks,
Shalini.
hailong1977 at 2007-10-9 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 6

Hi,

I've also found it quite unstable on Vista Ultimate. In my corporate environment, Teredo is not accessable and so is in the offline state. However, the confusing part about using PNRP is that it works fine for testing apps locally and then all of a sudden I get communicationexceptions and have to restart the PNRP service before it starts working again. It works fine running the simple chat sample in the SDK, can run 50 instances on the local machine and they all work fine using the default PNRP resolver, and then randomly later on it stops working. I'm totally new to the peer2peer stuff in the framework.

I've also added the Windows Collaboration Computer Name Registration Service to the firewall without any luck.

Can anybody please explain this behaviour?

The exception is:

System.ServiceModel.CommunicationException: The Peer resolver threw an exception. Please refer to InnerException. > System.ServiceModel.Channels.PnrpPeerResolver+PnrpException: A socket operation was attempted to an unreachable network

at System.ServiceModel.Channels.PeerExceptionHelper.ThrowPnrpError(Int32 errorCode, String cloud, Boolean trace)at System.ServiceModel.Channels.PnrpPeerResolver.UnsafePnrpNativeMethods.PeerNameRegistrar.InvokeService(WsaQuerySet registerQuery, WsaSetServiceOp op, Int32 flags)at System.ServiceModel.Channels.PnrpPeerResolver.UnsafePnrpNativeMethods.PeerNameRegistrar.Register(PnrpRegistration registration, TimeSpan timeout)at System.ServiceModel.Channels.PnrpPeerResolver.Register(String meshId, PeerNodeAddress nodeAddress, TimeSpan timeout)at System.ServiceModel.Channels.PeerNodeImplementation.RegisterAddress(String lclMeshId, PeerNodeAddress nodeAddress, TimeSpan timeout) End of inner exception stack trace

Server stack trace:
at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.PeerNodeImplementation.SimpleStateManager.EndOpen(IAsyncResult result)
at System.ServiceModel.Channels.PeerNodeImplementation.SimpleStateManager.Open(TimeSpan timeout, Boolean waitForOnline)
at System.ServiceModel.Channels.PeerNodeImplementation.Open(TimeSpan timeout, Boolean waitForOnline)
at System.ServiceModel.Channels.PeerDuplexChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open()

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.ServiceModel.ICommunicationObject.Open()
at Microsoft.ServiceModel.Samples.ChatApp.Main() in ...

Thanks
Chris

Chris69nz at 2007-10-9 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 7

Hi Chris:

I'm not sure whether we met the same problem. Do your test PC behind a NAT? Here is my suggest:

1: Disable teredo

Run "command prompt" as administrator, type following command "netsh interface teredo set state disable", enter

Test your program again. If the same problem occures, I think the problem is not because of teredo service.

2: Enable teredo

If no problems without teredo service running, enable teredo as following

Run "command prompt" as administrator, type following command "netsh interface teredo set state default", enter

Test your program again. If the same problem occures, please update your OS with "Windows Update". Then test again

Actually, I'm a beginner of WCF p2p too, I know few about it.

hailong1977 at 2007-10-9 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 8

Thanks for your help! Yes my PC is behind a NAT. I've tried what you suggested and that seems like its the cause. If its working and then I disable teredo, it can't resolve anymore, if I enable it again, it resolves again. However after a little while teredo goes offline again.

Heres the state of teredo when its working:

netsh interface teredo>show state
Teredo Parameters

Type : default
Server Name : teredo.ipv6.microsoft.com.
Client Refresh Interval : 30 seconds
Client Port : unspecified
State : probe (primary server)
Client Type : teredo client
Network : unmanaged
NAT : none (global connectivity)

and when its not:

netsh interface teredo>show state
Teredo Parameters

Type : default
Server Name : teredo.ipv6.microsoft.com.
Client Refresh Interval : 30 seconds
Client Port : unspecified
State : offline
Error : primary teredo server unreachable over UDP

Therefore the bit that confuses me is that why when you enable it or start the service, it starts up in a kind of connected state, to only find out later that my computer can't work over teredo because of the environment? I would of expected it would start up in an offline state, and only once its determined it can work over my environment it would go into an online state. Therefore I would expect that the chat sample would always not work using PNRP, rather than be up and then down, giving a feeling of instability.

There must be something simple I'm not understanding or overlooking?


Thanks!
Chris

Chris69nz at 2007-10-9 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 9

Hi Chris,

What you are seeing is a Teredo "feature" where by it goes offline/dormant after a while - so when the chat sample starts, Teredo is in the "qualified" (online) state and things work - but it is possible that it goes offline, and then the address that Peer channel has been using is no longer valid - and we end up throwing that exception.

Like I suggested to Hailong, it's a good idea to catch CommunicationExceptions in your application to make it robust and resilient to such underlying network conditions/changes. Note that you would need to recreate your client channel (proxy) if you intend to continue to use your application, since we abort the channel upon such exceptions.

I am also looking to see if there are some diagnostic tools that would periodically look at the Teredo supplied Global IPv6 address and make sure it is usable (by pinging the Global microsoft Teredo seed server - (by the way, make sure that the Teredo UDP port is enabled in your firewall). One way is to leave the follwoing netsh context running on a separate command window while running/testing your application:

Admin cmd shell:

"netsh p2p pnrp cl sho list"

Let me know if that helps!

-Shalini.

ShaliniJoshiMSFT at 2007-10-9 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 10

Hi Shalini,

Thanks for your help, it gives a bit more insight into whats happening.

Yes the application will handle the exceptions and retry connecting. What I was thinking is that the app shows a status icon somewhere on the main screen showing the connectivity. However, I'd like it to not show its connected to the p2p mesh initially if its doomed to go offline a little bit later when it can't send UDP messages to the Teredo seed server. (in the teredo blocked scenario). Is this possible?


Chris

Chris69nz at 2007-10-9 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...

Visual Studio Orcas

Site Classified