220 likes | 370 Views
incentive mechanism as a solution of the free riding problem. Design Document of P2P simulator 19971241 김종욱. content. design requirement simulator initialization simulation simulation end peer protocol network. Design requirement. easy to change protocol ex) Chord and others
E N D
incentive mechanismas a solution of the free riding problem Design Document of P2P simulator 19971241 김종욱
content • design requirement • simulator • initialization • simulation • simulation end • peer • protocol • network
Design requirement • easy to change • protocol • ex) Chord and others • peer action model • ex) with free riding mechanism, or not • network topology
Simulator Simulator P2P System Event Timer Peer Peer Peer ...... P2P Protocol P2P Protocol P2P Protocol • global Network Topology
Initialization simulator 6 1 3 network peer factory job queue 2 4 topology peer 5 protocol chord
Simulation simulator start query Protocol send(src, trg, packet) Network Peer return result receive latency join leave topology queue( job, delay ) job queue worker thread dequeue
Simulation end • condition • all peers leave the system • there's no shared thing in the system
Event Thread • Event Object • attribute • who • label to execute • args • time to execute • interface • void doAction( label, args ) • using time priorty queue • simplely run who.doAction( label, args )
- time priority queue - time이 같다면 먼저 들어온 event가 우선순위를 가진다. schedule( Event e, delay ) queue( Event e, delay ) EventTimer EventQueue schedule( Event e ) delay = 0 dequeue() getCurrentTime() - simulation의 현재 시간 EventThread
Event Thread dequeue current < request time yes update current time do job()
Peer SimplePeerModel without free riding control mechanism start wait random times make ToBDownload List No if enough if waitCntr > Threshold increase waitCntr choose a file to download Leave the system download wait for random times
SimplePeer( Detail ) Shared File List Peer To Be Download List Downloaded File List WaitCntr and ETC Global File List query download Protocol
p2p system peer peer peer event timer protocol protocol protocol node(nid) node(nid) node(nid) ...... network topology
initialization peer factory simulator P2P system topology network protocol peer init init init init with peer info init create peers init join join start
SimplePeer(flow) Network Protocol on another Protocol P2PSystem Peer if not enough WaitCntr++ & retry get global file list return leave make a list to be download leave select a file query get file location return file location location return request download send generate receive event send dummy data receive data event download complete sleep for a while
Protocol Protocol Peer Network query( callee, what ) query_result : query, pid list download( callee, filename, pid ) send( src nid, trg nid, download request ) receive( src nid, download request ) senddummy( src nid, trg nid, size ) receive( src nid, download complete ) download complete event : filename
P2P system global variable sharing peer list peer File shared File List FID Size PID
P2P application USER join leave query download P2P Protocol
Protocol • SimpleProtocol • query • always successful searching • Chord
Network • SimpleNetwork • the latency between peers is zero • bandwidth : constant k • implement others on demand
protocol send(src,trg, packet) network latency(src,trg) bandwidth topology