26.03.2013 Views

Peer-to-Peer in Flash Player 10.1 Build An App In A Week Go Multi ...

Peer-to-Peer in Flash Player 10.1 Build An App In A Week Go Multi ...

Peer-to-Peer in Flash Player 10.1 Build An App In A Week Go Multi ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Build</strong> <strong>An</strong> <strong>App</strong> <strong>In</strong> A <strong>Week</strong><br />

<strong>Go</strong> <strong>Multi</strong>-User With<br />

<strong>Peer</strong>-<strong>to</strong>-<strong>Peer</strong> <strong>in</strong> <strong>Flash</strong> <strong>Player</strong> <strong>10.1</strong><br />

Tom Krcha<br />

Platform Evangelist<br />

Adobe


Agenda<br />

‣What is <strong>Peer</strong>-<strong>to</strong>-peer?<br />

‣RTMFP - pro<strong>to</strong>col and implications<br />

‣Demo - P2P <strong>In</strong>stant Messenger<br />

‣Directed Rout<strong>in</strong>g<br />

Copyright 2009 Adobe Systems <strong>In</strong>corporated. All rights reserved. Adobe condential. 2<br />

STRATUS<br />

®


NetGroupSendMode<br />

Encryption<br />

Directed Rout<strong>in</strong>g<br />

WHAT? P2P?<br />

NetGroupSendResult<br />

NetStream<br />

IT’S HUGE!<br />

<strong>App</strong>lication-Level-<strong>Multi</strong>cast<br />

Topology<br />

NAT/Firewall Traversal<br />

RTMFP<br />

Object Replication<br />

NetGroupReceiveMode<br />

Copyright 2009 Adobe Systems <strong>In</strong>corporated. All rights reserved. Adobe condential. 3<br />

NetGroup<br />

NetStream<strong>Multi</strong>cast<strong>In</strong>fo<br />

Congestion Control<br />

Native <strong>Multi</strong>cast<br />

NetGroupReplicationStrategy<br />

IP Address Mobility<br />

Bootstrap<br />

Partial Reliability<br />

GroupSpecier<br />

NetGroup<strong>In</strong>fo<br />

NetConnection<br />

Fusion<br />

Post<strong>in</strong>g<br />

®


What is <strong>Peer</strong>-<strong>to</strong>-peer?<br />

Source: Wikipedia.org<br />

Hub-and-Spoke network<br />

Centralized server-based service model.<br />

P2P network<br />

A peer-<strong>to</strong>-peer system of nodes without central <strong>in</strong>frastructure.<br />

Copyright 2009 Adobe Systems <strong>In</strong>corporated. All rights reserved. Adobe condential. 4<br />

Hub-and-spoke:<br />

- centralized<br />

- S<strong>in</strong>gle po<strong>in</strong>t of failure<br />

- cost of a server<br />

- add<strong>in</strong>g more clients make network slower<br />

- need failover and backups<br />

P2P<br />

- decentralized<br />

- add<strong>in</strong>g more clients make network faster<br />

- robustness, no failover<br />

®


How does it work <strong>in</strong> <strong>Flash</strong>?<br />

STRATUS<br />

Copyright 2009 Adobe Systems <strong>In</strong>corporated. All rights reserved. Adobe condential. 5<br />

®


Adobe Stratus<br />

Hosted rendezvous service<br />

rtmfp://stratus.adobe.com<br />

Looks like FMS, but...<br />

‣ No client-server stream<strong>in</strong>g<br />

‣ No record<strong>in</strong>g<br />

‣ No server-side scripts or application logic<br />

‣ Requires (free) developer key <strong>to</strong> connect<br />

Emerg<strong>in</strong>g technology<br />

Copyright 2009 Adobe Systems <strong>In</strong>corporated. All rights reserved. Adobe condential. 6<br />

STRATUS<br />

®


<strong>Peer</strong>-<strong>to</strong>-peer <strong>in</strong> <strong>Flash</strong> <strong>Player</strong><br />

RTMFP<br />

‣ Real Time Media Flow Pro<strong>to</strong>col<br />

‣ <strong>In</strong>troduced <strong>in</strong> <strong>Flash</strong> <strong>Player</strong> 10 and upgraded <strong>in</strong> FP <strong>10.1</strong><br />

‣ Based on UDP (lossy, beer latency)<br />

‣ Encrypted 128-bit AES<br />

‣ Need <strong>to</strong> accept every <strong>in</strong>com<strong>in</strong>g connection<br />

USE CASES<br />

‣ <strong>Multi</strong>player games,<br />

‣ VoIP<br />

‣ Audio/Video<br />

‣ Collaboration<br />

‣ Chat<br />

Firewall fallback <strong>to</strong> RTMP/T (<strong>Flash</strong> Media Server)<br />

Copyright 2009 Adobe Systems <strong>In</strong>corporated. All rights reserved. Adobe condential. 7<br />

Adobe Stratus<br />

Hosted rendezvous service<br />

rtmfp://stratus.adobe.com<br />

STRATUS<br />

®


Types of P2P <strong>in</strong> <strong>Flash</strong><br />

Po<strong>in</strong>t-<strong>to</strong>-po<strong>in</strong>t<br />

Live stream<strong>in</strong>g<br />

Document delivery<br />

Live <strong>App</strong>lication-Level <strong>Multi</strong>cast<br />

Broadcast (1 <strong>to</strong> many, some latency <strong>to</strong>lerable)<br />

one-<strong>to</strong>-one<br />

FP 10<br />

one-<strong>to</strong>-many<br />

<strong>In</strong>teractive (many <strong>to</strong> many, or 1 <strong>to</strong> many with feedback,<br />

low latency required)<br />

FP <strong>10.1</strong><br />

Copyright 2009 Adobe Systems <strong>In</strong>corporated. All rights reserved. Adobe condential. 8<br />

“Swarm<strong>in</strong>g”<br />

Large-le download (possibly progressive)<br />

*Connections <strong>in</strong> step 2<br />

Distributed Data S<strong>to</strong>rage (distributed hash table)<br />

DHT-like structures <strong>to</strong> form distributed database<br />

many-<strong>to</strong>-many<br />

FP <strong>10.1</strong><br />

FP <strong>10.1</strong><br />

®


<strong>Peer</strong>-<strong>to</strong>-peer <strong>in</strong> <strong>Flash</strong> <strong>Player</strong><br />

Demo game - MILL<br />

hp://nes<strong>to</strong>r.cz/mill/<br />

Copyright 2009 Adobe Systems <strong>In</strong>corporated. All rights reserved. Adobe condential. 9<br />

Author<br />

Pavel Šimek, Geewa<br />

Czech Republic<br />

®


<strong>Peer</strong>-<strong>to</strong>-peer <strong>in</strong> <strong>Flash</strong> <strong>Player</strong><br />

Demo app - Phone<br />

hp://labs.adobe.com/technologies/stratus/samples/<br />

Copyright 2009 Adobe Systems <strong>In</strong>corporated. All rights reserved. Adobe condential. 10<br />

®


What’s new about P2P <strong>in</strong> <strong>Flash</strong> <strong>Player</strong> <strong>10.1</strong><br />

Groups & <strong>Multi</strong>cast<br />

‣ GroupSpecier<br />

‣ NetGroup<br />

‣ NetGroup<strong>In</strong>fo<br />

‣ NetGroupReceiveMode<br />

‣ NetGroupReplicationStrategy<br />

‣ NetGroupSendMode<br />

‣ NetGroupSendResult<br />

‣ NetStream updated<br />

‣ NetStream<strong>Multi</strong>cast<strong>In</strong>fo<br />

Copyright 2009 Adobe Systems <strong>In</strong>corporated. All rights reserved. Adobe condential. 11<br />

Group of peers<br />

®


Demo: P2P <strong>In</strong>stant Messenger<br />

P2PChatComponent<br />

P2PChatMobile<br />

P2PMessengerLib<br />

Copyright 2009 Adobe Systems <strong>In</strong>corporated. All rights reserved. Adobe condential. 12<br />

®


Demo: P2P Groups<br />

Copyright 2009 Adobe Systems <strong>In</strong>corporated. All rights reserved. Adobe condential. 13<br />

®


Copyright 2009 Adobe Systems <strong>In</strong>corporated. All rights reserved. Adobe condential. 14


Copyright 2009 Adobe Systems <strong>In</strong>corporated. All rights reserved. Adobe condential. 15


Copyright 2009 Adobe Systems <strong>In</strong>corporated. All rights reserved. Adobe condential. 16


sendToAllNeighbors<br />

Copyright 2009 Adobe Systems <strong>In</strong>corporated. All rights reserved. Adobe condential. 17


Copyright 2009 Adobe Systems <strong>In</strong>corporated. All rights reserved. Adobe condential. 18<br />

Network Address Translation


Copyright 2009 Adobe Systems <strong>In</strong>corporated. All rights reserved. Adobe condential.<br />

More on Directed Rout<strong>in</strong>g<br />

hp://www.<strong>Flash</strong>Realtime.com/<br />

19


ank you!<br />

twier.com/<strong>to</strong>mkrcha<br />

<strong>Flash</strong>Realtime.com


Q/A<br />

Copyright 2009 Adobe Systems <strong>In</strong>corporated. All rights reserved. Adobe condential. 21<br />

®

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

Saved successfully!

Ooh no, something went wrong!