Presentation is loading. Please wait.

Presentation is loading. Please wait.

“Indigo”: Building Peer-To-Peer Applications Todd R. Manion Program Manager Microsoft Corporation Todd R. Manion Program Manager.

Similar presentations


Presentation on theme: "“Indigo”: Building Peer-To-Peer Applications Todd R. Manion Program Manager Microsoft Corporation Todd R. Manion Program Manager."— Presentation transcript:

1 “Indigo”: Building Peer-To-Peer Applications Todd R. Manion Program Manager Microsoft Corporation tmanion@microsoft.com Todd R. Manion Program Manager Microsoft Corporation tmanion@microsoft.com Session Code: WSV306

2 Agenda Overall Architecture Peer-to-Peer Landscape Why Something New? Design Guidelines Peer-to-Peer Technologies Code Walkthroughs Call to Action Overall Architecture Peer-to-Peer Landscape Why Something New? Design Guidelines Peer-to-Peer Technologies Code Walkthroughs Call to Action

3 Tools Client Application Model AvalonWindows Forms Web & Service Application Model ASP.NET / Indigo Win FS Compact Framework Yukon Mobile PC Optimized System.Help System.Drawing System.NaturalLanguageServices Data Systems Application Model Presentation Data Mobile PC & Devices Application Model Communication Command Line NT Service DataSet Mapping ObjectSpaces ObjectSpace Query Schema Item Relationship Media Audio Video Images System.Messaging System. Discovery System.DirectoryServices System.Remoting System.Runtime.Remoting Active Directory Uddi System.Web.Services Web.Service Description Discovery Protocols System.MessageBus Transport Port Channel Service Queue PubSub Router System.Timers System.Globalization System.Serialization System.Threading System.Text System.Design Base & Application Services Fundamentals System.ComponentModel System.CodeDom System.Reflection System.EnterpriseServices System.Transactions Security System.Windows. TrustManagement System.Web. Security System.Message Bus.Security Authorization AccessControl Credentials Cryptography System.Web.Configuration System.MessageBus.Configuration System.Configuration System.Resources System.Management System.Deployment System.Diagnostics ConfigurationDeployment/Management System.Windows System.Windows.Forms System.Console System.ServiceProcess System.Windows.Forms System.Web System.Storage System.Data.SqlServer Animation Controls Control Design Panel Controls Dialogs SideBar Notification System.Windows Documents Text Element Shapes Shape Ink UI Element Explorer Media System.Windows.Forms Forms Control Print Dialog Design System.Web.UI Page Control HtmlControls MobileControls WebControls Adaptors Design Ports InteropServices System.Runtime System.IO System.Collections Generic System.Search Annotations Monitoring Logging Relevance System.Data SqlClient SqlTypes SqlXML OdbcClient OleDbClient OracleClient Core Contact Location Message Document Event System.Storage System.Web Personalization Caching SessionState System.Xml Schema Serialization Xpath Query Permissions Policy Principal Token System.Security System.Collaboration RealTimeEndpoint TransientDataSession SignalingSession Media Activities HttpWebRequest FtpWebListener SslClientStream WebClient System.Net NetworkInformation PeerIdentity Pnrp System.Web Administration Management Navigation Peer Store Policy Serialization CompilerServices Recognition System.Speech Synthesis

4 Base Operating System Services CLR Transactions Storage Protocols Network Services Kernel Mode Base Class Libraries Memory Manager Hosting Layer Code Execution Loader Security Serialization Lightweight Transactions Lightweight Transactions Transaction Coordinator Kernel Transaction Manager Common Logging File System Transacted File System Kernel Hardware Abstraction Layer Process Manager Process Manager Security Reference Monitor LPC Facility Memory Manager Power Manager Config. Manager Plug and Play File System Cache NTFS FAT 16/32 Filter Engine Filter Engine TPC, UDP IPV4, IPV6 TPC, UDP IPV4, IPV6 IPSEC QOS HTTP Listener HTTP Listener Internet Connection Firewall Demand Activation and Protocol Health PNRP Native WiFi Native WiFi SIP TCP Listener UDP Listener IPC Listener Network Class Library GDI/GDI+ Window Manager Window Manager Global Audio Engine Global Audio Engine DirectX Graphics Graphics drivers DDI Input Manager Input Manager Audio Drivers Audio Drivers DirectX Graphics Mini port DirectX Graphics Mini port Redirectors.. 802.3 802.11.. Device and File System Drivers Management PresentationData Communication WinFSIndigo Make the connection Windows Forms Avalon ASP.NET ObjectSpaces DataSet SQL XML Providers Framework Models Services Schemas Data Model ADO.NET Connectivity Synchronization (WinFS, Win32..) InfoAgent (PreferenceRules..) InfoAgent (PreferenceRules..) FileSystem Services (MetaDataHandlers..) FileSystem Services (MetaDataHandlers..) Exchange Media Document … … Items Relationships Extensions Communications Manager (Port) Service Object T/SQL XML Services Transport Channels (IPC, HTTP, TCP…) Transport Channels (IPC, HTTP, TCP…) Channels (Datagram, Reliable, Peer, …) Policy Engine Policy Engine Message Encoder Message Encoder Channel Security Channel Security Queue Topic Router Transaction Document UI Media Desktop Services Desktop Window Manager Desktop Window Manager Presentation Object Manager Desktop Composition Engine Desktop Composition Engine Animation and Composition Media Services Hardware Rendering Hardware Rendering Media Processing Capture and Sourcing Capture and Sourcing Software Rendering and Sinks Software Rendering and Sinks Adaptive UI Engine Adaptive UI Engine Page/Site Composition Personalization and Profiling Services Personalization and Profiling Services Membership and Security Services Membership and Security Services Designer Services Designer Services Controls Interop Engine Controls Interop Engine Controls Windows Forms Application Services Application Services Application Deployment Engine (Click-Once) Application Deployment Engine (Click-Once) IO Manager People Group Identity & Security System Identity & Security System Collaboration People Group Controls (Chat, …) Controls (Chat, …) Signaling Federation Servers

5 Network Class Library Internet Connection Firewall Demand Activation and Process Health - IIS PNRP Native WiFi TCP Listener SIP UDP Listener IPC Listener Network Services CLR Serialization Kernel Mode Framework Protocols Filter Engine TCP, UDP IPV4, IPV6 QOS IPSEC HTTP Listener IO Manager Device and File System Drivers … … 802.3 … … 802.11 Connector Communications Manager (Port) Transport Channels (IPC, HTTP, TCP…) Transport Channels (IPC, HTTP, TCP…) Channels (Datagram, Reliable, Peer, …) Policy Engine Message Encoder Channel Security Hosting Environments ASP.NET.container.exe NT Service DllHost Router Topic … … Transactions Federation … … Service Model Instance Manager Context Manager Type Integration Service Methods PeerStore … … Queue Indigo Identity and Security System Identity and Security System Transactions Messaging Services System Services

6 Peer-To-Peer Landscape Collaboration Project workspaces solving a goal Sharing your files with other people Content Distribution Concert, company meeting, class Distribution of product updates Real-Time Communications Instant messaging, voice, video Real-time game play/collaboration Distributed Processing Dissection and distribution of task Improved Internet Technologies Collaboration Project workspaces solving a goal Sharing your files with other people Content Distribution Concert, company meeting, class Distribution of product updates Real-Time Communications Instant messaging, voice, video Real-time game play/collaboration Distributed Processing Dissection and distribution of task Improved Internet Technologies

7 Why Something New? Limited Supply of Public Addresses NATs Prevent Sharing from the Edge Limited Name Resolution System Does not handle dynamic addresses Does not work in ad-hoc environments Does not lend itself to consumer use Inefficient Multipoint Communication Everyone Rewrites the Infrastructure Limited Supply of Public Addresses NATs Prevent Sharing from the Edge Limited Name Resolution System Does not handle dynamic addresses Does not work in ad-hoc environments Does not lend itself to consumer use Inefficient Multipoint Communication Everyone Rewrites the Infrastructure

8 Infrastructure Design Goals Secure, robust in face of failure/attack Scalable, from ad-hoc to the Internet Serverless, no central point of failure Self-tuning, adapts to constant change Self-repairing, automatically fixes itself Secure, robust in face of failure/attack Scalable, from ad-hoc to the Internet Serverless, no central point of failure Self-tuning, adapts to constant change Self-repairing, automatically fixes itself

9 Peer-To-Peer Technologies Peer Name Resolution Protocol (PNRP) Scalable, secure, serverless name resolution "Indigo" PeerChannel Efficient distribution of information between nodes Auto-tuning, self-repairing communication layer Peer Groups Create and manage persistent securable groups Peer Store* Distributed data management Synchronized, replicated meta-data store * Built using WinFS in Longhorn Peer Name Resolution Protocol (PNRP) Scalable, secure, serverless name resolution "Indigo" PeerChannel Efficient distribution of information between nodes Auto-tuning, self-repairing communication layer Peer Groups Create and manage persistent securable groups Peer Store* Distributed data management Synchronized, replicated meta-data store * Built using WinFS in Longhorn

10 Code Walkthroughs Name Resolution (PNRP) "Indigo" PeerChannel Peer Group and Peer Store Name Resolution (PNRP) "Indigo" PeerChannel Peer Group and Peer Store

11 Code Walkthroughs Name Resolution (PNRP) Create, Register, and Resolve a PnrpEndPoint "Indigo" PeerChannel Peer Group and Peer Store Name Resolution (PNRP) Create, Register, and Resolve a PnrpEndPoint "Indigo" PeerChannel Peer Group and Peer Store

12 Register/Resolve In PNRP

13 Name Registration/Resolution Members of System.Net.PeerToPeer Major Objects PeerName PeerIdentity PnrpEndPoint PnrpEndPointRegistration PnrpEndPointResolver Cloud/CloudWatcher Available in Longhorn PDC Preview Members of System.Net.PeerToPeer Major Objects PeerName PeerIdentity PnrpEndPoint PnrpEndPointRegistration PnrpEndPointResolver Cloud/CloudWatcher Available in Longhorn PDC Preview

14 PnrpEndPointRegistration PnrpEndPointRegistration reg = new PnrpEndPointRegistration(); … private void RegisterInPnrp(IPEndPoint[] myEndPoints) { PeerName peerName = new PeerName(“0.ToddAtThePDC”); PnrpEndPoint endPoint = new PnrpEndPoint(peerName, myEndPoints); reg.PnrpEndPoint = endPoint; reg.Cloud = CloudWatcher.GetGlobalCloud(); reg.Register(); }

15 PnrpEndPointResolver PnrpEndPointResolver resolver = new PnrpEndPointResolver(); … private void ResolveInPnrp() { // Retrieve the settings and fill out the resolver properties. resolver.PeerName = new PeerName(“0.ToddAtThePDC”); resolver.Cloud = CloudWatcher.GetGlobalCloud(); resolver.MaxResults = 1; resolver.TimeOut = new TimeSpan(0, 0, 30); List results = resolver.Resolve(); //Show the address of the resolved PeerName. if (results.Count > 0) MessageBox.Show(results[0].IPEndPoints[0].ToString()); }

16 Code Walkthroughs Name Resolution (PNRP) “Indigo” PeerChannel Create a PeerManager and channel Accept a new PeerChannel Send/Receive transient data via PeerChannel PeerGroup and PeerStore Name Resolution (PNRP) “Indigo” PeerChannel Create a PeerManager and channel Accept a new PeerChannel Send/Receive transient data via PeerChannel PeerGroup and PeerStore

17 “Indigo” PeerChannel Chat

18 “Indigo” PeerChannel Major Objects PeerChannel PeerManager Node Message Port Available in future Longhorn release Major Objects PeerChannel PeerManager Node Message Port Available in future Longhorn release

19 Create A PeerChannel PeerManager peerMgr = new PeerManager(); PeerChannel myChannel; … private void InitPeerManager() { peerMgr.PeerRequested = new PeerRequestedEventHandler(this.MyPeerRequestedHandler); } //Uri = “tcp.p2p://demo.microsoft.com:10000/demoLocalChannelId” private void CreatePeerChannel(Uri peerUri) { myChannel = peerMgr.CreateChannel(peerUri); } private void MyPeerRequestedHandler(object sender, PeerRequestedEventArgs e) { … }

20 Accepting A PeerChannel PeerManager incomingMgr = new PeerManager(); PeerChannel incomingPeer; … private void MyPeerRequestedHandler(object sender, PeerRequestedEventArgs e) { incomingPeer = incomingMgr.AcceptPeer(e.Message); } private void DisplayChannelNodes() { listNodes.Items.Clear(); foreach(Node n in incomingPeer.Nodes) { ListViewItem lvi = new ListViewItem(n.FriendlyName); lvi.Tag = n.Id; listNodes.Items.Add(lvi); }

21 Send A Message // Uri = “tcp.p2p://demo.microsoft.com:10000/demoRemoteChannelId” private void SendChatMessage(Uri destination, string text) { Message msg = new Message(destination); msg.Body = text; myChannel.Send(msg); }

22 Receive A Message private void ReceiveChatMessage() { Message msg = incomingPeer.Receive(); textBoxMessages.AppendText((string) msg.Data + “\r\n”); }

23 Code Walkthroughs Name Resolution (PNRP) “Indigo” PeerChannel Peer Group and Peer Store Open, connect, enumerate members Add/Retrieve data to/from peer store Name Resolution (PNRP) “Indigo” PeerChannel Peer Group and Peer Store Open, connect, enumerate members Add/Retrieve data to/from peer store

24 Group Photo Album

25 PeerStore And PeerGroup Major Objects PeerIdentity PeerGroup Member PeerStore Record PeerGroupInfo PeerStore built with WinFS in Longhorn Major Objects PeerIdentity PeerGroup Member PeerStore Record PeerGroupInfo PeerStore built with WinFS in Longhorn

26 Open, Connect, Enumerate Members PeerIdentity myIdentity; PeerGroup myGroup;... private void ConnectToFirstGroup() { List identities = PeerIdentity.GetIdentities(); myIdentity = identities[0]; List myGroups = PeerGroup.GetGroups(myIdentity); myGroup = PeerGroup(myGroups[0]); myGroup.Connect(); } private void DisplayMembers() { List members = myGroup.GetMembers(); foreach(Member m in members) { listMembers.Items.Add(m); }

27 Add Data To Group private void AddPictureRecord(string fileName) { PeerRecord record = new PeerRecord(pictureGuid,DateTime.Now.AddDays(1)); record.Data = GetImageDataFromFile(fileName); record.MetadataCollection.Add( new PeerRecordMetadata("FriendlyName",fileName)); myGroup.PeerStore.AddRecord(record); }

28 Retrieve Data From Group public void GetPictureList() { listRecords.Items.Clear(); foreach (PeerRecord record in myGroup.Store.GetRecords(pictureGuid)) { string strId = record.Id.ToString(); ListViewItem lvi = new ListViewItem(strId); lvi.Tag = record.Id; lvi.SubItems.Add( record.MetadataCollection["FriendlyName"].ToString()); listRecords.Items.Add(lvi); }

29 Corel Grafigo 2 Daniel Jette Software Design Engineer Corel Corporation Daniel Jette Software Design Engineer Corel Corporation

30 Summary Technology Offerings Scalable, secure, serverless name resolution Efficient, self-repairing “Indigo” PeerChannel Securable, persistent PeerGroup service Distributed data management via PeerStore Developers free to focus on application Integrated, consistent managed API “Indigo” in PDC Preview PNRP, PeerIdentity in PDC Preview Technology Offerings Scalable, secure, serverless name resolution Efficient, self-repairing “Indigo” PeerChannel Securable, persistent PeerGroup service Distributed data management via PeerStore Developers free to focus on application Integrated, consistent managed API “Indigo” in PDC Preview PNRP, PeerIdentity in PDC Preview

31 Call To Action Think Connectivity and Collaboration! Don’t Wait! Utilize Peer-to-Peer v1.0 today V1.0 runtime and Win32 APIs are available via Windows Update Utilize “Indigo” bits in PDC Preview Get More Information http://www.microsoft.com/p2p peerfb@microsoft.com Whitepaper on PDC bits DVD Think Connectivity and Collaboration! Don’t Wait! Utilize Peer-to-Peer v1.0 today V1.0 runtime and Win32 APIs are available via Windows Update Utilize “Indigo” bits in PDC Preview Get More Information http://www.microsoft.com/p2p peerfb@microsoft.com Whitepaper on PDC bits DVD

32 For More Information Come see me Immediately after this session Web Services Booth/Lounge: 309 Foyer MSDN “Longhorn” DevCenter http://msdn.microsoft.com/longhorn http://msdn.microsoft.com/longhorn Newsgroups microsoft.public.windows.developer.winfx.indigo microsoft.public.win32.programmer.networks At PDC Hands on labs: On-site or download on CommNet PDC Weblogs: http://pdcbloggers.nethttp://pdcbloggers.net Come see me Immediately after this session Web Services Booth/Lounge: 309 Foyer MSDN “Longhorn” DevCenter http://msdn.microsoft.com/longhorn http://msdn.microsoft.com/longhorn Newsgroups microsoft.public.windows.developer.winfx.indigo microsoft.public.win32.programmer.networks At PDC Hands on labs: On-site or download on CommNet PDC Weblogs: http://pdcbloggers.nethttp://pdcbloggers.net

33

34


Download ppt "“Indigo”: Building Peer-To-Peer Applications Todd R. Manion Program Manager Microsoft Corporation Todd R. Manion Program Manager."

Similar presentations


Ads by Google