Peer to Peer (P2P) in Flash Player 10 beta
There has been a lot of great excitement around RTMFP (Real Time Media Flow Protocol), especially because of the peer to peer (P2P) communication that is enabled in Flash Player 10 beta. This is a natural time to speculate about what cool applications you will build with new technology, so I’d like to give you some more information for you to work with.
Since I have been frequently been asked about details on this, a frequently asked questions format somehow seemed appropriate ;). For those that want to start working with RTMFP, make sure to read to the end, there is a goody for you!
Does Flash Player 10 beta support Peer to Peer (P2P) communication?
Flash Player 10 beta has new methods on the NetConnection and NetStream objects that allow communication through peer connections that are managed by a future Adobe server technology. The server will maintain a list of potential peers that can be connected to. If the NetConnection to the server is lost or closed, any peer connection that was initiated through the same NetConnection will also be closed.
How will I make a P2P connection through Flash Player 10 beta?
Connections from a SWF through a future Adobe server release will be assigned a temporary unique ID that is infeasible to guess or forge. Other SWFs connected to the same server can subscribe to the streams and events from that ID once the broadcasting SWF agrees to the connection.
On the server level, these IDs can be mapped to application-specific information such as presence. For a chat application, the ID can be linked to the nickname the user gave when connecting to the application. While the end-user may select the person that they want to chat with, Flash Player will use the ID to establish the connection with that user.
What can I send through the P2P connection?
In a similar way that you would stream local microphone and webcam media up to a server, you will also be able to stream it directly to another Flash Player client that has connected as a peer.
Through NetStream.send you can also send data which is useful for shared experiences in real-time applications. Any data format can be sent through this method though there are size limitations to the packet which may make certain data types less useful.
How does the peer connection work?
RTMFP UDP packets are sent directly from one Flash Player to another. The server translates the peer IDs to network addresses, and also assists in setting up the connection if one or both ends is behind a Network Address Translation (NAT) device. If UDP is blocked by a firewall or if RTMFP is blocked through a configuration of mms.cfg, the peer connection will not go through.
Can I choose between UDP and TCP?
No, RTMFP is a UDP-based protocol while RTMP is a TCP-based protocol. You will automatically use UDP by calling the methods that work over RTMFP.
Will RTMFP enable massive file-sharing applications through Flash Player 10 beta?
No. Large-scale file-sharing network applications rely on the ability to read from and write to the hard drive constantly to only load parts of files into memory when needed. In Flash Player 10 beta you can load files from the desktop to the Flash Player runtime, but the file would need to be loaded manually by the end-user and remain in memory for the entire time the file would be needed. The drain on system resources would make this style of application impractical.
Can I get started with RTMFP now?
While the support for RTMFP is built in to Flash Player 10 beta, there is no publicly available server technology to manage the connection process. If you would like to be considered for access to private beta programs around RTMFP, please send an email to fmsprerelease@adobe.com
Digg this!
May 23rd, 2008 at 11:56 pm
Flash 8 AS2 will suport this new protocol?
May 24th, 2008 at 1:22 am
[…] Peer to Peer (P2P) in Flash Player 10 beta […]
May 24th, 2008 at 6:52 pm
Thanks for explaining this so clearly. It’s not really P2P if you have to use the server though… but, I suppose once the connection to the other peer is established the server product steps out of the way–right? Does the server totally step away or do you just reduce the load to a mere trickle? Or, something else?
May 26th, 2008 at 12:33 am
What is not clear is if there will be UDP support at socket level. In other words, will it be possible to use UDP transport with the AS3 Socket class?
Thanx in advance!
May 26th, 2008 at 1:13 pm
[…] Streaming, peer-to-peer audio and video 1. Peer to peer, Speex and UDP now in Flash Player 1 2. Justin Everett-Church: RTMFP in Flash Player 10 beta 3. Justin Everett-Church: Peer to Peer (P2P) in Flash Player 10 beta […]
May 26th, 2008 at 4:37 pm
[…] Peer to Peer (P2P) in Flash Player 10 beta Justin breaks down what to expect from RTMP in Flash 10. The P2P stuff will require an Adobe server. (tags: p2p flash rtmfp as3 flex) […]
May 26th, 2008 at 6:57 pm
[…] según leo en este post, Adobe y Flash Player 10 nos trae mas sorpresas como el nuevo protocolo de comunicación RTMFP que […]
May 26th, 2008 at 8:01 pm
[…] Эверет-Чарч (Justin Everett-Church), опубликовал хороший FAQ по p2p коммуникации в Flash Player 10 beta, “Peer to Peer (P2P) in Flash Player 10 […]
May 27th, 2008 at 5:27 am
very cool news…I’ve been searching high and low for a decent explanation of this!
May 27th, 2008 at 8:37 am
[…] Everett-Church, a member of the Flash Player team, has posted Peer-to-Peer FAQ on his blog. Peer-to-Peer in Flash Player 10 will be achieved through utilizing a future Adobe […]
May 27th, 2008 at 10:39 am
Philip, It is still P2P communication in that the two Flash Player clients are communicating directly without passing their data through the server. It is however a managed connection in that the server does the introductions and you must still be connected to the server to retain your P2P connection. This is very similar to many IM client models where P2P communication is allowed in the context of still being signed in to the IM service.
ByteBuffer, there is no support for UDP over the socket object in this release of Flash Player.
May 27th, 2008 at 10:38 pm
Very Powerful! It can effectively reduce pressure on server, as it doesn’t need to pass the data through the server. If the flash video player 10 can reach a higher level, it would be very easy to own a video-share website without high-tech as long as have a system built successifuly. It’s meaningful for high traffic video-share site like Youtube!
May 28th, 2008 at 2:25 pm
Here’s another question for your FAQ (I know the answer, but people don’t believe me when I say it):
Can Flash Player 10 be used to swarm video to reduce bandwidth costs?
May 28th, 2008 at 5:29 pm
Justin,
Thank you for clarifying and giving us a definite answer.
Two weeks ago I sent email to fmsprerelease@adobe.com to be considered for the RTMFP beta programs but haven’t heard from Adobe. We are very interested. Is there something else we can do to be considered for the beta program other than just sending email?
May 28th, 2008 at 6:01 pm
@wes The fascinating thing to me about that question is how few people know the answer. I don’t know, and I don’t think you know either (no offence intended — being honest). I’m not even sure Justin knows, and he’s on the Flash team.
The reason so few people know is the intersection of skills it takes to pull off. First, you have to know the p2p side. That cuts out 99+% of developers. When I say “know” I basically mean you’ve coded p2p apps. Then you really, really have to know the ActionScript API, and there are gems in there that aren’t obvious at first. The combination of those two leaves very few people who can truly answer that question, and it’s part of the reason for the flailing in the blogosphere.
Stepping back, though, that’s the cool thing about platforms — they’re largely only limited by the creativity of developers. This will certainly get interesting.
June 5th, 2008 at 7:07 am
[…] Justin Everett-Church recently released some new details about the new RTMFP protocol that will be available with Flash Player 10. RTMFP stands for Real Time Media Flow Protocol and is going to be used to leverage the new peer to peer capabilities of Flash Player 10. The communication between peers is going to be managed by a future Adobe server technology (Flash Media Server 4.0???) which will keep a list of peers that can be connected to. If one peer want to connect to another, the server translates the peer IDs to network addresses, and assists in setting up the connection if one or both ends is behind a Network Address Translation (NAT) device. RTMFP is a UDP-based protocol and packets are sent directly from one Flash Player to another. If UDP is blocked by a firewall or if RTMFP is blocked through a configuration of mms.cfg, the peer connection will not go through. […]
June 6th, 2008 at 11:49 am
I wonder if RTMFP was changed by Adobe after Amicima MFP.. looks like there are some licensing issues also, which will be hidden from the world as MFP was an opensource project with GPL license
July 3rd, 2008 at 12:47 am
It’s great support.
What I think is: why we can’t use USB-PHONE with Flash Player ?
We only take an USBPHONE like “microphone” but we can’t send audio-output in different device !
Flash.Sound.setAudioOutput(1); // usb phone
Flash.Sound.setAudioOutput(0); // speaker of pc
I think that have no-sense to build very amouth of tecnology, without native speaker-selector support…
Jason
July 15th, 2008 at 1:06 am
good job
July 18th, 2008 at 11:56 am
thanks
July 24th, 2008 at 7:31 am
Will a flash player be allowed to have multiple connections to multiple different parties at the same time?
Cheers.
July 28th, 2008 at 2:41 pm
thanks you
August 4th, 2008 at 3:29 pm
Seems like Kevin Lynch’s comments don’t exactly jibe with yours:
http://gigaom.com/2008/08/04/the-gigaom-interview-kevin-lynch-cto-adob e-systems/
It sounds in his interview that the point of P2p is to lower video costs. What’s the deal exactly?