15.02.2015 Views

C# 4 and .NET 4

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Microsoft Windows Peer - to - Peer networking ❘ 1343<br />

➤<br />

➤<br />

➤<br />

Multi - user communication applications that allow users to communicate <strong>and</strong> exchange data directly<br />

rather than through a server<br />

Distributed processing applications, as an alternative to supercomputing applications that process<br />

enormous amounts of data<br />

Web 2.0 applications that combine some or all the above in dynamic, next - generation web<br />

applications<br />

miCrosofT WindoWs Peer - To - Peer neTWorKing<br />

The Microsoft Windows Peer - to - Peer Networking platform is Microsoft ’ s implementation of P2P<br />

technology. It is part of Windows XP SP2, Windows Vista, <strong>and</strong> Windows 7, <strong>and</strong> is also available as an<br />

add - on for Windows XP SP1. It includes two technologies that you can use when creating .<strong>NET</strong> P2P<br />

applications:<br />

➤<br />

➤<br />

The Peer Name Resolution Protocol (PNRP), which is used to publish <strong>and</strong> resolve peer addresses<br />

The People Near Me server, which is used to locate local peers (currently for Vista <strong>and</strong><br />

Windows 7 only)<br />

In this section you learn about these technologies.<br />

Peer name resolution Protocol (PnrP)<br />

You can of course use any protocol at your disposal to implement a P2P application, but if you are working<br />

in a Microsoft Windows environment (<strong>and</strong>, let ’ s face it, if you ’ re reading this book you probably are)<br />

it makes sense to at least consider PNRP. There have been two versions of PNRP released to date. PNRP<br />

version 1 was included in Windows XP SP2, Windows XP Professional x64 Edition, <strong>and</strong> Windows XP<br />

SP1 with the Advanced Networking Pack for Windows XP. PNRP version 2 was released with Windows<br />

Vista, <strong>and</strong> was made available to Windows XP SP2 users through a separate download (see KB920342 at<br />

support.microsoft.com/kb/920342 ). Windows 7 also uses version 2. Version 1 <strong>and</strong> version 2 of PNRP<br />

are not compatible, <strong>and</strong> this chapter covers only version 2.<br />

In itself, PNRP doesn ’ t give you everything you need to create a P2P application. Rather, it is one of the<br />

underlying technologies that you use to resolve peer addresses. PNRP enables a client to register an endpoint<br />

(known as a peer name ) that is automatically circulated among peers in a cloud. This peer name is encapsulated<br />

in a PNRP ID. A peer that discovers the PNRP ID is able to use PNRP to resolve it to the actual peer<br />

name, <strong>and</strong> can then communicate directly with the associated client.<br />

For example, you might defi ne a peer name that represents a WCF service endpoint. You could use PNRP<br />

to register this peer name in a cloud as a PNRP ID. A peer running a suitable client application that uses a<br />

discovery mechanism that can identify peer names for the service you are exposing might then discover this<br />

PNRP ID. Once discovered, the peer would use PNRP to locate the endpoint of the WCF service <strong>and</strong> then<br />

use that service.<br />

An important point is that PNRP makes no assumptions about what a peer name<br />

actually represents. It is up to peers to decide how to use them when discovered.<br />

The information a peer receives from PNRP when resolving a PNRP ID includes the<br />

IPv6 (<strong>and</strong> usually also the IPv4) address of the publisher of the ID, along with a port<br />

number <strong>and</strong> optionally a small amount of additional data. Unless the peer knows<br />

what the peer name means it is unlikely to be able to do anything useful with this<br />

information.<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!