SlideShare une entreprise Scribd logo
1  sur  28
Télécharger pour lire hors ligne
Introduction                Model           Simulation      Application   Summary




                               A Peer-to-Peer Simulator

                                         Uwe Schmidt

                                          Bachelor Thesis


                                        August 17, 2006




Uwe Schmidt: A Peer-to-Peer Simulator                                       1 / 28
Introduction                Model       Simulation   Application   Summary


Outline



               Introduction
       1



               Model
       2



               Simulation
       3



               Application
       4




Uwe Schmidt: A Peer-to-Peer Simulator                                2 / 28
Introduction                Model       Simulation   Application   Summary


Outline



               Introduction
       1



               Model
       2



               Simulation
       3



               Application
       4




Uwe Schmidt: A Peer-to-Peer Simulator                                3 / 28
Introduction                Model       Simulation    Application      Summary


Peer-to-Peer File-Sharing


       Gaining Importance
               Less expensive in comparison to dedicated file servers
               Exploit bandwidth of users
               Resilient to flashcrowds

       BitTorrent
            Files are separated into chunks
               Popular (also for legal purposes)

       Microsoft Avalanche
           Uses network coding for chunk distribution



Uwe Schmidt: A Peer-to-Peer Simulator                                    4 / 28
Introduction                Model        Simulation          Application        Summary


Motivation


       Freeriding
               Common problem of all P2P systems
               Large fraction of peers are free-riders
               BitTorrent tries to restrain it by enforcing a tit-for-tat strategy

       Primary purpose of the simulator:
       Research the impact of the amount of free-riders on ...
               Download times
               Peer load



Uwe Schmidt: A Peer-to-Peer Simulator                                                5 / 28
Introduction                Model       Simulation   Application   Summary


Outline



               Introduction
       1



               Model
       2



               Simulation
       3



               Application
       4




Uwe Schmidt: A Peer-to-Peer Simulator                                6 / 28
Introduction                Model       Simulation                    Application                            Summary


General
               Similar to BitTorrent (chunk-based file-sharing)
               Global knowledge of all other peers in the system
               No incentives to upload are given (such as tit-for-tat)
               Peers wait random time between downloads

                                                                                         Peer



                                                                         Chunk Selection
       Download Behavior                                                    File

          Multiple Downloads                             Chunk#1    Chunk#2        ...    Chunk#n         Peer Selection

               Queued Requests
                                                                   Peer Lists for Chunks
               Chunk Selection                                               Peer#13
                                                                                                       Peer#11
               Peer Selection                           Peer#6                Peer#2
                                                 List                List                       List   Peer#5
                                                        Peer#40              Peer#77
                                                                                                       Peer#8
                                                                             Peer#19



Uwe Schmidt: A Peer-to-Peer Simulator                                                                            7 / 28
Introduction                Model       Simulation   Application   Summary


General Configuration GUI




Uwe Schmidt: A Peer-to-Peer Simulator                                8 / 28
Introduction                Model       Simulation     Application    Summary


Peers



       Separated into peer groups:
       Peer Group
               Number of members
               Number of free-riders
               Bandwidth (upstream & downstream)
               Maximum number of simultaneous uploads & downloads
               Disconnect probability after successful file download




Uwe Schmidt: A Peer-to-Peer Simulator                                   9 / 28
Introduction                Model       Simulation   Application   Summary


Peers Configuration GUI




Uwe Schmidt: A Peer-to-Peer Simulator                                10 / 28
Introduction                Model       Simulation       Application   Summary


Files

       Separated into file types:
       File Type
               Number of files
               Number of copies (per file)
               File size (determines number of chunks)
               File distribution to peer groups
               Popularity distribution of files among type

       Global Chunk Size
       Applies to all file types



Uwe Schmidt: A Peer-to-Peer Simulator                                    11 / 28
Introduction                Model       Simulation   Application   Summary


Files Configuration GUI




Uwe Schmidt: A Peer-to-Peer Simulator                                12 / 28
Introduction                Model       Simulation   Application   Summary


Requests




               Mean request period
               Request distribution to file types




Uwe Schmidt: A Peer-to-Peer Simulator                                13 / 28
Introduction                Model       Simulation   Application   Summary


Requests Configuration GUI




Uwe Schmidt: A Peer-to-Peer Simulator                                14 / 28
Introduction                Model       Simulation   Application   Summary


Outline



               Introduction
       1



               Model
       2



               Simulation
       3



               Application
       4




Uwe Schmidt: A Peer-to-Peer Simulator                                15 / 28
Introduction                Model       Simulation      Application    Summary


Preliminaries



       Factories
           Create peers and files
               Deploy files to peers

       File Request Generator
               Uses request configuration and file popularity settings
               Creates empirical distributions for file indexes
               Replays this distributions during the simulation




Uwe Schmidt: A Peer-to-Peer Simulator                                    16 / 28
Introduction                Model                   Simulation                 Application      Summary


Discrete Event Simulation Concept

                   Ordered Event List                            Simulation Executive

                                          removes                  executes


                                           Next Event

                               inserted         changes state                    appends data


                                            Entities

                                          schedule               append data


                        New Events                           Data Collection




Uwe Schmidt: A Peer-to-Peer Simulator                                                             17 / 28
Introduction                            Model                          Simulation                 Application                      Summary


Simulation Cycle
File Request Generator


                                                                           Peer

                                             Download Part                                                      Upload Part



     Download File                                                                                                  Incoming Chunk Request




     Add Chunks to                                                                                                        More Uploads
                              Download Complete
    Download Queue                                                                                                         possible?

                                                                                                                  yes         no



                                 Last Chunk
Process Download Queue                                                                         Upload Chunk     Queue Chunk Request       no
                                   of File?

                                      yes



 More Downloads          Maybe
                                            Chunk Download started      Chunk Request Queued      Upload Complete         Update Uploads
    possible?           go Ofline

                 yes             no


                                                                     Maybe start
               Select Chunk           Update Downloads                                                          Process Upload Queue
                                                                     new Request



                                                   Select Peer                Download Chunk


Uwe Schmidt: A Peer-to-Peer Simulator                                                                                                    18 / 28
Introduction                Model       Simulation   Application   Summary


Control




Uwe Schmidt: A Peer-to-Peer Simulator                                19 / 28
Introduction                Model       Simulation     Application   Summary


Collected Data

       Before the Simulation
           Peer groups
               File types
               List of files with chunk mapping
               List of peers with file mapping

       During the Simulation
               Completed chunk transfers
               Completed file downloads
               Miscellaneous (e.g. peer goes offline)

       After the Simulation
            List of peers with file mapping

Uwe Schmidt: A Peer-to-Peer Simulator                                  20 / 28
Introduction                Model       Simulation   Application   Summary


Outline



               Introduction
       1



               Model
       2



               Simulation
       3



               Application
       4




Uwe Schmidt: A Peer-to-Peer Simulator                                21 / 28
Introduction                Model       Simulation   Application   Summary


Overview


               Written in Java SE 5
               Used Eclipse 3
               58 classes in 8 packages
               ≈ 8000 lines of code and comments (JavaDoc)

       Used Libraries
          Jakarta Commons Math → Random Number Generators
               Jakarta Commons Configuration → XML Configuration
               JFreeChart → Charts




Uwe Schmidt: A Peer-to-Peer Simulator                                22 / 28
Introduction                      Model                                    Simulation                                 Application                             Summary


Structure
                                            User


                                  starts                  starts


           Graphical User Interface                   Console Mode

                                                  controls                 controls


                                                                           Simulator

                        changes                                                   uses                                                 executes


                           File Request Generator                          Factories                                                   Next Event

          uses                  uses                use                                    create       create        writes             controls

                                                                                returns Files
                 Configuration                                                                   Files         Peers
                                                                                to download

                    save load              uses           use      consist of               transfer    use      schedule      write                removes


                  Config File                                 Chunks                Strategies            New Events                Log Files

                                                                        use                                                       inserted


                         Random Number Generators                                                                                        Event List


Uwe Schmidt: A Peer-to-Peer Simulator                                                                                                                           23 / 28
Introduction                Model       Simulation      Application   Summary


Used Design Patterns

       Observer Pattern
          Simulator → Simulation State  Progress
               Configuration → Changes

       Singleton Pattern
               Implemented by frequently used components
               Single point of access from everywhere
               No need to pass references on to other components

       Command Pattern
          Hashtable that maps an ActionString to a Command
               Avoid code duplication

Uwe Schmidt: A Peer-to-Peer Simulator                                   24 / 28
Introduction                Model       Simulation      Application       Summary


Extensions


               General modular design
               Selection strategies are easy to change and extend

       Example (Chunk Selection)
               Select rarest chunk among 50 randomly selected ones to
               reflect that peers have no global knowledge in reality

       Example (Peer Selection)
               Select peer with most upstream left
               Select peer with smallest upload queue (if all are busy)



Uwe Schmidt: A Peer-to-Peer Simulator                                       25 / 28
Introduction                Model       Simulation   Application   Summary




                                        Demo




Uwe Schmidt: A Peer-to-Peer Simulator                                26 / 28
Introduction                Model       Simulation      Application       Summary


Summary




               Easy and flexible way to simulate P2P systems (similar to
               BitTorrent)
               Tool to research the impact of free-riders, and other
               parameters, on a P2P system
               Modular designed and extendable




Uwe Schmidt: A Peer-to-Peer Simulator                                       27 / 28
Thank you for your attention




                                        Questions?



Uwe Schmidt: A Peer-to-Peer Simulator                28 / 28

Contenu connexe

Similaire à A Peer-to-Peer Simulator

5- Requirement.ppt
5- Requirement.ppt5- Requirement.ppt
5- Requirement.pptssusera1c25a
 
itsme Prototype Demo 2009-08-03
itsme Prototype Demo 2009-08-03itsme Prototype Demo 2009-08-03
itsme Prototype Demo 2009-08-03itsmesrl
 
Emulation and simulation
Emulation and simulationEmulation and simulation
Emulation and simulationNebalAlJamal
 
20121017 e challenges lisbon
20121017 e challenges lisbon20121017 e challenges lisbon
20121017 e challenges lisbonArian Zwegers
 
Se ii unit1-se_ii_intorduction
Se ii unit1-se_ii_intorductionSe ii unit1-se_ii_intorduction
Se ii unit1-se_ii_intorductionAhmad sohail Kakar
 
DSD-INT 2014 - OpenMI Symposium - Federated modelling of Critical Infrastruct...
DSD-INT 2014 - OpenMI Symposium - Federated modelling of Critical Infrastruct...DSD-INT 2014 - OpenMI Symposium - Federated modelling of Critical Infrastruct...
DSD-INT 2014 - OpenMI Symposium - Federated modelling of Critical Infrastruct...Deltares
 
Assignment 1 - Application of Simulation Software.pdf
Assignment 1 - Application of Simulation Software.pdfAssignment 1 - Application of Simulation Software.pdf
Assignment 1 - Application of Simulation Software.pdfSafeen Yaseen Ja'far
 
RTDesignWithUMLUseCase.ppt
RTDesignWithUMLUseCase.pptRTDesignWithUMLUseCase.ppt
RTDesignWithUMLUseCase.pptShashikanth
 
Modeling and Simulation of Parallel and Distributed Computing Systems with Si...
Modeling and Simulation of Parallel and Distributed Computing Systems with Si...Modeling and Simulation of Parallel and Distributed Computing Systems with Si...
Modeling and Simulation of Parallel and Distributed Computing Systems with Si...Rafael Ferreira da Silva
 
Model level debugging and profiling, Code Generation Conference 2014
Model level debugging and profiling, Code Generation Conference 2014Model level debugging and profiling, Code Generation Conference 2014
Model level debugging and profiling, Code Generation Conference 2014Juha-Pekka Tolvanen
 
07 - Design and Implementation.pptx
07 - Design and Implementation.pptx07 - Design and Implementation.pptx
07 - Design and Implementation.pptxssuser13a155
 
Bridging Concepts and Practice in eScience via Simulation-driven Engineering
Bridging Concepts and Practice in eScience via Simulation-driven EngineeringBridging Concepts and Practice in eScience via Simulation-driven Engineering
Bridging Concepts and Practice in eScience via Simulation-driven EngineeringRafael Ferreira da Silva
 

Similaire à A Peer-to-Peer Simulator (20)

5- Requirement.ppt
5- Requirement.ppt5- Requirement.ppt
5- Requirement.ppt
 
itsme Prototype Demo 2009-08-03
itsme Prototype Demo 2009-08-03itsme Prototype Demo 2009-08-03
itsme Prototype Demo 2009-08-03
 
Prototyping model
Prototyping modelPrototyping model
Prototyping model
 
Emulation and simulation
Emulation and simulationEmulation and simulation
Emulation and simulation
 
20121017 e challenges lisbon
20121017 e challenges lisbon20121017 e challenges lisbon
20121017 e challenges lisbon
 
Se ii unit1-se_ii_intorduction
Se ii unit1-se_ii_intorductionSe ii unit1-se_ii_intorduction
Se ii unit1-se_ii_intorduction
 
DSD-INT 2014 - OpenMI Symposium - Federated modelling of Critical Infrastruct...
DSD-INT 2014 - OpenMI Symposium - Federated modelling of Critical Infrastruct...DSD-INT 2014 - OpenMI Symposium - Federated modelling of Critical Infrastruct...
DSD-INT 2014 - OpenMI Symposium - Federated modelling of Critical Infrastruct...
 
Itech 1005
Itech 1005Itech 1005
Itech 1005
 
Assignment 1 - Application of Simulation Software.pdf
Assignment 1 - Application of Simulation Software.pdfAssignment 1 - Application of Simulation Software.pdf
Assignment 1 - Application of Simulation Software.pdf
 
Spim Mips Simulator
Spim Mips SimulatorSpim Mips Simulator
Spim Mips Simulator
 
RTDesignWithUMLUseCase.ppt
RTDesignWithUMLUseCase.pptRTDesignWithUMLUseCase.ppt
RTDesignWithUMLUseCase.ppt
 
Fuzz
FuzzFuzz
Fuzz
 
Modeling and Simulation of Parallel and Distributed Computing Systems with Si...
Modeling and Simulation of Parallel and Distributed Computing Systems with Si...Modeling and Simulation of Parallel and Distributed Computing Systems with Si...
Modeling and Simulation of Parallel and Distributed Computing Systems with Si...
 
Model level debugging and profiling, Code Generation Conference 2014
Model level debugging and profiling, Code Generation Conference 2014Model level debugging and profiling, Code Generation Conference 2014
Model level debugging and profiling, Code Generation Conference 2014
 
Notacion uml
Notacion umlNotacion uml
Notacion uml
 
Simulation
SimulationSimulation
Simulation
 
07 - Design and Implementation.pptx
07 - Design and Implementation.pptx07 - Design and Implementation.pptx
07 - Design and Implementation.pptx
 
Fdmu pro step_2010_final
Fdmu pro step_2010_finalFdmu pro step_2010_final
Fdmu pro step_2010_final
 
Bridging Concepts and Practice in eScience via Simulation-driven Engineering
Bridging Concepts and Practice in eScience via Simulation-driven EngineeringBridging Concepts and Practice in eScience via Simulation-driven Engineering
Bridging Concepts and Practice in eScience via Simulation-driven Engineering
 
Software Engineering
Software EngineeringSoftware Engineering
Software Engineering
 

Dernier

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 

Dernier (20)

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 

A Peer-to-Peer Simulator

  • 1. Introduction Model Simulation Application Summary A Peer-to-Peer Simulator Uwe Schmidt Bachelor Thesis August 17, 2006 Uwe Schmidt: A Peer-to-Peer Simulator 1 / 28
  • 2. Introduction Model Simulation Application Summary Outline Introduction 1 Model 2 Simulation 3 Application 4 Uwe Schmidt: A Peer-to-Peer Simulator 2 / 28
  • 3. Introduction Model Simulation Application Summary Outline Introduction 1 Model 2 Simulation 3 Application 4 Uwe Schmidt: A Peer-to-Peer Simulator 3 / 28
  • 4. Introduction Model Simulation Application Summary Peer-to-Peer File-Sharing Gaining Importance Less expensive in comparison to dedicated file servers Exploit bandwidth of users Resilient to flashcrowds BitTorrent Files are separated into chunks Popular (also for legal purposes) Microsoft Avalanche Uses network coding for chunk distribution Uwe Schmidt: A Peer-to-Peer Simulator 4 / 28
  • 5. Introduction Model Simulation Application Summary Motivation Freeriding Common problem of all P2P systems Large fraction of peers are free-riders BitTorrent tries to restrain it by enforcing a tit-for-tat strategy Primary purpose of the simulator: Research the impact of the amount of free-riders on ... Download times Peer load Uwe Schmidt: A Peer-to-Peer Simulator 5 / 28
  • 6. Introduction Model Simulation Application Summary Outline Introduction 1 Model 2 Simulation 3 Application 4 Uwe Schmidt: A Peer-to-Peer Simulator 6 / 28
  • 7. Introduction Model Simulation Application Summary General Similar to BitTorrent (chunk-based file-sharing) Global knowledge of all other peers in the system No incentives to upload are given (such as tit-for-tat) Peers wait random time between downloads Peer Chunk Selection Download Behavior File Multiple Downloads Chunk#1 Chunk#2 ... Chunk#n Peer Selection Queued Requests Peer Lists for Chunks Chunk Selection Peer#13 Peer#11 Peer Selection Peer#6 Peer#2 List List List Peer#5 Peer#40 Peer#77 Peer#8 Peer#19 Uwe Schmidt: A Peer-to-Peer Simulator 7 / 28
  • 8. Introduction Model Simulation Application Summary General Configuration GUI Uwe Schmidt: A Peer-to-Peer Simulator 8 / 28
  • 9. Introduction Model Simulation Application Summary Peers Separated into peer groups: Peer Group Number of members Number of free-riders Bandwidth (upstream & downstream) Maximum number of simultaneous uploads & downloads Disconnect probability after successful file download Uwe Schmidt: A Peer-to-Peer Simulator 9 / 28
  • 10. Introduction Model Simulation Application Summary Peers Configuration GUI Uwe Schmidt: A Peer-to-Peer Simulator 10 / 28
  • 11. Introduction Model Simulation Application Summary Files Separated into file types: File Type Number of files Number of copies (per file) File size (determines number of chunks) File distribution to peer groups Popularity distribution of files among type Global Chunk Size Applies to all file types Uwe Schmidt: A Peer-to-Peer Simulator 11 / 28
  • 12. Introduction Model Simulation Application Summary Files Configuration GUI Uwe Schmidt: A Peer-to-Peer Simulator 12 / 28
  • 13. Introduction Model Simulation Application Summary Requests Mean request period Request distribution to file types Uwe Schmidt: A Peer-to-Peer Simulator 13 / 28
  • 14. Introduction Model Simulation Application Summary Requests Configuration GUI Uwe Schmidt: A Peer-to-Peer Simulator 14 / 28
  • 15. Introduction Model Simulation Application Summary Outline Introduction 1 Model 2 Simulation 3 Application 4 Uwe Schmidt: A Peer-to-Peer Simulator 15 / 28
  • 16. Introduction Model Simulation Application Summary Preliminaries Factories Create peers and files Deploy files to peers File Request Generator Uses request configuration and file popularity settings Creates empirical distributions for file indexes Replays this distributions during the simulation Uwe Schmidt: A Peer-to-Peer Simulator 16 / 28
  • 17. Introduction Model Simulation Application Summary Discrete Event Simulation Concept Ordered Event List Simulation Executive removes executes Next Event inserted changes state appends data Entities schedule append data New Events Data Collection Uwe Schmidt: A Peer-to-Peer Simulator 17 / 28
  • 18. Introduction Model Simulation Application Summary Simulation Cycle File Request Generator Peer Download Part Upload Part Download File Incoming Chunk Request Add Chunks to More Uploads Download Complete Download Queue possible? yes no Last Chunk Process Download Queue Upload Chunk Queue Chunk Request no of File? yes More Downloads Maybe Chunk Download started Chunk Request Queued Upload Complete Update Uploads possible? go Ofline yes no Maybe start Select Chunk Update Downloads Process Upload Queue new Request Select Peer Download Chunk Uwe Schmidt: A Peer-to-Peer Simulator 18 / 28
  • 19. Introduction Model Simulation Application Summary Control Uwe Schmidt: A Peer-to-Peer Simulator 19 / 28
  • 20. Introduction Model Simulation Application Summary Collected Data Before the Simulation Peer groups File types List of files with chunk mapping List of peers with file mapping During the Simulation Completed chunk transfers Completed file downloads Miscellaneous (e.g. peer goes offline) After the Simulation List of peers with file mapping Uwe Schmidt: A Peer-to-Peer Simulator 20 / 28
  • 21. Introduction Model Simulation Application Summary Outline Introduction 1 Model 2 Simulation 3 Application 4 Uwe Schmidt: A Peer-to-Peer Simulator 21 / 28
  • 22. Introduction Model Simulation Application Summary Overview Written in Java SE 5 Used Eclipse 3 58 classes in 8 packages ≈ 8000 lines of code and comments (JavaDoc) Used Libraries Jakarta Commons Math → Random Number Generators Jakarta Commons Configuration → XML Configuration JFreeChart → Charts Uwe Schmidt: A Peer-to-Peer Simulator 22 / 28
  • 23. Introduction Model Simulation Application Summary Structure User starts starts Graphical User Interface Console Mode controls controls Simulator changes uses executes File Request Generator Factories Next Event uses uses use create create writes controls returns Files Configuration Files Peers to download save load uses use consist of transfer use schedule write removes Config File Chunks Strategies New Events Log Files use inserted Random Number Generators Event List Uwe Schmidt: A Peer-to-Peer Simulator 23 / 28
  • 24. Introduction Model Simulation Application Summary Used Design Patterns Observer Pattern Simulator → Simulation State Progress Configuration → Changes Singleton Pattern Implemented by frequently used components Single point of access from everywhere No need to pass references on to other components Command Pattern Hashtable that maps an ActionString to a Command Avoid code duplication Uwe Schmidt: A Peer-to-Peer Simulator 24 / 28
  • 25. Introduction Model Simulation Application Summary Extensions General modular design Selection strategies are easy to change and extend Example (Chunk Selection) Select rarest chunk among 50 randomly selected ones to reflect that peers have no global knowledge in reality Example (Peer Selection) Select peer with most upstream left Select peer with smallest upload queue (if all are busy) Uwe Schmidt: A Peer-to-Peer Simulator 25 / 28
  • 26. Introduction Model Simulation Application Summary Demo Uwe Schmidt: A Peer-to-Peer Simulator 26 / 28
  • 27. Introduction Model Simulation Application Summary Summary Easy and flexible way to simulate P2P systems (similar to BitTorrent) Tool to research the impact of free-riders, and other parameters, on a P2P system Modular designed and extendable Uwe Schmidt: A Peer-to-Peer Simulator 27 / 28
  • 28. Thank you for your attention Questions? Uwe Schmidt: A Peer-to-Peer Simulator 28 / 28