2009-BT-MASCOTS
Download
Report
Transcript 2009-BT-MASCOTS
A BitTorrent Module for the OMNeT++ Simulator
MASCOTS 2009, London, UK
G. Xylomenos
(with K. Katsaros, V.P. Kemerlis and C. Stais)
Outline
•
•
•
•
•
•
•
•
Context
Motivation
Advantages
Features
Structure
Extras
Performance
Conclusion
Context
• The ICT PSIRP Project
– The Internet mostly disseminates data
– Publish-Subscribe Internet Routing Paradigm
– Clean slate approach to Future Internet
– Pub-Sub at application and network levels
• What does that have to do with BitTorrent?
– PSIRP was motivated by content distribution
– BitTorrent is the perfect benchmark for this!
– Now if we only had a good BitTorrent simulator…
Motivation
• Why a BitTorrent simulator?
– BitTorrent swarms exhibit very complex behavior
• Many mechanisms and strategies are at play
– Traces are hard to gather and understand
• Fully distributed systems are hard to monitor
– Performance predictions are simply guesses
• What happens when we modify a strategy?
– Existing simulators were not detailed enough
• Some omit large parts of the protocol
• Others only work over abstract networks
Advantages
• Why bother with our simulator?
– It operates over the OMNeT++ platform
• You can use it with everything available for OMNeT++
• Example: OMNeT++ supports two types of network
– InetUnderlay: hosts with full TCP/IP stacks
– SimpleUnderlay: simple and fast abstract hosts
– It incorporates nearly all BitTorrent details
• All policies and options are present and tunable
• If something is missing, feel free to add it!
– Extra features that simplify simulations
• Asymmetric links, churn model, GT-ITM topologies
Features
• Full implementation of tracker and peer-wire protocols
– All messages are included
• Arbitrary file, piece and block sizes
• Variable number of peer connections (min/max)
• Rarest first and random first download strategies
• Data request pipelining
• Tunable choking algorithm (intervals, peers)
• Super seeding and end game modes
• Not implemented (yet!): trackerless mode (DHT based)
BTHost
Structure
Peer-wire module
Tracker
client
module
Peerwire
thread
Peer-wir
e
thread
...
Peer-wir
e
thread
...
TCP
Physical Layer
Swarm
...
Physical Layer
TCP
Tracker
thread
Tracker
thread
...
• Fully modularized code
– Extends existing class hierarchy
– Easier to modify and extend
– Possibility of parallel simulation
• Tracker module
– Models a multi-threaded tracker
• Tracker client module
– Connects client with tracker
• Peer-wire module
– Models a multi-threaded peer
Peer-wire base
Tracker
thread
Tracker base
Tracker module
Tracker
Extras
• BitTorrent simulation scenarios are complex
– Numerous widely dispersed nodes are needed
– Hard to manually place and start them
• Topology creation: GT-ITM import filter
– Extension of the BRITE import tool
• Supports hierarchical networks
• Supports asymmetric (ADSL) access links
• Host deployment: BitTorrent churn generator
– Empirical distribution of host interarrival times
– Based on actual BitTorrent trace data
Performance
CPU Time (sec)
• CPU time measurements (Intel E5200 2.5GHz)
– 200 MByte file
7000
IPv4 Underlay (GT-ITM)
Simple Underlay (Skitter)
– Mixed ADSL
6000
• GT-ITM
5000
– Full stack
4000
– 1400 routers
3000
• Skitter
2000
– Delays only
1000
– No queueing
0
30
60
90
Total Peers
120
Performance
• Memory footprint measurements (Ubuntu, 4 GB RAM)
– Same scenario
800
Memory Footprint (MB)
700
IPv4 Underlay (GT-ITM)
Simple Underlay (Skitter)
600
500
400
300
200
100
0
30
60
90
Total Peers
120
Performance
Download Time (sec)
• Question: which piece size minimizes download time?
– Same scenario
3000
– 60 peers
2500
• Any differences?
2000
– Variance
IPv4 Underlay (GT-ITM)
1500
Simple Underlay (Skitter)
– Slope
1000
– Knee at 512
500
0
256512 1024
2048
Piece Size (KB)
4096
Conclusion
• OMNeT++ based BitTorrent module
– Comprehensive protocol model
– Works with detailed and simplified stacks
• Space/time vs. accuracy tradeoff
• The difference is important!
– Extra tools to help your simulations
• Churn generator, topologies, mix of ADSL links
– Code available under the GPL
• http://mm.aueb.gr/research/bittorrent/
– New version for OMNeT++ 4 coming real soon now!