SlideShare une entreprise Scribd logo
1  sur  21
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/

Contenu connexe

Similaire à P2P vs Sockets: Communication on the Flash Platform

บทที่ 2 โพรโตคอล (protocol)
บทที่  2 โพรโตคอล (protocol)บทที่  2 โพรโตคอล (protocol)
บทที่ 2 โพรโตคอล (protocol)
chrisman77
 
Hacking Robotics(English Version)
Hacking Robotics(English Version)Hacking Robotics(English Version)
Hacking Robotics(English Version)
Kensei Demura
 

Similaire à P2P vs Sockets: Communication on the Flash Platform (20)

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

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Dernier (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

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/

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n