P2P: Simulations and Real world Networks
-
Upload
matilda-rhode -
Category
Technology
-
view
253 -
download
0
Transcript of P2P: Simulations and Real world Networks
![Page 1: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/1.jpg)
P2P: Simulations and Real World Networks
Matilda Rhode and Matt Courtney
![Page 2: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/2.jpg)
(Partial) Average functionpublic void nextCycle(Node node, int protocolID) { int linkableID = FastConfig.getLinkable(protocolID); Linkable linkable = (Linkable) node.getProtocol(linkableID); if (linkable.degree() > 0) { Node peer = linkable.getNeighbor(CommonState.r.nextInt(linkable .degree()));
// Failure handling if (!peer.isUp()) return;
AverageFunction neighbor = (AverageFunction) peer .getProtocol(protocolID); double mean = (this.value + neighbor.value) / 2; this.value = mean; neighbor.value = mean; } }
![Page 3: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/3.jpg)
(Partial) Maximum functionpublic void nextCycle(Node node, int protocolID) { int linkableID = FastConfig.getLinkable(protocolID); Linkable linkable = (Linkable) node.getProtocol(linkableID); if (linkable.degree() > 0) { Node peer = linkable.getNeighbor(CommonState.r.nextInt(linkable .degree()));
// Failure handling if (!peer.isUp()) return;
MaximumFunction neighbor = (MaximumFunction) peer .getProtocol(protocolID); double maximum = this.value
if (neighbor.value > this.value) { maximum = neighbor.value; }
this.value = maximum; neighbor.value = maximum; } }
![Page 4: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/4.jpg)
(Partial) Minimum functionpublic void nextCycle(Node node, int protocolID) { int linkableID = FastConfig.getLinkable(protocolID); Linkable linkable = (Linkable) node.getProtocol(linkableID); if (linkable.degree() > 0) { Node peer = linkable.getNeighbor(CommonState.r.nextInt(linkable .degree()));
// Failure handling if (!peer.isUp()) return;
MaximumFunction neighbor = (MaximumFunction) peer .getProtocol(protocolID); double maximum = this.value
if (neighbor.value < this.value) { maximum = neighbor.value; }
this.value = maximum; neighbor.value = maximum; } }
![Page 5: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/5.jpg)
Gossip-based protocols
• Gossip or epidemic protocol
• Each node has only a partial view of the network
![Page 6: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/6.jpg)
When all nodes hold the same value
Using Incremental Stats printed in average observer to see when network is ‘settled’
control.avgo: 0 1.0 99.99999999999999 50 50.5 867.4354435651799 1 1CDSimulator: cycle 0 donecontrol.avgo: 1 1.0 69.6938775510204 50 23.386122448979595 414.34298362076936 7 1CDSimulator: cycle 1 donecontrol.avgo: 2 1.0 31.30612244897959 50 5.162040816326529 49.386130098853386 26 2CDSimulator: cycle 2 donecontrol.avgo: 3 1.0 7.061224489795918 50 1.4040816326530612 1.6661425086486068 44 2CDSimulator: cycle 3 donecontrol.avgo: 4 1.0 1.0 50 1.0 0.0 50 50CDSimulator: cycle 4 done
Largest value held by
any nodeCycle
Smallest value held by
any node
Network size
Mean value
Variance in values
Total nodes holding
minimum value
Total nodes holding
maximum value
Minimum function, linear distribution of values (1,100) , network size = 50
![Page 7: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/7.jpg)
When all nodes hold the same value
Using Incremental Stats printed in average observer to see when network is ‘settled’
control.avgo: 0 1.0 99.99999999999999 50 50.5 867.4354435651799 1 1CDSimulator: cycle 0 donecontrol.avgo: 1 1.0 69.6938775510204 50 23.386122448979595 414.34298362076936 7 1CDSimulator: cycle 1 donecontrol.avgo: 2 1.0 31.30612244897959 50 5.162040816326529 49.386130098853386 26 2CDSimulator: cycle 2 donecontrol.avgo: 3 1.0 7.061224489795918 50 1.4040816326530612 1.6661425086486068 44 2CDSimulator: cycle 3 donecontrol.avgo: 4 50 1.0 0.0 50 50CDSimulator: cycle 4 done
Largest value held by
any nodeCycle
Smallest value held by
any node
Network size
Mean value
Variance in values
Total nodes holding
minimum value
Total nodes holding
maximum value
Minimum function, linear distribution of values (1,100) , network size = 50
1.0 1.0
![Page 8: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/8.jpg)
When all nodes hold the same value
Using Incremental Stats printed in average observer to see when network is ‘settled’
control.avgo: 0 1.0 99.99999999999999 50 50.5 867.4354435651799 1 1CDSimulator: cycle 0 donecontrol.avgo: 1 1.0 69.6938775510204 50 23.386122448979595 414.34298362076936 7 1CDSimulator: cycle 1 donecontrol.avgo: 2 1.0 31.30612244897959 50 5.162040816326529 49.386130098853386 26 2CDSimulator: cycle 2 donecontrol.avgo: 3 1.0 7.061224489795918 50 1.4040816326530612 1.6661425086486068 44 2CDSimulator: cycle 3 donecontrol.avgo: 4 1.0 1.0 1.0 0.0 CDSimulator: cycle 4 done
Largest value held by
any nodeCycle
Smallest value held by
any node
Network size
Mean value
Variance in values
Total nodes holding
minimum value
Total nodes holding
maximum value
Minimum function, linear distribution of values (1,100) , network size = 50
50 50 50
![Page 9: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/9.jpg)
Varying parameters• Protocol {AverageFunction, MaximumFunction, MinumumFunction}
• Network size [2,50000]
• Distribution of values {Linear, Peak}, distribution parameters
• k, directed edges out of each node [1,8]
• Network Topography {WireKOut, WireINet, WireRegRootedTree, WireRingLattice, WireStar, WireWS}
• Network dynamism {Static, Dynamic, Oscillating}, dynamic and oscillating parameters
![Page 10: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/10.jpg)
Distribution
Static config filerandom.seed 1234567890control.shf Shuffle
simulation.cycles 10network.size 100 protocol.lnk IdleProtocol
protocol.0 example.aggregation.protocol.0.linkable lnk init.rnd WireKOutinit.rnd.protocol lnkinit.rnd.k 5
init.lin LinearDistributioninit.lin.protocol 0init.lin.max 100init.lin.min 1
init.peak example.aggregation.PeakDistributionInitializerinit.peak.value 10000init.peak.protocol 0
include.init rnd lin
control.avgo example.aggregation.AverageObservercontrol.avgo.protocol 0
k
MaximumFunction
Distribution Parameters
ProtocolNetwork size
![Page 11: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/11.jpg)
Distribution
Static config filerandom.seed 1234567890control.shf Shuffle
simulation.cycles 10network.size protocol.lnk IdleProtocol
protocol.0 example.aggregation.protocol.0.linkable lnk init.rnd WireKOutinit.rnd.protocol lnkinit.rnd.k 5
init.lin LinearDistributioninit.lin.protocol 0init.lin.max 100init.lin.min 1
init.peak example.aggregation.PeakDistributionInitializerinit.peak.value 10000init.peak.protocol 0
include.init rnd lin
control.avgo example.aggregation.AverageObservercontrol.avgo.protocol 0
ProtocolNetwork size
MaximumFunction
100
kDistribution Parameters
![Page 12: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/12.jpg)
Static config fileProtocol
Network sizeDistribution
MaximumFunction
100
1001
10000
lin
kDistribution Parameters
random.seed 1234567890control.shf Shuffle
simulation.cycles 10network.size protocol.lnk IdleProtocol
protocol.0 example.aggregation.protocol.0.linkable lnk init.rnd WireKOutinit.rnd.protocol lnkinit.rnd.k 5
init.lin LinearDistributioninit.lin.protocol 0init.lin.max init.lin.min
init.peak example.aggregation.PeakDistributionInitializerinit.peak.valueinit.peak.protocol 0
include.init rnd
control.avgo example.aggregation.AverageObservercontrol.avgo.protocol 0
![Page 13: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/13.jpg)
random.seed 1234567890control.shf Shuffle
simulation.cycles 10network.size protocol.lnk IdleProtocol
protocol.0 example.aggregation.protocol.0.linkable lnk init.rnd WireKOutinit.rnd.protocol lnkinit.rnd.k 5
init.lin LinearDistributioninit.lin.protocol 0init.lin.max init.lin.min
init.peak example.aggregation.PeakDistributionInitializerinit.peak.valueinit.peak.protocol 0
include.init rnd
control.avgo example.aggregation.AverageObservercontrol.avgo.protocol 0
Static config fileProtocol
Network sizeDistribution
MaximumFunction
100
1001
10000
lin
kDistribution Parameters
![Page 14: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/14.jpg)
random.seed 1234567890control.shf Shuffle
simulation.cycles 10network.size protocol.lnk IdleProtocol
protocol.0 example.aggregation.protocol.0.linkable lnk init.rnd WireKOutinit.rnd.protocol lnkinit.rnd.k
init.lin LinearDistributioninit.lin.protocol 0init.lin.max init.lin.min
init.peak example.aggregation.PeakDistributionInitializerinit.peak.valueinit.peak.protocol 0
include.init rnd
control.avgo example.aggregation.AverageObservercontrol.avgo.protocol 0
Static config fileProtocol
Network sizeDistribution
MaximumFunction
100
1001
10000
lin
kDistribution Parameters
5
![Page 15: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/15.jpg)
Static config file
MaximumFunction
100
1001
10000
lin
1
random.seed 1234567890control.shf Shuffle
simulation.cycles 10network.size protocol.lnk IdleProtocol
protocol.0 example.aggregation.protocol.0.linkable lnk init.rnd WireKOutinit.rnd.protocol lnkinit.rnd.k
init.lin LinearDistributioninit.lin.protocol 0init.lin.max init.lin.min
init.peak example.aggregation.PeakDistributionInitializerinit.peak.valueinit.peak.protocol 0
include.init rnd
control.avgo example.aggregation.AverageObservercontrol.avgo.protocol 0
![Page 16: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/16.jpg)
Observations
• Ran many simulations and recorded results
• Used Tableau to analyse
![Page 17: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/17.jpg)
Protocol
![Page 18: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/18.jpg)
Network size
Network ~ Linear(0,100); k=5; static network
![Page 19: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/19.jpg)
Distribution
![Page 20: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/20.jpg)
k
![Page 21: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/21.jpg)
Benefits of Simulation
Allows for a ‘sterile’ environment where approaches can be designed to improve the components of a P2P network’s
functionality.
![Page 22: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/22.jpg)
Benefits of Simulation
Test various approaches and topologies for their suitability in the given scenario. This may imply a suitability for a real life
application.
![Page 23: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/23.jpg)
Other Projects
“http://doc.tm.uka.de/tr/TM-2011-4.pdf” , “https://dspace.stir.ac.uk/bitstream/1893/3688/1/ccnc-2011-jamie.pdf”
![Page 24: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/24.jpg)
Dynamic config fileRemoving nodes/
OscillatingDynamic
parameterssimulation.cycles 5
network.size 100
protocol.link IdleProtocol
protocol.coord example.hot.InetCoordinates
protocol.1 example.aggregation.MaximumFunctionprotocol.1.linkable link
init.0 example.hot.InetInitializer init.0.protocol coordinit.1 peersim.dynamics.WireRingLatticeinit.1.protocol linkinit.1.coord_protocol coordinit.1.k 5
init.ld LinearDistributioninit.ld.protocol 1init.ld.max 100init.ld.min 1
control.dnet DynamicNetworkcontrol.dnet.add -10control.dnet.from 1control.dnet.until 5
control.onet OscillatingNetwork
k/alpha/ k, betaTopography
![Page 25: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/25.jpg)
simulation.cycles 5
network.size 100
protocol.link IdleProtocol
protocol.coord example.hot.InetCoordinates
protocol.1 example.aggregation.MaximumFunctionprotocol.1.linkable link
init.0 example.hot.InetInitializer init.0.protocol coordinit.1 peersim.dynamics.WireRingLatticeinit.1.protocol linkinit.1.coord_protocol coordinit.1.k 5
init.ld LinearDistributioninit.ld.protocol 1init.ld.max 100init.ld.min 1
control.dnet DynamicNetworkcontrol.dnet.add control.dnet.from control.dnet.minsize
control.onet OscillatingNetwork
Dynamic config fileRemoving nodes/
OscillatingDynamic
parameters
-101
2
100203
k/alpha/ k, betaTopography
![Page 26: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/26.jpg)
simulation.cycles 5
network.size 100
protocol.link IdleProtocol
protocol.coord example.hot.InetCoordinates
protocol.1 example.aggregation.MaximumFunctionprotocol.1.linkable link
init.0 example.hot.InetInitializer init.0.protocol coordinit.1init.1.protocol linkinit.1.coord_protocol coordinit.1.k 5
init.ld LinearDistributioninit.ld.protocol 1init.ld.max 100init.ld.min 1
control.dnet DynamicNetworkcontrol.dnet.add control.dnet.from control.dnet.minsize
control.onet OscillatingNetwork
Dynamic config fileRemoving nodes/
OscillatingDynamic
parameters Topography k/alpha/ k, beta
-101
2
100203
peersim.dynamics.WireRingLattice
![Page 27: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/27.jpg)
simulation.cycles 5
network.size 100
protocol.link IdleProtocol
protocol.coord example.hot.InetCoordinates
protocol.1 example.aggregation.MaximumFunctionprotocol.1.linkable link
init.0 example.hot.InetInitializer init.0.protocol coordinit.1init.1.protocol linkinit.1.coord_protocol coordinit.1.
init.ld LinearDistributioninit.ld.protocol 1init.ld.max 100init.ld.min 1
control.dnet DynamicNetworkcontrol.dnet.add control.dnet.from control.dnet.minsize
control.onet OscillatingNetwork
Dynamic config fileRemoving nodes/
OscillatingDynamic
parameters Topography k/alpha/ k, beta
-101
2
100203
peersim.dynamics.WireRingLattice
k 5
![Page 28: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/28.jpg)
Dynamic config fileRemoving nodes/
OscillatingDynamic
parameters Topography k/alpha/ k, beta
-101
2
100203
peersim.dynamics.WireRingLattice
k 5
simulation.cycles 5
network.size 100
protocol.link IdleProtocol
protocol.coord example.hot.InetCoordinates
protocol.1 example.aggregation.MaximumFunctionprotocol.1.linkable link
init.0 example.hot.InetInitializer init.0.protocol coordinit.1init.1.protocol linkinit.1.coord_protocol coordinit.1.
init.ld LinearDistributioninit.ld.protocol 1init.ld.max 100init.ld.min 1
control.dnet DynamicNetworkcontrol.dnet.add control.dnet.from control.dnet.minsize
control.onet OscillatingNetwork
![Page 29: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/29.jpg)
Dynamic Network (killing nodes)
![Page 30: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/30.jpg)
Oscillating Network
![Page 31: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/31.jpg)
Oscillating Network
![Page 32: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/32.jpg)
Oscillating Network
![Page 33: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/33.jpg)
WireKOut
![Page 34: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/34.jpg)
WireInetTopology
![Page 35: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/35.jpg)
WireRegRootedTree
![Page 36: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/36.jpg)
WireRingLattice
![Page 37: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/37.jpg)
WireStar
![Page 38: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/38.jpg)
WireWS
![Page 39: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/39.jpg)
Topographies
2
2
![Page 40: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/40.jpg)
Topographies
2
2
2
2
![Page 41: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/41.jpg)
Real World P2P• Structured - Overlay has fixed topology, protocol
aims to ensure an efficient search of network for a given resource.
ImageSRC:- “https://personalpages.manchester.ac.uk/staff/m.dodge/cybergeography/atlas/gnucleus_graph_large.gif”
![Page 42: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/42.jpg)
Real World P2P• Unstructured - No formal topology, easy to build.
Allow for localised optimisations and are highly resilient against problems caused with high ‘churn’.
ImageSRC:- “http://courses.cse.tamu.edu/caverlee/csce438/hw/rand_graph.png"
![Page 43: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/43.jpg)
Real World P2P• Hybrid - Combination of P2P and client-server
models. Currently tend to have better all round performance versus pure P2P and client-server.
ImageSRC:- “http://www.di.unipi.it/~hkholidy/projects/cids/CIDS%20in%20Pure%20P2P%20model.gif”
![Page 44: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/44.jpg)
Real World P2P• Spotify(2011) - Hybrid model, utilises centralised
servers, P2P network, and a local cache. Only non web-based on-demand music streaming service.
ImageSRC:- “http://pansentient.com/2011/04/spotify-technology-some-stats-and-how-spotify-works/“
~8
~36~56
![Page 45: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/45.jpg)
Real World P2P• Spotify - Simple use case
ImageSRC:- “http://pansentient.com/2011/04/spotify-technology-some-stats-and-how-spotify-works/“
• User selects track • If cached, play from there• Else
• Request first 15secs from servers. • Search P2P network for remainder of song.
![Page 46: P2P: Simulations and Real world Networks](https://reader031.fdocuments.us/reader031/viewer/2022030215/588a00891a28ab0f388b68a7/html5/thumbnails/46.jpg)
Real World P2P
• Spotify’s P2P Network - Works like BitTorrent, using server-side trackers and network queries to locate peers. Returned peers are those that can support playback.
Predictable listening habits - Most users listen to the same music multiple times or listen to albums. Makes predictive caching possible, reducing network traffic.