SlideShare a Scribd company logo
Sockets vs P2P
Communication on the Flash Platform
Aaron Boushley
›   Senior Developer at ZaaLabs, Ltd.
›   www.zaalabs.com
›   aaron@zaalabs.com
›   @boushley
Forms Of
Communication
›   Sockets
›   NetConnection + NetGroup
›   HTTPBased
    »   WebService (SOAP)
    »   HTTPService (REST)

›   RemoteObject (AMF)
High Level --
Sockets
›   Client-Server Architecture
›   Flash Independent
›   Requires a server of some kind
High Level -- P2P
      ›   Peer to Peer Communication
      ›   Adobe specific implementation (RTMFP)
      ›   No server required*, all clients can
          communicate




*P2P Setup requires a server or ip multicast to maintain the mesh.
Code Time...
Basic Sockets
War Games
WOPR example by Nate Beck
P2P Chat
›   Example by Tom Krcha
›   http://www.flashrealtime.com/simple-chat-p2p-netgroup-rtmfp/

›   Great demonstration of the basics of P2P
Forms Of




  The IP Stack
TCP vs UDP --
FIGHT!
          TCP                               UDP
›   Header Size: 32 Bytes        ›   Header Size: 20 Bytes

›   Guaranteed Order             ›   No Guarantee on Order

›   Guaranteed Delivery          ›   No Guarantee on Delivery

›   Uses Triple Handshake        ›   Single Packet



›   IP Header Size: IPv4 ->16 Bytes IPv6 -> 40 Bytes
Protocols
›   The RTMP Family (RTMP, RTMPT, RTMPS,
    RTMPE, RTMFP)
›   AMF (Socket#writeObject/readObject)
›   SOAP, Plain XML, JSON
›   Custom (Hopefully bit packed)
Custom
AMF

JSON


XML


SOAP
Custom Packing -

 Hex      Binary
 05      00000101
          First   Second Third
Custom Packing -
Integer


     Hex       Decimal
 00 00 04 D2    1234
Custom Packing
      Encode




      Decode
Sockets vs
›   Communication is (more) private   ›   Can function purely with Flash

›   Gets through most firewalls       ›   Broadcasts are simpler and
                                          Bandwidth Efficient
Private
Communication
›   Sockets send packets directly to recipient
›   P2P requires directing code
    »   Example
    »   http://www.flashrealtime.com/directed-routing-
        explained-flash-p2p/

›   Encryption for security over the network
    »   AS3Crypto -- https://code.google.com/p/as3crypto/
Sockets + P2P =
      <3
ZaaMulti
Questions?
http://github.com/

More Related Content

ODP
How to make P2P apps without a server? RTFM... no RTMFP.
PDF
WebRTC and Janus intro for FOSS Stockholm January 2019
PDF
Kamailio World 2018: Having fun with new stuff
ODP
PDF
PDF
Kamailio World 2014 - Introduction to IMS Application Servers
PDF
Webrtc overview
PDF
Asterisk WebRTC frontier: make client SIP Phone with sipML5 and Janus Gateway
How to make P2P apps without a server? RTFM... no RTMFP.
WebRTC and Janus intro for FOSS Stockholm January 2019
Kamailio World 2018: Having fun with new stuff
Kamailio World 2014 - Introduction to IMS Application Servers
Webrtc overview
Asterisk WebRTC frontier: make client SIP Phone with sipML5 and Janus Gateway

Similar to P2P vs Sockets: Communication on the Flash Platform (20)

ODP
Your app lives on the network - networking for web developers
PDF
บทที่ 2 โพรโตคอล (protocol)
PDF
Networking Fundamentals: Transport Protocols (TCP and UDP)
PDF
Why and How to use Onion Networking - #EMFCamp2018
PDF
Is there still room for linking narrowband PMR sites in this digital world?
PPTX
Small office Home office , network setup in details
ODP
Hacking Robotics(English Version)
PPT
Introduction to TCP/IP
PDF
Cyber Security Cyber SecurityCyber Security
PPTX
Bluetooth the new invension of last century
PPT
SOHO Network Setup Tutorial
PDF
08 tcp-dns
PPT
Turbot - A Next Generation Botnet
PPT
SIP for geeks
PPTX
10 coms 525 tcpip - internet protocol - ip
PPTX
Liberating the Black Box - Real-Time Communications for the Internet of Things
PDF
Nokia 3GPP Industry e-Workshop on XR Sept 2020
PDF
VOIP QOS
PPTX
CCNA ppt Day 9
Your app lives on the network - networking for web developers
บทที่ 2 โพรโตคอล (protocol)
Networking Fundamentals: Transport Protocols (TCP and UDP)
Why and How to use Onion Networking - #EMFCamp2018
Is there still room for linking narrowband PMR sites in this digital world?
Small office Home office , network setup in details
Hacking Robotics(English Version)
Introduction to TCP/IP
Cyber Security Cyber SecurityCyber Security
Bluetooth the new invension of last century
SOHO Network Setup Tutorial
08 tcp-dns
Turbot - A Next Generation Botnet
SIP for geeks
10 coms 525 tcpip - internet protocol - ip
Liberating the Black Box - Real-Time Communications for the Internet of Things
Nokia 3GPP Industry e-Workshop on XR Sept 2020
VOIP QOS
CCNA ppt Day 9
Ad

Recently uploaded (20)

PDF
Machine learning based COVID-19 study performance prediction
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Spectroscopy.pptx food analysis technology
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
DOCX
The AUB Centre for AI in Media Proposal.docx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Electronic commerce courselecture one. Pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
Machine learning based COVID-19 study performance prediction
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Understanding_Digital_Forensics_Presentation.pptx
Encapsulation theory and applications.pdf
Spectral efficient network and resource selection model in 5G networks
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Spectroscopy.pptx food analysis technology
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Chapter 3 Spatial Domain Image Processing.pdf
Encapsulation_ Review paper, used for researhc scholars
MYSQL Presentation for SQL database connectivity
Unlocking AI with Model Context Protocol (MCP)
Advanced methodologies resolving dimensionality complications for autism neur...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
The AUB Centre for AI in Media Proposal.docx
“AI and Expert System Decision Support & Business Intelligence Systems”
Reach Out and Touch Someone: Haptics and Empathic Computing
Electronic commerce courselecture one. Pdf
NewMind AI Weekly Chronicles - August'25 Week I
The Rise and Fall of 3GPP – Time for a Sabbatical?
Ad

P2P vs Sockets: Communication on the Flash Platform

  • 1. Sockets vs P2P Communication on the Flash Platform
  • 2. Aaron Boushley › Senior Developer at ZaaLabs, Ltd. › www.zaalabs.com › aaron@zaalabs.com › @boushley
  • 3. Forms Of Communication › Sockets › NetConnection + NetGroup › HTTPBased » WebService (SOAP) » HTTPService (REST) › RemoteObject (AMF)
  • 4. High Level -- Sockets › Client-Server Architecture › Flash Independent › Requires a server of some kind
  • 5. High Level -- P2P › Peer to Peer Communication › Adobe specific implementation (RTMFP) › No server required*, all clients can communicate *P2P Setup requires a server or ip multicast to maintain the mesh.
  • 8. War Games WOPR example by Nate Beck
  • 9. P2P Chat › Example by Tom Krcha › http://www.flashrealtime.com/simple-chat-p2p-netgroup-rtmfp/ › Great demonstration of the basics of P2P
  • 10. Forms Of The IP Stack
  • 11. TCP vs UDP -- FIGHT! TCP UDP › Header Size: 32 Bytes › Header Size: 20 Bytes › Guaranteed Order › No Guarantee on Order › Guaranteed Delivery › No Guarantee on Delivery › Uses Triple Handshake › Single Packet › IP Header Size: IPv4 ->16 Bytes IPv6 -> 40 Bytes
  • 12. Protocols › The RTMP Family (RTMP, RTMPT, RTMPS, RTMPE, RTMFP) › AMF (Socket#writeObject/readObject) › SOAP, Plain XML, JSON › Custom (Hopefully bit packed)
  • 14. Custom Packing - Hex Binary 05 00000101 First Second Third
  • 15. Custom Packing - Integer Hex Decimal 00 00 04 D2 1234
  • 16. Custom Packing Encode Decode
  • 17. Sockets vs › Communication is (more) private › Can function purely with Flash › Gets through most firewalls › Broadcasts are simpler and Bandwidth Efficient
  • 18. Private Communication › Sockets send packets directly to recipient › P2P requires directing code » Example » http://www.flashrealtime.com/directed-routing- explained-flash-p2p/ › Encryption for security over the network » AS3Crypto -- https://code.google.com/p/as3crypto/

Editor's Notes