fsnsg Presented by: Bartlomiej Polot and Matthias Wachs Beyond - - PowerPoint PPT Presentation

fsnsg
SMART_READER_LITE
LIVE PREVIEW

fsnsg Presented by: Bartlomiej Polot and Matthias Wachs Beyond - - PowerPoint PPT Presentation

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols Nathan S. Evans Christian Grothoff Technische Universit at M unchen August 8, 2011 fsnsg Presented by: Bartlomiej Polot and Matthias Wachs Beyond Simulation:


slide-1
SLIDE 1

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Nathan S. Evans Christian Grothoff

Technische Universit¨ at M¨ unchen

August 8, 2011

fsnsg

Presented by: Bartlomiej Polot and Matthias Wachs

slide-2
SLIDE 2

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Systems Research — Simulation

Implementation Simulation Abstract Interpret Bug Bug

Ideal use of simulation for security testing.

Simulation

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 2

slide-3
SLIDE 3

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Systems Research — Simulation

Implementation Simulation Abstract Interpret Bug

Ideal use of simulation for security testing.

Simulation

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 3

slide-4
SLIDE 4

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Systems Research — Simulation

Design Implementation Simulation ??? Exploit Bug

Reality for most simulation usage.

Simulation

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 4

slide-5
SLIDE 5

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Systems Research — Emulation

DETER

VLAN

APP OS OS APP

OS

VLAN

APP OS OS APP

OS

VLAN

APP OS OS APP

OS

LAN/WAN

Emulation

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 5

slide-6
SLIDE 6

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Our Emulation Approach

LAN/WAN

APP

OS

APP Test Control App APP

OS

APP APP

OS

APP APP APP

Emulation

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 6

slide-7
SLIDE 7

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

GNUnet Architecture

P2P framework Focus on security Written in C Portable & extendable Multi-process architecture & IPC Extensive utility library

Peer A

Core Peerinfo Your App Transport

GNUnet

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 7

slide-8
SLIDE 8

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

The Transport Service

Low-level P2P connectivity Transport plugins: provide many connection options Unix domain sockets Blacklisting & whitelisting

WLAN HTTP

GNUnet Transport Service

host transport selection send/receive

Transport API

TCP UDP

GNUnet GNUnet GNUnet GNUnet

GNUnet

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 8

slide-9
SLIDE 9

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

P2P Emulation Steps

Design P2P application Implement as GNUnet service Use built-in statistics or design logging facility Create test control application

Links against emulation library Peer group startup/shutdown Utilizes API to access service

GNUnet

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 9

slide-10
SLIDE 10

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Our Emulation Approach

OS

E m u l a t i

  • n

L i b r a r y

Test Control App

generates

Peer A

Core Transport Peerinfo Your App

calls starts calls uses config generates

Peer B

Core Transport Peerinfo Your App

calls starts calls uses config

GNUnet

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 10

slide-11
SLIDE 11

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Single Peer Startup Sequence

Running Peer Configuration File Hostkey File Running P2P App

start peer running generate write config hostkey peer shutdown clean up start

Emulation Library T est Control Application

launches subsystems stop stop e v e n t s r e q u e s t s time

GNUnet

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 11

slide-12
SLIDE 12

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Peer Group

“Peer group” is the handle to running peers Layering — peer group reuses single peer startup code Peer group features

Configuration mangling Resource allocation, throttling Connects peers in desired topology Capture running topology/statistics Start/stop/reconfigure peers Induce churn Provide handles to specific peers

GNUnet

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 12

slide-13
SLIDE 13

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Peer Group Startup, Code Example

1 s t r u c t GNUNET TESTING PeerGroup ∗ 2 GNUNET TESTING peergroup start ( const s t r u c t GNUNET CONFIGURATION Handle ∗cfg , 3 unsigned i n t t o t a l , 4 s t r u c t GNUNET TIME Relative timeout , 5 GNUNET TESTING NotifyConnection connect cb , 6 GNUNET TESTING NotifyCompletion peergroup cb , 7 void ∗ p e e r g r o u p c l s , 8 const s t r u c t GNUNET TESTING Host ∗ h o s t s ) ; 1 GNUNET CONFIGURATION load ( t e s t i n g c f g , ”˜/ t e s t . conf ” ) ; 2 s t r u c t MyClosure ∗data ; /∗ your data here ∗/ 3 s t r u c t GNUNET TESTING Host ∗ h o s t s = GNUNET TESTING HOSTS load( ”˜/ h o s t s . conf ” ) ; 4 pg = GNUNET TESTING peergroup start ( t e s t i n g c f g , 20000 , TIMEOUT, &connect cb , 5 &peergroup cb , data , h o s t s ) ; 6 /∗ peergroup cb must e v e n t u a l l y c a l l : ∗/ 7 GNUNET TESTING daemons stop ( pg , TIMEOUT, &shutdown cb , data ) ; GNUnet

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 13

slide-14
SLIDE 14

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Network Topologies

Simple topology creation/im- port/export

(a) 2d-grid (b) Small-World (c) Erdos-Renyi (d) InterNAT

GNUnet

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 14

slide-15
SLIDE 15

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Topology Generation and Evolution

(a) Initial (b) 2 Minutes (c) 5 Minutes (d) 10 minutes (e) 15 minutes (f) 30 minutes Figure

GNUnet

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 15

slide-16
SLIDE 16

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Limitations of Emulation

Timing accuracy

Network latency Throughput

Underlying OS interference

CPU scheduling Disk access Memory usage

Speed Shared IP/hostnames Peer diversity GNUnet

Limitations

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 16

slide-17
SLIDE 17

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Overcoming Limitations

Single OS per peer ⇒ Testing framework can be used on lower level emulators focused on timing accurate results

PlanetLab, Emulab, DETER, etc. Sacrifice scalability

Shared IP/hostnames — Virtual addresses, VMs Peer diversity — Configure per-peer bandwidth, VMs GNUnet — Benefit and limitation

Limitations

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 17

slide-18
SLIDE 18

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Important Lessons Learned

Cryptography Start-up time Periodic tasks Sockets Memory

01010101

Lessons Learned

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 18

slide-19
SLIDE 19

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Peer and Emulation Performance

Memory consumption

Service Non-shared Heap Shared supervisor 228 KB 32 KB 2,364 KB transport 359 KB 99 KB 2,888 KB core 300 KB 84 KB 2,428 KB dht 536 KB 240 KB 3,684 KB total 1,424 KB 456 KB 11,364 KB

Lessons Learned

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 19

slide-20
SLIDE 20

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Peer and Emulation Performance

Architecture Hosts Cores Memory Peers Connections Time to (Total) (Total) per second start peer Cortex-A8 1 1 512 MB 100 ∼ 1 ∼ 206 ms Xeon W3505 1 2 12 GB 2,025 ∼ 60 ∼ 12 ms Xeon W3520 1 8 12 GB 2,025 ∼ 188 ∼ 5 ms Opteron 8222 1 16 64 GB 10,000 ∼ 327 ∼ 27 ms Opteron 850 31 124 217 GB 80,000 ∼ 559 ∼ 1 ms

Lessons Learned

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 20

slide-21
SLIDE 21

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Example: Comparison of DHT Performance

Performance comparison of different DHT implementations 60,000 peers Specific peers were changed into malicious sybil nodes Success rate of requests measured

DHT Example

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 21

slide-22
SLIDE 22

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Example: NSE Implementation

Network Size Estimation algorithm 2 days to implement 2 weeks from idea to paper Single host: 4,000 peers

NSE Example

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 22

slide-23
SLIDE 23

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Conclusion

Framework available at https://gnunet.org We encourage people to use our framework 80,000 peers on cluster: what happens on supercomputer? at least consider: emulation vs. simulation even at large scale

Conclusion

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 23

slide-24
SLIDE 24

Beyond Simulation: Large-Scale Distributed Emulation of P2P Protocols

Questions?

The End.

  • N. Evans, C. Grothoff (TUM)

August 8, 2011 24