P2P: Simulations and Real world Networks

  • View
    249

  • Download
    0

Embed Size (px)

Transcript

  • P2P: Simulations and Real World Networks

    Matilda Rhode and Matt Courtney

  • (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; } }

  • (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; } }

  • (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; } }

  • Gossip-based protocols

    Gossip or epidemic protocol

    Each node has only a partial view of the network

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • Observations

    Ran many simulations and recorded results

    Used Tableau to analyse

  • Protocol

  • Network size